- From: Tangi Vass <tangivass@compuserve.com>
- Date: Mon, 4 Feb 2002 16:02:57 +0100
- To: <www-lib@w3.org>
- Cc: <Manuele.Kirsch_Pinheiro@inrialpes.fr>
Hi,
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,
HT_ALL ,HT_FILTER_LAST , NO);
Executing the request :
if ( (chunk = HTLoadAnchorToChunk (app->anchor,request)) != NULL) {
HTPrint ("Loaded\n");
HTRequest_setContext(request,chunk);
}
else
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));
else
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!
Manuele
Received on Monday, 4 February 2002 10:00:04 UTC