Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V5.11.0 proposal #6322

Closed
wants to merge 90 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
8da4bad
test: fix pummel test failures
Trott Apr 2, 2016
fbc99ba
src: add missing 'inline' keywords
bnoordhuis Apr 5, 2016
bc0ee06
doc: note about Android support
Trott Apr 4, 2016
a27e952
test: enforce strict mode for test-domain-crypto
Trott Apr 4, 2016
a5f8d0c
build: remove -f{data,function}-sections flags
bnoordhuis Apr 6, 2016
07829b0
doc: simple doc typo fix
BrendonPierson Apr 4, 2016
96ad5c5
doc: update openssl LICENSE using license-builder.sh
srl295 Apr 5, 2016
632e6b9
deps: backport 125ac66 from v8 upstream
Apr 6, 2016
6bb7999
test: refactor test-file-write-stream3
Trott Apr 5, 2016
440d117
doc: add example using algorithms not directly exposed
hillbrad Apr 7, 2016
d44540f
buffer: standardize array index check
trevnorris Apr 6, 2016
a81fca4
doc: add topic - event loop, timers, `nextTick()`
techjeffharris Apr 8, 2016
2254f1a
repl: refactor repl.js
Trott Apr 6, 2016
fc89d17
path: fixing a test that breaks on some machines.
Apr 5, 2016
476535c
test: fix flaky test-http-client-abort
Trott Apr 8, 2016
a40d0e8
doc: fix scrolling on iOS devices
lpinca Mar 23, 2016
a2dd848
tools,doc: fix incomplete json produced by doctool
firedfox Mar 31, 2016
69eb4a6
tools,doc: fix json for grouped optional params
firedfox Mar 31, 2016
5e6915f
doc: describe child.kill() pitfalls on linux
eljefedelrodeodeljefe Apr 5, 2016
daaad47
doc: clarification for maxBuffer and Unicode output
jasnell Apr 9, 2016
b26fea1
doc: add copy about how to curl SHA256.txt
Apr 8, 2016
4392b4a
stream: Fix readableState.awaitDrain mechanism
addaleax Apr 2, 2016
fabc33a
tools: remove simplejson dependency
thefourtheye Apr 7, 2016
a38b614
test: fix flaky test-child-process-fork-net
Trott Apr 9, 2016
a7104e4
deps: cherry-pick 1383d00 from v8 upstream
indutny Apr 13, 2016
f69416c
streams: support unlimited synchronous cork/uncork cycles
mcollina Apr 12, 2016
6bc3bde
doc: fix incorrect references in buffer docs
Amery2010 Apr 14, 2016
1d669ab
deps: upgrade npm to 3.8.6
zkat Apr 11, 2016
f8c0ab9
deps: floating fix for npm's test-node script
zkat Apr 11, 2016
5807f9d
benchmark: add module loader benchmark parameter
mscdex Feb 10, 2016
3364703
doc: add addaleax to collaborators
addaleax Apr 15, 2016
9d3317a
doc: add santigimeno to collaborators
santigimeno Apr 15, 2016
4a2b53a
doc: add iWuzHere to collaborators
imran-iq Apr 15, 2016
02bf459
doc: add stefanmb to collaborators
stefanmb Apr 15, 2016
1796e49
doc: add domain postmortem
trevnorris Apr 11, 2016
01d4522
test,vm: enable strict mode for vm tests
Trott Apr 15, 2016
bb97de0
doc: clarify fs.watch() and inodes on linux, os x
jorangreef Apr 7, 2016
0658632
tools,doc: parse types in braces everywhere
estliberitas Feb 20, 2016
fbb0a06
process: fix incorrect usage of assert.fail()
Trott Apr 15, 2016
90eb765
doc: native module reloading is not supported
bengl Apr 12, 2016
5c4395b
doc: explain differences in console.assert between node and browsers
jasnell Apr 12, 2016
93f91c6
gitignore: ignore VS 2015 *.VC.opendb files
Apr 5, 2016
90aabb9
gitignore: adding .vs/ directory to .gitignore
Apr 13, 2016
fb64630
tools: fix license-builder.sh again for ICU
srl295 Apr 5, 2016
ea8fe04
doc: document intention and dangers of fs module Buffer API
seishun Apr 2, 2016
5bf8d1a
doc: fix http response event, Agent#getName
mdouglass Apr 1, 2016
038801d
doc: DCO anchor that doesn't change
williamkapke Apr 18, 2016
91001d3
doc: replace functions with arrow functions
hiroppy Apr 14, 2016
85cb9bb
assert: respect assert.doesNotThrow message.
Aug 17, 2015
68c3283
test: fix test-net-settimeout flakiness
santigimeno Apr 12, 2016
1af0e44
test: fix flaky test-http-set-timeout-server
santigimeno Apr 15, 2016
3ce59ab
tools: update ESLint to 2.7.0
silverwind Apr 9, 2016
8077b89
test: fix issues for ESLint 2.7.0
silverwind Apr 9, 2016
90c12a9
lib,test,tools: alignment on variable assignments
Trott Apr 16, 2016
7ea5e43
tools: lint for alignment of variable assignments
Trott Apr 16, 2016
713f6ff
tools: improve js linter
mscdex Mar 10, 2016
95e9c06
build: allow test-ci to run tests in parallel
jbergstroem Apr 15, 2016
b0ba16f
test: move the debugger tests back to parallel
santigimeno Apr 15, 2016
9293946
test: move some test from sequential to parallel
santigimeno Apr 5, 2016
b8ae1b8
doc: path.format provide more examples
eversojk Mar 22, 2016
6892536
tools: move message listener to worker objects
mscdex Apr 15, 2016
b74ddea
doc: fix broken references
gromnitsky Apr 13, 2016
8779967
test: move debugger tests to sequential
Trott Apr 14, 2016
8ccfb87
http: unref socket timer on parser execute
indutny Apr 19, 2016
052d87c
stream_base: expose `bytesRead` getter
indutny Apr 19, 2016
36c58da
net: replace __defineGetter__ with defineProperty
indutny Apr 20, 2016
24ec701
buffer: add Buffer.prototype.compare by offset
jasnell Mar 23, 2016
9f2dc70
src: add SIGINFO to supported signals
jamesreggio Apr 7, 2016
b7dd451
deps: update to http-parser 2.7.0
indutny Apr 19, 2016
f6969a1
http: skip body and next message of CONNECT res
indutny Apr 19, 2016
1ef18bd
test: add test for responses to HTTP CONNECT req
slushie Apr 19, 2016
68cf6a5
build: fix make tar-headers for Linux
gibfahn Mar 31, 2016
8877703
tools: enable linting for v8_prof_processor.js
Trott Apr 18, 2016
73eac79
tools: lint rule for assert.fail()
Trott Apr 18, 2016
fb2a978
test,tools: enable linting for undefined vars
Trott Apr 18, 2016
df93d6b
test: assert - fixed error messages to match the tests
suryagh Apr 16, 2016
2e6e2d6
child_process: add nullptr checks after allocs
addaleax Apr 18, 2016
033b21b
test: move more tests from sequential to parallel
santigimeno Apr 9, 2016
5c9dddf
debugger: run last command on presssing enter
Trott Apr 6, 2016
3a5dd02
zlib: detect gzip files when using unzip*
addaleax Mar 24, 2016
2ac14ee
zlib: Make the finish flush flag configurable
addaleax Apr 5, 2016
87e0734
node: make builtin libs available for `--eval`
addaleax Apr 15, 2016
40945e0
repl: keep the built-in modules non-enumerable
addaleax Apr 18, 2016
9f9371b
doc: note that zlib.flush acts after pending writes
addaleax Apr 12, 2016
02a84e2
doc: add full example for zlib.flush()
addaleax Apr 19, 2016
5874502
doc: git mv to .md
eljefedelrodeodeljefe Apr 20, 2016
d9cd449
http: disallow sending obviously invalid status codes
mscdex Apr 20, 2016
4f6f599
zlib: fix use after null when calling .close
lightsofapollo Mar 31, 2016
3bacd19
test: add zlib close-after-error regression test
addaleax Apr 18, 2016
8dc1d5e
2016-04-21, Version 5.11.0 (Stable) Release
Apr 20, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
deps: update to http-parser 2.7.0
Adds `2` as a return value of `on_headers_complete`, this mode will be
used to fix handling responses to `CONNECT` requests.

