mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 09:21:50 -05:00
tool_operate: Fix retry on FTP 4xx to ignore other protocols
Only treat response code as FTP response codes in case the protocol type is FTP. This fixes an issue where an HTTP download was treated as FTP in case libcurl returned with 33. This happens when the download has already finished and the server responses 416: HTTP/1.1 416 Requested Range Not Satisfiable This should not be treated as an FTP error. Fixes #2464 Closes #2465
This commit is contained in:
parent
dd03e8c281
commit
464a019cbe
@ -1570,9 +1570,13 @@ static CURLcode operate_do(struct GlobalConfig *global,
|
|||||||
}
|
}
|
||||||
} /* if CURLE_OK */
|
} /* if CURLE_OK */
|
||||||
else if(result) {
|
else if(result) {
|
||||||
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response);
|
long protocol;
|
||||||
|
|
||||||
if(response/100 == 4)
|
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &response);
|
||||||
|
curl_easy_getinfo(curl, CURLINFO_PROTOCOL, &protocol);
|
||||||
|
|
||||||
|
if((protocol == CURLPROTO_FTP || protocol == CURLPROTO_FTPS) &&
|
||||||
|
response / 100 == 4)
|
||||||
/*
|
/*
|
||||||
* This is typically when the FTP server only allows a certain
|
* This is typically when the FTP server only allows a certain
|
||||||
* amount of users and we are not one of them. All 4xx codes
|
* amount of users and we are not one of them. All 4xx codes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user