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

Re: How to stop the event loop?

From: Henrik Frystyk Nielsen <frystyk@w3.org>
Date: Tue, 15 Dec 1998 01:52:14 -0500
To: www-lib@w3.org
Message-ID: <3676071E.9F51F678@w3.org>
To: Jim_Ravan@avid.com

Jim_Ravan@avid.com wrote:
> 
> So then I assume a better way to code an AFTER filter to stop the event
> loop is:
> 
>      static int endRequest(HTRequest* req, HTResponse* res,
>                          void* param, int status) {
>           if (HTNet_isIdle())
>                HTEventList_stopLoop();
>           return HT_OK;
>      }

Yes, although the best is simply to keep track of your requests so that
you know what you have outstanding.
 
> In this case, will the AFTER filter be called more than once or should I
> return a value other than HT_OK if I want the AFTER filter to be called
> again?

The filter return value determines whether the filter chain is broken or
continued. HT_OK continues the next filters to be called, HT_ERROR stops
immediately. However, as you have registered yourself as the last filter
then it doesn't make a big difference.
 
> !>Btw, you can register your after filter as a global filter which may be
> !>easier if you are using it for all requests.
> 
> I specifically didn't do this because I didn't know what would happen when
> the AFTER filter was called on GETs (which don't require an event loop -
> correct?). What does happen?

No, they work as normal. GET requests don't prevent an eventloop just
like any other request type. The limitation is that PUT and POST can not
be used without an event loop. In fact, I prefer always using an event
loop.

Henrik
Received on Tuesday, 15 December 1998 01:52:18 EST

This archive was generated by hypermail pre-2.1.9 : Wednesday, 3 September 2003 17:59:24 EDT