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

Libwww event manager

From: Ivan Tarapov <itarapov@telcos.net.ua>
Date: Thu, 1 Dec 2005 21:50:32 +0200
To: "libwww w3c" <www-lib@w3.org>
Message-Id: <20051201195031.A7CE8CAD26@mail.telcos.net.ua>
Hello everyone

 

I need some held with libwww event manager. 

 

I have got an example running that makes a call to HTLoadToChunk. And then
copies the response body to a string. 

The code is like that:

 

chunk = HTLoadToChunk(sCallRequest.c_str(), request);

bool bOk = false;

if (chunk) {

      char * resp_string = NULL;

      // wait until the request is over 

      HTEventList_loop (request);

      resp_string  = HTChunk_toCString(chunk);

 

      if(resp_string  != NULL){

            sReturnData = resp_string ;

            bOk = true;

            HT_FREE(resp_string );

      }

      }

 

Here my application goes to infinite loop after call to HTEventList_loop. If
I remove HTEventList_loop, I don't get anything in resp_string because (as I
presume) the body hasn't been downloaded by the time. 

 

I think that I need to register some callbacks and break the event loop
after the body has been downloaded. But how do I do that?

 

Thanks,

Ivan
Received on Thursday, 1 December 2005 19:50:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:45 GMT