[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] Re: Avoid potential SSL read spinlocks



Hi,

Why does bev_ssl require deferred callbacks?

Commit fc52dbac (see below) fixed an issue I was seeing where deferred
error_cb(EOF)s were confusing clients which had disabled EV_READs
(notably evhttp). If bev_ssl didn't require deferred cbs, the EOFs
would have stayed queued at the OpenSSL layer (in the same way that
EOFs normally stay queued in the kernel when bev_sock clients disable
EV_READ).

Thanks,
Catalin

diff --git a/bufferevent_openssl.c b/bufferevent_openssl.c
index 86a8619..3843b31 100644
--- a/bufferevent_openssl.c
+++ b/bufferevent_openssl.c
<snip>
-       while ((bev_ssl->bev.bev.enabled & EV_READ) &&
+       if ((bev_ssl->bev.bev.enabled & EV_READ) &&
<snip>
                r = do_read(bev_ssl, n_to_read);
-               if (r <= 0)
-                       break;
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.