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
651e1477
Commit
651e1477
authored
Sep 28, 2018
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow client sending :protocol optimistically
parent
a42faf1c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
lib/nghttp2_http.c
lib/nghttp2_http.c
+3
-3
lib/nghttp2_session.c
lib/nghttp2_session.c
+9
-2
lib/nghttp2_session.h
lib/nghttp2_session.h
+3
-0
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+1
-1
No files found.
lib/nghttp2_http.c
View file @
651e1477
...
...
@@ -457,9 +457,9 @@ int nghttp2_http_on_header(nghttp2_session *session, nghttp2_stream *stream,
}
if
(
session
->
server
||
frame
->
hd
.
type
==
NGHTTP2_PUSH_PROMISE
)
{
return
http_request_on_header
(
stream
,
nv
,
trailer
,
session
->
server
&&
session
->
local_settings
.
enable_connect_protocol
);
return
http_request_on_header
(
stream
,
nv
,
trailer
,
session
->
server
&&
session
->
pending_
enable_connect_protocol
);
}
return
http_response_on_header
(
stream
,
nv
,
trailer
);
...
...
lib/nghttp2_session.c
View file @
651e1477
...
...
@@ -3748,7 +3748,7 @@ static int session_after_header_block_received(nghttp2_session *session) {
if
(
subject_stream
)
{
rv
=
nghttp2_http_on_request_headers
(
subject_stream
,
frame
,
session
->
server
&&
session
->
local_settings
.
enable_connect_protocol
);
session
->
server
&&
session
->
pending_
enable_connect_protocol
);
}
}
else
{
assert
(
frame
->
hd
.
type
==
NGHTTP2_HEADERS
);
...
...
@@ -3756,7 +3756,7 @@ static int session_after_header_block_received(nghttp2_session *session) {
case
NGHTTP2_HCAT_REQUEST
:
rv
=
nghttp2_http_on_request_headers
(
stream
,
frame
,
session
->
server
&&
session
->
local_settings
.
enable_connect_protocol
);
session
->
server
&&
session
->
pending_
enable_connect_protocol
);
break
;
case
NGHTTP2_HCAT_RESPONSE
:
case
NGHTTP2_HCAT_PUSH_RESPONSE
:
...
...
@@ -7080,6 +7080,13 @@ int nghttp2_session_add_settings(nghttp2_session *session, uint8_t flags,
}
}
for
(
i
=
niv
;
i
>
0
;
--
i
)
{
if
(
iv
[
i
-
1
].
settings_id
==
NGHTTP2_SETTINGS_ENABLE_CONNECT_PROTOCOL
)
{
session
->
pending_enable_connect_protocol
=
(
uint8_t
)
iv
[
i
-
1
].
value
;
break
;
}
}
return
0
;
}
...
...
lib/nghttp2_session.h
View file @
651e1477
...
...
@@ -322,6 +322,9 @@ struct nghttp2_session {
/* Unacked local ENABLE_PUSH value. We use this to refuse
PUSH_PROMISE before SETTINGS ACK is received. */
uint8_t
pending_enable_push
;
/* Unacked local ENABLE_CONNECT_PROTOCOL value. We use this to
accept :protocol header field before SETTINGS_ACK is received. */
uint8_t
pending_enable_connect_protocol
;
/* Nonzero if the session is server side. */
uint8_t
server
;
/* Flags indicating GOAWAY is sent and/or received. The flags are
...
...
tests/nghttp2_session_test.c
View file @
651e1477
...
...
@@ -11082,7 +11082,7 @@ void test_nghttp2_http_mandatory_headers(void) {
/* enable SETTINGS_CONNECT_PROTOCOL */
nghttp2_session_server_new
(
&
session
,
&
callbacks
,
&
ud
);
session
->
local_settings
.
enable_connect_protocol
=
1
;
session
->
pending_
enable_connect_protocol
=
1
;
nghttp2_hd_deflate_init
(
&
deflater
,
mem
);
...
...
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