parse_remote_port: fix ;type= URL suffix over HTTP proxy

Test 563 is enabled now and verifies that the combo FTP type=A URL,
CURLOPT_PORT set and proxy work fine. As a bonus I managed to remove the
somewhat odd FTP check in parse_remote_port() and instead converted it
to a better and more generic 'slash_removed' struct field. Checking the
->protocol field isn't right since when an FTP:// URL is sent over a
HTTP proxy, the protocol is HTTP but the URL was handled by the FTP code
and thus slash_removed is set TRUE for this case.
This commit is contained in:
Daniel Stenberg 2010-08-10 00:56:45 +02:00
parent 5d5dd08e77
commit dc2157a087
5 changed files with 18 additions and 10 deletions

View file

@ -4178,6 +4178,7 @@ static CURLcode ftp_setup_connection(struct connectdata * conn)
}
data->state.path++; /* don't include the initial slash */
data->state.slash_removed = TRUE; /* we've skipped the slash */
/* FTP URLs support an extension like ";type=<typecode>" that
* we'll try to get now! */
@ -4189,6 +4190,7 @@ static CURLcode ftp_setup_connection(struct connectdata * conn)
if(type) {
*type = 0; /* it was in the middle of the hostname */
command = Curl_raw_toupper(type[6]);
conn->bits.type_set = TRUE;
switch (command) {
case 'A': /* ASCII mode */