Skip to content

Commit bc8475f

Browse files
committed
Revert "deps: update http_parser to 2.4.0"
The commit breaks windows build and brings some test failures that needs to be debugged. This reverts commit d790f61.
1 parent 95955a1 commit bc8475f

12 files changed

Lines changed: 264 additions & 601 deletions

File tree

deps/http_parser/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ tags
55
test
66
test_g
77
test_fast
8-
bench
98
url_parser
109
parsertrace
1110
parsertrace_g

deps/http_parser/.mailmap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ Salman Haq <salman.haq@asti-usa.com>
55
Simon Zimmermann <simonz05@gmail.com>
66
Thomas LE ROUX <thomas@november-eleven.fr> LE ROUX Thomas <thomas@procheo.fr>
77
Thomas LE ROUX <thomas@november-eleven.fr> Thomas LE ROUX <thomas@procheo.fr>
8-
Fedor Indutny <fedor@indutny.com>

deps/http_parser/.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ script:
1010
notifications:
1111
email: false
1212
irc:
13-
- "irc.freenode.net#node-ci"
13+
- "irc.freenode.net#libuv"

deps/http_parser/AUTHORS

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,12 @@ BogDan Vatra <bogdan@kde.org>
3939
Peter Faiman <peter@thepicard.org>
4040
Corey Richardson <corey@octayn.net>
4141
Tóth Tamás <tomika_nospam@freemail.hu>
42+
Patrik Stutz <patrik.stutz@gmail.com>
4243
Cam Swords <cam.swords@gmail.com>
4344
Chris Dickinson <christopher.s.dickinson@gmail.com>
4445
Uli Köhler <ukoehler@btronik.de>
4546
Charlie Somerville <charlie@charliesomerville.com>
46-
Patrik Stutz <patrik.stutz@gmail.com>
4747
Fedor Indutny <fedor.indutny@gmail.com>
4848
runner <runner.mei@gmail.com>
4949
Alexis Campailla <alexis@janeasystems.com>
5050
David Wragg <david@wragg.org>
51-
Vinnie Falco <vinnie.falco@gmail.com>
52-
Alex Butum <alexbutum@linux.com>
53-
Rex Feng <rexfeng@gmail.com>
54-
Alex Kocharin <alex@kocharin.ru>
55-
Mark Koopman <markmontymark@yahoo.com>
56-
Helge Heß <me@helgehess.eu>
57-
Alexis La Goutte <alexis.lagoutte@gmail.com>
58-
George Miroshnykov <george.miroshnykov@gmail.com>
59-
Maciej Małecki <me@mmalecki.com>
60-
Marc O'Morain <github.com@marcomorain.com>
61-
Jeff Pinner <jpinner@twitter.com>
62-
Timothy J Fontaine <tjfontaine@gmail.com>
63-
Akagi201 <akagi201@gmail.com>

deps/http_parser/CONTRIBUTIONS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Contributors must agree to the Contributor License Agreement before patches
2+
can be accepted.
3+
4+
http://spreadsheets2.google.com/viewform?hl=en&formkey=dDJXOGUwbzlYaWM4cHN1MERwQS1CSnc6MQ

deps/http_parser/Makefile

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
# IN THE SOFTWARE.
2020

2121
PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"')
22-
SONAME ?= libhttp_parser.so.2.4
22+
SONAME ?= libhttp_parser.so.2.3
2323

2424
CC?=gcc
2525
AR?=ar
@@ -29,12 +29,10 @@ CPPFLAGS_DEBUG = $(CPPFLAGS) -DHTTP_PARSER_STRICT=1
2929
CPPFLAGS_DEBUG += $(CPPFLAGS_DEBUG_EXTRA)
3030
CPPFLAGS_FAST = $(CPPFLAGS) -DHTTP_PARSER_STRICT=0
3131
CPPFLAGS_FAST += $(CPPFLAGS_FAST_EXTRA)
32-
CPPFLAGS_BENCH = $(CPPFLAGS_FAST)
3332

3433
CFLAGS += -Wall -Wextra -Werror
3534
CFLAGS_DEBUG = $(CFLAGS) -O0 -g $(CFLAGS_DEBUG_EXTRA)
3635
CFLAGS_FAST = $(CFLAGS) -O3 $(CFLAGS_FAST_EXTRA)
37-
CFLAGS_BENCH = $(CFLAGS_FAST) -Wno-unused-parameter
3836
CFLAGS_LIB = $(CFLAGS_FAST) -fPIC
3937

