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
0fa4779d
Commit
0fa4779d
authored
Mar 13, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't call on_frame_recv_callback after stream close or being closed
parent
d07bb1dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
14 deletions
+18
-14
lib/nghttp2_session.c
lib/nghttp2_session.c
+18
-14
No files found.
lib/nghttp2_session.c
View file @
0fa4779d
...
...
@@ -2286,19 +2286,22 @@ static int session_after_header_block_received(nghttp2_session *session)
nghttp2_frame
*
frame
=
&
session
->
iframe
.
frame
;
nghttp2_stream
*
stream
;
/* We call on_frame_recv_callback regardless of the existence of
stream */
/* We don't call on_frame_recv_callback if stream has been closed
already or being closed. */
stream
=
nghttp2_session_get_stream
(
session
,
frame
->
hd
.
stream_id
);
if
(
!
stream
||
stream
->
state
==
NGHTTP2_STREAM_CLOSING
)
{
return
0
;
}
rv
=
nghttp2_session_call_on_frame_received
(
session
,
frame
);
if
(
nghttp2_is_fatal
(
rv
))
{
return
rv
;
}
if
(
frame
->
hd
.
type
!=
NGHTTP2_HEADERS
)
{
return
0
;
}
stream
=
nghttp2_session_get_stream
(
session
,
frame
->
hd
.
stream_id
);
if
(
!
stream
)
{
return
0
;
}
switch
(
frame
->
headers
.
cat
)
{
case
NGHTTP2_HCAT_REQUEST
:
return
nghttp2_session_end_request_headers_received
...
...
@@ -3184,20 +3187,21 @@ int nghttp2_session_on_data_received(nghttp2_session *session,
int
rv
=
0
;
nghttp2_stream
*
stream
;
/* We call on_frame_recv_callback even if stream has been closed
already */
rv
=
nghttp2_session_call_on_frame_received
(
session
,
frame
);
if
(
nghttp2_is_fatal
(
rv
))
{
return
rv
;
}
/* We don't call on_frame_recv_callback if stream has been closed
already or being closed. */
stream
=
nghttp2_session_get_stream
(
session
,
frame
->
hd
.
stream_id
);
if
(
!
stream
)
{
if
(
!
stream
||
stream
->
state
==
NGHTTP2_STREAM_CLOSING
)
{
/* This should be treated as stream error, but it results in lots
of RST_STREAM. So just ignore frame against nonexistent stream
for now. */
return
0
;
}
rv
=
nghttp2_session_call_on_frame_received
(
session
,
frame
);
if
(
nghttp2_is_fatal
(
rv
))
{
return
rv
;
}
if
(
frame
->
hd
.
flags
&
NGHTTP2_FLAG_END_STREAM
)
{
nghttp2_stream_shutdown
(
stream
,
NGHTTP2_SHUT_RD
);
rv
=
nghttp2_session_close_stream_if_shut_rdwr
(
session
,
stream
);
...
...
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