Commit ecc4290d authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttp: Fix crash on plain HTTP

parent 0fb4d32d
...@@ -1313,6 +1313,7 @@ void eventcb(bufferevent *bev, short events, void *ptr) ...@@ -1313,6 +1313,7 @@ void eventcb(bufferevent *bev, short events, void *ptr)
if(client->need_upgrade()) { if(client->need_upgrade()) {
rv = client->on_upgrade_connect(); rv = client->on_upgrade_connect();
} else { } else {
if(client->ssl) {
// Check NPN or ALPN result // Check NPN or ALPN result
const unsigned char *next_proto = nullptr; const unsigned char *next_proto = nullptr;
unsigned int next_proto_len; unsigned int next_proto_len;
...@@ -1344,6 +1345,7 @@ void eventcb(bufferevent *bev, short events, void *ptr) ...@@ -1344,6 +1345,7 @@ void eventcb(bufferevent *bev, short events, void *ptr)
client->disconnect(); client->disconnect();
return; return;
} }
}
rv = client->on_connect(); rv = client->on_connect();
} }
if(rv != 0) { if(rv != 0) {
......
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