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/02/01 13:20:01 UTC
Re: mod_proxy/5668: Patch for streaming servers and long running cgi-scripts
The following reply was made to PR mod_proxy/5668; it has been noted by GNATS.
From: Kim Bisgaard <ki...@dmi.dk>
To: kib@dmi.dk
Cc: apbugs@apache.org
Subject: Re: mod_proxy/5668: Patch for streaming servers and long running cgi-scripts
Date: Tue, 1 Feb 2000 13:10:57 +0100
Retransmit because Netscape send last message as uuencode/base64.
Clarification:
After this patch has been applied, one only has to make sure that the long
running scripts outputs "Pragma: nocache" in the header (what they should have
done all the time, anyway), and then they will be passed through the proxy
un-buffered and un-cached. No performance losses on other urls.
The total/correct patch for this problem is:
*** /tmp/proxy_http.c.org Mon Jan 31 16:37:32 2000
--- /tmp/proxy_http.c Mon Jan 31 16:37:32 2000
***************
*** 187,193 ****
int destport = 0;
char *destportstr = NULL;
const char *urlptr = NULL;
! const char *datestr;
struct tbl_do_args tdo;
void *sconf = r->server->module_config;
--- 187,193 ----
int destport = 0;
char *destportstr = NULL;
const char *urlptr = NULL;
! const char *datestr, *pragma;
struct tbl_do_args tdo;
void *sconf = r->server->module_config;
***************
*** 468,473 ****
--- 468,483 ----
ap_table_set(resp_hdrs, "Location", proxy_location_reverse_map(r, datestr));
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++) {
--
Kim Bisgaard
Oersted Science Data Center
Solar-Terrestrial Physics Division Phone: +45 3915 7495 (direct)
Danish Meteorological Institute Fax: +45 3915 7460 (division)
http://www.dmi.dk/solar-terrestrial/ -- Division homepage
http://www.dmi.dk/projects/oersted/ -- Oersted Satellite
http://www.dmi.dk/projects/wdcc1/ -- WDC C1 for geo-magnetism
These are our official Web addresses - ignore any change in the server name
which may occur while browsing this site. Unfortunately, these pages are
not reachable via links from the main institute pages - http://www.dmi.dk