nghttp: Fix host to connect when SSL/TLS is used

This commit is contained in:
Tatsuhiro Tsujikawa 2014-01-22 21:55:30 +09:00
parent be71e1f11c
commit 9cd90bcff2
1 changed files with 2 additions and 4 deletions

View File

@ -520,13 +520,11 @@ struct HttpClient {
bev = bufferevent_openssl_socket_new(evbase, -1, ssl,
BUFFEREVENT_SSL_CONNECTING,
BEV_OPT_DEFER_CALLBACKS);
rv = bufferevent_socket_connect_hostname
(bev, dnsbase, AF_UNSPEC, host_string, port);
} else {
bev = bufferevent_socket_new(evbase, -1, BEV_OPT_DEFER_CALLBACKS);
rv = bufferevent_socket_connect_hostname
(bev, dnsbase, AF_UNSPEC, host.c_str(), port);
}
rv = bufferevent_socket_connect_hostname
(bev, dnsbase, AF_UNSPEC, host.c_str(), port);
if(rv != 0) {
return -1;
}