Commit bbebc4ad authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Fix crash on CONNECT or downstream failure

parent 01f7162b
...@@ -417,6 +417,10 @@ bool Downstream::get_output_buffer_full() ...@@ -417,6 +417,10 @@ bool Downstream::get_output_buffer_full()
// Downstream. Otherwise, the program will crash. // Downstream. Otherwise, the program will crash.
int Downstream::push_request_headers() int Downstream::push_request_headers()
{ {
if(!dconn_) {
DLOG(INFO, this) << "dconn_ is NULL";
return -1;
}
return dconn_->push_request_headers(); return dconn_->push_request_headers();
} }
...@@ -434,6 +438,10 @@ int Downstream::push_upload_data_chunk(const uint8_t *data, size_t datalen) ...@@ -434,6 +438,10 @@ int Downstream::push_upload_data_chunk(const uint8_t *data, size_t datalen)
int Downstream::end_upload_data() int Downstream::end_upload_data()
{ {
if(!dconn_) {
DLOG(INFO, this) << "dconn_ is NULL";
return -1;
}
return dconn_->end_upload_data(); return dconn_->end_upload_data();
} }
...@@ -546,6 +554,10 @@ void Downstream::set_response_connection_close(bool f) ...@@ -546,6 +554,10 @@ void Downstream::set_response_connection_close(bool f)
int Downstream::on_read() int Downstream::on_read()
{ {
if(!dconn_) {
DLOG(INFO, this) << "dconn_ is NULL";
return -1;
}
return dconn_->on_read(); return dconn_->on_read();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment