Skip to content

Commit

Permalink
In HTTP parser, proxy return value of onHeadersComplete
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed May 26, 2010
1 parent 2fca40e commit 35c14f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions src/node_http_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ class Parser : public ObjectWrap {

Local<Value> argv[1] = { message_info };

Local<Value> ret = cb->Call(parser->handle_, 1, argv);
Local<Value> 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;
}
}

Expand Down

0 comments on commit 35c14f6

Please sign in to comment.