diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc index 493f1e065e..47e229d1ed 100644 --- a/src/node_http_parser.cc +++ b/src/node_http_parser.cc @@ -495,6 +495,15 @@ public: } + template + static Handle Pause(const Arguments& args) { + HandleScope scope; + Parser* parser = ObjectWrap::Unwrap(args.This()); + http_parser_pause(&parser->parser_, should_pause); + return Undefined(); + } + + private: Local CreateHeaders() { @@ -574,6 +583,8 @@ void InitHttpParser(Handle target) { NODE_SET_PROTOTYPE_METHOD(t, "execute", Parser::Execute); NODE_SET_PROTOTYPE_METHOD(t, "finish", Parser::Finish); NODE_SET_PROTOTYPE_METHOD(t, "reinitialize", Parser::Reinitialize); + NODE_SET_PROTOTYPE_METHOD(t, "pause", Parser::Pause); + NODE_SET_PROTOTYPE_METHOD(t, "resume", Parser::Pause); target->Set(String::NewSymbol("HTTPParser"), t->GetFunction());