From f4b6284b8393dbabf389ddce734a30f4cdeffa17 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Thu, 5 Nov 2015 17:40:25 +0300 Subject: [PATCH] be_openssl: don't add events during bev creation (like be_sock) Using the following examples you can get changes between be_openssl and be_sock: $ function diff_addr() { eval diff -u $(printf "<(strip_addr %s) " "$@") } $ function strip_addr() { sed 's/0x[a-zA-Z0-9]*/0xFFFF/g' "$@" } $ EVENT_DEBUG_LOGGING_ALL= regress --verbose --no-fork +http/https_connection_retry 2> /tmp/https-retry.log >&2 $ EVENT_DEBUG_LOGGING_ALL= regress --verbose --no-fork +http/connection_retry 2> /tmp/http-retry.log >&2 $ diff_addr /tmp/http-retry.log /tmp/https-retry.log --- bufferevent_openssl.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/bufferevent_openssl.c b/bufferevent_openssl.c index 4afdde27..7d469bfa 100644 --- a/bufferevent_openssl.c +++ b/bufferevent_openssl.c @@ -1394,15 +1394,6 @@ bufferevent_openssl_new_impl(struct event_base *base, if (state == BUFFEREVENT_SSL_OPEN) bufferevent_suspend_read_(underlying, BEV_SUSPEND_FILT_READ); - } else { - struct bufferevent *bev = &bev_ssl->bev.bev; - bev->enabled = EV_READ|EV_WRITE; - if (state != BUFFEREVENT_SSL_OPEN) - if (event_add(&bev->ev_read, NULL) < 0) - goto err; - if (event_initialized(&bev->ev_write)) - if (event_add(&bev->ev_write, NULL) < 0) - goto err; } return &bev_ssl->bev.bev;