Hiro Dudani wrote:
>
> But unfortunately, it seems another -at least for me much worse- bug has
> crept in. The symptom I first noticed were frequent "Document contains no
> data"-popups in Netscape and lots of "broken picture" images. I played
> around with the options in wwwoffle.conf [1], but to no avail. I finally
> found what I believe to be the problem when I tried talking to the proxy
> with Telnet while it was online:
>
> ===
> GET http://www.rz.uni-frankfurt.de/index.html HTTP/1.0
>
> HTTP/1.0 304 WWWOFFLE Not Modified
> Server: WWWOFFLE/2.7
> Date: Thu, 14 Feb 2002 21:00:55 GMT
> Content-type: text/html
> Content-Length: 0
> Connection: close
> Proxy-Connection: close
> ===
>
> Now, I don't claim to know a lot about http, but I don't think that a 304
> should be a valid reply to a request without an "If-modified-since" header,
> or is it?
Andrew M. Bishop wrote:
>
> You are correct, it is only valid when there is a header like
> If-Modified-Since or If-None-Match.
>
> In the WWWOFFLE code there are three places where the 304 error code
> can be generated for a reply. One is in messages.l where an
> If-Modified-Since header is checked against the modification time of
> the local HTML file, this is not applicable here. In wwwoffles.c
> there are two places, but each of those can only be executed if there
> was an If-Modified-Since or If-None-Match header in the request.
>
> I don't see any way that the reply that you get can be generated by
> WWWOFFLE for the input that you give. I have tried it on some example
> pages and I don't see the problem.
Hiro Dudani wrote:
>
> As I already told you off-list, I found out that it is the one in line
> 1729 of wwwoffles.c that is giving me these problems.
>
> Commenting out the lines 1727 through 1734 and line 1739 has at least
> allowed me to use WWWOFFLE at all. And since I don't use a large browser
> cache anyway, the speed loss doesn't hit me very hard.
>
Hi,
I've been experiencing the problem with the many "broken picture" images myself
and it caused me to revert back to version 2.6d and wait until a fix appeared.
But you and Andrew gave such tantalizing clues to the cause of the problem that
I had a look at the code to see if I could fix it myself.
I think I now understand what causes the problem.
As Andrew said, in wwwoffles.c there are two places where the 304 status code
can be generated for a reply. These should only be executed if there was an
If-Modified-Since or If-None-Match header line in the request.
The fact whether there was such a header line contained in request_head is
stored in the boolean variables conditional_request_ims and
conditional_request_inm. However, there are two separate places where these
variables are assigned values. And between these assignments a function
RequireChanges can be called with request_head as an argument.
Unfortunately RequireChanges has the side effect that it can add "If-None-Match"
and "If-Modified-Since" header lines!
So after the second assignment to conditional_request_ims and
conditional_request_inm these variables don't necessarily reflect the fact
whether the header lines in question where present in the original request made
by the browser.
The trouble spot at line 1727 is located after the second assignment.
I attached a patch file to this message which, I hope, fixes the problem.
The patch seems to work for me.
Please let me know if it works for you.
--
Paul A. Rombouts <[EMAIL PROTECTED]>
Vincent van Goghlaan 27
5246 GA Rosmalen
Netherlands
--- wwwoffle.orig/wwwoffle-2.7/src/wwwoffles.c Mon Feb 4 20:15:15 2002
+++ wwwoffle.myversion/wwwoffle-2.7/src/wwwoffles.c Thu Feb 21 15:45:44 2002
@@ -101,6 +101,7 @@
int outgoing_exists=0,lasttime_exists=0;
time_t spool_exists=0,spool_exists_pw=0;
int conditional_request_ims=0,conditional_request_inm=0;
+ int conditional_request_ims_orig=0,conditional_request_inm_orig=0;
char *user_agent;
int offline_request=1;
int is_client_wwwoffle=0;
@@ -1108,8 +1109,8 @@
Check if a refresh is needed based on pragma, request changes, autodial.
----------------------------------------*/
- conditional_request_ims=!!GetHeader(request_head,"If-Modified-Since");
- conditional_request_inm=!!GetHeader(request_head,"If-None-Match");
+
+conditional_request_ims_orig=conditional_request_ims=!!GetHeader(request_head,"If-Modified-Since");
+
+conditional_request_inm_orig=conditional_request_inm=!!GetHeader(request_head,"If-None-Match");
/* If in Real mode and there is a lockfile then just spool the cache version. */
@@ -1724,7 +1725,7 @@
else if(mode==Real)
{
- if(conditional_request_ims || conditional_request_inm)
+ if(conditional_request_ims_orig || conditional_request_inm_orig)
{
HTMLMessageHead(tmpclient,304,"WWWOFFLE Not Modified",
NULL);