summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimothy J Fontaine <tjfontaine@gmail.com>2013-10-14 11:57:45 -0700
committerTrevor Norris <trev.norris@gmail.com>2013-10-16 17:12:34 -0700
commitf051b8919fec8efd8ef050f580cfcabea3d2534c (patch)
tree4ecb90a70e0b3fe560a9ae01d31766fcde91dad9 /src
parent2e16037201b6338914d41048660c1ce713094893 (diff)
downloadandroid-node-v8-f051b8919fec8efd8ef050f580cfcabea3d2534c.tar.gz
android-node-v8-f051b8919fec8efd8ef050f580cfcabea3d2534c.tar.bz2
android-node-v8-f051b8919fec8efd8ef050f580cfcabea3d2534c.zip
http_parser: expose pause/resume method for parser
Diffstat (limited to 'src')
-rw-r--r--src/node_http_parser.cc11
1 files changed, 11 insertions, 0 deletions
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 <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());