See: #6198
PR-URL: #6279
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
indutny authored and MylesBorins committed Apr 21, 2016
commit b7dd451fefbbaf9b3eece27195edc8bfe7b50e32
4 changes: 2 additions & 2 deletions deps/http_parser/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
HELPER ?=
BINEXT ?=
ifeq (darwin,$(PLATFORM))
SONAME ?= libhttp_parser.2.6.2.dylib
SONAME ?= libhttp_parser.2.7.0.dylib
SOEXT ?= dylib
else ifeq (wine,$(PLATFORM))
CC = winegcc
BINEXT = .exe.so
HELPER = wine
else
SONAME ?= libhttp_parser.so.2.6.2
SONAME ?= libhttp_parser.so.2.7.0
SOEXT ?= so
endif

Expand Down
3 changes: 3 additions & 0 deletions deps/http_parser/http_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1812,6 +1812,9 @@ size_t http_parser_execute (http_parser *parser,
case 0:
break;

case 2:
parser->upgrade = 1;

case 1:
parser->flags |= F_SKIPBODY;
break;
Expand Down
9 changes: 7 additions & 2 deletions deps/http_parser/http_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ extern "C" {

/* Also update SONAME in the Makefile whenever you change these. */
#define HTTP_PARSER_VERSION_MAJOR 2
#define HTTP_PARSER_VERSION_MINOR 6
#define HTTP_PARSER_VERSION_PATCH 2
#define HTTP_PARSER_VERSION_MINOR 7
#define HTTP_PARSER_VERSION_PATCH 0

#include <sys/types.h>
#if defined(_WIN32) && !defined(__MINGW32__) && \
Expand Down Expand Up @@ -77,6 +77,11 @@ typedef struct http_parser_settings http_parser_settings;
* HEAD request which may contain 'Content-Length' or 'Transfer-Encoding:
* chunked' headers that indicate the presence of a body.
*
* Returning `2` from on_headers_complete will tell parser that it should not
* expect neither a body nor any futher responses on this connection. This is
* useful for handling responses to a CONNECT request which may not contain
* `Upgrade` or `Connection: upgrade` headers.
*
* http_data_cb does not return data chunks. It will be called arbitrarily
* many times for each string. E.G. you might get 10 callbacks for "on_url"
* each providing just a few characters more data.
Expand Down
103 changes: 86 additions & 17 deletions deps/http_parser/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2173,6 +2173,20 @@ pause_chunk_complete_cb (http_parser *p)
return chunk_complete_cb(p);
}

int
connect_headers_complete_cb (http_parser *p)
{
headers_complete_cb(p);
return 1;
}

int
connect_message_complete_cb (http_parser *p)
{
messages[num_messages].should_keep_alive = http_should_keep_alive(parser);
return message_complete_cb(p);
}

static http_parser_settings settings_pause =
{.on_message_begin = pause_message_begin_cb
,.on_header_field = pause_header_field_cb
Expand Down Expand Up @@ -2212,6 +2226,19 @@ static http_parser_settings settings_count_body =
,.on_chunk_complete = chunk_complete_cb
};

static http_parser_settings settings_connect =
{.on_message_begin = message_begin_cb
,.on_header_field = header_field_cb
,.on_header_value = header_value_cb
,.on_url = request_url_cb
,.on_status = response_status_cb
,.on_body = dontcall_body_cb
,.on_headers_complete = connect_headers_complete_cb
,.on_message_complete = connect_message_complete_cb
,.on_chunk_header = chunk_header_cb
,.on_chunk_complete = chunk_complete_cb
};

static http_parser_settings settings_null =
{.on_message_begin = 0
,.on_header_field = 0
Expand Down Expand Up @@ -2275,6 +2302,14 @@ size_t parse_pause (const char *buf, size_t len)
return nparsed;
}

size_t parse_connect (const char *buf, size_t len)
{
size_t nparsed;
currently_parsing_eof = (len == 0);
nparsed = http_parser_execute(parser, &settings_connect, buf, len);
return nparsed;
}

static inline int
check_str_eq (const struct message *m,
const char *prop,
Expand Down Expand Up @@ -2331,7 +2366,7 @@ do { \
} while(0)

int
message_eq (int index, const struct message *expected)
message_eq (int index, int connect, const struct message *expected)
{
int i;
struct message *m = &messages[index];
Expand All @@ -2346,8 +2381,10 @@ message_eq (int index, const struct message *expected)
MESSAGE_CHECK_STR_EQ(expected, m, response_status);
}

MESSAGE_CHECK_NUM_EQ(expected, m, should_keep_alive);
MESSAGE_CHECK_NUM_EQ(expected, m, message_complete_on_eof);
if (!connect) {
MESSAGE_CHECK_NUM_EQ(expected, m, should_keep_alive);
MESSAGE_CHECK_NUM_EQ(expected, m, message_complete_on_eof);
}

assert(m->message_begin_cb_called);
assert(m->headers_complete_cb_called);
Expand Down Expand Up @@ -2385,16 +2422,22 @@ message_eq (int index, const struct message *expected)
MESSAGE_CHECK_NUM_EQ(expected, m, port);
}

if (expected->body_size) {
if (connect) {
check_num_eq(m, "body_size", 0, m->body_size);
} else if (expected->body_size) {
MESSAGE_CHECK_NUM_EQ(expected, m, body_size);
} else {
MESSAGE_CHECK_STR_EQ(expected, m, body);
}

assert(m->num_chunks == m->num_chunks_complete);
MESSAGE_CHECK_NUM_EQ(expected, m, num_chunks_complete);
for (i = 0; i < m->num_chunks && i < MAX_CHUNKS; i++) {
MESSAGE_CHECK_NUM_EQ(expected, m, chunk_lengths[i]);
if (connect) {
check_num_eq(m, "num_chunks_complete", 0, m->num_chunks_complete);
} else {
assert(m->num_chunks == m->num_chunks_complete);
MESSAGE_CHECK_NUM_EQ(expected, m, num_chunks_complete);
for (i = 0; i < m->num_chunks && i < MAX_CHUNKS; i++) {
MESSAGE_CHECK_NUM_EQ(expected, m, chunk_lengths[i]);
}
}

MESSAGE_CHECK_NUM_EQ(expected, m, num_headers);
Expand Down Expand Up @@ -3201,7 +3244,7 @@ test_message (const struct message *message)
abort();
}

if(!message_eq(0, message)) abort();
if(!message_eq(0, 0, message)) abort();

parser_free();
}
Expand Down Expand Up @@ -3238,7 +3281,7 @@ test_message_count_body (const struct message *message)
abort();
}

