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
46f5d4b1
Commit
46f5d4b1
authored
Feb 20, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
examples: Check stream_data is null
parent
bbc09b00
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
doc/sources/tutorial-server.rst
doc/sources/tutorial-server.rst
+4
-1
examples/libevent-server.c
examples/libevent-server.c
+4
-1
No files found.
doc/sources/tutorial-server.rst
View file @
46f5d4b1
...
...
@@ -462,7 +462,7 @@ is emitted via ``on_header_callback`` function, which is called after
}
stream_data = nghttp2_session_get_stream_user_data(session,
frame->hd.stream_id);
if(stream_data->request_path) {
if(
!stream_data ||
stream_data->request_path) {
break;
}
if(namelen == sizeof(PATH) - 1 && memcmp(PATH, name, namelen) == 0) {
...
...
@@ -580,6 +580,9 @@ is about to close::
http2_stream_data *stream_data;
stream_data = nghttp2_session_get_stream_user_data(session, stream_id);
if(!stream_data) {
return 0;
}
remove_stream(session_data, stream_data);
delete_http2_stream_data(stream_data);
return 0;
...
...
examples/libevent-server.c
View file @
46f5d4b1
...
...
@@ -410,7 +410,7 @@ static int on_header_callback(nghttp2_session *session,
}
stream_data
=
nghttp2_session_get_stream_user_data
(
session
,
frame
->
hd
.
stream_id
);
if
(
stream_data
->
request_path
)
{
if
(
!
stream_data
||
stream_data
->
request_path
)
{
break
;
}
if
(
namelen
==
sizeof
(
PATH
)
-
1
&&
memcmp
(
PATH
,
name
,
namelen
)
==
0
)
{
...
...
@@ -529,6 +529,9 @@ static int on_stream_close_callback(nghttp2_session *session,
http2_stream_data
*
stream_data
;
stream_data
=
nghttp2_session_get_stream_user_data
(
session
,
stream_id
);
if
(
!
stream_data
)
{
return
0
;
}
remove_stream
(
session_data
,
stream_data
);
delete_http2_stream_data
(
stream_data
);
return
0
;
...
...
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