Dear Geff,

I have sent the attached mail to the apache developers list back in May. I said
exactly the same thing, but the group decided that IIS bugs are not their
responsibility. This was very disappointing... I modified the proxy_cache code
myself 

--- apache_1.3.24/src/modules/proxy/proxy_cache.c       2002-03-13 23:05:32+02
+++ apache_1.3.24/src/modules/proxy/proxy_cache.c       2002-05-07 20:13:08+03
@@ -1477,6 +1487,10 @@
         ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, r->server, "Expiry
date calculated %ld", (long)expc);
     }

+/* Ignore content-length on 304 reponse, buggy IIS sends it! */
+    if (r->status == HTTP_NOT_MODIFIED) {
+       ap_table_unset(resp_hdrs, "Content-Length");
+    }
 /* get the content-length header */
     clen = ap_table_get(resp_hdrs, "Content-Length");
     if (clen == NULL)

which is essentially what you suggest. It is frustrating to hear that other
people fall again and again to the same trap I fell into!

On Mon, 12 Aug 2002 17:50:58 -0700, Geff wrote about "Re: Reproducable apache 
1.3.26 /modproxy issue viewing www.kbb.com":
> I've written a patch that seems to address the problem.
> 
> I just wanted others to have the option to apply it.  I think it's
> ridiculous to have to break apache, an RFC compliant server to be able
> to view a website.  But what am I going to do about it? :)  The truth is
> the patch should remove ANY entity-header variable.  But I only chose to
> deal with the Content-Length variable in the short term.
> 
> Comments are welcome as always.
> 
> Enjoy,
> 
> Geff
> 
> On Mon, 2002-08-12 at 11:47, Graham Leggett wrote:
> > Geff wrote:
> > 
> > > I'd also like to say that this issue doesn't just affect the 'no-cache'
> > > case but it also seems to affect the case when the cache decides it
> > > needs to revalidate a resource with the original server.  The 'no-cache'
> > > method is just a convenient way to demonstrate the problem and force the
> > > cache to try to revalidate the resource.
> > 
> >  From what I understand this is caused by some buggy versions of IIS v5 
> > which send Content-Length: 0 along with 304 responses.
> > 
> > Regards,
> > Graham
> > -- 
> > -----------------------------------------
> > [EMAIL PROTECTED] 
> >     "There's a moon
> >                                     over Bourbon Street
> >                                             tonight..."
> > 
> 
> 
> 
> 


-- 
Dr. Zvi Har'El     mailto:[EMAIL PROTECTED]     Department of Mathematics
tel:+972-54-227607                   Technion - Israel Institute of Technology
fax:+972-4-8324654 http://www.math.technion.ac.il/~rl/     Haifa 32000, ISRAEL
"If you can't say somethin' nice, don't say nothin' at all." -- Thumper (1942)
                                 Tuesday, 5 Elul 5762, 13 August 2002, 11:05AM
--- Begin Message ---
Dear Apache developers,

I have noticed today that when Microsoft-IIS/5.0 sends a "304 Not Modified"
response to IMS GET request, it (incorrectly IMHO) sends with it a
"Content-Length: 0" header. This is (again IMHO) a bug in IIS, but because of
that, IMS GET request with "Pragma: no-cache" headers are not handled
correctly: When the cache revalidation is done, in ap_proxy_cache_update(), the
content length is reset (in line 1481 in apache_1.3.24, line 1508 in the
current snapshot of apache_1.3.25-dev, file proxy_cache.c), before the status
is checked to be HTTP_NOT_MODIFIED (in line 1513 or 1547 resp). This makes the
erroneous Content-Length: 0 header replace the real length in the cache file
headers, and the file is destroyed. Not this doesn't happen without the
"Pragma: no-cache" header. A possible fix would be do ignore the
"Content-Length" in the response in case of "304 Not Modified", but I think
that perhaps no header in such a response should replace the cached headers!

Best,

Zvi.


-- 
Dr. Zvi Har'El     mailto:[EMAIL PROTECTED]     Department of Mathematics
tel:+972-54-227607                   Technion - Israel Institute of Technology
fax:+972-4-8324654 http://www.math.technion.ac.il/~rl/     Haifa 32000, ISRAEL
"If you can't say somethin' nice, don't say nothin' at all." -- Thumper (1942)
                                   Monday, 25 Iyyar 5762,  6 May 2002,  6:42PM

--- End Message ---

Reply via email to