aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/local-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-12-16 19:44:13 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-12-16 19:44:13 +0000
commite0bd307802d13476055f8ba99ab7808de0fd71e5 (patch)
tree83be8fedec92ebb15f05120e2e49451841699482 /src/libstore/local-store.cc
parent78598d06f0240a15b74720d8f987daeb702318d7 (diff)
* Make the import operation through the daemon much more efficient
(way fewer roundtrips) by allowing the client to send data in bigger chunks. * Some refactoring.
Diffstat (limited to 'src/libstore/local-store.cc')
-rw-r--r--src/libstore/local-store.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc
index 525e5fc7b..65b1cdbc8 100644
--- a/src/libstore/local-store.cc
+++ b/src/libstore/local-store.cc
@@ -1199,10 +1199,11 @@ struct HashAndReadSource : Source
{
hashing = true;
}
- virtual void operator () (unsigned char * data, size_t len)
+ size_t read(unsigned char * data, size_t len)
{
- readSource(data, len);
- if (hashing) hashSink(data, len);
+ size_t n = readSource.read(data, len);
+ if (hashing) hashSink(data, n);
+ return n;
}
};