summaryrefslogtreecommitdiffstats
path: root/apps/s_server.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-07-22 17:50:51 +0100
committerMatt Caswell <matt@openssl.org>2015-11-20 23:33:46 +0000
commit252d6d3aa62dccf0dc826644b7da0b6bafa3831b (patch)
tree529055a0ca2eb9f6564f18e4a87d25d1d458c371 /apps/s_server.c
parent7070e5ca2fa41940d56599bf016a45cb1c0e03f0 (diff)
Add ASYNC_JOB pools
It is expensive to create the ASYNC_JOB objects due to the "makecontext" call. This change adds support for pools of ASYNC_JOB objects so that we don't have to create a new ASYNC_JOB every time we want to use one. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'apps/s_server.c')
-rw-r--r--apps/s_server.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/apps/s_server.c b/apps/s_server.c
index 548eacbbce..6fb8f675a3 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -143,6 +143,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <openssl/async.h>
#include <openssl/e_os2.h>
@@ -1657,8 +1658,10 @@ int s_server_main(int argc, char *argv[])
else
SSL_CTX_sess_set_cache_size(ctx, 128);
- if (async)
+ if (async) {
SSL_CTX_set_mode(ctx, SSL_MODE_ASYNC);
+ ASYNC_init_pool(0, 0, 0);
+ }
#ifndef OPENSSL_NO_SRTP
if (srtp_profiles != NULL) {
@@ -1970,6 +1973,9 @@ int s_server_main(int argc, char *argv[])
bio_s_out = NULL;
BIO_free(bio_s_msg);
bio_s_msg = NULL;
+ if (async) {
+ ASYNC_free_pool();
+ }
return (ret);
}