diff options
author | Trevor Norris <trev.norris@gmail.com> | 2013-06-21 11:35:29 -0700 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2013-07-03 15:03:41 -0700 |
commit | 278183a902d50f63e334c0ecde52c0186a523192 (patch) | |
tree | 463c3fce6f3ae1ab6ffc2742897befd8fe2f5d7f /src/node_http_parser.cc | |
parent | fa10b757f50acc4330bffa11ad12ac46be89cbd5 (diff) | |
download | android-node-v8-278183a902d50f63e334c0ecde52c0186a523192.tar.gz android-node-v8-278183a902d50f63e334c0ecde52c0186a523192.tar.bz2 android-node-v8-278183a902d50f63e334c0ecde52c0186a523192.zip |
{stream,udp,tls}_wrap: remove unused offset/length
The function arguments offset and length are now no longer used since
all I/O requests now use discretely allocated memory.
Diffstat (limited to 'src/node_http_parser.cc')
-rw-r--r-- | src/node_http_parser.cc | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc index 782bdf9bc9..c9391b57c7 100644 --- a/src/node_http_parser.cc +++ b/src/node_http_parser.cc @@ -378,7 +378,7 @@ public: } - // var bytesParsed = parser->execute(buffer, off, len); + // var bytesParsed = parser->execute(buffer); static Handle<Value> Execute(const Arguments& args) { HandleScope scope(node_isolate); @@ -403,18 +403,6 @@ public: char *buffer_data = Buffer::Data(buffer_obj); size_t buffer_len = Buffer::Length(buffer_obj); - size_t off = args[1]->Int32Value(); - if (off >= buffer_len) { - return ThrowException(Exception::Error( - String::New("Offset is out of bounds"))); - } - - size_t len = args[2]->Int32Value(); - if (off+len > buffer_len) { - return ThrowException(Exception::Error( - String::New("off + len > buffer.length"))); - } - // Assign 'buffer_' while we parse. The callbacks will access that varible. current_buffer = &buffer_v; current_buffer_data = buffer_data; @@ -422,7 +410,7 @@ public: parser->got_exception_ = false; size_t nparsed = - http_parser_execute(&parser->parser_, &settings, buffer_data + off, len); + http_parser_execute(&parser->parser_, &settings, buffer_data, buffer_len); parser->Save(); @@ -437,7 +425,7 @@ public: Local<Integer> nparsed_obj = Integer::New(nparsed, node_isolate); // If there was a parse error in one of the callbacks // TODO What if there is an error on EOF? - if (!parser->parser_.upgrade && nparsed != len) { + if (!parser->parser_.upgrade && nparsed != buffer_len) { enum http_errno err = HTTP_PARSER_ERRNO(&parser->parser_); Local<Value> e = Exception::Error(String::NewSymbol("Parse Error")); |