]> granicus.if.org Git - apache/commitdiff
mod_ssl: don't FLUSH first for non blocking reads.
authorYann Ylavic <ylavic@apache.org>
Fri, 25 Sep 2015 07:27:04 +0000 (07:27 +0000)
committerYann Ylavic <ylavic@apache.org>
Fri, 25 Sep 2015 07:27:04 +0000 (07:27 +0000)
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

modules/ssl/ssl_engine_io.c

index 6631bf1b190ba0cd046446c571692800c5baa96f..c23d9abab4e217fbb61b0db91ef6510560b3a8bb 100644 (file)
@@ -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;