mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
Merge remote branch 'origin/v0.6'
Conflicts: Makefile lib/_debugger.js
This commit is contained in:
commit
f7f8af8420
128 files changed
+634
-265
No files matched your search
+16
-10
@@ -115,15 +115,17 @@ using namespace v8;
|
||||
|
||||
|
||||
#define HTTP_CB(name) \
|
||||
static int name(http_parser* p_) { \
|
||||
Parser* self = container_of(p_, Parser, parser_); \
|
||||
return self->name##_(); \
|
||||
} \
|
||||
int always_inline name##_()
|
||||
static int name(http_parser* p_) { \
|
||||
HandleScope scope; \
|
||||
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); \
|
||||
} \
|
||||
@@ -208,10 +210,12 @@ struct StringPtr {
|
||||
|
||||
|
||||
Handle<String> ToString() const {
|
||||
if (str_)
|
||||
return String::New(str_, size_);
|
||||
else
|
||||
return String::Empty();
|
||||
HandleScope scope;
|
||||
if (str_) {
|
||||
return scope.Close(String::New(str_, size_));
|
||||
} else {
|
||||
return scope.Close(String::Empty());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -509,6 +513,8 @@ public:
|
||||
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));
|
||||
@@ -518,7 +524,7 @@ private:
|
||||
headers->Set(2 * i + 1, values_[i].ToString());
|
||||
}
|
||||
|
||||
return headers;
|
||||
return scope.Close(headers);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user