From 35c14f637e7963bd6cc66776463339e006e60c01 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 25 May 2010 18:39:23 -0700 Subject: [PATCH] In HTTP parser, proxy return value of onHeadersComplete --- lib/http.js | 2 ++ src/node_http_parser.cc | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/http.js b/lib/http.js index 2f46908..f46ef18 100644 --- a/lib/http.js +++ b/lib/http.js @@ -85,6 +85,8 @@ var parsers = new FreeList('parsers', 1000, function () { // so that we can capture the first part of the new protocol parser.onIncoming(parser.incoming, info.shouldKeepAlive); } + + return false; // Is response to HEAD request? }; parser.onBody = function (b, start, len) { diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc index 3473686..29423c0 100644 --- a/src/node_http_parser.cc +++ b/src/node_http_parser.cc @@ -177,13 +177,13 @@ class Parser : public ObjectWrap { Local argv[1] = { message_info }; - Local ret = cb->Call(parser->handle_, 1, argv); + Local head_response = cb->Call(parser->handle_, 1, argv); - if (ret.IsEmpty()) { + if (head_response.IsEmpty()) { parser->got_exception_ = true; return -1; } else { - return 0; + return head_response->IsTrue() ? 1 : 0; } } -- 2.7.4