curl-library
curl mget for solaris ftp server
Date: Wed, 25 Dec 2013 13:47:30 +0800
Hi List,
I am editing a curl API example to get files from solaris by ftp , but it
always return error 87 which means can't get file list, I am on debian
wheezy. I checked the latest curl code curl-7.34.0/lib/ ftplistparser.c :
case PL_UNIX_TOTALSIZE_READING:
parser->item_length++;
if(c == '\r') {
parser->item_length--;
finfo->b_used--;
}
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;
}
}
I can't understand the handling here, as I understand, if total dir size is
not zero, then we have list, but it return error here; if it's zero, then no
need to move on.
Did I miss sth ? Anyone know anything about that ?
Thanks in advance.
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
- application/octet-stream attachment: wildcard.c