if(!message_eq(0, message)) abort();
if(!message_eq(0, 0, message)) abort();

parser_free();
}
Expand Down Expand Up @@ -3589,9 +3632,9 @@ test_multiple3 (const struct message *r1, const struct message *r2, const struct
abort();
}

if (!message_eq(0, r1)) abort();
if (message_count > 1 && !message_eq(1, r2)) abort();
if (message_count > 2 && !message_eq(2, r3)) abort();
if (!message_eq(0, 0, r1)) abort();
if (message_count > 1 && !message_eq(1, 0, r2)) abort();
if (message_count > 2 && !message_eq(2, 0, r3)) abort();

parser_free();
}
Expand Down Expand Up @@ -3687,17 +3730,17 @@ test_scan (const struct message *r1, const struct message *r2, const struct mess
goto error;
}

if (!message_eq(0, r1)) {
if (!message_eq(0, 0, r1)) {
fprintf(stderr, "\n\nError matching messages[0] in test_scan.\n");
goto error;
}

if (message_count > 1 && !message_eq(1, r2)) {
if (message_count > 1 && !message_eq(1, 0, r2)) {
fprintf(stderr, "\n\nError matching messages[1] in test_scan.\n");
goto error;
}

if (message_count > 2 && !message_eq(2, r3)) {
if (message_count > 2 && !message_eq(2, 0, r3)) {
fprintf(stderr, "\n\nError matching messages[2] in test_scan.\n");
goto error;
}
Expand Down Expand Up @@ -3796,7 +3839,29 @@ test_message_pause (const struct message *msg)
abort();
}

if(!message_eq(0, msg)) abort();
if(!message_eq(0, 0, msg)) abort();

parser_free();
}

/* Verify that body and next message won't be parsed in responses to CONNECT */
void
test_message_connect (const struct message *msg)
{
char *buf = (char*) msg->raw;
size_t buflen = strlen(msg->raw);
size_t nread;

parser_init(msg->type);

nread = parse_connect(buf, buflen);

if (num_messages != 1) {
printf("\n*** num_messages != 1 after testing '%s' ***\n\n", msg->name);
abort();
}

if(!message_eq(0, 1, msg)) abort();

parser_free();
}
Expand Down Expand Up @@ -3867,6 +3932,10 @@ main (void)
test_message_pause(&responses[i]);
}

for (i = 0; i < response_count; i++) {
test_message_connect(&responses[i]);
}

for (i = 0; i < response_count; i++) {
if (!responses[i].should_keep_alive) continue;
for (j = 0; j < response_count; j++) {
Expand Down