mirror of https://github.com/moparisthebest/curl
Daniel Noguerol made the ftp code output "Accept-Ranges: bytes" in similar
style like other faked HTTP headers when NOBODY and HEADER are used.
This commit is contained in:
parent
6809a906bb
commit
e3b4dd08ff
14
lib/ftp.c
14
lib/ftp.c
|
@ -2032,6 +2032,8 @@ CURLcode ftp_perform(struct connectdata *conn,
|
||||||
may not support it! It is however the only way we have to get a file's
|
may not support it! It is however the only way we have to get a file's
|
||||||
size! */
|
size! */
|
||||||
ssize_t filesize;
|
ssize_t filesize;
|
||||||
|
ssize_t nread;
|
||||||
|
int ftpcode;
|
||||||
|
|
||||||
ftp->no_transfer = TRUE; /* this means no actual transfer is made */
|
ftp->no_transfer = TRUE; /* this means no actual transfer is made */
|
||||||
|
|
||||||
|
@ -2051,6 +2053,18 @@ CURLcode ftp_perform(struct connectdata *conn,
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Determine if server can respond to REST command and therefore
|
||||||
|
whether it can do a range */
|
||||||
|
FTPSENDF(conn, "REST 0", NULL);
|
||||||
|
result = Curl_GetFTPResponse(&nread, conn, &ftpcode);
|
||||||
|
|
||||||
|
if ((CURLE_OK == result) && (ftpcode == 350)) {
|
||||||
|
result = Curl_client_write(data, CLIENTWRITE_BOTH,
|
||||||
|
(char *)"Accept-ranges: bytes\r\n", 0);
|
||||||
|
if(result)
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/* If we asked for a time of the file and we actually got one as
|
/* If we asked for a time of the file and we actually got one as
|
||||||
well, we "emulate" a HTTP-style header in our output. */
|
well, we "emulate" a HTTP-style header in our output. */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue