> > I've made a small extension to the WWWOFFLE source code that solves my
> > particular problem with redirections. I've added an option I called
> > "request-redirection" to the "OnlineOptions" section of the configuration
> > file.
> >
> > The syntax for this option is: [<URL-SPEC>] request-redirection = yes | no.
> > Setting "request-redirection = yes" makes WWWOFFLE more compliant with RFC
> > 2616
> ...
> > Hopefully we can convince AMB to include this option or something similar
> > in future releases of WWWOFFLE.
> 
> Do you have a patch for this modification (like AMB has done for those
> small fixes)?  I'm very interested to modify my version of WWWOFFLE.
> I can dig the code but since you've already done this...  ;)
> 

Hi,

Yes, of course I can give you a patch file. You can find it as an attachment to
this message.
This is not precisely the version I use myself, because I have made numerous
small changes to the WWWOFFLE source. These include some small bugfixes, some
small improvements in efficiency and some adaptations to suit my personal taste
and coding style. I'm also working on an extension to enable WWWOFFLE to call
executable CGI-style scripts, but I will tell more about that in a future
posting to this mailing list.

The patch I've included here is a minimalist version. I've tested it by patching
the original wwwoffle-2.6d source with it and compiling the result, but I
haven't tested the resulting executable myself.

To use the patch, simply cd to the directory containing the WWWOFFLE source and
use the command:

patch < path_to_patch/wwwoffle-2.6d-redir-patch

Then compile and install as usual. (First stop wwwoffled if it is running).
Add the following to the OnlineOptions section of your wwwoffle configuration
file:

request-redirection = yes

or if you prefer to limit this option to specific sites, something like:

<http://*.nytimes.com/*.html> request-redirection = yes

Then (re)start wwwoffled.
Have fun!


Paul A. Rombouts <[EMAIL PROTECTED]>
Vincent van Goghlaan 27
NL-5246 GA  Rosmalen
Netherlands
--- wwwoffle.orig/wwwoffle-2.6d/config.h        Wed May 23 20:54:59 2001
+++ wwwoffle.myversion/wwwoffle-2.6d/config.h   Mon Dec 31 03:20:04 2001
@@ -129,6 +129,10 @@
 /*+ The option to re-request pages that have the no-cache flag set. +*/
 extern ConfigItem RequestNoCache;
 
+/* Following added by Paul Rombouts */
+/*+ The option to re-request pages that have status code 302 (temporary 
+redirection).+*/
+extern ConfigItem RequestRedirection;
+
 /*+ The option to try and get the requested URL without a password as well as with. 
+*/
 extern ConfigItem TryWithoutPassword;
 
--- wwwoffle.orig/wwwoffle-2.6d/config.c        Sun Jul  1 09:11:07 2001
+++ wwwoffle.myversion/wwwoffle-2.6d/config.c   Mon Dec 31 03:20:04 2001
@@ -164,6 +164,10 @@
 /*+ The option to re-request pages that have the no-cache flag set. +*/
 ConfigItem RequestNoCache;
 
+/* Following added by Paul Rombouts */
+/*+ The option to re-request pages that have status code 302 (temporary 
+redirection).+*/
+ConfigItem RequestRedirection;
+
 /*+ The option to try and get the requested URL without a password as well as with. 
+*/
 ConfigItem TryWithoutPassword;
 
@@ -185,6 +189,7 @@
                                             {"request-changed-once"   
,&RequestChangedOnce   ,1,Fixed,Boolean   ,"yes"},
                                             {"request-expired"        
,&RequestExpired       ,1,Fixed,Boolean   ,"no" },
                                             {"request-no-cache"       
,&RequestNoCache       ,1,Fixed,Boolean   ,"no" },
+                                            {"request-redirection"    
+,&RequestRedirection   ,1,Fixed,Boolean   ,"no" },
                                             {"try-without-password"   
,&TryWithoutPassword   ,1,Fixed,Boolean   ,"yes"},
                                             {"intr-download-keep"     
,&IntrDownloadKeep     ,1,Fixed,Boolean   ,"no" },
                                             {"intr-download-size"     
,&IntrDownloadSize     ,1,Fixed,FileSize  ,"1"  },
--- wwwoffle.orig/wwwoffle-2.6d/parse.c Tue Jun 12 20:57:08 2001
+++ wwwoffle.myversion/wwwoffle-2.6d/parse.c    Mon Dec 31 03:20:04 2001
@@ -240,7 +240,10 @@
    }
  else
    {
-    if(ConfigBooleanURL(RequestExpired,Url))
+    /* Note: implementation of the option "request-redirection" added by Paul 
+Rombouts */
+    int temp_redirection = ((status==302 || status==303 || status==307) && 
+ConfigBooleanURL(RequestRedirection,Url));
+
+    if(temp_redirection || ConfigBooleanURL(RequestExpired,Url))
       {
        char *expires,*cachecontrol,*date;
 
@@ -272,6 +275,11 @@
              retval=1;
             }
          }
+       else if(temp_redirection)
+        {
+          PrintMessage(Debug,"Requesting URL (Redirection status %d).", status);
+          retval = 1;
+        }
       }
 
     if(retval==0 && ConfigBooleanURL(RequestNoCache,Url))





Reply via email to