Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Revert "Add HandleScope to http-parser binding"

This commit did not actually fix the production crashes.

This reverts commit 73cf8e8.
  • Loading branch information...
commit 448c5e07ca594399f3d3f93ea6f97124ea56af95 1 parent d483acc
@ry ry authored
Showing with 10 additions and 16 deletions.
  1. +10 −16 src/node_http_parser.cc
View
26 src/node_http_parser.cc
@@ -119,17 +119,15 @@ static size_t current_buffer_len;
#define HTTP_CB(name) \
- static int name(http_parser* p_) { \
- HandleScope scope; \
- Parser* self = container_of(p_, Parser, parser_); \
- return self->name##_(); \
- } \
- int always_inline name##_()
+ static int name(http_parser* p_) { \
+ Parser* self = container_of(p_, Parser, parser_); \
+ return self->name##_(); \
+ } \
+ int always_inline name##_()
#define HTTP_DATA_CB(name) \
static int name(http_parser* p_, const char* at, size_t length) { \
- HandleScope scope; \
Parser* self = container_of(p_, Parser, parser_); \
return self->name##_(at, length); \
} \
@@ -214,12 +212,10 @@ struct StringPtr {
Handle<String> ToString() const {
- HandleScope scope;
- if (str_) {
- return scope.Close(String::New(str_, size_));
- } else {
- return scope.Close(String::Empty());
- }
+ if (str_)
+ return String::New(str_, size_);
+ else
+ return String::Empty();
}
@@ -517,8 +513,6 @@ class Parser : public ObjectWrap {
private:
Local<Array> CreateHeaders() {
- HandleScope scope;
-
// num_values_ is either -1 or the entry # of the last header
// so num_values_ == 0 means there's a single header
Local<Array> headers = Array::New(2 * (num_values_ + 1));
@@ -528,7 +522,7 @@ class Parser : public ObjectWrap {
headers->Set(2 * i + 1, values_[i].ToString());
}
- return scope.Close(headers);
+ return headers;
}
Please sign in to comment.
Something went wrong with that request. Please try again.