]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_proxy_fcgi: prioritize the check for mayflush when using flushpackets
authorLuca Toscano <elukey@apache.org>
Sun, 11 Feb 2018 19:30:40 +0000 (19:30 +0000)
committerLuca Toscano <elukey@apache.org>
Sun, 11 Feb 2018 19:30:40 +0000 (19:30 +0000)
The mayflush variable should be checked before the rest
to avoid polling when not needed.

Suggested by Yann Ylavic on the dev@ mailing list.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1823886 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_fcgi.c

index 0b5021e339af56519bb009fcc381359e2c5721a0..2e97408f3f7bba3a0913747d6918901699524791 100644 (file)
@@ -889,10 +889,10 @@ recv_again:
                 }
             }
 
-            if (((conn->worker->s->flush_packets == flush_on) ||
-                 ((conn->worker->s->flush_packets == flush_auto) && 
-                  (apr_poll(flushpoll, 1, &flushpoll_fd,
-                            conn->worker->s->flush_wait) == APR_TIMEUP))) && mayflush) {
+            if (mayflush && ((conn->worker->s->flush_packets == flush_on) ||
+                             ((conn->worker->s->flush_packets == flush_auto) && 
+                              (apr_poll(flushpoll, 1, &flushpoll_fd,
+                               conn->worker->s->flush_wait) == APR_TIMEUP)))) {
                 apr_bucket* flush_b = apr_bucket_flush_create(r->connection->bucket_alloc);
                 APR_BRIGADE_INSERT_TAIL(ob, flush_b);
                 rv = ap_pass_brigade(r->output_filters, ob);