Fix issue #44, eof on connect to http.
authorBen Williamson <benw@pobox.com>
Mon, 11 Jan 2010 06:06:05 +0000 (17:06 +1100)
committerRyan Dahl <ry@tinyclouds.org>
Mon, 11 Jan 2010 06:22:21 +0000 (22:22 -0800)
eof_symbol wasn't initialized until the first packet arrived.
In this case no packets arrive before the client closes the socket - eof.

src/node_http.cc

index 2ba9a08..efd9489 100644 (file)
@@ -71,6 +71,7 @@ HTTPConnection::Initialize (Handle<Object> target)
   http_version_symbol = NODE_PSYMBOL("httpVersion");
   should_keep_alive_symbol = NODE_PSYMBOL("should_keep_alive");
 
+  eof_symbol = NODE_PSYMBOL("eof");
 
   delete_sym = NODE_PSYMBOL("DELETE");
   get_sym = NODE_PSYMBOL("GET");
@@ -169,7 +170,6 @@ HTTPConnection::on_message_begin (http_parser *parser)
     header_value_symbol = NODE_PSYMBOL("headerValue");
     header_complete_symbol = NODE_PSYMBOL("headerComplete");
     body_symbol = NODE_PSYMBOL("body");
-    eof_symbol = NODE_PSYMBOL("eof");
   }
 
   HTTPConnection *connection = static_cast<HTTPConnection*> (parser->data);