Skip to content

Instantly share code, notes, and snippets.

@chakrit
Created December 23, 2009 04:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chakrit/262306 to your computer and use it in GitHub Desktop.
Save chakrit/262306 to your computer and use it in GitHub Desktop.
diff --git a/src/node_http.cc b/src/node_http.cc
index 5ccc53b..d01912b 100644
--- a/src/node_http.cc
+++ b/src/node_http.cc
@@ -277,8 +277,13 @@ HTTPConnection::on_headers_complete (http_parser *parser)
message_info->Set(version_minor_symbol,
Integer::New(connection->parser_.http_minor));
- message_info->Set(should_keep_alive_symbol,
- http_should_keep_alive(&connection->parser_) ? True() : False());
+ if (connection->parser_.http_major < 1 || connection->parser_.http_minor < 1)
+ message_info->Set(should_keep_alive_symbol, False());
+ else
+ message_info->Set(should_keep_alive_symbol, True());
+
+ /*message_info->Set(should_keep_alive_symbol,
+ http_should_keep_alive(&connection->parser_) ? True() : False());*/
Local<Value> argv[1] = { message_info };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment