Fix an issue, affecting FTP transfers, introduced with the transfer.c patch committed May 4.
Additionally some identation fixes.
This commit is contained in:
parent
f32dc6b828
commit
ac9d92587e
4
CHANGES
4
CHANGES
@ -6,6 +6,10 @@
|
|||||||
|
|
||||||
Changelog
|
Changelog
|
||||||
|
|
||||||
|
Yang Tse (7 May 2009)
|
||||||
|
- Fixed an issue affecting FTP transfers, introduced with the transfer.c
|
||||||
|
patch committed May 4.
|
||||||
|
|
||||||
Daniel Stenberg (7 May 2009)
|
Daniel Stenberg (7 May 2009)
|
||||||
- Man page *roff problems fixed thanks to input from Colin Watson. Problems
|
- Man page *roff problems fixed thanks to input from Colin Watson. Problems
|
||||||
reported in the Debian package.
|
reported in the Debian package.
|
||||||
|
@ -130,15 +130,15 @@ CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp)
|
|||||||
struct SessionHandle *data = conn->data;
|
struct SessionHandle *data = conn->data;
|
||||||
size_t buffersize = (size_t)bytes;
|
size_t buffersize = (size_t)bytes;
|
||||||
int nread;
|
int nread;
|
||||||
int sending_http_headers = FALSE;
|
bool sending_http_headers = FALSE;
|
||||||
|
|
||||||
if(data->req.upload_chunky) {
|
if(data->req.upload_chunky) {
|
||||||
/* if chunked Transfer-Encoding */
|
/* if chunked Transfer-Encoding */
|
||||||
buffersize -= (8 + 2 + 2); /* 32bit hex + CRLF + CRLF */
|
buffersize -= (8 + 2 + 2); /* 32bit hex + CRLF + CRLF */
|
||||||
data->req.upload_fromhere += (8 + 2); /* 32bit hex + CRLF */
|
data->req.upload_fromhere += (8 + 2); /* 32bit hex + CRLF */
|
||||||
}
|
}
|
||||||
if((data->state.proto.http)
|
if((conn->protocol&PROT_HTTP) &&
|
||||||
&& (data->state.proto.http->sending == HTTPSEND_REQUEST)) {
|
(data->state.proto.http->sending == HTTPSEND_REQUEST)) {
|
||||||
/* We're sending the HTTP request headers, not the data.
|
/* We're sending the HTTP request headers, not the data.
|
||||||
Remember that so we don't re-translate them into garbage. */
|
Remember that so we don't re-translate them into garbage. */
|
||||||
sending_http_headers = TRUE;
|
sending_http_headers = TRUE;
|
||||||
@ -242,18 +242,16 @@ CURLcode Curl_fillreadbuffer(struct connectdata *conn, int bytes, int *nreadp)
|
|||||||
}
|
}
|
||||||
|
|
||||||
nread+=strlen(endofline_native); /* for the added end of line */
|
nread+=strlen(endofline_native); /* for the added end of line */
|
||||||
|
}
|
||||||
#ifdef CURL_DOES_CONVERSIONS
|
#ifdef CURL_DOES_CONVERSIONS
|
||||||
} else {
|
else if((data->set.prefer_ascii) && (!sending_http_headers)) {
|
||||||
if((data->set.prefer_ascii) && (!sending_http_headers)) {
|
|
||||||
CURLcode res;
|
CURLcode res;
|
||||||
res = Curl_convert_to_network(data, data->req.upload_fromhere, nread);
|
res = Curl_convert_to_network(data, data->req.upload_fromhere, nread);
|
||||||
/* Curl_convert_to_network calls failf if unsuccessful */
|
/* Curl_convert_to_network calls failf if unsuccessful */
|
||||||
if(res != CURLE_OK) {
|
if(res != CURLE_OK)
|
||||||
return(res);
|
return(res);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif /* CURL_DOES_CONVERSIONS */
|
#endif /* CURL_DOES_CONVERSIONS */
|
||||||
}
|
|
||||||
|
|
||||||
*nreadp = nread;
|
*nreadp = nread;
|
||||||
|
|
||||||
@ -1460,7 +1458,7 @@ static CURLcode readwrite_upload(struct SessionHandle *data,
|
|||||||
ssize_t bytes_written;
|
ssize_t bytes_written;
|
||||||
CURLcode result;
|
CURLcode result;
|
||||||
ssize_t nread; /* number of bytes read */
|
ssize_t nread; /* number of bytes read */
|
||||||
int sending_http_headers = FALSE;
|
bool sending_http_headers = FALSE;
|
||||||
|
|
||||||
if((k->bytecount == 0) && (k->writebytecount == 0))
|
if((k->bytecount == 0) && (k->writebytecount == 0))
|
||||||
Curl_pgrsTime(data, TIMER_STARTTRANSFER);
|
Curl_pgrsTime(data, TIMER_STARTTRANSFER);
|
||||||
@ -1496,15 +1494,15 @@ static CURLcode readwrite_upload(struct SessionHandle *data,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data->state.proto.http) {
|
if(conn->protocol&PROT_HTTP) {
|
||||||
if(data->state.proto.http->sending == HTTPSEND_REQUEST) {
|
if(data->state.proto.http->sending == HTTPSEND_REQUEST)
|
||||||
/* We're sending the HTTP request headers, not the data.
|
/* We're sending the HTTP request headers, not the data.
|
||||||
Remember that so we don't change the line endings. */
|
Remember that so we don't change the line endings. */
|
||||||
sending_http_headers = TRUE;
|
sending_http_headers = TRUE;
|
||||||
} else {
|
else
|
||||||
sending_http_headers = FALSE;
|
sending_http_headers = FALSE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
result = Curl_fillreadbuffer(conn, BUFSIZE, &fillcount);
|
result = Curl_fillreadbuffer(conn, BUFSIZE, &fillcount);
|
||||||
if(result)
|
if(result)
|
||||||
return result;
|
return result;
|
||||||
@ -1534,13 +1532,13 @@ static CURLcode readwrite_upload(struct SessionHandle *data,
|
|||||||
data->req.upload_present = nread;
|
data->req.upload_present = nread;
|
||||||
|
|
||||||
/* convert LF to CRLF if so asked */
|
/* convert LF to CRLF if so asked */
|
||||||
|
if((!sending_http_headers) &&
|
||||||
#ifdef CURL_DO_LINEEND_CONV
|
#ifdef CURL_DO_LINEEND_CONV
|
||||||
/* always convert if we're FTPing in ASCII mode */
|
/* always convert if we're FTPing in ASCII mode */
|
||||||
if(((data->set.crlf) || (data->set.prefer_ascii))
|
((data->set.crlf) || (data->set.prefer_ascii))) {
|
||||||
#else
|
#else
|
||||||
if((data->set.crlf)
|
(data->set.crlf)) {
|
||||||
#endif /* CURL_DO_LINEEND_CONV */
|
#endif
|
||||||
&& (!sending_http_headers)) {
|
|
||||||
if(data->state.scratch == NULL)
|
if(data->state.scratch == NULL)
|
||||||
data->state.scratch = malloc(2*BUFSIZE);
|
data->state.scratch = malloc(2*BUFSIZE);
|
||||||
if(data->state.scratch == NULL) {
|
if(data->state.scratch == NULL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user