HTFile problem?

Hi all.

(I'm sorry if it has already been discussed here)

Now I'm writing a small browser using libwww(CVS latest version).
It works fine, but when it launches multiple requests for
local files via FILE protocol(i.e. file:/hoge), it enters
an infinite loop (around HTHost.c line 185).
It seems to be a small bug in the finite state machine in HTFile.c.

Here is a part of the trace log:
>> Host Event.. wild socket 6 type = Event_Read real socket is 8
>> Host Event.. wild socket 6 type = Event_Read real socket is 8
>> Host Event.. wild socket 6 type = Event_Read real socket is 8
>> ...

Usually one HTHost object is created per one host, and it
uses single channel(socket/fd) for each host. (as far as I understand)
But when we create multiple requests using FILE protocol, 
all are tied to one host named "localhost", and libwww immediately
opens target files and overwrites the localhost's channel whether
it has been used for existing requests or not.

I made a tiny patch for HTFile.c(see below).
I don't know if it is a correct way, but after applying it,
my browser is working well.

diff -bw HTFile.c.orig HTFile.c
439c439
< 		if (HTHost_addNet(host, net) == HT_PENDING)
---
> 		if (HTHost_addNet(host, net) == HT_PENDING) {
440a441,442
>                     return HT_OK;
>                 }

--
kinuko

Received on Monday, 17 January 2000 21:52:55 UTC