W3C home > Mailing lists > Public > www-lib@w3.org > January to March 2000

HTFile problem?

From: Kinuko Yasuda <kinuko@tom.sfc.keio.ac.jp>
Date: Tue, 18 Jan 2000 11:52:51 +0900
To: www-lib@w3.org
Message-Id: <20000118115251R.kinuko@tom.sfc.keio.ac.jp>

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 GMT

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