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

Re: FTP client help

From: Putz Doug <PutzDoug@JohnDeere.com>
Date: Fri, 3 Nov 2000 09:55:54 -0600
Message-ID: <44E8F46BB3EFD211B9210008C75DAB9A02BA1939@e90corp3.dx.deere.com>
To: "'www-lib@w3.org'" <www-lib@w3.org>
Ken,

  Before you make your call to "LoadToChunk" you will need to set up a
terminate routine to be called:

int terminate_ftp(HTRequest *request, HTResponse *response,void *param, int
status)
{
  // stop event loop
  HTEventList_stopLoop();

  return (status ? status : 0);
}

  HTNet_addAfter(terminate_ftp, NULL, NULL, HT_ALL, HT_FILTER_LAST);

  if ((chunk = HTLoadToChunk(url, request)) == NULL) 
  {
    // Delete our request
    HTRequest_delete(request);
    HTTRACE(APP_TRACE,"Unable to GET url file [%s]\n" _ url);
    return ERR_UNABLE_TO_GET;
  } 

  HTEventList_loop(request);

  HTNet_deleteAfter(terminate_ftp);

  if (HTChunk_data(chunk) != NULL)
     ...

  given the above code, the execution will stop at the
HTEventList_loop(request); 
  call until the termination routine "terminate_ftp" has been called to stop
the
  Event List Loop.  Until this terminate routine has been called, the FTP
operation
  you were trying hasn't actually completed and the "Chunk" contains
incomplete
  data.
Received on Friday, 3 November 2000 10:56:35 GMT

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