From 21f0e82e77052e5416d0c435385f0dbc18f3109c Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Sat, 28 Apr 2018 08:17:16 +0200 Subject: [PATCH] fixup: clear storage early --- src/node_http2.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/node_http2.cc b/src/node_http2.cc index 4b1fc3582f227a..05d9243ee30ec0 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -1366,6 +1366,8 @@ void Http2Session::ClearOutgoing(int status) { CHECK_NE(flags_ & SESSION_STATE_SENDING, 0); if (outgoing_buffers_.size() > 0) { + outgoing_storage_.clear(); + for (const nghttp2_stream_write& wr : outgoing_buffers_) { WriteWrap* wrap = wr.req_wrap; if (wrap != nullptr) @@ -1373,7 +1375,6 @@ void Http2Session::ClearOutgoing(int status) { } outgoing_buffers_.clear(); - outgoing_storage_.clear(); } flags_ &= ~SESSION_STATE_SENDING;