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

Bug in HTCache.c

From: Jens Meggers <jens@meggers.com>
Date: Thu, 29 Jun 2000 15:41:02 +0200
Message-ID: <002b01bfe1cf$aaab5be0$6b02a8c0@pille>
To: <www-lib@w3.org>
I found a possible bug in CacheEvent of HTCache.c
The bug disables caching of binary objects. I changed the read mode in CacheEvent from HT_FT_RDONLY to HT_FB_RDONLY.
The change lets the cache procedure read from the stored files with mode "rb" instead of "r". When using "r", the read operation stops early with an EOF result.
I assume the bug only apprears on Win32 systems because files are opened in another way on Unix systems.

>
>PRIVATE int CacheEvent (SOCKET soc, void * pVoid, HTEventType type)
>
>case CL_NEED_OPEN_FILE:
>     // status = HTFileOpen(net, cache->local, HT_FT_RDONLY);
          status = HTFileOpen(net, cache->local, HT_FB_RDONLY);
>     if (status == HT_OK) {
>

In case I'm wrong, please drop me some lines,

regards,

Jens
Received on Thursday, 29 June 2000 09:42:03 GMT

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