hack for ending https connections
authorRyan Dahl <ry@tinyclouds.org>
Tue, 4 Jan 2011 18:36:05 +0000 (10:36 -0800)
committerRyan Dahl <ry@tinyclouds.org>
Tue, 4 Jan 2011 18:36:05 +0000 (10:36 -0800)
lib/http.js

index 786f373e7435b4e531d6b419916c28dae7eed4c9..f061effe3314bcfcbfe84e983f9ccf92a7ee3173 100644 (file)
@@ -833,11 +833,17 @@ function connectionListener(socket) {
     if (message._last) {
       // No more messages to be pushed out.
 
-      // HACK: need way to do this with socket interface
-      if (socket._writeQueue.length) {
-        socket.__destroyOnDrain = true; //socket.end();
+      if (!socket._writeQueue) {
+        // Putting this here for https. Really need to add below hack to
+        // both socket and https interfaces.
+        socket.end();
       } else {
-        socket.destroy();
+        // HACK: need way to do this with socket interface
+        if (socket._writeQueue.length) {
+          socket.__destroyOnDrain = true; //socket.end();
+        } else {
+          socket.destroy();
+        }
       }
 
     } else if (socket._outgoing.length) {