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
e9d1ba25
Commit
e9d1ba25
authored
Feb 08, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle incoming PAD_HIGH and PAD_LOW in inbound_frame_handle_padding
parent
2ff3d97b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
15 deletions
+32
-15
lib/nghttp2_session.c
lib/nghttp2_session.c
+32
-15
No files found.
lib/nghttp2_session.c
View file @
e9d1ba25
...
...
@@ -3313,6 +3313,29 @@ static int inbound_frame_set_settings_entry(nghttp2_inbound_frame *iframe)
return
0
;
}
/*
* Checks PAD_HIGH and PAD_LOW flags and set next state
* accordingly. If padding is set, this function returns 1. If no
* padding is set, this function returns 0. On error, returns -1.
*/
static
int
inbound_frame_handle_pad
(
nghttp2_inbound_frame
*
iframe
)
{
if
(
iframe
->
frame
.
hd
.
flags
&
NGHTTP2_FLAG_PAD_HIGH
)
{
if
((
iframe
->
frame
.
hd
.
flags
&
NGHTTP2_FLAG_PAD_LOW
)
==
0
)
{
return
-
1
;
}
iframe
->
state
=
NGHTTP2_IB_READ_NBYTE
;
iframe
->
left
=
2
;
return
1
;
}
if
(
iframe
->
frame
.
hd
.
flags
&
NGHTTP2_FLAG_PAD_LOW
)
{
iframe
->
state
=
NGHTTP2_IB_READ_NBYTE
;
iframe
->
left
=
1
;
return
1
;
}
return
0
;
}
ssize_t
nghttp2_session_mem_recv
(
nghttp2_session
*
session
,
const
uint8_t
*
in
,
size_t
inlen
)
{
...
...
@@ -3354,26 +3377,20 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session,
if
(
nghttp2_is_fatal
(
rv
))
{
return
rv
;
}
if
(
iframe
->
frame
.
hd
.
flags
&
NGHTTP2_FLAG_PAD_HIGH
)
{
if
((
iframe
->
frame
.
hd
.
flags
&
NGHTTP2_FLAG_PAD_LOW
)
==
0
)
{
iframe
->
state
=
NGHTTP2_IB_IGN_DATA
;
rv
=
nghttp2_session_terminate_session
(
session
,
NGHTTP2_PROTOCOL_ERROR
);
if
(
nghttp2_is_fatal
(
rv
))
{
return
rv
;
}
break
;
rv
=
inbound_frame_handle_pad
(
iframe
);
if
(
rv
<
0
)
{
iframe
->
state
=
NGHTTP2_IB_IGN_DATA
;
rv
=
nghttp2_session_terminate_session
(
session
,
NGHTTP2_PROTOCOL_ERROR
);
if
(
nghttp2_is_fatal
(
rv
))
{
return
rv
;
}
iframe
->
state
=
NGHTTP2_IB_READ_NBYTE
;
iframe
->
left
=
2
;
break
;
}
if
(
iframe
->
frame
.
hd
.
flags
&
NGHTTP2_FLAG_PAD_LOW
)
{
iframe
->
state
=
NGHTTP2_IB_READ_NBYTE
;
iframe
->
left
=
1
;
if
(
rv
==
0
)
{
iframe
->
state
=
NGHTTP2_IB_READ_DATA
;
break
;
}
iframe
->
state
=
NGHTTP2_IB_READ_DATA
;
break
;
}
case
NGHTTP2_HEADERS
:
...
...
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