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
19729962
Commit
19729962
authored
Jun 07, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check stream_id is nonzero for DATA, HEADERS, PRIORITY, RST_STREAM, PUSH_PROMISE
parent
bfaab307
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
2 deletions
+30
-2
lib/includes/nghttp2/nghttp2.h
lib/includes/nghttp2/nghttp2.h
+12
-1
lib/nghttp2_submit.c
lib/nghttp2_submit.c
+18
-1
No files found.
lib/includes/nghttp2/nghttp2.h
View file @
19729962
...
...
@@ -2231,6 +2231,8 @@ int32_t nghttp2_submit_request(nghttp2_session *session,
*
* :enum:`NGHTTP2_ERR_NOMEM`
* Out of memory.
* :enum:`NGHTTP2_ERR_INVALID_ARGUMENT`
* The |stream_id| is 0.
*/
int
nghttp2_submit_response
(
nghttp2_session
*
session
,
int32_t
stream_id
,
...
...
@@ -2297,6 +2299,8 @@ int nghttp2_submit_response(nghttp2_session *session,
* :enum:`NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE`
* No stream ID is available because maximum stream ID was
* reached.
* :enum:`NGHTTP2_ERR_INVALID_ARGUMENT`
* The |stream_id| is 0.
*
* .. warning::
*
...
...
@@ -2332,6 +2336,8 @@ int32_t nghttp2_submit_headers(nghttp2_session *session, uint8_t flags,
* Out of memory.
* :enum:`NGHTTP2_ERR_DATA_EXIST`
* DATA has been already submitted and not fully processed yet.
* :enum:`NGHTTP2_ERR_INVALID_ARGUMENT`
* The |stream_id| is 0.
*/
int
nghttp2_submit_data
(
nghttp2_session
*
session
,
uint8_t
flags
,
int32_t
stream_id
,
...
...
@@ -2363,7 +2369,8 @@ int nghttp2_submit_data(nghttp2_session *session, uint8_t flags,
* :enum:`NGHTTP2_ERR_NOMEM`
* Out of memory.
* :enum:`NGHTTP2_ERR_INVALID_ARGUMENT`
* The |pri_spec| is NULL; or trying to depend on itself.
* The |stream_id| is 0; or the |pri_spec| is NULL; or trying to
* depend on itself.
*/
int
nghttp2_submit_priority
(
nghttp2_session
*
session
,
uint8_t
flags
,
int32_t
stream_id
,
...
...
@@ -2383,6 +2390,8 @@ int nghttp2_submit_priority(nghttp2_session *session, uint8_t flags,
*
* :enum:`NGHTTP2_ERR_NOMEM`
* Out of memory.
* :enum:`NGHTTP2_ERR_INVALID_ARGUMENT`
* The |stream_id| is 0.
*/
int
nghttp2_submit_rst_stream
(
nghttp2_session
*
session
,
uint8_t
flags
,
int32_t
stream_id
,
...
...
@@ -2466,6 +2475,8 @@ int nghttp2_submit_settings(nghttp2_session *session, uint8_t flags,
* :enum:`NGHTTP2_ERR_STREAM_ID_NOT_AVAILABLE`
* No stream ID is available because maximum stream ID was
* reached.
* :enum:`NGHTTP2_ERR_INVALID_ARGUMENT`
* The |stream_id| is 0.
*
* .. warning::
*
...
...
lib/nghttp2_submit.c
View file @
19729962
...
...
@@ -52,6 +52,11 @@ static int32_t submit_headers_shared
nghttp2_headers_aux_data
*
aux_data
=
NULL
;
nghttp2_headers_category
hcat
;
if
(
stream_id
==
0
)
{
rv
=
NGHTTP2_ERR_INVALID_ARGUMENT
;
goto
fail
;
}
if
(
data_prd
!=
NULL
&&
data_prd
->
read_callback
!=
NULL
)
{
data_prd_copy
=
malloc
(
sizeof
(
nghttp2_data_provider
));
if
(
data_prd_copy
==
NULL
)
{
...
...
@@ -197,7 +202,7 @@ int nghttp2_submit_priority(nghttp2_session *session, uint8_t flags,
nghttp2_frame
*
frame
;
nghttp2_priority_spec
copy_pri_spec
;
if
(
pri_spec
==
NULL
)
{
if
(
stream_id
==
0
||
pri_spec
==
NULL
)
{
return
NGHTTP2_ERR_INVALID_ARGUMENT
;
}
...
...
@@ -233,6 +238,10 @@ int nghttp2_submit_rst_stream(nghttp2_session *session, uint8_t flags,
int32_t
stream_id
,
nghttp2_error_code
error_code
)
{
if
(
stream_id
==
0
)
{
return
NGHTTP2_ERR_INVALID_ARGUMENT
;
}
return
nghttp2_session_add_rst_stream
(
session
,
stream_id
,
error_code
);
}
...
...
@@ -262,6 +271,10 @@ int32_t nghttp2_submit_push_promise(nghttp2_session *session, uint8_t flags,
int32_t
promised_stream_id
;
int
rv
;
if
(
stream_id
==
0
)
{
return
NGHTTP2_ERR_INVALID_ARGUMENT
;
}
if
(
!
session
->
server
)
{
return
NGHTTP2_ERR_PROTO
;
}
...
...
@@ -495,6 +508,10 @@ int nghttp2_submit_data(nghttp2_session *session, uint8_t flags,
uint8_t
nflags
=
flags
&
(
NGHTTP2_FLAG_END_STREAM
|
NGHTTP2_FLAG_END_SEGMENT
);
if
(
stream_id
==
0
)
{
return
NGHTTP2_ERR_INVALID_ARGUMENT
;
}
data_frame
=
malloc
(
sizeof
(
nghttp2_private_data
));
if
(
data_frame
==
NULL
)
{
return
NGHTTP2_ERR_NOMEM
;
...
...
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