W3C home > Mailing lists > Public > www-lib@w3.org > April to June 1999

Cache problem + fix

From: <jose.kahan@w3.org>
Date: Tue, 22 Jun 1999 19:58:35 +0200 (MET DST)
Message-Id: <199906221758.TAA15192@tuvalu.inrialpes.fr>
To: www-lib@w3.org
Problem:

If the libwww cache contains an entry for a document and you PUT the
document corresponding to this entry, the entry isn't updated. If you
quit the libwww application and you browse the document, you'll get the 
previous version.

Fix:

In HTCache.c, I systematically delete the cache entry whenever doing
a PUT:

1369,1372c1369,1376
<               if (status == 204)
<                   HTCache_updateMeta(cache, request, response);
<               else
<                   HTCache_remove(cache);
---
>             HTMethod method = HTRequest_method(request);            
>             if (status == 204 && method != METHOD_PUT) {
>               /* to avoid cache corruption, we remove all entries
>                  we PUT */
>               HTCache_updateMeta(cache, request, response);
>             }
>             else
>               HTCache_remove(cache);


Anyone sees any objections on my integrating this fix to the libwww
base?

Thanks,

-Jose
Received on Tuesday, 22 June 1999 13:58:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:29 GMT