mirror of
https://github.com/NixOS/nix.git
synced 2025-11-16 23:42:43 +01:00
* 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.
This commit is contained in:
parent
78598d06f0
commit
e0bd307802
6 changed files with 68 additions and 44 deletions
|
|
@ -501,11 +501,11 @@ void RemoteStore::processStderr(Sink * sink, Source * source)
|
|||
}
|
||||
else if (msg == STDERR_READ) {
|
||||
if (!source) throw Error("no source");
|
||||
unsigned int len = readInt(from);
|
||||
size_t len = readInt(from);
|
||||
unsigned char * buf = new unsigned char[len];
|
||||
AutoDeleteArray<unsigned char> d(buf);
|
||||
(*source)(buf, len);
|
||||
writeString(string((const char *) buf, len), to);
|
||||
size_t n = source->read(buf, len);
|
||||
writeString(string((const char *) buf, n), to); // !!! inefficient
|
||||
to.flush();
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue