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

Chunk and Filters order problem

From: Manuele Kirsch Pinheiro <Manuele.Kirsch_Pinheiro@inrialpes.fr>
Date: Tue, 22 Jan 2002 18:38:34 +0100
Message-ID: <3C4DA39A.3070303@inrialpes.fr>
To: www-lib@w3.org
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 Tuesday, 22 January 2002 12:34:16 UTC

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