From: Daniel Stenberg Date: Wed, 20 Mar 2002 10:52:24 +0000 (+0000) Subject: verbose FTP PASV output could output a "random" name from the stack based X-Git-Tag: upstream/7.37.1~15608 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ca9760756ae2d02b95f2ce7158a24df79d62ea85;p=platform%2Fupstream%2Fcurl.git verbose FTP PASV output could output a "random" name from the stack based array Also, uploading data with --crlf cannot check that the proper size was uploaded and thus should not warn if the sizes differ. This can be changed in the future by having the expected size in the connectdata struct and then increase the expected size for each byte that is added in the --crlf replacement process. --- diff --git a/lib/ftp.c b/lib/ftp.c index 809ca7a..efef6ad 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -622,8 +622,10 @@ CURLcode Curl_ftp_done(struct connectdata *conn) CURLcode result=CURLE_OK; if(data->set.upload) { - if((-1 != data->set.infilesize) && (data->set.infilesize != *ftp->bytecountp)) { - failf(data, "Wrote only partial file (%d out of %d bytes)", + if((-1 != data->set.infilesize) && + (data->set.infilesize != *ftp->bytecountp) && + !data->set.crlf) { + failf(data, "Uploaded unaligned file size (%d out of %d bytes)", *ftp->bytecountp, data->set.infilesize); return CURLE_PARTIAL_FILE; } @@ -1460,7 +1462,7 @@ CURLcode ftp_use_pasv(struct connectdata *conn) /* normal, direct, ftp connection */ addr = Curl_resolv(data, newhostp, newport, &hostdataptr); if(!addr) { - failf(data, "Can't resolve new host %s", newhost); + failf(data, "Can't resolve new host %s:%d", newhostp, newport); return CURLE_FTP_CANT_GET_HOST; } connectport = newport; /* we connect to the remote port */ @@ -1475,7 +1477,7 @@ CURLcode ftp_use_pasv(struct connectdata *conn) if((CURLE_OK == result) && data->set.verbose) /* this just dumps information about this second connection */ - ftp_pasv_verbose(conn, conninfo, newhost, connectport); + ftp_pasv_verbose(conn, conninfo, newhostp, connectport); if(CURLE_OK != result) return result; @@ -1483,7 +1485,7 @@ CURLcode ftp_use_pasv(struct connectdata *conn) if (data->set.tunnel_thru_httpproxy) { /* We want "seamless" FTP operations through HTTP proxy tunnel */ result = Curl_ConnectHTTPProxyTunnel(conn, conn->secondarysocket, - newhost, newport); + newhostp, newport); if(CURLE_OK != result) return result; }