For non-blocking sockets tls_connect_fds() could fail with EAGAIN.
authorbluhm <bluhm@openbsd.org>
Tue, 13 Jan 2015 17:35:35 +0000 (17:35 +0000)
committerbluhm <bluhm@openbsd.org>
Tue, 13 Jan 2015 17:35:35 +0000 (17:35 +0000)
commit3d6199eb2ca0a6e97970865df4d371fdd27837be
treef0a5905903187f688635e2efdd35a979caee1566
parent1f8dec0b420999bef7971166abc290cefb2a6e6d
For non-blocking sockets tls_connect_fds() could fail with EAGAIN.
Use the same logic from the read, write, accept functions to inform
the caller wether a readable or writable socket is needed.  After
that event, the connect function must be called again.  All the
checks before connecting are done only once.
OK tedu@
lib/libtls/tls_client.c
lib/libtls/tls_internal.h