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
2a83fc75
Commit
2a83fc75
authored
Nov 28, 2013
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add nghttp2_submit_response2
parent
679a389b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
3 deletions
+42
-3
lib/includes/nghttp2/nghttp2.h
lib/includes/nghttp2/nghttp2.h
+22
-0
lib/nghttp2_submit.c
lib/nghttp2_submit.c
+20
-3
No files found.
lib/includes/nghttp2/nghttp2.h
View file @
2a83fc75
...
@@ -1876,6 +1876,28 @@ int nghttp2_submit_response(nghttp2_session *session,
...
@@ -1876,6 +1876,28 @@ int nghttp2_submit_response(nghttp2_session *session,
int32_t
stream_id
,
const
char
**
nv
,
int32_t
stream_id
,
const
char
**
nv
,
const
nghttp2_data_provider
*
data_prd
);
const
nghttp2_data_provider
*
data_prd
);
/**
* @function
*
* Just like `nghttp2_submit_response()`, but this function takes the
* |nva|, which is an array of ``nghttp2_nv`` with |nvlen| elements,
* as name/value pairs. This function is useful if name/value pairs
* are not NULL-terminated strings.
*
* This function returns 0 if it succeeds, or one of the following
* negative error codes:
*
* :enum:`NGHTTP2_ERR_INVALID_ARGUMENT`
* The |pri| is invalid; or the |nva| includes empty name or
* name which contains invalid characters.
* :enum:`NGHTTP2_ERR_NOMEM`
* Out of memory.
*/
int
nghttp2_submit_response2
(
nghttp2_session
*
session
,
int32_t
stream_id
,
const
nghttp2_nv
*
nva
,
size_t
nvlen
,
const
nghttp2_data_provider
*
data_prd
);
/**
/**
* @function
* @function
*
*
...
...
lib/nghttp2_submit.c
View file @
2a83fc75
...
@@ -326,19 +326,36 @@ int nghttp2_submit_request2(nghttp2_session *session, int32_t pri,
...
@@ -326,19 +326,36 @@ int nghttp2_submit_request2(nghttp2_session *session, int32_t pri,
data_prd
,
stream_user_data
);
data_prd
,
stream_user_data
);
}
}
int
nghttp2_submit_response
(
nghttp2_session
*
session
,
static
uint8_t
set_response_flags
(
const
nghttp2_data_provider
*
data_prd
)
int32_t
stream_id
,
const
char
**
nv
,
const
nghttp2_data_provider
*
data_prd
)
{
{
uint8_t
flags
=
NGHTTP2_FLAG_NONE
;
uint8_t
flags
=
NGHTTP2_FLAG_NONE
;
if
(
data_prd
==
NULL
||
data_prd
->
read_callback
==
NULL
)
{
if
(
data_prd
==
NULL
||
data_prd
->
read_callback
==
NULL
)
{
flags
|=
NGHTTP2_FLAG_END_STREAM
;
flags
|=
NGHTTP2_FLAG_END_STREAM
;
}
}
return
flags
;
}
int
nghttp2_submit_response
(
nghttp2_session
*
session
,
int32_t
stream_id
,
const
char
**
nv
,
const
nghttp2_data_provider
*
data_prd
)
{
uint8_t
flags
=
set_response_flags
(
data_prd
);
return
nghttp2_submit_headers_shared_nv
(
session
,
flags
,
stream_id
,
return
nghttp2_submit_headers_shared_nv
(
session
,
flags
,
stream_id
,
NGHTTP2_PRI_DEFAULT
,
nv
,
data_prd
,
NGHTTP2_PRI_DEFAULT
,
nv
,
data_prd
,
NULL
);
NULL
);
}
}
int
nghttp2_submit_response2
(
nghttp2_session
*
session
,
int32_t
stream_id
,
const
nghttp2_nv
*
nva
,
size_t
nvlen
,
const
nghttp2_data_provider
*
data_prd
)
{
uint8_t
flags
=
set_response_flags
(
data_prd
);
return
nghttp2_submit_headers_shared_nva
(
session
,
flags
,
stream_id
,
NGHTTP2_PRI_DEFAULT
,
nva
,
nvlen
,
data_prd
,
NULL
);
}
int
nghttp2_submit_data
(
nghttp2_session
*
session
,
uint8_t
flags
,
int
nghttp2_submit_data
(
nghttp2_session
*
session
,
uint8_t
flags
,
int32_t
stream_id
,
int32_t
stream_id
,
const
nghttp2_data_provider
*
data_prd
)
const
nghttp2_data_provider
*
data_prd
)
...
...
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