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
794633f8
Commit
794633f8
authored
Dec 23, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add nghttp2_session_set_stream_user_data API function
parent
e04e6ccd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
7 deletions
+39
-7
lib/includes/nghttp2/nghttp2.h
lib/includes/nghttp2/nghttp2.h
+26
-7
lib/nghttp2_session.c
lib/nghttp2_session.c
+13
-0
No files found.
lib/includes/nghttp2/nghttp2.h
View file @
794633f8
...
...
@@ -1577,17 +1577,36 @@ int nghttp2_session_want_write(nghttp2_session *session);
* @function
*
* Returns stream_user_data for the stream |stream_id|. The
* stream_user_data is provided by `nghttp2_submit_request()`
or
* `nghttp2_submit_headers()`
. If the stream is initiated by the
*
remote endpoint, stream_user_data is always ``NULL``. If the stream
*
is initiated by the local endpoint and ``NULL`` is given in
*
`nghttp2_submit_request()` or `nghttp2_submit_headers()`, then
*
this function returns ``NULL``. If the stream does not exist, thi
s
*
function returns
``NULL``.
* stream_user_data is provided by `nghttp2_submit_request()`
,
* `nghttp2_submit_headers()`
or
*
`nghttp2_session_set_stream_user_data()`. Unless it is set using
*
`nghttp2_session_set_stream_user_data()`, if the stream is
*
initiated by the remote endpoint, stream_user_data is always
*
``NULL``. If the stream does not exist, this function return
s
* ``NULL``.
*/
void
*
nghttp2_session_get_stream_user_data
(
nghttp2_session
*
session
,
int32_t
stream_id
);
/**
* @function
*
* Sets the |stream_user_data| to the stream denoted by the
* |stream_id|. If a stream user data is already set to the stream, it
* is replaced with the |stream_user_data|. It is valid to specify
* ``NULL`` in the |stream_user_data|, which nullifies the associated
* data pointer.
*
* This function returns 0 if it succeeds, or one of following
* negative error codes:
*
* :enum:`NGHTTP2_ERR_INVALID_ARGUMENT`
* The stream does not exist
*/
int
nghttp2_session_set_stream_user_data
(
nghttp2_session
*
session
,
int32_t
stream_id
,
void
*
stream_user_data
);
/**
* @function
*
...
...
lib/nghttp2_session.c
View file @
794633f8
...
...
@@ -3622,6 +3622,19 @@ void* nghttp2_session_get_stream_user_data(nghttp2_session *session,
}
}
int
nghttp2_session_set_stream_user_data
(
nghttp2_session
*
session
,
int32_t
stream_id
,
void
*
stream_user_data
)
{
nghttp2_stream
*
stream
;
stream
=
nghttp2_session_get_stream
(
session
,
stream_id
);
if
(
!
stream
)
{
return
NGHTTP2_ERR_INVALID_ARGUMENT
;
}
stream
->
stream_user_data
=
stream_user_data
;
return
0
;
}
int
nghttp2_session_resume_data
(
nghttp2_session
*
session
,
int32_t
stream_id
)
{
int
r
;
...
...
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