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

Re: HTLocal bug?

From: Kinuko Yasuda <kinuko@tom.sfc.keio.ac.jp>
Date: Mon, 14 Feb 2000 19:15:51 +0900
To: sam@topic.com.au
Cc: www-lib@w3.org
Message-Id: <20000214191551Y.kinuko@tom.sfc.keio.ac.jp>

Sam, 
please let me give the more description about my patch.

Sam Couter <sam@topic.com.au> wrote:
> HTFileOpen() calls this:
> HTHost_setChannel(host, HTChannel_new(sockfd, NULL, YES));
> 
> Is that supposed to be called? If the "localhost" host object already has a
> channel from a previous file open, doesn't it get lost?

As you said, 
HostEvet() eventually calls HTFileOpen(), and HTFileOpen() calls
HTHost_setChannel(). Then HTHost_setChannel() set the new socket
to the "localhost" host object whether it has already had a channel
for a previous file or not. 

I think if there is a file already opened, a new file request
should be postponed until the previous one is done.  
Actually, HTCache.c seems to do this.
When HTHost_addNet() returns HT_PENDING, i.e. there is a previous
request, the new net object for that file is added to the list host->pending. 
In this case, the file should not be opened yet. 

If FileEvent() returns here(as in my patch), the previous file open
eventually finishes and calls FileEvent() with HTEvent_CLOSE, then
 1. FileEvent() calls FileCleanup(),
 2. FileCleanup() calls HTNet_delete(), 
 3. HTNet_delete() calls unregister_net(),
 4. unregister_net() calls check_pending(),
 5. check_pending() calls HTHost_launchPending(), and
 6. HTHost_launchPending() launches the postponed request
    in the host->pending.

So eventually the postponed file request will be launched.

If select() freezes in your code, I think there may be another reason...

Hmm... I'm doing mistake something?

--
kinuko
Received on Monday, 14 February 2000 05:15:46 GMT

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