nghttpx: Use nocopy version to send trailer headers to backend
It looks like we can use nocopy version here. We use nocopy version in frontend in day 1.
This commit is contained in:
parent
fb2d8f79d6
commit
6ec7683991
|
@ -201,9 +201,7 @@ ssize_t http2_data_read_callback(nghttp2_session *session, int32_t stream_id,
|
||||||
if (!trailers.empty()) {
|
if (!trailers.empty()) {
|
||||||
std::vector<nghttp2_nv> nva;
|
std::vector<nghttp2_nv> nva;
|
||||||
nva.reserve(trailers.size());
|
nva.reserve(trailers.size());
|
||||||
// We cannot use nocopy version, since nva may be touched after
|
http2::copy_headers_to_nva_nocopy(nva, trailers, http2::HDOP_STRIP_ALL);
|
||||||
// Downstream object is deleted.
|
|
||||||
http2::copy_headers_to_nva(nva, trailers, http2::HDOP_STRIP_ALL);
|
|
||||||
if (!nva.empty()) {
|
if (!nva.empty()) {
|
||||||
rv = nghttp2_submit_trailer(session, stream_id, nva.data(), nva.size());
|
rv = nghttp2_submit_trailer(session, stream_id, nva.data(), nva.size());
|
||||||
if (rv != 0) {
|
if (rv != 0) {
|
||||||
|
|
Loading…
Reference in New Issue