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
2d41c992
Commit
2d41c992
authored
Aug 24, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Connection error if header continuation is employed by peer for now
parent
e55abcd6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
3 deletions
+28
-3
lib/nghttp2_session.c
lib/nghttp2_session.c
+25
-0
tests/nghttp2_session_test.c
tests/nghttp2_session_test.c
+3
-3
No files found.
lib/nghttp2_session.c
View file @
2d41c992
...
...
@@ -1668,6 +1668,11 @@ int nghttp2_session_on_request_headers_received(nghttp2_session *session,
return
nghttp2_session_handle_invalid_connection
(
session
,
frame
,
NGHTTP2_PROTOCOL_ERROR
);
}
/* Connection error if header continuation is employed for now */
if
((
frame
->
hd
.
flags
&
NGHTTP2_FLAG_END_HEADERS
)
==
0
)
{
return
nghttp2_session_handle_invalid_connection
(
session
,
frame
,
NGHTTP2_INTERNAL_ERROR
);
}
if
(
session
->
goaway_flags
)
{
/* We don't accept new stream after GOAWAY is sent or received. */
return
0
;
...
...
@@ -1720,6 +1725,11 @@ int nghttp2_session_on_response_headers_received(nghttp2_session *session,
return
nghttp2_session_handle_invalid_connection
(
session
,
frame
,
NGHTTP2_PROTOCOL_ERROR
);
}
/* Connection error if header continuation is employed for now */
if
((
frame
->
hd
.
flags
&
NGHTTP2_FLAG_END_HEADERS
)
==
0
)
{
return
nghttp2_session_handle_invalid_connection
(
session
,
frame
,
NGHTTP2_INTERNAL_ERROR
);
}
if
((
stream
->
shut_flags
&
NGHTTP2_SHUT_RD
)
==
0
)
{
stream
->
state
=
NGHTTP2_STREAM_OPENED
;
nghttp2_session_call_on_frame_received
(
session
,
frame
);
...
...
@@ -1752,6 +1762,11 @@ int nghttp2_session_on_push_response_headers_received(nghttp2_session *session,
return
nghttp2_session_handle_invalid_connection
(
session
,
frame
,
NGHTTP2_PROTOCOL_ERROR
);
}
/* Connection error if header continuation is employed for now */
if
((
frame
->
hd
.
flags
&
NGHTTP2_FLAG_END_HEADERS
)
==
0
)
{
return
nghttp2_session_handle_invalid_connection
(
session
,
frame
,
NGHTTP2_INTERNAL_ERROR
);
}
if
(
session
->
goaway_flags
)
{
/* We don't accept new stream after GOAWAY is sent or received. */
return
0
;
...
...
@@ -1777,6 +1792,11 @@ int nghttp2_session_on_headers_received(nghttp2_session *session,
return
nghttp2_session_handle_invalid_connection
(
session
,
frame
,
NGHTTP2_PROTOCOL_ERROR
);
}
/* Connection error if header continuation is employed for now */
if
((
frame
->
hd
.
flags
&
NGHTTP2_FLAG_END_HEADERS
)
==
0
)
{
return
nghttp2_session_handle_invalid_connection
(
session
,
frame
,
NGHTTP2_INTERNAL_ERROR
);
}
if
((
stream
->
shut_flags
&
NGHTTP2_SHUT_RD
)
==
0
)
{
if
(
nghttp2_session_is_my_stream_id
(
session
,
frame
->
hd
.
stream_id
))
{
if
(
stream
->
state
==
NGHTTP2_STREAM_OPENED
)
{
...
...
@@ -2153,6 +2173,11 @@ int nghttp2_session_on_push_promise_received(nghttp2_session *session,
return
nghttp2_session_handle_invalid_connection
(
session
,
frame
,
NGHTTP2_PROTOCOL_ERROR
);
}
/* Connection error if header continuation is employed for now */
if
((
frame
->
hd
.
flags
&
NGHTTP2_FLAG_END_PUSH_PROMISE
)
==
0
)
{
return
nghttp2_session_handle_invalid_connection
(
session
,
frame
,
NGHTTP2_INTERNAL_ERROR
);
}
if
(
session
->
goaway_flags
)
{
/* We just dicard PUSH_PROMISE after GOAWAY is sent or
received. */
...
...
tests/nghttp2_session_test.c
View file @
2d41c992
...
...
@@ -750,7 +750,7 @@ void test_nghttp2_session_on_headers_received(void)
NGHTTP2_PRI_DEFAULT
,
NGHTTP2_STREAM_CLOSING
,
NULL
);
frame
.
hd
.
stream_id
=
3
;
frame
.
hd
.
flags
=
NGHTTP2_FLAG_
NONE
;
frame
.
hd
.
flags
=
NGHTTP2_FLAG_
END_HEADERS
;
CU_ASSERT
(
0
==
nghttp2_session_on_headers_received
(
session
,
&
frame
,
stream
));
/* See no counters are updated */
CU_ASSERT
(
2
==
user_data
.
frame_recv_cb_called
);
...
...
@@ -762,7 +762,7 @@ void test_nghttp2_session_on_headers_received(void)
NGHTTP2_STREAM_OPENING
,
NULL
);
/* half closed (remote) */
frame
.
hd
.
flags
=
NGHTTP2_FLAG_END_STREAM
;
frame
.
hd
.
flags
=
NGHTTP2_FLAG_END_
HEADERS
|
NGHTTP2_FLAG_END_
STREAM
;
frame
.
hd
.
stream_id
=
2
;
CU_ASSERT
(
0
==
nghttp2_session_on_headers_received
(
session
,
&
frame
,
stream
));
...
...
@@ -2465,7 +2465,7 @@ void test_nghttp2_session_max_concurrent_streams(void)
NGHTTP2_PRI_DEFAULT
,
NGHTTP2_STREAM_OPENED
,
NULL
);
nvlen
=
nghttp2_nv_array_from_cstr
(
&
nva
,
nv
);
nghttp2_frame_headers_init
(
&
frame
.
headers
,
NGHTTP2_FLAG_
NONE
,
3
,
nghttp2_frame_headers_init
(
&
frame
.
headers
,
NGHTTP2_FLAG_
END_HEADERS
,
3
,
NGHTTP2_PRI_DEFAULT
,
nva
,
nvlen
);
session
->
local_settings
[
NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS
]
=
1
;
...
...
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