int sslAccept(SSL *ssl) { while(true) { int ret = SSL_accept(ssl); if (ret >= 0) { return ret; } else { ret = sslWait(ssl,ret,"Accept"); if (ret < 0) return ret; } } }
int sslDoHandshake(SSL *ssl) { while(true) { int ret = SSL_do_handshake(ssl); if (ret > 0) { return ret; } else { ret = sslWait(ssl,ret,"Handshake"); if (ret < 0) return ret; } } }
int sslConnect(SSL *ssl) { while(true) { int ret = SSL_connect(ssl); if (ret >= 0) { return ret; } else { ret = sslWait(ssl,ret,"Connect"); if (ret < 0) return ret; } } }
int sslShutdown(SSL *ssl) { //assert(!SSL_renegotiate_pending(ssl)); while (true) { int ret = SSL_shutdown(ssl); if (ret >= 0) { return ret; } else { ret = sslWait(ssl,ret,"Shutdown"); if (ret < 0) { return ret; } } } }
int sslConnect(SSL *ssl) { while(true) { int ret = SSL_connect(ssl); if (ret >= 0) { return ret; } else { ret = sslWait(ssl,ret,"Connect"); // It would seem that connect can return EAGAIN... if ((SSL_get_error(ssl,ret) != SSL_ERROR_SYSCALL || errno != EAGAIN) && ret < 0) { return ret; } } } }