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
334c439c
Commit
334c439c
authored
Oct 04, 2018
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug that regular CONNECT does not work
parent
6700626c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
13 deletions
+14
-13
lib/nghttp2_http.c
lib/nghttp2_http.c
+2
-3
lib/nghttp2_http.h
lib/nghttp2_http.h
+2
-4
lib/nghttp2_session.c
lib/nghttp2_session.c
+2
-6
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+8
-0
No files found.
lib/nghttp2_http.c
View file @
334c439c
...
...
@@ -466,9 +466,8 @@ int nghttp2_http_on_header(nghttp2_session *session, nghttp2_stream *stream,
}
int
nghttp2_http_on_request_headers
(
nghttp2_stream
*
stream
,
nghttp2_frame
*
frame
,
int
connect_protocol
)
{
if
(
!
connect_protocol
&&
nghttp2_frame
*
frame
)
{
if
(
!
(
stream
->
http_flags
&
NGHTTP2_HTTP_FLAG__PROTOCOL
)
&&
(
stream
->
http_flags
&
NGHTTP2_HTTP_FLAG_METH_CONNECT
))
{
if
((
stream
->
http_flags
&
(
NGHTTP2_HTTP_FLAG__SCHEME
|
NGHTTP2_HTTP_FLAG__PATH
))
||
...
...
lib/nghttp2_http.h
View file @
334c439c
...
...
@@ -52,13 +52,11 @@ int nghttp2_http_on_header(nghttp2_session *session, nghttp2_stream *stream,
int
trailer
);
/*
* This function is called when request header is received.
* |connect_protocol| is nonzero if SETTINGS_ENABLE_CONNECT_PROTOCOL
* is enabled by the local endpoint (which must be server). This
* This function is called when request header is received. This
* function performs validation and returns 0 if it succeeds, or -1.
*/
int
nghttp2_http_on_request_headers
(
nghttp2_stream
*
stream
,
nghttp2_frame
*
frame
,
int
connect_protocol
);
nghttp2_frame
*
frame
);
/*
* This function is called when response header is received. This
...
...
lib/nghttp2_session.c
View file @
334c439c
...
...
@@ -3746,17 +3746,13 @@ static int session_after_header_block_received(nghttp2_session *session) {
subject_stream
=
nghttp2_session_get_stream
(
session
,
frame
->
push_promise
.
promised_stream_id
);
if
(
subject_stream
)
{
rv
=
nghttp2_http_on_request_headers
(
subject_stream
,
frame
,
session
->
server
&&
session
->
pending_enable_connect_protocol
);
rv
=
nghttp2_http_on_request_headers
(
subject_stream
,
frame
);
}
}
else
{
assert
(
frame
->
hd
.
type
==
NGHTTP2_HEADERS
);
switch
(
frame
->
headers
.
cat
)
{
case
NGHTTP2_HCAT_REQUEST
:
rv
=
nghttp2_http_on_request_headers
(
stream
,
frame
,
session
->
server
&&
session
->
pending_enable_connect_protocol
);
rv
=
nghttp2_http_on_request_headers
(
stream
,
frame
);
break
;
case
NGHTTP2_HCAT_RESPONSE
:
case
NGHTTP2_HCAT_PUSH_RESPONSE
:
...
...
tests/nghttp2_session_test.c
View file @
334c439c
...
...
@@ -10922,6 +10922,8 @@ void test_nghttp2_http_mandatory_headers(void) {
MAKE_NV
(
":scheme"
,
"http"
),
MAKE_NV
(
":path"
,
"/"
),
MAKE_NV
(
":method"
,
"CONNECT"
),
MAKE_NV
(
"host"
,
"localhost"
),
MAKE_NV
(
":protocol"
,
"websocket"
)};
const
nghttp2_nv
regularconnect_reqnv
[]
=
{
MAKE_NV
(
":method"
,
"CONNECT"
),
MAKE_NV
(
":authority"
,
"localhost"
)};
mem
=
nghttp2_mem_default
();
...
...
@@ -11107,6 +11109,12 @@ void test_nghttp2_http_mandatory_headers(void) {
connectprotonoauth_reqnv
,
ARRLEN
(
connectprotonoauth_reqnv
));
/* regular CONNECT method should succeed with
SETTINGS_CONNECT_PROTOCOL */
check_nghttp2_http_recv_headers_ok
(
session
,
&
deflater
,
9
,
-
1
,
regularconnect_reqnv
,
ARRLEN
(
regularconnect_reqnv
));
nghttp2_hd_deflate_free
(
&
deflater
);
nghttp2_session_del
(
session
);
...
...
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