This commit is contained in:
Tatsuhiro Tsujikawa 2019-10-02 23:57:47 +09:00
parent dbfd59ad38
commit 06cdc97da5
1 changed files with 15 additions and 13 deletions

View File

@ -512,10 +512,7 @@ int Client::make_socket(addrinfo *addr) {
std::cerr << "quic_init failed" << std::endl;
return -1;
}
return 0;
}
} else {
fd = util::create_nonblock_socket(addr->ai_family);
if (fd == -1) {
return -1;
@ -528,11 +525,16 @@ int Client::make_socket(addrinfo *addr) {
SSL_set_fd(ssl, fd);
SSL_set_connect_state(ssl);
}
}
if (ssl && !util::numeric_host(config.host.c_str())) {
SSL_set_tlsext_host_name(ssl, config.host.c_str());
}
if (config.is_quic()) {
return 0;
}
rv = ::connect(fd, addr->ai_addr, addr->ai_addrlen);
if (rv != 0 && errno != EINPROGRESS) {
if (ssl) {