Skip to content

Commit

Permalink
fix http call response crash (envoyproxy#455)
Browse files Browse the repository at this point in the history
Signed-off-by: Pengyuan Bian <bianpengyuan@google.com>
  • Loading branch information
bianpengyuan committed May 15, 2020
1 parent 6144102 commit d1ef68a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/extensions/common/wasm/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1772,7 +1772,8 @@ void Context::setEncoderFilterCallbacks(Envoy::Http::StreamEncoderFilterCallback

void Context::onHttpCallSuccess(uint32_t token, Envoy::Http::ResponseMessagePtr& response) {
http_call_response_ = &response;
onHttpCallResponse(token, response->headers().size(), response->body()->length(),
uint32_t body_size = response->body() ? response->body()->length() : 0;
onHttpCallResponse(token, response->headers().size(), body_size,
headerSize(response->trailers()));
http_call_response_ = nullptr;
http_request_.erase(token);
Expand Down

0 comments on commit d1ef68a

Please sign in to comment.