Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
ce962c3f
Commit
ce962c3f
authored
Apr 15, 2019
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'update-http-parser'
parents
d978f351
f931504e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
22 deletions
+21
-22
third-party/http-parser/http_parser.c
third-party/http-parser/http_parser.c
+17
-21
third-party/http-parser/http_parser.h
third-party/http-parser/http_parser.h
+1
-1
third-party/http-parser/test.c
third-party/http-parser/test.c
+3
-0
No files found.
third-party/http-parser/http_parser.c
View file @
ce962c3f
...
@@ -1497,24 +1497,20 @@ reexecute:
...
@@ -1497,24 +1497,20 @@ reexecute:
switch
(
h_state
)
{
switch
(
h_state
)
{
case
h_general
:
case
h_general
:
{
{
const
char
*
p_cr
;
const
char
*
limit
=
p
+
MIN
(
data
+
len
-
p
,
max_header_size
);
const
char
*
p_lf
;
size_t
limit
=
data
+
len
-
p
;
limit
=
MIN
(
limit
,
max_header_size
);
p_cr
=
(
const
char
*
)
memchr
(
p
,
CR
,
limit
);
for
(;
p
!=
limit
;
p
++
)
{
p_lf
=
(
const
char
*
)
memchr
(
p
,
LF
,
limit
);
ch
=
*
p
;
if
(
p_cr
!=
NULL
)
{
if
(
ch
==
CR
||
ch
==
LF
)
{
if
(
p_lf
!=
NULL
&&
p_cr
>=
p_lf
)
--
p
;
p
=
p_lf
;
break
;
else
p
=
p_cr
;
}
else
if
(
UNLIKELY
(
p_lf
!=
NULL
))
{
p
=
p_lf
;
}
else
{
p
=
data
+
len
;
}
}
if
(
!
lenient
&&
!
IS_HEADER_CHAR
(
ch
))
{
SET_ERRNO
(
HPE_INVALID_HEADER_TOKEN
);
goto
error
;
}
}
if
(
p
==
data
+
len
)
--
p
;
--
p
;
break
;
break
;
}
}
...
...
third-party/http-parser/http_parser.h
View file @
ce962c3f
...
@@ -27,7 +27,7 @@ extern "C" {
...
@@ -27,7 +27,7 @@ extern "C" {
/* Also update SONAME in the Makefile whenever you change these. */
/* Also update SONAME in the Makefile whenever you change these. */
#define HTTP_PARSER_VERSION_MAJOR 2
#define HTTP_PARSER_VERSION_MAJOR 2
#define HTTP_PARSER_VERSION_MINOR 9
#define HTTP_PARSER_VERSION_MINOR 9
#define HTTP_PARSER_VERSION_PATCH
0
#define HTTP_PARSER_VERSION_PATCH
1
#include <stddef.h>
#include <stddef.h>
#if defined(_WIN32) && !defined(__MINGW32__) && \
#if defined(_WIN32) && !defined(__MINGW32__) && \
...
...
third-party/http-parser/test.c
View file @
ce962c3f
...
@@ -4316,6 +4316,9 @@ main (void)
...
@@ -4316,6 +4316,9 @@ main (void)
test_simple
(
"GET / HTTP/11.1
\r\n\r\n
"
,
HPE_INVALID_VERSION
);
test_simple
(
"GET / HTTP/11.1
\r\n\r\n
"
,
HPE_INVALID_VERSION
);
test_simple
(
"GET / HTTP/1.01
\r\n\r\n
"
,
HPE_INVALID_VERSION
);
test_simple
(
"GET / HTTP/1.01
\r\n\r\n
"
,
HPE_INVALID_VERSION
);
test_simple
(
"GET / HTTP/1.0
\r\n
Hello: w
\1
rld
\r\n\r\n
"
,
HPE_INVALID_HEADER_TOKEN
);
test_simple
(
"GET / HTTP/1.0
\r\n
Hello: woooo
\2
rld
\r\n\r\n
"
,
HPE_INVALID_HEADER_TOKEN
);
// Extended characters - see nodejs/test/parallel/test-http-headers-obstext.js
// Extended characters - see nodejs/test/parallel/test-http-headers-obstext.js
test_simple
(
"GET / HTTP/1.1
\r\n
"
test_simple
(
"GET / HTTP/1.1
\r\n
"
"Test: Düsseldorf
\r\n
"
,
"Test: Düsseldorf
\r\n
"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment