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

Avoiding Serialization/Pipelining of POST Requests

From: Mike Bytnar <mbytnar@auvo.com>
Date: Fri, 27 Apr 2001 16:16:36 -0500
Message-ID: <3AE9E1B4.AEA22AB7@auvo.com>
To: www-lib@w3.org
My client code makes asynchronous HTTP POSTs from separate threads using
the code below.
However, I cannot make more than one POST to a remote server at the same
time. libwww sits in a poll until the previous POST returns a result.

The first line seems to have no effect on the serializing (pipelining)
of the requests.
How can I force libwww to concurrently, and non-serially process HTTP
POST requests?


(Ripped from a library using libwww.
This lists the order and names of the relevant calls used.)
<begin snippet>
    HTProfile_newRobot(appname, appversion);
     retval->request = HTRequest_new();
    HTRequest_setContext(retval->request, retval);

    target_stream = HTStreamToChunk(retval->request,
                                    &retval->response_data, 0);

    retval->source_anchor = HTTmpAnchor(NULL);
    HTAnchor_setDocument(retval->source_anchor, retval->serialized_xml);
    HTAnchor_setFormat(retval->source_anchor, HTAtom_for("text/xml"));

    retval->dest_anchor = HTAnchor_findAddress(server->_server_url);

    HTRequest_addAfter(request, &asynch_terminate_handler, NULL, NULL,
                       HT_FILTER_LAST, NO);
    ok = HTPostAnchor(src, dst, request);

    /* The poll occurs burried inside HTEventList_newLoop(), causing
       asynchronously created HTRequest to block. Resulting in
serialization by libwww. */
    while (!retval->is_done)
<end snippet>
Received on Friday, 27 April 2001 17:16:46 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:33:54 UTC