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

How to stop the event loop?

From: <Jim_Ravan@avid.com>
Date: Mon, 14 Dec 1998 14:06:55 -0500
To: www-lib@w3.org
Message-ID: <852566DA.00690136.00@amm02.avid.com>


I'm trying to write a "standard" AFTER filter that I will use in lots of
places to stop the event loop. Currently my Put code looks something like:

     // Perform a ranged PUT on that anchor.
     request = HTRequest_new();
     HTRequest_addRange(request, "bytes", rangeStr);
     HTRequest_addAfter(request, endRequest, NULL, NULL, HT_ALL,
HT_FILTER_LAST, FALSE);

     if (HTPutAbsolute(HTAnchor_parent(anchor), urlStr, request)) {
          HTEventList_loop(request);
          err = OK;
     } else {
          err = NO;
     }

     static int endRequest(HTRequest* req, HTResponse* res, void* param,
int status) {
          HTEventList_stopLoop();
          return HT_OK;
     }

My first question is "Is this an acceptable way to stop the event loop?".
If so, it seems that endRequest() does not handle redirections, and if one
is in progress, this filter will stop the redirection. Is this correct, and
if so, how should the AFTER filter be coded so as to stop the event loop
when the PUT has finished and, at the same time, handle redirections, etc?

regards,
-jim
Received on Monday, 14 December 1998 14:08:57 EST

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