Re: FTP client help

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 UTC