]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl/cli: async fd io-handlers printable on show fd
authorEmeric Brun <ebrun@haproxy.com>
Fri, 19 Apr 2019 15:15:28 +0000 (17:15 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 19 Apr 2019 15:27:01 +0000 (17:27 +0200)
This patch exports the async fd iohandlers and make them printable
doing a 'show fd' on cli.

include/proto/ssl_sock.h
src/cli.c
src/ssl_sock.c

index 62ebcb87e413eeb9a02913ca0d6dc8f130699152..ce52fb74ce18191e83b07efe151ec6809a1ea536 100644 (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);
 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 */
 
index 568ceba2e78e6d68af809b4ee8fa48f7e56195ad..843c3d043f408fe1217bc37092af37a50dc3a012 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -69,6 +69,9 @@
 #include <proto/stream_interface.h>
 #include <proto/task.h>
 #include <proto/proto_udp.h>
+#ifdef USE_OPENSSL
+#include <proto/ssl_sock.h>
+#endif
 
 #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 == poller_pipe_io_handler) ? "poller_pipe_io_handler" :
                             (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");
 
                if (fdt.iocb == conn_fd_handler) {
index 112520c82a3c8db638f8aa9786ddc85db8507f70..58ae8a264acc677a91e3c374e9f1a65d52b18e53 100644 (file)
@@ -573,7 +573,7 @@ fail_get:
 /*
  * 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;
 
@@ -594,7 +594,7 @@ static void ssl_async_fd_handler(int fd)
 /*
  * 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;
        OSSL_ASYNC_FD all_fd[32];