MINOR: ssl/cli: async fd io-handlers printable on show fd

This patch exports the async fd iohandlers and make them printable
doing a 'show fd' on cli.
This commit is contained in:
Emeric Brun 2019-04-19 17:15:28 +02:00 committed by Willy Tarreau
parent 46451d6e04
commit d0e095c2aa
3 changed files with 15 additions and 2 deletions

View File

@ -85,6 +85,10 @@ SSL_CTX *ssl_sock_get_generated_cert(unsigned int key, struct bind_conf *bind_co
int ssl_sock_set_generated_cert(SSL_CTX *ctx, unsigned int key, struct bind_conf *bind_conf); int ssl_sock_set_generated_cert(SSL_CTX *ctx, unsigned int key, struct bind_conf *bind_conf);
unsigned int ssl_sock_generated_cert_key(const void *data, size_t len); unsigned int ssl_sock_generated_cert_key(const void *data, size_t len);
#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL) && !defined(OPENSSL_NO_ASYNC)
void ssl_async_fd_handler(int fd);
void ssl_async_fd_free(int fd);
#endif
/* ssl shctx macro */ /* ssl shctx macro */

View File

@ -69,6 +69,9 @@
#include <proto/stream_interface.h> #include <proto/stream_interface.h>
#include <proto/task.h> #include <proto/task.h>
#include <proto/proto_udp.h> #include <proto/proto_udp.h>
#ifdef USE_OPENSSL
#include <proto/ssl_sock.h>
#endif
#define PAYLOAD_PATTERN "<<" #define PAYLOAD_PATTERN "<<"
@ -998,6 +1001,12 @@ static int cli_io_handler_show_fd(struct appctx *appctx)
(fdt.iocb == listener_accept) ? "listener_accept" : (fdt.iocb == listener_accept) ? "listener_accept" :
(fdt.iocb == poller_pipe_io_handler) ? "poller_pipe_io_handler" : (fdt.iocb == poller_pipe_io_handler) ? "poller_pipe_io_handler" :
(fdt.iocb == mworker_accept_wrapper) ? "mworker_accept_wrapper" : (fdt.iocb == mworker_accept_wrapper) ? "mworker_accept_wrapper" :
#ifdef USE_OPENSSL
#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL) && !defined(OPENSSL_NO_ASYNC)
(fdt.iocb == ssl_async_fd_free) ? "ssl_async_fd_free" :
(fdt.iocb == ssl_async_fd_handler) ? "ssl_async_fd_handler" :
#endif
#endif
"unknown"); "unknown");
if (fdt.iocb == conn_fd_handler) { if (fdt.iocb == conn_fd_handler) {

View File

@ -573,7 +573,7 @@ static int ssl_init_single_engine(const char *engine_id, const char *def_algorit
/* /*
* openssl async fd handler * openssl async fd handler
*/ */
static void ssl_async_fd_handler(int fd) void ssl_async_fd_handler(int fd)
{ {
struct connection *conn = fdtab[fd].owner; struct connection *conn = fdtab[fd].owner;
@ -594,7 +594,7 @@ static void ssl_async_fd_handler(int fd)
/* /*
* openssl async delayed SSL_free handler * openssl async delayed SSL_free handler
*/ */
static void ssl_async_fd_free(int fd) void ssl_async_fd_free(int fd)
{ {
SSL *ssl = fdtab[fd].owner; SSL *ssl = fdtab[fd].owner;
OSSL_ASYNC_FD all_fd[32]; OSSL_ASYNC_FD all_fd[32];