You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Kim Bisgaard <ki...@dmi.dk> on 2000/01/29 17:46:14 UTC
mod_proxy/5668: Patch for streaming servers and long running cgi-scripts
>Number: 5668
>Category: mod_proxy
>Synopsis: Patch for streaming servers and long running cgi-scripts
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: apache
>State: open
>Class: change-request
>Submitter-Id: apache
>Arrival-Date: Sat Jan 29 08:50:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: kib@dmi.dk
>Release: 1.3.11
>Organization:
apache
>Environment:
any
>Description:
Apache proxy module ruins the marvelous new facility in apache 1.3 of
delivering the output from scripts un-buffered - thus instantly. This
property is vital in long running cgi-scripts (see bug report 4733, 1166),
and in streaming servers (see bug report 4566)
>How-To-Repeat:
See above emntioned bug reports.
>Fix:
Utilize the "Pragma: no-cache" or HTTP 1.1 "Cache-Control: no-cache" to signify
both no-caching and no-buffering in proxy module.
--- apache_1.9.11/src/modules/proxy/proxy_http.c
+++ apache_1.9.11/src/modules/proxy/proxy_http.c
@@ -472,6 +472,16 @@
if ((datestr = ap_table_get(resp_hdrs, "URI")) != NULL)
ap_table_set(resp_hdrs, "URI", proxy_location_reverse_map(r, datestr));
+ /* If "Pragma: no-cache" or "Cache-Control: no-cache"
+ * set nocache and make reply un-buffered to enshure timely delivery */
+ if (((pragma = ap_table_get(resp_hdrs, "Pragma")) != NULL &&
+ ap_proxy_liststr(pragma, "no-cache")) ||
+ ((pragma = ap_table_get(resp_hdrs, "Cache-Control")) != NULL &&
+ ap_proxy_liststr(pragma, "no-cache"))) {
+ nocache = 1;
+ r->connection->client->flags &= ~B_WR;
+ }
/* check if NoCache directive on this host */
for (i = 0; i < conf->nocaches->nelts; i++) {
>Release-Note:
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <ap...@Apache.Org> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or ]
["Re: general/1098:"). If the subject doesn't match this ]
[pattern, your message will be misfiled and ignored. The ]
["apbugs" address is not added to the Cc line of messages from ]
[the database automatically because of the potential for mail ]
[loops. If you do not include this Cc, your reply may be ig- ]
[nored unless you are responding to an explicit request from a ]
[developer. Reply only with text; DO NOT SEND ATTACHMENTS! ]