File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -495,6 +495,15 @@ class Parser : public ObjectWrap {
495495 }
496496
497497
498+ template <bool should_pause>
499+ static Handle<Value> Pause (const Arguments& args) {
500+ HandleScope scope;
501+ Parser* parser = ObjectWrap::Unwrap<Parser>(args.This ());
502+ http_parser_pause (&parser->parser_ , should_pause);
503+ return Undefined ();
504+ }
505+
506+
498507private:
499508
500509 Local<Array> CreateHeaders () {
@@ -574,6 +583,8 @@ void InitHttpParser(Handle<Object> target) {
574583 NODE_SET_PROTOTYPE_METHOD (t, " execute" , Parser::Execute);
575584 NODE_SET_PROTOTYPE_METHOD (t, " finish" , Parser::Finish);
576585 NODE_SET_PROTOTYPE_METHOD (t, " reinitialize" , Parser::Reinitialize);
586+ NODE_SET_PROTOTYPE_METHOD (t, " pause" , Parser::Pause<true >);
587+ NODE_SET_PROTOTYPE_METHOD (t, " resume" , Parser::Pause<false >);
577588
578589 target->Set (String::NewSymbol (" HTTPParser" ), t->GetFunction ());
579590
You can’t perform that action at this time.
0 commit comments