Bug in HTCache.c

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 UTC