From: Yann Ylavic Date: Fri, 25 Sep 2015 07:27:04 +0000 (+0000) Subject: mod_ssl: don't FLUSH first for non blocking reads. X-Git-Tag: 2.5.0-alpha~2807 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=696e52fa7eeb638f3bb92a903f5715ed220b1164;p=apache mod_ssl: don't FLUSH first for non blocking reads. Such readers are prepared to receive empty data anyway (and take appropriate action), while e.g. check_pipeline() is not expecting the pipe to be flushed under it. Reverted by: r1705820 Replaced by: r1705823 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1705236 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/ssl/ssl_engine_io.c b/modules/ssl/ssl_engine_io.c index 6631bf1b19..c23d9abab4 100644 --- a/modules/ssl/ssl_engine_io.c +++ b/modules/ssl/ssl_engine_io.c @@ -472,9 +472,12 @@ static int bio_filter_in_read(BIO *bio, char *in, int inlen) * connection or for a proxy connection. Calling _out_flush * should be very cheap in cases where it is unnecessary (and no * output is buffered) so the performance impact of doing it - * unconditionally should be minimal. + * unconditionally should be minimal, but in non blocking mode + * where the caller may not expect the flush round trip (e.g. + * check_pipeline()'s speculative and non-blocking read). */ - if (bio_filter_out_flush(inctx->bio_out) < 0) { + if (block != APR_NONBLOCK_READ && + bio_filter_out_flush(inctx->bio_out) < 0) { bio_filter_out_ctx_t *outctx = inctx->bio_out->ptr; inctx->rc = outctx->rc; return -1;