W3C home > Mailing lists > Public > www-lib@w3.org > October to December 1999

Re: Patch to stop some event loop madness

From: <linda_fu@peoplesoft.com>
Date: Wed, 15 Dec 1999 16:24:25 -0800
To: eddie@topic.com.au
Cc: www-lib@w3.org
Message-ID: <OFF9AF599E.3F5A259F-ON88256849.00016364@peoplesoft.com>

Hi, Sam,
     I am confused here. If HTTimer_next could actually cause
HTEventLoop_stopLoop() to be
called, HTEndLoop turns to 1.  In that case, the loop will stop since
"while" loop condition is broken.
So why do you need to break it at that point?
     The other question is: what causes the infinite loop? In what kind of
scenario? I find libwww
doesn't work on HP and also stuck in this infinite "while" loop because
select( ) always return 0, while
active_sockets == 0, the loop continues.  So I don't understand how these
two lines
resolve the problem.



Regards,
Linda



                                                                                           
                    Sam Couter                                                             
                    <eddie@topic.        To:     www-lib@w3.org                            
                    com.au>              cc:                                               
                    Sent by:             Subject:     Patch to stop some event loop        
                    www-lib-reque        madness                                           
                    st@w3.org                                                              
                                                                                           
                                                                                           
                    12/15/99                                                               
                    03:38 PM                                                               
                                                                                           
                                                                                           




Short patch, to avoid infinite event loop madness when HTTimer_next() calls
callbacks that call HTEventLoop_stopLoop().

If someone with CVS write access could check this in, I'd appreciate it.

diff -u -r2.41 HTEvtLst.c
--- HTEvtLst.c  1999/07/07 15:43:28     2.41
+++ HTEvtLst.c  1999/12/15 23:32:32
@@ -664,6 +664,8 @@
        wt = NULL;
        if ((status = HTTimer_next(&timeout)))
            break;
+       if (HTEndLoop)
+               break;
        if (timeout != 0) {
            waittime.tv_sec = timeout / MILLI_PER_SECOND;
            waittime.tv_usec = (timeout % MILLI_PER_SECOND) *


--
Sam Couter                                             sam@topic.com.au
Internet Engineer
tSA Consulting
Received on Thursday, 16 December 1999 00:17:20 GMT

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