From f07898e3bc1d12fb91bb553916b27b78eb86d96a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?okhowang=28=E7=8E=8B=E6=B2=9B=E6=96=87=29?= Date: Sat, 25 Jul 2020 17:17:46 +0800 Subject: [PATCH] bufferevent_openssl: fix -Wcast-function-type for SSL_pending Introduced-in: #1028 --- bufferevent_openssl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bufferevent_openssl.c b/bufferevent_openssl.c index 2fb6c252..34259ce5 100644 --- a/bufferevent_openssl.c +++ b/bufferevent_openssl.c @@ -392,6 +392,11 @@ be_openssl_bio_set_fd(struct bufferevent_ssl *bev_ssl, evutil_socket_t fd) return 0; } +static size_t SSL_pending_wrap(void *ssl) +{ + return SSL_pending(ssl); +} + static struct le_ssl_ops le_openssl_ops = { SSL_init, SSL_context_free, @@ -399,7 +404,7 @@ static struct le_ssl_ops le_openssl_ops = { (int (*)(void *))SSL_renegotiate, openssl_write, openssl_read, - (size_t(*)(void *))SSL_pending, + SSL_pending_wrap, (int (*)(void *))SSL_do_handshake, (int (*)(void *, int))SSL_get_error, ERR_clear_error,