Curl_conn_cf_discard_all(data, data->conn, SECONDARYSOCKET);
}
-/*
- * NOTE: back in the old days, we added code in the FTP code that made NOBODY
- * requests on files respond with headers passed to the client/stdout that
- * looked like HTTP ones.
- *
- * This approach is not elegant, it causes confusion and is error-prone. It is
- * subject for removal at the next (or at least a future) soname bump. Until
- * then you can test the effects of the removal by undefining the following
- * define named CURL_FTP_HTTPSTYLE_HEAD.
- */
-#define CURL_FTP_HTTPSTYLE_HEAD 1
-
static void freedirs(struct ftp_conn *ftpc)
{
Curl_safefree(ftpc->dirs);
showtime = TRUE;
}
-#ifdef CURL_FTP_HTTPSTYLE_HEAD
/* If we asked for a time of the file and we actually got one as well,
we "emulate" an HTTP-style header in our output. */
if(result)
return result;
} /* end of a ridiculous amount of conditionals */
-#endif
}
break;
default:
}
if(instate == FTP_SIZE) {
-#ifdef CURL_FTP_HTTPSTYLE_HEAD
if(filesize != -1) {
char clbuf[128];
int clbuflen = curl_msnprintf(clbuf, sizeof(clbuf),
if(result)
return result;
}
-#endif
Curl_pgrsSetDownloadSize(data, filesize);
result = ftp_state_rest(data, ftpc, ftp);
}
switch(instate) {
case FTP_REST:
default:
-#ifdef CURL_FTP_HTTPSTYLE_HEAD
if(ftpcode == 350) {
char buffer[24]= { "Accept-ranges: bytes\r\n" };
result = client_write_header(data, buffer, strlen(buffer));
if(result)
return result;
}
-#endif
result = ftp_state_prepare_transfer(data, ftpc, ftp);
break;