- From: olga <olga@goliath.eai.com>
- Date: Mon, 24 Aug 1998 17:04:22 -0500 (CDT)
- To: www-html@w3.org
Hi, I am trying to write a wrapper class MyWWWLib which uses 3wc. I have the function "putURL" which processes HTTP PUT requests. The problem is that in the client code like following: ... MyWWWLib lib; lib.putURL(src, dest); lib.putURL(src, dest); ... or like: ... MyWWWLib lib; lib.getURL(src, dest); //GET request lib.putURL(src, dest); ... the first putURL (or getURL) request is processed correctly and then the programs hangs... (even though multiple get requests are processed w/o any problems). I suspect that the problem is in the callback function(?), but I do not know how to write it correctly. I would appreciate any help on this matter. Thank you, Olga Antropova. ------------------------------ There is my current callback function: PRIVATE HTChunk * result = NULL; PRIVATE int terminate_handler (HTRequest * request, HTResponse * response, void * param, int status) { if (status == HT_LOADED && result && HTChunk_data(result)) { fprintf(stderr, HTChunk_data(result)); HTChunk_delete(result); } HTRequest_delete(request); return HT_OK; } -------------------------------- and part of the PUT function: BOOL MyWWWLib::putURL(const char* url, const char* local_filename) { HTRequest *request; request = HTRequest_new(); BOOL status = NO; HTProfile_newNoCacheClient(APP_NAME, APP_VERSION); HTNet_addAfter(terminate_handler, NULL, NULL, HT_ALL, HT_FILTER_LAST); HTParentAnchor * destination; // Destination for PUT, etc. HTParentAnchor * source = NULL; // The file we want to put char * cwd = HTGetCurrentDirectoryURL(); char * ref = HTParse(local_filename, cwd, PARSE_ALL); source = (HTParentAnchor *) HTAnchor_findAddress(ref); HT_FREE(ref); char * dest = HTParse(url, cwd, PARSE_ALL); destination = (HTParentAnchor *) HTAnchor_findAddress(dest); HT_FREE(dest); status = HTPutDocumentAnchor( source, (HTAnchor *) destination, request ); HT_FREE(dest); HT_FREE(ref); HT_FREE(cwd); HTEventList_loop(request); return status; } ---------------------------------- E-Mail: olga <olga@eai.com> Date: 24-Aug-98 This message was sent by XFMail ----------------------------------
Received on Monday, 24 August 1998 18:01:28 UTC