Handle TLS_WANNT_POLL{IN,OUT} from tls_handshake(3)
For blocking sockets it should be retried immediately.weechat-hashes
parent
a5a225c52c
commit
b3631a7e32
2
irc.c
2
irc.c
|
@ -165,7 +165,9 @@ int ircConnect(const char *bindHost, const char *host, const char *port) {
|
||||||
error = tls_connect_socket(client, sock, host);
|
error = tls_connect_socket(client, sock, host);
|
||||||
if (error) errx(EX_PROTOCOL, "tls_connect: %s", tls_error(client));
|
if (error) errx(EX_PROTOCOL, "tls_connect: %s", tls_error(client));
|
||||||
|
|
||||||
|
do {
|
||||||
error = tls_handshake(client);
|
error = tls_handshake(client);
|
||||||
|
} while (error == TLS_WANT_POLLIN || error == TLS_WANT_POLLOUT);
|
||||||
if (error) errx(EX_PROTOCOL, "tls_handshake: %s", tls_error(client));
|
if (error) errx(EX_PROTOCOL, "tls_handshake: %s", tls_error(client));
|
||||||
|
|
||||||
return sock;
|
return sock;
|
||||||
|
|
Loading…
Reference in New Issue