[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [Libevent-users] bufferevent_openssl: readcb not always called for last partial read
On Tue, Aug 21, 2012 at 8:02 PM, Hochhaus, Andrew
<ahochhaus@xxxxxxxxxxxx> wrote:
> Hello,
>
> In libevent-2.0.19-stable, do_read can return 0 (stalled) when some
> progress has been made reading. This can occur, for example, when
> space[0].iov_len > 0 and the 2nd read attempt returns
> SSL_ERROR_WANT_READ. Then consider_reading may not call
> _bufferevent_run_readcb if no additional data arrives.
>
> Should do_read return 1 (progress) if it makes any progress at all?
Andrew, this might also explain
https://github.com/libevent/libevent/issues/17
Good find!
Diwaker
> --- a/third_party/libevent/upstream/bufferevent_openssl.c
> +++ b/third_party/libevent/upstream/bufferevent_openssl.c
> @@ -606,7 +606,7 @@ do_read(struct bufferevent_openssl *bev_ssl, int n_to_read)
> conn_closed(bev_ssl, err, r);
> break;
> }
> - blocked = 1;
> + blocked = n_used == 0;
> break; /* out of the loop */
> }
> }
>
> Thanks,
> -Andy
> ***********************************************************************
> To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
> unsubscribe libevent-users in the body.
--
http://maginatics.com
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users in the body.