diff options
Diffstat (limited to 'src/s_bsd.c')
-rw-r--r-- | src/s_bsd.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/s_bsd.c b/src/s_bsd.c index 89ba44d..5750b39 100644 --- a/src/s_bsd.c +++ b/src/s_bsd.c @@ -239,16 +239,22 @@ ssl_handshake(int fd, struct Client *client_p) if ((ret = SSL_accept(client_p->localClient->fd.ssl)) <= 0) { + if ((CurrentTime - client_p->localClient->firsttime) > 30) + { + exit_client(client_p, client_p, "Timeout during SSL handshake"); + return; + } + switch (SSL_get_error(client_p->localClient->fd.ssl, ret)) { case SSL_ERROR_WANT_WRITE: comm_setselect(&client_p->localClient->fd, COMM_SELECT_WRITE, - (PF *) ssl_handshake, client_p, 0); + (PF *) ssl_handshake, client_p, 30); return; case SSL_ERROR_WANT_READ: comm_setselect(&client_p->localClient->fd, COMM_SELECT_READ, - (PF *) ssl_handshake, client_p, 0); + (PF *) ssl_handshake, client_p, 30); return; default: |