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
fe1a39ed
Commit
fe1a39ed
authored
Jan 09, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow client side to send PUSH_PROMISE
parent
b4058d15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
12 deletions
+11
-12
lib/nghttp2_session.c
lib/nghttp2_session.c
+11
-12
No files found.
lib/nghttp2_session.c
View file @
fe1a39ed
...
...
@@ -523,8 +523,10 @@ int nghttp2_session_add_frame(nghttp2_session *session,
}
if
(
frame
->
hd
.
type
==
NGHTTP2_HEADERS
&&
(
frame
->
hd
.
stream_id
==
-
1
||
(
stream
&&
stream
->
state
==
NGHTTP2_STREAM_RESERVED
&&
session
->
server
)))
{
(
stream
&&
stream
->
state
==
NGHTTP2_STREAM_RESERVED
)))
{
/* We push request HEADERS and push response HEADERS to
dedicated queue because their transmission is affected by
SETTINGS_MAX_CONCURRENT_STREAMS */
/* TODO If 2 HEADERS are submitted for reserved stream, then
both of them are queued into ob_ss_pq, which is not
desirable. */
...
...
@@ -791,7 +793,7 @@ static int nghttp2_session_predicate_response_headers_send
* NGHTTP2_ERR_STREAM_SHUT_WR
* The stream is half-closed for transmission.
* NGHTTP2_ERR_PROTO
* The s
ession is client-side and/or s
tream is not reserved state
* The stream is not reserved state
* NGHTTP2_ERR_STREAM_CLOSED
* RST_STREAM was queued for this stream.
*/
...
...
@@ -805,8 +807,7 @@ static int nghttp2_session_predicate_push_response_headers_send
if
(
r
!=
0
)
{
return
r
;
}
if
(
!
session
->
server
||
stream
->
state
!=
NGHTTP2_STREAM_RESERVED
)
{
/* Only server can send HEADERS for reserved streams */
if
(
stream
->
state
!=
NGHTTP2_STREAM_RESERVED
)
{
return
NGHTTP2_ERR_PROTO
;
}
if
(
stream
->
state
==
NGHTTP2_STREAM_CLOSING
)
{
...
...
@@ -917,9 +918,8 @@ static int nghttp2_session_predicate_push_promise_send
{
int
rv
;
nghttp2_stream
*
stream
;
if
(
!
session
->
server
||
nghttp2_session_is_my_stream_id
(
session
,
stream_id
))
{
/* Only server is allowed to push. And associated stream must be
created from client side */
if
(
nghttp2_session_is_my_stream_id
(
session
,
stream_id
))
{
/* The associated stream must be initiated by the remote peer */
return
NGHTTP2_ERR_PROTO
;
}
stream
=
nghttp2_session_get_stream
(
session
,
stream_id
);
...
...
@@ -1995,7 +1995,7 @@ int nghttp2_session_on_push_response_headers_received(nghttp2_session *session,
nghttp2_stream
*
stream
)
{
int
rv
=
0
;
assert
(
!
session
->
server
&&
stream
->
state
==
NGHTTP2_STREAM_RESERVED
);
assert
(
stream
->
state
==
NGHTTP2_STREAM_RESERVED
);
if
(
frame
->
hd
.
stream_id
==
0
)
{
return
nghttp2_session_handle_invalid_connection
(
session
,
frame
,
NGHTTP2_PROTOCOL_ERROR
);
...
...
@@ -2543,7 +2543,7 @@ int nghttp2_session_on_push_promise_received(nghttp2_session *session,
{
nghttp2_stream
*
stream
;
nghttp2_stream
*
promised_stream
;
if
(
session
->
server
||
frame
->
hd
.
stream_id
==
0
)
{
if
(
frame
->
hd
.
stream_id
==
0
)
{
return
nghttp2_session_handle_invalid_connection
(
session
,
frame
,
NGHTTP2_PROTOCOL_ERROR
);
}
...
...
@@ -2810,8 +2810,7 @@ static int nghttp2_session_process_ctrl_frame(nghttp2_session *session)
frame
->
headers
.
cat
=
NGHTTP2_HCAT_HEADERS
;
r
=
nghttp2_session_on_headers_received
(
session
,
frame
,
stream
);
}
}
else
if
(
!
session
->
server
&&
stream
->
state
==
NGHTTP2_STREAM_RESERVED
)
{
}
else
if
(
stream
->
state
==
NGHTTP2_STREAM_RESERVED
)
{
frame
->
headers
.
cat
=
NGHTTP2_HCAT_PUSH_RESPONSE
;
r
=
nghttp2_session_on_push_response_headers_received
(
session
,
frame
,
stream
);
...
...
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