4038
LDFLAGS_LIB = $(LDFLAGS) -shared
@@ -63,12 +61,6 @@ test_fast: http_parser.o test.o http_parser.h
6361
test.o: test.c http_parser.h Makefile
6462
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c test.c -o $@
6563

66-
bench: http_parser.o bench.o
67-
$(CC) $(CFLAGS_BENCH) $(LDFLAGS) http_parser.o bench.o -o $@
68-
69-
bench.o: bench.c http_parser.h Makefile
70-
$(CC) $(CPPFLAGS_BENCH) $(CFLAGS_BENCH) -c bench.c -o $@
71-
7264
http_parser.o: http_parser.c http_parser.h Makefile
7365
$(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c http_parser.c
7466

deps/http_parser/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ if (recved < 0) {
6161
}
6262
6363
/* Start up / continue the parser.
64-
* Note we pass recved==0 to signal that EOF has been received.
64+
* Note we pass recved==0 to signal that EOF has been recieved.
6565
*/
6666
nparsed = http_parser_execute(parser, &settings, buf, recved);
6767
@@ -75,7 +75,7 @@ if (parser->upgrade) {
7575
HTTP needs to know where the end of the stream is. For example, sometimes
7676
servers send responses without Content-Length and expect the client to
7777
consume input (for the body) until EOF. To tell http_parser about EOF, give
78-
`0` as the fourth parameter to `http_parser_execute()`. Callbacks and errors
78+
`0` as the forth parameter to `http_parser_execute()`. Callbacks and errors
7979
can still be encountered during an EOF, so one must still be prepared
8080
to receive them.
8181

@@ -110,7 +110,7 @@ followed by non-HTTP data.
110110
information the Web Socket protocol.)
111111

112112
To support this, the parser will treat this as a normal HTTP message without a
113-
body, issuing both on_headers_complete and on_message_complete callbacks. However
113+
body. Issuing both on_headers_complete and on_message_complete callbacks. However
114114
http_parser_execute() will stop parsing at the end of the headers and return.
115115

116116
The user is expected to check if `parser->upgrade` has been set to 1 after
@@ -131,7 +131,7 @@ There are two types of callbacks:
131131
* notification `typedef int (*http_cb) (http_parser*);`
132132
Callbacks: on_message_begin, on_headers_complete, on_message_complete.
133133
* data `typedef int (*http_data_cb) (http_parser*, const char *at, size_t length);`
134-
Callbacks: (requests only) on_url,
134+
Callbacks: (requests only) on_uri,
135135
(common) on_header_field, on_header_value, on_body;
136136

137137
Callbacks must return 0 on success. Returning a non-zero value indicates
@@ -145,7 +145,7 @@ buffer to avoid copying memory around if this fits your application.
145145

146146
Reading headers may be a tricky task if you read/parse headers partially.
147147
Basically, you need to remember whether last header callback was field or value
148-
and apply the following logic:
148+
and apply following logic:
149149

150150
(on_header_field and on_header_value shortened to on_h_*)
151151
------------------------ ------------ --------------------------------------------

deps/http_parser/bench.c

Lines changed: 0 additions & 111 deletions
This file was deleted.

deps/http_parser/contrib/parsertrace.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,22 @@ int main(int argc, char* argv[]) {
111111
FILE* file = fopen(filename, "r");
112112
if (file == NULL) {
113113
perror("fopen");
114-
goto fail;
114+
return EXIT_FAILURE;
115115
}
116116

117117
fseek(file, 0, SEEK_END);
118118
long file_length = ftell(file);
119119
if (file_length == -1) {
120120
perror("ftell");
121-
goto fail;
121+
return EXIT_FAILURE;
122122
}
123123
fseek(file, 0, SEEK_SET);
124124

125125
char* data = malloc(file_length);
126126
if (fread(data, 1, file_length, file) != (size_t)file_length) {
127127
fprintf(stderr, "couldn't read entire file\n");
128128
free(data);
129-
goto fail;
129+
return EXIT_FAILURE;
130130
}
131131

132132
http_parser_settings settings;
@@ -149,12 +149,8 @@ int main(int argc, char* argv[]) {
149149
"Error: %s (%s)\n",
150150
http_errno_description(HTTP_PARSER_ERRNO(&parser)),
151151
http_errno_name(HTTP_PARSER_ERRNO(&parser)));
152-
goto fail;
152+
return EXIT_FAILURE;
153153
}
154154

155155
return EXIT_SUCCESS;
156-
157-
fail:
158-
fclose(file);
159-
return EXIT_FAILURE;
160156
}

0 commit comments

Comments
 (0)