Fix test-http-upload-timeout
authorRyan Dahl <ry@tinyclouds.org>
Fri, 21 Jan 2011 02:23:50 +0000 (18:23 -0800)
committerRyan Dahl <ry@tinyclouds.org>
Fri, 21 Jan 2011 02:24:00 +0000 (18:24 -0800)
Cannot just close the connection or client will error.

test/pummel/test-http-upload-timeout.js

index 4fb49800193516b36ff89c953c9a543beb000122..06b8e744966846e14005d91cf3ec7cbe85a72366 100644 (file)
@@ -14,18 +14,20 @@ server.on('request', function(req, res) {
   });
   req.on('end', function() {
     connections--;
-    req.socket.end();
+    res.writeHead(200);
+    res.end("done\n");
     if (connections == 0) {
       server.close();
     }
   });
 });
+
 server.listen(common.PORT, '127.0.0.1', function() {
   for (var i = 0; i < 10; i++) {
     connections++;
 
     setTimeout(function() {
-      var client = http.createClient(common.PORT, '127.0.0.1'),
+      var client = http.createClient(common.PORT),
           request = client.request('POST', '/');
 
       function ping() {