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
d75ba74b
Commit
d75ba74b
authored
Nov 29, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return error if invalid stream_id is given to nghttp2_submit_push_promise
parent
9ff19255
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
8 deletions
+6
-8
lib/includes/nghttp2/nghttp2.h
lib/includes/nghttp2/nghttp2.h
+2
-1
lib/nghttp2_session.c
lib/nghttp2_session.c
+0
-5
lib/nghttp2_submit.c
lib/nghttp2_submit.c
+1
-1
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+3
-1
No files found.
lib/includes/nghttp2/nghttp2.h
View file @
d75ba74b
...
...
@@ -2802,7 +2802,8 @@ int nghttp2_submit_settings(nghttp2_session *session, uint8_t flags,
* No stream ID is available because maximum stream ID was
* reached.
* :enum:`NGHTTP2_ERR_INVALID_ARGUMENT`
* The |stream_id| is 0.
* The |stream_id| is 0; The |stream_id| does not designate stream
* that peer initiated.
*
* .. warning::
*
...
...
lib/nghttp2_session.c
View file @
d75ba74b
...
...
@@ -1358,11 +1358,6 @@ static int session_predicate_push_promise_send(nghttp2_session *session,
assert
(
stream
);
if
(
nghttp2_session_is_my_stream_id
(
session
,
stream
->
stream_id
))
{
/* The associated stream must be initiated by the remote peer */
return
NGHTTP2_ERR_PROTO
;
}
if
(
session
->
remote_settings
.
enable_push
==
0
)
{
return
NGHTTP2_ERR_PUSH_DISABLED
;
}
...
...
lib/nghttp2_submit.c
View file @
d75ba74b
...
...
@@ -247,7 +247,7 @@ int32_t nghttp2_submit_push_promise(nghttp2_session *session, uint8_t flags _U_,
int32_t
promised_stream_id
;
int
rv
;
if
(
stream_id
==
0
)
{
if
(
stream_id
==
0
||
nghttp2_session_is_my_stream_id
(
session
,
stream_id
)
)
{
return
NGHTTP2_ERR_INVALID_ARGUMENT
;
}
...
...
tests/nghttp2_session_test.c
View file @
d75ba74b
...
...
@@ -4146,7 +4146,9 @@ void test_nghttp2_submit_invalid_nv(void) {
NULL
));
/* nghttp2_submit_push_promise */
CU_ASSERT
(
0
<
nghttp2_submit_push_promise
(
session
,
NGHTTP2_FLAG_NONE
,
2
,
open_stream
(
session
,
1
);
CU_ASSERT
(
0
<
nghttp2_submit_push_promise
(
session
,
NGHTTP2_FLAG_NONE
,
1
,
empty_name_nv
,
ARRLEN
(
empty_name_nv
),
NULL
));
...
...
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