]> granicus.if.org Git - libevent/commitdiff
be_openssl: don't add events during bev creation (like be_sock)
authorAzat Khuzhin <a3at.mail@gmail.com>
Thu, 5 Nov 2015 14:40:25 +0000 (17:40 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Fri, 6 Nov 2015 07:21:04 +0000 (10:21 +0300)
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

index 4afdde27b2ab63cb92de31922688e77d97fc037b..7d469bfad00806fb4f124e55619bfa59813b09f6 100644 (file)
@@ -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;