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

Re: HTEndLoop flag not reset.

From: <Jim_Ravan@avid.com>
Date: Wed, 23 Jun 1999 09:36:15 -0400
To: www-lib@w3.org
Message-ID: <85256799.004BC474.00@aamta02.avid.com>


>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.

regards,
-jim
Received on Wednesday, 23 June 1999 09:45:19 GMT

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