From 715ffadfd99351442c457c29cffeb729929c7370 Mon Sep 17 00:00:00 2001 From: Valery Yatsko Date: Sun, 6 Apr 2008 18:28:56 +0400 Subject: [PATCH] Importing changes from ircd-ratbox revision r25203, this fixes libratbox/src/openssl.c a bit --- libratbox/src/openssl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libratbox/src/openssl.c b/libratbox/src/openssl.c index 41e6cfae..6d5562a5 100644 --- a/libratbox/src/openssl.c +++ b/libratbox/src/openssl.c @@ -80,6 +80,7 @@ rb_ssl_tryaccept(rb_fde_t * F, void *data) { int ssl_err; lrb_assert(F->accept != NULL); + int flags = RB_SELECT_READ; if(!SSL_is_init_finished((SSL *) F->ssl)) { @@ -92,8 +93,10 @@ rb_ssl_tryaccept(rb_fde_t * F, void *data) case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: { + if(ssl_err == SSL_ERROR_WANT_WRITE) + flags |= RB_SELECT_WRITE; F->ssl_errno = get_last_err(); - rb_setselect(F, RB_SELECT_READ | RB_SELECT_WRITE, + rb_setselect(F, flags, rb_ssl_tryaccept, NULL); return; }