Last active
May 22, 2017 19:17
-
-
Save noisan/eeedcde5ad5b565cd953 to your computer and use it in GitHub Desktop.
Quick patch for mod_proxy_fcgi to work with `flush()` (Apache httpd-2.4.10)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- modules/proxy/mod_proxy_fcgi.c.orig 2014-06-26 09:24:44.000000000 +0900 | |
+++ modules/proxy/mod_proxy_fcgi.c 2014-09-09 18:19:28.102859189 +0900 | |
@@ -690,6 +690,21 @@ | |
break; | |
} | |
} | |
+ | |
+ if (type == AP_FCGI_STDOUT) { | |
+ APR_BRIGADE_INSERT_TAIL(ob, apr_bucket_flush_create(c->bucket_alloc)); | |
+ | |
+ rv = apr_poll(&pfd, 1, &n, 0); | |
+ if ((rv != APR_SUCCESS) && (pfd.rtnevents & APR_POLLIN)) { | |
+ /* flush the current chunk if the next chunk has not arrived */ | |
+ rv = ap_pass_brigade(r->output_filters, ob); | |
+ if (rv != APR_SUCCESS) { | |
+ *err = "passing brigade to output filters"; | |
+ break; | |
+ } | |
+ apr_brigade_cleanup(ob); | |
+ } | |
+ } | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Has this been implemented? Because mod_proxy_fcgi currently does not work with flush() (from PHP). It is driving me batty as I'm trying to use mod_proxy_fcgi as mod_fastcgi is no longer available in Ubuntu 17.04, and my original code just does not work now..