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:
Tatsuhiro Tsujikawa 2017-06-02 22:38:39 +09:00
parent fb2d8f79d6
commit 6ec7683991
1 changed files with 1 additions and 3 deletions

View File

@ -201,9 +201,7 @@ ssize_t http2_data_read_callback(nghttp2_session *session, int32_t stream_id,
if (!trailers.empty()) {
std::vector<nghttp2_nv> nva;
nva.reserve(trailers.size());
// We cannot use nocopy version, since nva may be touched after
// Downstream object is deleted.
http2::copy_headers_to_nva(nva, trailers, http2::HDOP_STRIP_ALL);
http2::copy_headers_to_nva_nocopy(nva, trailers, http2::HDOP_STRIP_ALL);
if (!nva.empty()) {
rv = nghttp2_submit_trailer(session, stream_id, nva.data(), nva.size());
if (rv != 0) {