about summary refs log tree commit diff
path: root/src/libutil/serialise.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-12-04T17·17+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-12-04T17·17+0000
commit0130ef88ea280e67037fa76bcedc59db17d9a8ca (patch)
tree120a616c9a9ee296d2c1832f1b238c281df016ae /src/libutil/serialise.cc
parent4740baf3a61c48c07f12f23927c84ca9892088a8 (diff)
* 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.

Diffstat (limited to 'src/libutil/serialise.cc')
-rw-r--r--src/libutil/serialise.cc7
1 files changed, 4 insertions, 3 deletions
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<unsigned char> d(buf);
+    source(buf, len);
     readPadding(len, source);
-    return string(buf, len);
+    return string((char *) buf, len);
 }