ssh-store: fix length when writing nar

This fixes nix copy and other things that use copyStorePath.
This commit is contained in:
Daiderd Jordan 2017-12-06 11:35:24 +01:00
parent 11a7f8ce14
commit 2cb8aaa610
No known key found for this signature in database
GPG key ID: D02435D05B810C96

View file

@ -62,9 +62,9 @@ public:
ForwardSource(Source & readSource, Sink & writeSink) : readSource(readSource), writeSink(writeSink) {} ForwardSource(Source & readSource, Sink & writeSink) : readSource(readSource), writeSink(writeSink) {}
size_t read(unsigned char * data, size_t len) override size_t read(unsigned char * data, size_t len) override
{ {
auto res = readSource.read(data, len); auto n = readSource.read(data, len);
writeSink(data, len); writeSink(data, n);
return res; return n;
} }
}; };