From c5912341ad84de748f5573825620d0e6e3919ce4 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 26 Sep 2013 21:39:19 +0900 Subject: [PATCH] nghttpx: Fix crash on upgrade success --- src/shrpx_client_handler.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shrpx_client_handler.cc b/src/shrpx_client_handler.cc index b8aeec84..74bc675a 100644 --- a/src/shrpx_client_handler.cc +++ b/src/shrpx_client_handler.cc @@ -436,6 +436,8 @@ int ClientHandler::perform_http2_upgrade(HttpsUpstream *http) if(upstream->upgrade_upstream(http) != 0) { return -1; } + // http pointer is now owned by upstream. + upstream_.release(); upstream_ = std::move(upstream); set_bev_cb(upstream_http2_connhd_readcb, upstream_writecb, upstream_eventcb); static char res[] = "HTTP/1.1 101 Switching Protocols\r\n"