lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev [PATCH to dev18] Patch that allows to ignore document expiry da


From: Vlad Harchev
Subject: lynx-dev [PATCH to dev18] Patch that allows to ignore document expiry dates
Date: Wed, 26 Jan 2000 23:43:42 +0400 (SAMT)

 
 A tiny patch. I know it's cheating, but it could be useful for somebody with
 a slow connection. Feel free to change the name of the lynx.cfg option.

* Added new lynx.cfg setting named "documents_do_not_expire"  that, if set to
  TRUE, allows to avoid reloading documents that are expired or with 
  "Cache-Control: no-cache" set for them - VH
 
 Best regards,
  -Vlad

diff -ru old/WWW/Library/Implementation/HTAccess.c 
fixed/WWW/Library/Implementation/HTAccess.c
--- old/WWW/Library/Implementation/HTAccess.c   Thu Nov  4 00:30:56 1999
+++ fixed/WWW/Library/Implementation/HTAccess.c Wed Jan 26 23:26:41 2000
@@ -896,9 +896,10 @@
        */
 #ifdef DONT_TRACK_INTERNAL_LINKS
        if (LYoverride_no_cache || !HText_hasNoCacheSet(text) ||
-           !HText_AreDifferent(anchor, full_address))
+           !HText_AreDifferent(anchor, full_address) || 
+           documents_do_not_expire )
 #else
-       if (LYoverride_no_cache ||
+       if (LYoverride_no_cache || documents_do_not_expire ||
            ((LYinternal_flag || !HText_hasNoCacheSet(text)) &&
             strncmp(full_address, "LYNXIMGMAP:", 11)))
 #endif /* TRACK_INTERNAL_LINKS */
diff -ru old/lynx.cfg fixed/lynx.cfg
--- old/lynx.cfg        Mon Dec  4 23:11:58 2000
+++ fixed/lynx.cfg      Wed Jan 26 23:37:11 2000
@@ -2701,6 +2701,14 @@
 #      RULE:Fail       finger:*                     # but not others
 #      RULE:Redirect   http://old.server/*     http://new.server/*
 
+.h2 DOCUMENTS_DO_NOT_EXPIRE
+# If set to TRUE, this setting tells lynx to ignore Cache-Control pragma, and 
+# to avoid reloading the document even if it's expired accoriding to
+# "Expires" http header set for it. Of course, Ctrl-R will reload the document.
+# This could be helpful if pages you are browsing are rather "static", but 
+# pretend that they are expired only in order to show you another ad.
+#DOCUMENTS_DO_NOT_EXPIRE:FALSE
+
 .h1 Appearance
 .h2 HTMLSRC_ATTRNAME_XFORM
 .h2 HTMLSRC_TAGNAME_XFORM
diff -ru old/src/LYGlobalDefs.h fixed/src/LYGlobalDefs.h
--- old/src/LYGlobalDefs.h      Tue Dec 14 06:35:39 1999
+++ fixed/src/LYGlobalDefs.h    Wed Jan 26 23:23:58 2000
@@ -408,6 +408,7 @@
 #endif
 
 extern BOOL force_empty_hrefless_a;
+extern BOOL documents_do_not_expire;
 
 #ifdef TEXTFIELDS_MAY_NEED_ACTIVATION
 extern BOOL textfields_need_activation;
diff -ru old/src/LYMain.c fixed/src/LYMain.c
--- old/src/LYMain.c    Tue Dec 14 09:35:20 1999
+++ fixed/src/LYMain.c  Wed Jan 26 23:25:13 2000
@@ -436,6 +436,7 @@
 PUBLIC BOOLEAN LYPrependCharsetToSource = TRUE;
 PUBLIC BOOLEAN LYQuitDefaultYes = QUIT_DEFAULT_YES;
 PUBLIC BOOLEAN dont_wrap_pre = FALSE;
+PUBLIC BOOLEAN documents_do_not_expire = FALSE;/*ignore cache control?*/
 
 #ifdef EXP_JUSTIFY_ELTS
 PUBLIC BOOL ok_justify = TRUE;
diff -ru old/src/LYReadCFG.c fixed/src/LYReadCFG.c
--- old/src/LYReadCFG.c Mon Dec  4 23:10:56 2000
+++ fixed/src/LYReadCFG.c       Wed Jan 26 23:27:36 2000
@@ -1292,6 +1292,7 @@
 #ifdef EXP_CHARSET_CHOICE
      PARSE_FUN("display_charset_choice",CONF_FUN,parse_display_charset_choice),
 #endif
+     PARSE_SET("documents_do_not_expire", CONF_BOOL, &documents_do_not_expire),
      PARSE_ADD("downloader", CONF_ADD_ITEM, downloaders),
      PARSE_SET("emacs_keys_always_on", CONF_BOOL, &emacs_keys),
      PARSE_SET("enable_scrollback", CONF_BOOL, &enable_scrollback),


reply via email to

[Prev in Thread] Current Thread [Next in Thread]