diff options
author | Matt Caswell <matt@openssl.org> | 2016-05-03 17:55:00 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-05-05 19:39:14 +0100 |
commit | fc7f190c732729c1d0eb9dcdb7ff05ed6b06056f (patch) | |
tree | b4b70753df865b62635b71b1ad177a1b0582a6d0 /apps | |
parent | 0eadff033fea00f1b9abe0a83bf0d6637690f085 (diff) |
Handle no async jobs in libssl
If the application has limited the size of the async pool using
ASYNC_init_thread() then we could run out of jobs while trying to start a
libssl io operation. However libssl was failing to handle this and treating
it like a fatal error. It should not be fatal...we just need to retry when
there are jobs available again.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/s_client.c | 5 | ||||
-rw-r--r-- | apps/s_server.c | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/apps/s_client.c b/apps/s_client.c index 5d575ad726..42ef049d24 100644 --- a/apps/s_client.c +++ b/apps/s_client.c @@ -238,6 +238,7 @@ static void do_ssl_shutdown(SSL *ssl) case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_ASYNC: + case SSL_ERROR_WANT_ASYNC_JOB: /* We just do busy waiting. Nothing clever */ continue; } @@ -2360,6 +2361,8 @@ int s_client_main(int argc, char **argv) write_ssl = 0; } break; + case SSL_ERROR_WANT_ASYNC_JOB: + /* This shouldn't ever happen in s_client - treat as an error */ case SSL_ERROR_SSL: ERR_print_errors(bio_err); goto shut; @@ -2446,6 +2449,8 @@ int s_client_main(int argc, char **argv) BIO_printf(bio_c_out, "closed\n"); ret = 0; goto shut; + case SSL_ERROR_WANT_ASYNC_JOB: + /* This shouldn't ever happen in s_client. Treat as an error */ case SSL_ERROR_SSL: ERR_print_errors(bio_err); goto shut; diff --git a/apps/s_server.c b/apps/s_server.c index f0b28fd288..9cbff09b85 100644 --- a/apps/s_server.c +++ b/apps/s_server.c @@ -2421,6 +2421,10 @@ static int sv_body(int s, int stype, unsigned char *context) case SSL_ERROR_WANT_X509_LOOKUP: BIO_printf(bio_s_out, "Write BLOCK\n"); break; + case SSL_ERROR_WANT_ASYNC_JOB: + /* + * This shouldn't ever happen in s_server. Treat as an error + */ case SSL_ERROR_SYSCALL: case SSL_ERROR_SSL: BIO_printf(bio_s_out, "ERROR\n"); @@ -2495,6 +2499,10 @@ static int sv_body(int s, int stype, unsigned char *context) case SSL_ERROR_WANT_READ: BIO_printf(bio_s_out, "Read BLOCK\n"); break; + case SSL_ERROR_WANT_ASYNC_JOB: + /* + * This shouldn't ever happen in s_server. Treat as an error + */ case SSL_ERROR_SYSCALL: case SSL_ERROR_SSL: BIO_printf(bio_s_out, "ERROR\n"); |