]> granicus.if.org Git - libevent/commitdiff
Join le_ssl_ops.post_init with le_ssl_ops.init
authorAzat Khuzhin <azat@libevent.org>
Wed, 22 Jul 2020 20:08:50 +0000 (23:08 +0300)
committerAzat Khuzhin <azat@libevent.org>
Wed, 22 Jul 2020 20:08:50 +0000 (23:08 +0300)
bufferevent_mbedtls.c
bufferevent_openssl.c
bufferevent_ssl.c
ssl-compat.h

index f1422019fbcd658f0b1dd0df0629753cf2371a31..c60b109c587d32256a3953b9f3ce23de7700d755 100644 (file)
@@ -313,7 +313,6 @@ static struct le_ssl_ops le_mbedtls_ops = {
        mbedtls_is_want_write,
        be_mbedtls_get_fd,
        be_mbedtls_bio_set_fd,
-       mbedtls_set_ssl_noops,
        (void (*)(struct bufferevent_ssl *))mbedtls_set_ssl_noops,
        (void (*)(struct bufferevent_ssl *))mbedtls_set_ssl_noops,
        conn_closed,
index a88ae8912d367db20690ba633d4c8ca8c9c34aae..c50c022dc59f20b876bf5a5eab92059af4eb480a 100644 (file)
@@ -322,6 +322,10 @@ decrement_buckets(struct bufferevent_ssl *bev_ssl)
 static void *
 SSL_init(void *ssl)
 {
+       /* Don't explode if we decide to realloc a chunk we're writing from in
+        * the output buffer. */
+       SSL_set_mode(ssl, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
+
        return ssl;
 }
 
@@ -350,14 +354,6 @@ SSL_is_want_write(int err)
        return err == SSL_ERROR_WANT_WRITE;
 }
 
-static void
-be_openssl_post_init(void *ssl)
-{
-       /* Don't explode if we decide to realloc a chunk we're writing from in
-        * the output buffer. */
-       SSL_set_mode(ssl, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
-}
-
 static int
 openssl_read(void *ssl, unsigned char *buf, size_t len)
 {
@@ -415,7 +411,6 @@ static struct le_ssl_ops le_openssl_ops = {
        SSL_is_want_write,
        (int (*)(void *))be_openssl_get_fd,
        be_openssl_bio_set_fd,
-       be_openssl_post_init,
        init_bio_counts,
        decrement_buckets,
        conn_closed,
index be503819ed0bcaa487e53a65952a68e95a33be3d..5c6956d5db9d26193c21d8f4851025b6d33d6a45 100644 (file)
@@ -1007,7 +1007,6 @@ bufferevent_ssl_new_impl(struct event_base *base,
        bev_ssl->ssl_ops = ssl_ops;
 
        bev_ssl->ssl = bev_ssl->ssl_ops->init(ssl);
-       bev_ssl->ssl_ops->post_init(ssl);
 
        bev_ssl->underlying = underlying;
 
index ee88b624c36377b326c7859d055cee222e22c33f..a19c457f78a940d489ec3b9e8b28a6975f74c649 100644 (file)
@@ -25,7 +25,6 @@ struct le_ssl_ops {
        int (*err_is_want_write)(int err);
        evutil_socket_t (*get_fd)(void *ssl);
        int (*bio_set_fd)(struct bufferevent_ssl *ssl, evutil_socket_t fd);
-       void (*post_init)(void *ssl);
        void (*init_bio_counts)(struct bufferevent_ssl *bev);
        void (*decrement_buckets)(struct bufferevent_ssl *bev);
        void (*conn_closed)(