o memory leak when handling compressed data streams from broken servers
o no NTLM unicode response
o resume HTTP PUT using Digest authentication
+ o FTP NOBODY requests on directories sent "SIZE (null)"
This release includes the following known bugs:
Daniel Cater, Colin Hogben, Jofell Gallardo, Daniel Johnson,
Ralf S. Engelschall, James Housley, Chris Flerackers, Patrick Monnerat,
Jayesh A Shah, Greg Zavertnik, Peter O'Gorman, Greg Morse, Dmitriy Sergeyev,
- Scott Cantor, Allen Pulsifer, Andrew Wansink
+ Scott Cantor, Allen Pulsifer, Andrew Wansink, Robson Braga Araujo
Thanks! (and sorry if I forgot to mention someone)
#define NBFTPSENDF(x,y,z) if ((result = Curl_nbftpsendf(x,y,z)) != CURLE_OK) \
return result
+
+/*
+ * 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 very 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 connectdata *conn)
{
struct ftp_conn *ftpc = &conn->proto.ftpc;
CURLcode result = CURLE_OK;
struct FTP *ftp = conn->data->reqdata.proto.ftp;
- if(ftp->no_transfer) {
- /* if a "head"-like request is being made */
+ if(ftp->no_transfer && ftp->file) {
+ /* if a "head"-like request is being made (on a file) */
/* Determine if server can respond to REST command and therefore
whether it supports range */
CURLcode result = CURLE_OK;
struct FTP *ftp = conn->data->reqdata.proto.ftp;
- if(ftp->no_transfer) {
- /* if a "head"-like request is being made */
+ if(ftp->no_transfer && ftp->file) {
+ /* if a "head"-like request is being made (on a file) */
/* we know ftp->file is a valid pointer to a file name */
NBFTPSENDF(conn, "SIZE %s", ftp->file);
data->info.filetime = (long)curl_getdate(buf, &secs);
}
+#ifdef CURL_FTP_HTTPSTYLE_HEAD
/* 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. */
if(result)
return result;
} /* end of a ridiculous amount of conditionals */
+#endif
}
break;
default:
filesize = (ftpcode == 213)?curlx_strtoofft(buf+4, NULL, 0):-1;
if(instate == FTP_SIZE) {
+#ifdef CURL_FTP_HTTPSTYLE_HEAD
if(-1 != filesize) {
snprintf(buf, sizeof(data->state.buffer),
"Content-Length: %" FORMAT_OFF_T "\r\n", filesize);
if(result)
return result;
}
+#endif
result = ftp_state_post_size(conn);
}
else if(instate == FTP_RETR_SIZE)
switch(instate) {
case FTP_REST:
default:
+#ifdef CURL_FTP_HTTPSTYLE_HEAD
if (ftpcode == 350) {
result = Curl_client_write(conn, CLIENTWRITE_BOTH,
(char *)"Accept-ranges: bytes\r\n", 0);
if(result)
return result;
}
-
+#endif
result = ftp_state_post_rest(conn);
break;