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
70c05584
Commit
70c05584
authored
Oct 10, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set payload length when expected SETTINGS is not received
parent
f2bfe623
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
lib/nghttp2_session.c
lib/nghttp2_session.c
+3
-0
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+14
-0
No files found.
lib/nghttp2_session.c
View file @
70c05584
...
@@ -4413,6 +4413,9 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session,
...
@@ -4413,6 +4413,9 @@ ssize_t nghttp2_session_mem_recv(nghttp2_session *session,
}
}
if
(
iframe
->
sbuf
.
pos
[
3
]
!=
NGHTTP2_SETTINGS
)
{
if
(
iframe
->
sbuf
.
pos
[
3
]
!=
NGHTTP2_SETTINGS
)
{
nghttp2_frame_unpack_frame_hd
(
&
iframe
->
frame
.
hd
,
iframe
->
sbuf
.
pos
);
iframe
->
payloadleft
=
iframe
->
frame
.
hd
.
length
;
busy
=
1
;
busy
=
1
;
iframe
->
state
=
NGHTTP2_IB_IGN_PAYLOAD
;
iframe
->
state
=
NGHTTP2_IB_IGN_PAYLOAD
;
...
...
tests/nghttp2_session_test.c
View file @
70c05584
...
@@ -6477,6 +6477,8 @@ void test_nghttp2_session_recv_client_preface(void)
...
@@ -6477,6 +6477,8 @@ void test_nghttp2_session_recv_client_preface(void)
nghttp2_session_callbacks
callbacks
;
nghttp2_session_callbacks
callbacks
;
nghttp2_option
*
option
;
nghttp2_option
*
option
;
ssize_t
rv
;
ssize_t
rv
;
nghttp2_frame
ping_frame
;
uint8_t
buf
[
16
];
memset
(
&
callbacks
,
0
,
sizeof
(
callbacks
));
memset
(
&
callbacks
,
0
,
sizeof
(
callbacks
));
...
@@ -6496,6 +6498,18 @@ void test_nghttp2_session_recv_client_preface(void)
...
@@ -6496,6 +6498,18 @@ void test_nghttp2_session_recv_client_preface(void)
CU_ASSERT
(
rv
==
NGHTTP2_CLIENT_CONNECTION_PREFACE_LEN
);
CU_ASSERT
(
rv
==
NGHTTP2_CLIENT_CONNECTION_PREFACE_LEN
);
CU_ASSERT
(
NGHTTP2_IB_READ_FIRST_SETTINGS
==
session
->
iframe
.
state
);
CU_ASSERT
(
NGHTTP2_IB_READ_FIRST_SETTINGS
==
session
->
iframe
.
state
);
/* Receiving PING is error */
nghttp2_frame_ping_init
(
&
ping_frame
.
ping
,
NGHTTP2_FLAG_NONE
,
NULL
);
nghttp2_frame_pack_frame_hd
(
buf
,
&
ping_frame
.
ping
.
hd
);
rv
=
nghttp2_session_mem_recv
(
session
,
buf
,
NGHTTP2_FRAME_HDLEN
);
CU_ASSERT
(
NGHTTP2_FRAME_HDLEN
==
rv
);
CU_ASSERT
(
NGHTTP2_IB_IGN_PAYLOAD
==
session
->
iframe
.
state
);
CU_ASSERT
(
8
==
session
->
iframe
.
payloadleft
);
nghttp2_frame_ping_free
(
&
ping_frame
.
ping
);
nghttp2_session_del
(
session
);
nghttp2_session_del
(
session
);
/* Check bad case */
/* Check bad case */
...
...
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