1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

[svn] Send the no-cache directive when required regardless of whether we're

going through a proxy.
Published in <sxsitjqncbx.fsf@florida.arsdigita.de>.
This commit is contained in:
hniksic 2001-04-26 22:26:44 -07:00
parent 26ddb28a7c
commit c6e565fd33
4 changed files with 22 additions and 5 deletions

View File

@ -1,3 +1,12 @@
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> 2001-04-27 Hrvoje Niksic <hniksic@arsdigita.com>
* http.c (mktime_from_utc): Improve documentation. * http.c (mktime_from_utc): Improve documentation.

View File

@ -1521,8 +1521,16 @@ File `%s' already there, will not retrieve.\n"), u->local);
&& file_exists_p (locf)) && file_exists_p (locf))
if (stat (locf, &st) == 0 && S_ISREG (st.st_mode)) if (stat (locf, &st) == 0 && S_ISREG (st.st_mode))
hstat.restval = st.st_size; 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; *dt |= SEND_NOCACHE;
else else
*dt &= ~SEND_NOCACHE; *dt &= ~SEND_NOCACHE;

View File

@ -104,7 +104,7 @@ static struct {
{ "backups", &opt.backups, cmd_number }, { "backups", &opt.backups, cmd_number },
{ "base", &opt.base_href, cmd_string }, { "base", &opt.base_href, cmd_string },
{ "bindaddress", &opt.bind_address, cmd_address }, { "bindaddress", &opt.bind_address, cmd_address },
{ "cache", &opt.proxy_cache, cmd_boolean }, { "cache", &opt.allow_cache, cmd_boolean },
{ "continue", &opt.always_rest, cmd_boolean }, { "continue", &opt.always_rest, cmd_boolean },
{ "convertlinks", &opt.convert_links, cmd_boolean }, { "convertlinks", &opt.convert_links, cmd_boolean },
{ "cookies", &opt.cookies, cmd_boolean }, { "cookies", &opt.cookies, cmd_boolean },
@ -237,7 +237,7 @@ defaults (void)
tmp = getenv ("no_proxy"); tmp = getenv ("no_proxy");
if (tmp) if (tmp)
opt.no_proxy = sepstring (tmp); opt.no_proxy = sepstring (tmp);
opt.proxy_cache = 1; opt.allow_cache = 1;
#ifdef HAVE_SELECT #ifdef HAVE_SELECT
opt.timeout = 900; opt.timeout = 900;

View File

@ -92,7 +92,7 @@ struct options
int http_keep_alive; /* whether we use keep-alive */ int http_keep_alive; /* whether we use keep-alive */
int use_proxy; /* Do we use proxy? */ 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 *http_proxy, *ftp_proxy, *https_proxy;
char **no_proxy; char **no_proxy;
char *base_href; char *base_href;