- From: Michael Saunders <michael@amtec.com>
- Date: Wed, 23 Jun 1999 06:53:15 -0700
- To: Jim_Ravan@avid.com
- CC: www-lib@w3.org
Jim_Ravan@avid.com wrote: > > >To be honest, I am not entirely certain why the HTEndLoop variable is not > >set to zero before entering the loop and the "while(!HTEndLoop) { ... }" > >is not changed to a "do { ... } while (!HTEndLoop);". Am I missing the > >point here? > > Yes, this is an important point. In some situations code may, for example, look > like: > > foo = HT<something>(<some arguments>); > if (foo) > HTEventList_loop(request); /* wait for the request to complete*/ > > Now, assume that the call to HT<something> essentially fails such that the > request should not continue, but a non-null foo is still returned. The chunk > functions exhibit this property. If there is an end-of-request callback, it will > already have been called during HT<something> processing, and the callback may > have called HTEventList_stopLoop() and set HTEndLoop to 1, but HTEventList_loop > has not yet been entered. Thus if HTEndLoop is set to 0 by HTEventList_loop, it > would not recognize that the loop should not even be entered. > > I had this exact problem in my libwww code. > Jim, Thanks for you comments and I see your point. Do you agree with me then that all exit points in the HTEventList_loop should make sure to reset HTEndLoop to zero before returning? Thanks, Michael
Received on Wednesday, 23 June 1999 09:53:33 UTC