result = ftp_state_retr(data, ftpc->known_filesize);
}
else {
- if(data->set.ignorecl) {
- /* This code is to support download of growing files. It prevents
- the state machine from requesting the file size from the
- server. With an unknown file size the download continues until
- the server terminates it, otherwise the client stops if the
- received byte count exceeds the reported file size. Set option
- CURLOPT_IGNORE_CONTENT_LENGTH to 1 to enable this behavior.*/
+ if(data->set.ignorecl || data->set.prefer_ascii) {
+ /* 'ignorecl' is used to support download of growing files. It
+ prevents the state machine from requesting the file size from
+ the server. With an unknown file size the download continues
+ until the server terminates it, otherwise the client stops if
+ the received byte count exceeds the reported file size. Set
+ option CURLOPT_IGNORE_CONTENT_LENGTH to 1 to enable this
+ behavior.
+
+ In addition: asking for the size for 'TYPE A' transfers is not
+ constructive since servers don't report the converted size. So
+ skip it.
+ */
result = Curl_pp_sendf(data, &ftpc->pp, "RETR %s", ftpc->file);
if(!result)
state(data, FTP_RETR);
test100 test101 test102 test103 test104 test105 test106 test107 test108 \
test109 test110 test111 test112 test113 test114 test115 test116 test117 \
test118 test119 test120 test121 test122 test123 test124 test125 test126 \
-test127 test128 test129 test130 test131 test132 test133 test134 test135 \
+test127 test128 test130 test131 test132 test133 test134 test135 \
test136 test137 test138 test139 test140 test141 test142 test143 test144 \
test145 test146 test147 test148 test149 test150 test151 test152 test153 \
test154 test155 test156 test157 test158 test159 test160 test161 test162 \
+++ /dev/null
-<testcase>
-<info>
-<keywords>
-FTP
-EPSV
-TYPE A
-RETR
-type=
-</keywords>
-</info>
-# Server-side
-<reply>
-<size>
-37
-</size>
-<data>
-data
- to
- see
-that FTP
-works
- so does it?
-</data>
-</reply>
-
-# Client-side
-<client>
-<server>
-ftp
-</server>
- <name>
-FTP GET with type=A style ASCII URL and understated server SIZE
- </name>
- <command>
-"ftp://%HOSTIP:%FTPPORT/129;type=A"
-</command>
-</client>
-
-# Verify data after the test has been "shot"
-<verify>
-<protocol>
-USER anonymous\r
-PASS ftp@example.com\r
-PWD\r
-EPSV\r
-TYPE A\r
-SIZE 129\r
-RETR 129\r
-QUIT\r
-</protocol>
-</verify>
-</testcase>