Mike Jean fixed so that the second CONNECT when doing FTP over a HTTP proxy

actually used a new connection and not sent the second request on the first
socket!
This commit is contained in:
Daniel Stenberg 2006-01-07 22:24:16 +00:00
parent e4d8cb4ee0
commit f4cc8153ae
3 changed files with 20 additions and 9 deletions

View File

@ -8,6 +8,11 @@
Daniel (7 January 2006)
- Mike Jean fixed so that the second CONNECT when doing FTP over a HTTP proxy
actually used a new connection and not sent the second request on the first
socket!
Daniel (6 January 2006) Daniel (6 January 2006)
- Alexander Lazic made the buildconf run the buildconf in the ares dir if that - Alexander Lazic made the buildconf run the buildconf in the ares dir if that
is present instead of trying to mimic that script in curl's buildconf is present instead of trying to mimic that script in curl's buildconf

View File

@ -15,6 +15,7 @@ This release includes the following changes:
This release includes the following bugfixes: This release includes the following bugfixes:
o FTP over HTTP proxy now sends the second CONNECT properly
o numerous compiler warnings and build quirks for various compilers have o numerous compiler warnings and build quirks for various compilers have
been addressed been addressed
o supports name and passwords up to 255 bytes long, embedded in URLs o supports name and passwords up to 255 bytes long, embedded in URLs
@ -29,6 +30,6 @@ This release would not have looked like this without help, code, reports and
advice from friends like these: advice from friends like these:
Dov Murik, Jean Jacques Drouin, Andres Garcia, Yang Tse, Gisle Vanem, Dan Dov Murik, Jean Jacques Drouin, Andres Garcia, Yang Tse, Gisle Vanem, Dan
Fandrich, Alexander Lazic Fandrich, Alexander Lazic, Mike Jean
Thanks! (and sorry if I forgot to mention someone) Thanks! (and sorry if I forgot to mention someone)

View File

@ -845,8 +845,9 @@ send_buffer *add_buffer_init(void)
static static
CURLcode add_buffer_send(send_buffer *in, CURLcode add_buffer_send(send_buffer *in,
struct connectdata *conn, struct connectdata *conn,
long *bytes_written) /* add the number of sent long *bytes_written, /* add the number of sent
bytes to this counter */ bytes to this counter */
int socketindex)
{ {
ssize_t amount; ssize_t amount;
CURLcode res; CURLcode res;
@ -854,7 +855,11 @@ CURLcode add_buffer_send(send_buffer *in,
size_t size; size_t size;
struct HTTP *http = conn->proto.http; struct HTTP *http = conn->proto.http;
size_t sendsize; size_t sendsize;
curl_socket_t sockfd = conn->sock[FIRSTSOCKET]; curl_socket_t sockfd;
curlassert(socketindex <= SECONDARYSOCKET);
sockfd = conn->sock[socketindex];
/* The looping below is required since we use non-blocking sockets, but due /* The looping below is required since we use non-blocking sockets, but due
to the circumstances we will just loop and try again and again etc */ to the circumstances we will just loop and try again and again etc */
@ -1166,7 +1171,7 @@ CURLcode Curl_proxyCONNECT(struct connectdata *conn,
if(CURLE_OK == result) if(CURLE_OK == result)
/* Now send off the request */ /* Now send off the request */
result = add_buffer_send(req_buffer, conn, result = add_buffer_send(req_buffer, conn,
&data->info.request_size); &data->info.request_size, sockindex);
} }
if(result) if(result)
failf(data, "Failed sending CONNECT to proxy"); failf(data, "Failed sending CONNECT to proxy");
@ -2032,7 +2037,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
return result; return result;
result = add_buffer_send(req_buffer, conn, result = add_buffer_send(req_buffer, conn,
&data->info.request_size); &data->info.request_size, FIRSTSOCKET);
if(result) if(result)
failf(data, "Failed sending POST request"); failf(data, "Failed sending POST request");
else else
@ -2097,7 +2102,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
/* fire away the whole request to the server */ /* fire away the whole request to the server */
result = add_buffer_send(req_buffer, conn, result = add_buffer_send(req_buffer, conn,
&data->info.request_size); &data->info.request_size, FIRSTSOCKET);
if(result) if(result)
failf(data, "Failed sending POST request"); failf(data, "Failed sending POST request");
else else
@ -2141,7 +2146,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
/* this sends the buffer and frees all the buffer resources */ /* this sends the buffer and frees all the buffer resources */
result = add_buffer_send(req_buffer, conn, result = add_buffer_send(req_buffer, conn,
&data->info.request_size); &data->info.request_size, FIRSTSOCKET);
if(result) if(result)
failf(data, "Failed sending PUT request"); failf(data, "Failed sending PUT request");
else else
@ -2263,7 +2268,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
} }
/* issue the request */ /* issue the request */
result = add_buffer_send(req_buffer, conn, result = add_buffer_send(req_buffer, conn,
&data->info.request_size); &data->info.request_size, FIRSTSOCKET);
if(result) if(result)
failf(data, "Failed sending HTTP POST request"); failf(data, "Failed sending HTTP POST request");
@ -2280,7 +2285,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
/* issue the request */ /* issue the request */
result = add_buffer_send(req_buffer, conn, result = add_buffer_send(req_buffer, conn,
&data->info.request_size); &data->info.request_size, FIRSTSOCKET);
if(result) if(result)
failf(data, "Failed sending HTTP request"); failf(data, "Failed sending HTTP request");