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

Re: Getting out of HTEventList_loop()

From: Michael Saunders <michael@amtec.com>
Date: Wed, 23 Jun 1999 09:19:29 -0700
Message-ID: <37710911.2F9FF505@amtec.com>
To: Henrik Frystyk Nielsen <frystyk@w3.org>
CC: www-lib@w3.org
Henrik Frystyk Nielsen wrote:
> 
> Michael Saunders wrote:
> 
> > I have experience some pretty large obsticles attempting to use this
> > library which has been quite disappointing. I am not sure if it is
> > the way in which I am using it or if it really is buggy. I discovered
> > the following problems:
> >
> >         1) Exiting the event loop after interrupting a transfer makes
> >         the library unusable upon subsequent transfers using the
> >         default event loop in HTEvtLst.c. I followed the documentation
> >         and called the HTHost_killPipe as instructed but it the library
> >         doesn't seem to clean up correctly. Subsequent transfers
> >         using HTLoadToFile stop immediately due to some read error
> >         which causes the library to kill the pipe.
> 
> Do you have a libwww trace of this?
> 
> >         2) I had to make code modifications to the HTEventList_loop function
> >         to make sure that the HTEndLoop flag was reset at all exit
> >         points in the function.
> 
> Do you have a diff for this so that we can get it in?
> 
> >         3) I tried reinitializing the library and cleaning it up completely
> >         before and after each request but I discovered that if perform
> >         several subsequent download and uploads using HTLoadToFile and
> >         HTPutDocumentAnchor the library crashes.
> 
> That is pretty much what the web commander does - do you have some
> traces of this too?
> 

Henrik,

I would be happy to provide the traces that you request. What level of trace
would you like? Most of the time I set the trace flag as follows so that I don't
see all the mallocs and frees:

	WWWTRACE = SHOW_ALL_TRACE & (SHOW_ALL_TRACE ^ SHOW_MEM_TRACE);

Is this sufficient for you or would you like to see all of it?

Also, attached with this email are the diffs for "HTEvtLst.c". You might find
that cleaning up the code and having a single exit point is better. I tried to
keep the code changes down to a minimum so I retained the multiple exit point
design and simply reset HTEndLoop before each exit point.

If libwww's mailing list server does not accept the attachment let me know and
I'll send it to you as a straight text file.

Thanks,
Michael
645c645,647
< 	if ((status = HTTimer_next(&timeout)))
---
> 	if ((status = HTTimer_next(&timeout))) {
> 	    /* Reset HTEndLoop in case we want to start again */
> 	    HTEndLoop = 0;
646a649
> 	}
715a719,720
> 	    /* Reset HTEndLoop in case we want to start again */
> 	    HTEndLoop = 0;
729c734,736
< 		if ((status = EventOrder_add(s, HTEvent_OOB, now)) != HT_OK)
---
> 		if ((status = EventOrder_add(s, HTEvent_OOB, now)) != HT_OK) {
> 		    /* Reset HTEndLoop in case we want to start again */
> 		    HTEndLoop = 0;
730a738
> 		}
732c740,742
< 		if ((status = EventOrder_add(s, HTEvent_WRITE, now)) != HT_OK)
---
> 		if ((status = EventOrder_add(s, HTEvent_WRITE, now)) != HT_OK) {
> 		    /* Reset HTEndLoop in case we want to start again */
> 		    HTEndLoop = 0;
733a744
> 		}
735c746,748
< 		if ((status = EventOrder_add(s, HTEvent_READ, now)) != HT_OK)
---
> 		if ((status = EventOrder_add(s, HTEvent_READ, now)) != HT_OK) {
> 		    /* Reset HTEndLoop in case we want to start again */
> 		    HTEndLoop = 0;
736a750,755
> 		}
> 	}
> 	if ((status = EventOrder_executeAndDelete()) != HT_OK) {
> 	    /* Reset HTEndLoop in case we want to start again */
> 	    HTEndLoop = 0;
> 	    return status;
738d756
< 	if ((status = EventOrder_executeAndDelete()) != HT_OK) return status;
Received on Wednesday, 23 June 1999 12:19:48 GMT

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