going through a proxy.
Published in <sxsitjqncbx.fsf@florida.arsdigita.de>.
+2001-04-27 Hrvoje Niksic <hniksic@arsdigita.com>
+
+ * http.c (http_loop): If allow_cache is zero, always disable
+ caching, not only when retrieving through proxy.
+
+ * init.c: Ditto.
+
+ * options.h (struct options): Rename proxy_cache to allow_cache.
+
2001-04-27 Hrvoje Niksic <hniksic@arsdigita.com>
* http.c (mktime_from_utc): Improve documentation.
&& file_exists_p (locf))
if (stat (locf, &st) == 0 && S_ISREG (st.st_mode))
hstat.restval = st.st_size;
- /* Decide whether to send the no-cache directive. */
- if (u->proxy && (count > 1 || (opt.proxy_cache == 0)))
+
+ /* Decide whether to send the no-cache directive. We send it in
+ two cases:
+ a) we're using a proxy, and we're past our first retrieval.
+ Some proxies are notorious for caching incomplete data, so
+ we require a fresh get.
+ b) caching is explicitly inhibited. */
+ if ((u->proxy && count > 1) /* a */
+ || !opt.allow_cache /* b */
+ )
*dt |= SEND_NOCACHE;
else
*dt &= ~SEND_NOCACHE;
{ "backups", &opt.backups, cmd_number },
{ "base", &opt.base_href, cmd_string },
{ "bindaddress", &opt.bind_address, cmd_address },
- { "cache", &opt.proxy_cache, cmd_boolean },
+ { "cache", &opt.allow_cache, cmd_boolean },
{ "continue", &opt.always_rest, cmd_boolean },
{ "convertlinks", &opt.convert_links, cmd_boolean },
{ "cookies", &opt.cookies, cmd_boolean },
tmp = getenv ("no_proxy");
if (tmp)
opt.no_proxy = sepstring (tmp);
- opt.proxy_cache = 1;
+ opt.allow_cache = 1;
#ifdef HAVE_SELECT
opt.timeout = 900;
int http_keep_alive; /* whether we use keep-alive */
int use_proxy; /* Do we use proxy? */
- int proxy_cache; /* Do we load from proxy cache? */
+ int allow_cache; /* Do we allow server-side caching? */
char *http_proxy, *ftp_proxy, *https_proxy;
char **no_proxy;
char *base_href;