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

[www-lib] <none>

From: Sandesh Anvekar <sanvekar@controlnet.co.in>
Date: Sat, 8 Feb 2003 12:08:13 +0530
Message-ID: <011701c2cf3c$ac9fb3d0$9b0aa8c0@sandesh>
To: <www-lib@w3.org>
Hi All,

    I have written a piece of code something like this and I am calling the function xrayhttpget after a fixed time interval repeatetively .But I have encountered a problem in this
Suppose I give a valid uri of some html document and as I said my program logic will continuosly loop and try to fetch this document in each iteration .Also I have specified the 
time gap between the successive requests is 3 seconds then during the second iteration my program gives segmentaion fault and it occurs due to the HTHost_setEventTimeout(3000);
call in the code.Could anyone explain me why this could occur?


PRIVATE int request_terminater (HTRequest * request, HTResponse * response,
    void * param, int status) 
    /*Stop the event loop and quit*/
    HTEventList_stopLoop ();
    return HT_OK;

/* ------------------------------------------------------------------------- */
/* xrayhttpget will now accept the uri and length of the uri*/
int xrayhttpget ( char * argv ,int len, int completeURI)
 App * app = NULL;
 HTRequest * request = NULL;
 HTAnchor * anchor = NULL;

 /* Need our own trace and print functions */
 char * uri = HTParse(argv, NULL, PARSE_ALL);
 if ((anchor = HTAnchor_findAddress(uri)) == NULL)
  anchor = HTAnchor_findAddress(DEFAULT_HOME);

#if 0

 /* Initiate libwww */

 /* Create a new app obect */
 app = App_new();

 /* Add our own request terminate handler */
 HTNet_addAfter(request_terminater, NULL, app, HT_ALL, HT_FILTER_LAST);
 /*Set the timeout for request */
 /* Start request */
 request = Request_new(app ,argv ,len, completeURI);
 if(get_document(request, anchor) == YES) {
  /* Go into the event loop... */
 Request_delete(app, request);
 return 0;
Received on Wednesday, 8 October 2003 03:18:07 UTC

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