Browse Source

http_parser: expose pause/resume method for parser

v0.10.21-release
Timothy J Fontaine 11 years ago
committed by Trevor Norris
parent
commit
f051b8919f
  1. 11
      src/node_http_parser.cc

11
src/node_http_parser.cc

@ -495,6 +495,15 @@ public:
}
template <bool should_pause>
static Handle<Value> Pause(const Arguments& args) {
HandleScope scope;
Parser* parser = ObjectWrap::Unwrap<Parser>(args.This());
http_parser_pause(&parser->parser_, should_pause);
return Undefined();
}
private:
Local<Array> CreateHeaders() {
@ -574,6 +583,8 @@ void InitHttpParser(Handle<Object> 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<true>);
NODE_SET_PROTOTYPE_METHOD(t, "resume", Parser::Pause<false>);
target->Set(String::NewSymbol("HTTPParser"), t->GetFunction());

Loading…
Cancel
Save