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
961f41d7
Commit
961f41d7
authored
Mar 08, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttp, nghttpd: Add trailer header field when sending trailer part
parent
928d3e5f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
1 deletion
+21
-1
src/HttpServer.cc
src/HttpServer.cc
+11
-1
src/nghttp.cc
src/nghttp.cc
+10
-0
No files found.
src/HttpServer.cc
View file @
961f41d7
...
...
@@ -690,12 +690,22 @@ int Http2Handler::submit_file_response(const std::string &status,
http2
::
make_nv_ls
(
"content-length"
,
content_length
),
http2
::
make_nv_ll
(
"cache-control"
,
"max-age=3600"
),
http2
::
make_nv_ls
(
"date"
,
sessions_
->
get_cached_date
()),
http2
::
make_nv_ll
(
""
,
""
));
http2
::
make_nv_ll
(
""
,
""
)
,
http2
::
make_nv_ll
(
""
,
""
)
);
size_t
nvlen
=
5
;
if
(
last_modified
!=
0
)
{
last_modified_str
=
util
::
http_date
(
last_modified
);
nva
[
nvlen
++
]
=
http2
::
make_nv_ls
(
"last-modified"
,
last_modified_str
);
}
auto
&
trailer
=
get_config
()
->
trailer
;
std
::
string
trailer_names
;
if
(
!
trailer
.
empty
())
{
trailer_names
=
trailer
[
0
].
name
;
for
(
size_t
i
=
1
;
i
<
trailer
.
size
();
++
i
)
{
trailer_names
+=
", "
;
trailer_names
+=
trailer
[
i
].
name
;
}
nva
[
nvlen
++
]
=
http2
::
make_nv_ls
(
"trailer"
,
trailer_names
);
}
return
nghttp2_submit_response
(
session_
,
stream
->
stream_id
,
nva
.
data
(),
nvlen
,
data_prd
);
}
...
...
src/nghttp.cc
View file @
961f41d7
...
...
@@ -376,6 +376,16 @@ int submit_request(HttpClient *client, const Headers &headers, Request *req) {
nva
.
push_back
(
http2
::
make_nv
(
kv
.
name
,
kv
.
value
,
kv
.
no_index
));
}
std
::
string
trailer_names
;
if
(
!
config
.
trailer
.
empty
())
{
trailer_names
=
config
.
trailer
[
0
].
name
;
for
(
size_t
i
=
1
;
i
<
config
.
trailer
.
size
();
++
i
)
{
trailer_names
+=
", "
;
trailer_names
+=
config
.
trailer
[
i
].
name
;
}
nva
.
push_back
(
http2
::
make_nv_ls
(
"trailer"
,
trailer_names
));
}
auto
stream_id
=
nghttp2_submit_request
(
client
->
session
,
&
req
->
pri_spec
,
nva
.
data
(),
nva
.
size
(),
req
->
data_prd
,
req
);
...
...
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