From 0130ef88ea280e67037fa76bcedc59db17d9a8ca Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 4 Dec 2006 17:17:13 +0000 Subject: * Daemon mode (`nix-worker --daemon'). Clients connect to the server via the Unix domain socket in /nix/var/nix/daemon.socket. The server forks a worker process per connection. * readString(): use the heap, not the stack. * Some protocol fixes. --- src/libutil/serialise.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/libutil/serialise.cc') diff --git a/src/libutil/serialise.cc b/src/libutil/serialise.cc index 969f638ef408..c0e1c17af066 100644 --- a/src/libutil/serialise.cc +++ b/src/libutil/serialise.cc @@ -85,10 +85,11 @@ unsigned int readInt(Source & source) string readString(Source & source) { unsigned int len = readInt(source); - char buf[len]; - source((unsigned char *) buf, len); + unsigned char * buf = new unsigned char[len]; + AutoDeleteArray d(buf); + source(buf, len); readPadding(len, source); - return string(buf, len); + return string((char *) buf, len); } -- cgit 1.4.1