From: Luca Toscano Date: Sun, 11 Feb 2018 19:30:40 +0000 (+0000) Subject: mod_proxy_fcgi: prioritize the check for mayflush when using flushpackets X-Git-Tag: 2.5.0-alpha2-ci-test-only~2878 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=81dbaddc5324f5703aa73823677680eb89d89158;p=thirdparty%2Fapache%2Fhttpd.git mod_proxy_fcgi: prioritize the check for mayflush when using flushpackets 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 --- diff --git a/modules/proxy/mod_proxy_fcgi.c b/modules/proxy/mod_proxy_fcgi.c index 0b5021e339a..2e97408f3f7 100644 --- a/modules/proxy/mod_proxy_fcgi.c +++ b/modules/proxy/mod_proxy_fcgi.c @@ -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);