h2load: Fix bug that NPN fails if ALPN is enabled

This commit is contained in:
Tatsuhiro Tsujikawa 2015-05-22 00:48:32 +09:00
parent c795018f29
commit 28adb2dad3
1 changed files with 8 additions and 10 deletions

View File

@ -418,23 +418,21 @@ int Client::connection_made() {
if (next_proto) { if (next_proto) {
if (util::check_h2_is_selected(next_proto, next_proto_len)) { if (util::check_h2_is_selected(next_proto, next_proto_len)) {
session = make_unique<Http2Session>(this); session = make_unique<Http2Session>(this);
} else { break;
}
#ifdef HAVE_SPDYLAY #ifdef HAVE_SPDYLAY
else {
auto spdy_version = auto spdy_version =
spdylay_npn_get_version(next_proto, next_proto_len); spdylay_npn_get_version(next_proto, next_proto_len);
if (spdy_version) { if (spdy_version) {
session = make_unique<SpdySession>(this, spdy_version); session = make_unique<SpdySession>(this, spdy_version);
} else { break;
debug_nextproto_error();
fail();
return -1;
} }
#else // !HAVE_SPDYLAY
debug_nextproto_error();
fail();
return -1;
#endif // !HAVE_SPDYLAY
} }
#endif // HAVE_SPDYLAY
next_proto = nullptr;
break;
} }
#if OPENSSL_VERSION_NUMBER >= 0x10002000L #if OPENSSL_VERSION_NUMBER >= 0x10002000L