cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_easy_perform() failed: Unable to parse FTP file list

From: Paritosh Garg <paritoshgarg.cs_at_gmail.com>
Date: Wed, 7 Nov 2012 17:16:00 +0530

Hi,

parsing is failing on highlighted line of function "Curl_ftp_parselist":

  else if(c == '\n') {
            finfo->b_data[parser->item_length - 1] = 0;
            if(strncmp("total ", finfo->b_data, 6) == 0) {
              char *endptr = finfo->b_data+6;
              /* here we can deal with directory size */
              while(ISSPACE(*endptr))
                endptr++;
              if(*endptr != 0) {
                PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST);
                return bufflen;
              }
              else {
                parser->state.UNIX.main = PL_UNIX_FILETYPE;
                finfo->b_used = 0;
              }
            }
            else {
              PL_ERROR(conn, CURLE_FTP_BAD_FILE_LIST);
              return bufflen;

Error comes when ftp directory listing is showing below output:

227 Entering Passive Mode (192,168,40,215,232,30)
150 ASCII data connection for /bin/ls (192.168.4.192,6097) (0 bytes).
total 180
Why curl is expecting total 0 here, am I missing some option? Please help.

Thanks,
Pgarg

On Mon, Nov 5, 2012 at 10:28 AM, Paritosh Garg <paritoshgarg.cs_at_gmail.com>wrote:

> Hi,
>
>
>
> I am getting below error, while trying to do an ftpdownload from a solaris
> ftp server.
>
>
>
> 226 ASCII Transfer complete
> Connection #0 to host 192.168.40.215 left intact
> Re-using existing connection! (#0) with host 192.168.40.215
> Connected to 192.168.40.215 (192.168.40.215) port 21 (#0)
> Closing connection #0
> Unable to parse FTP file list
>
>
>
> It seems to give error in highlighted line of directory listing:
>
>
>
> 227 Entering Passive Mode (192,168,40,215,232,30)
> 150 ASCII data connection for /bin/ls (192.168.4.192,6097) (0 bytes).
> total 180
>
>
>
> I am using below options:
>
> curl_easy_setopt(ftpHnd, CURLOPT_WILDCARDMATCH, 1L);
>
> curl_easy_setopt(ftpHnd, CURLOPT_TIMEOUT, 0L);
>
> curl_easy_setopt(ftpHnd, CURLOPT_FTP_RESPONSE_TIMEOUT, 0L);
>
>
> Please help if I am missing something.
> Please let me know if any other information is required.
>
>
>
> Thanks,
>
> pgarg
>
>
>
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-11-07