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

RE: -902

From: <Jim_Ravan@avid.com>
Date: Mon, 21 Dec 1998 12:29:17 -0500
To: www-lib@w3.org
Message-ID: <852566E1.0060112B.00@amm02.avid.com>


In the continuing saga of my PUT request that insists on returning -902, I
added a setOutputStream to HTBlackHole() in an attempt to put someone
downstream of the MIME parser to handle the PUT's response body. And,
wonder of wonders, the request returns 200! Yea!

Well... actually... modified rapture. It turns out the *first* request
returns 200. A second PUT request returns from the event loop without even
calling my terminate handler! I can't believe it! I thought I was beginning
to understand this stuff, but no luck.

The task is to write a memory buffer to a URL. Here's my PUT code sequence:

     // Create a temporary anchor to represent the buffer being written.
     anchor = HTTmpAnchor(HTLib_userProfile());
     HTAnchor_setDocument(anchor, buffer);
     HTAnchor_setLength(anchor, numBytes);

     // Perform a PUT on that anchor.
     request = HTRequest_new();
     HTRequest_setOutputFormat(request, WWW_SOURCE);    // Don't convert
output format.
     HTRequest_setOutputStream(request, HTBlockHole());           // Throw
away any reponse body.

     // Add a terminate handler to stop the event loop.
     HTRequest_addAfter(request, aTerminateHandler, NULL, NULL, HT_ALL,
HT_FILTER_LAST, FALSE);

     if (HTPutAbsolute(anchor, (char*)url, request)) {
          HTEventList_loop(request);                    // Wait for PUT to
complete.
          err = OK;                           // PUT succeded.
     } else
          err = NO;

     HTRequest_delete(request);                         // Clean up.
     HTAnchor_deleteAll(NULL);

The symptom is:

First time, the server returns "100 Continue", then "200 OK". The client
processes both responses, calls my terminate handler with status = 200, and
everything is fine. Second time, the *same* code runs, the server returns
"100 Continue" and the client processes the reply, and then returns from
the event loop without waiting for the "200 OK" *and* without calling my
terminate handler. ARGH! Any ideas?

regards,
-jim
Received on Monday, 21 December 1998 12:31:36 EST

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