W3C home > Mailing lists > Public > www-lib@w3.org > January to March 2002

Re: Chunk and Filters order problem

From: Tangi Vass <tangivass@compuserve.com>
Date: Mon, 4 Feb 2002 16:02:57 +0100
Message-ID: <00a701c1ad8d$088a4d40$15dc050a@inhouse.compuserve.com>
To: <www-lib@w3.org>
Cc: <Manuele.Kirsch_Pinheiro@inrialpes.fr>

I'm experiencing the same problem.

It seems like the filter can be executed right after the HTLoadToChunk,
prior to the HTRequest_setContext, in a very reactive environment (e.g.:
requesting a static resource in a LAN).

Since libwww is an event-driven single threaded library, this issue can't be
solved by introducing a mutex. What's the solution then?

Tangi Vass

Manuele.Kirsch_Pinheiro@inrialpes.fr wrote:

Hi Everybody,

I have a strange problem using libwww.. I'm trying to download an URL to
a chunk, but sometimes the "local after" filters have been called before
I set the chunk to the request's context. So, when I try to use the
chunk in the filters, it is not available. Here some codes :

Initiate libwww  :
    HTProfile_newNoCacheClient(APP_NAME, APP_VERSION);

Request building :
    HTRequest * request = HTRequest_new();
    HTRequest_setOutputFormat(request, HTAtom_for ("text/xml"));
    HTRequest_setMethod (request,METHOD_GET);
    HTRequest_addAfter (request, local_request_terminater, NULL, app,

Executing the request :
   if ( (chunk = HTLoadAnchorToChunk (app->anchor,request)) != NULL) {
        HTPrint ("Loaded\n");
        HTPrint ("MY_DEBUG: load to chunk failed\n");

After filter :
   chunk = (HTChunk *) HTRequest_context(request);
    if ( chunk && HTChunk_data(chunk))
       HTPrint ("Loaded: \n%s\n",HTChunk_data(chunk));
       HTPrint ("No data available\n");

Output :
Sometimes I have the output "No data available" before the "Loaded"....

Has somebody any suggestion? Ah, I can't use a preemptive client,
neither global filters...

Thanks all!

Received on Monday, 4 February 2002 10:00:04 UTC

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