aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-11-12 14:08:41 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-11-12 14:08:41 +0000
commit05f3ca880fa092e4fd8684d39cb52401fedc9db7 (patch)
tree8820a69fe528b08d917920f34bba30ba6f6590b1
parenta18d41a463b51b2ed6b9c4efcaf26cb0489128a8 (diff)
made CURLOPT_HTTPPROXYTUNNEL work for plain HTTP as well
-rw-r--r--lib/http.c29
-rw-r--r--lib/mprintf.c6
-rw-r--r--lib/url.c1
3 files changed, 18 insertions, 18 deletions
diff --git a/lib/http.c b/lib/http.c
index 2fe8e08dd..6d1330c25 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -398,19 +398,22 @@ CURLcode Curl_http_connect(struct connectdata *conn)
* us to the host we want to talk to. Only after the connect
* has occured, can we start talking SSL
*/
- if (conn->protocol & PROT_HTTPS) {
- if (data->change.proxy) {
- /* HTTPS through a proxy can only be done with a tunnel */
- result = Curl_ConnectHTTPProxyTunnel(conn, conn->firstsocket,
- conn->hostname, conn->remote_port);
- if(CURLE_OK != result)
- return result;
- }
- /* now, perform the SSL initialization for this socket */
- result = Curl_SSLConnect(conn);
- if(result)
+ if(data->change.proxy &&
+ ((conn->protocol & PROT_HTTPS) || data->set.tunnel_thru_httpproxy)) {
+
+ /* either HTTPS over proxy, OR explicitly asked for a tunnel */
+ result = Curl_ConnectHTTPProxyTunnel(conn, conn->firstsocket,
+ conn->hostname, conn->remote_port);
+ if(CURLE_OK != result)
return result;
+
+ if(conn->protocol & PROT_HTTPS) {
+ /* now, perform the SSL initialization for this socket */
+ result = Curl_SSLConnect(conn);
+ if(result)
+ return result;
+ }
}
if(conn->bits.user_passwd && !data->state.this_is_a_follow) {
@@ -530,7 +533,9 @@ CURLcode Curl_http(struct connectdata *conn)
host, ppath,
conn->protocol&PROT_HTTPS?TRUE:FALSE);
}
- if ((data->change.proxy) && !(conn->protocol&PROT_HTTPS)) {
+ if (data->change.proxy &&
+ !data->set.tunnel_thru_httpproxy &&
+ !(conn->protocol&PROT_HTTPS)) {
/* The path sent to the proxy is in fact the entire URL */
ppath = data->change.url;
}
diff --git a/lib/mprintf.c b/lib/mprintf.c
index 7c42fcae1..7259a9ade 100644
--- a/lib/mprintf.c
+++ b/lib/mprintf.c
@@ -92,13 +92,7 @@
*
****************************************************************************/
-*
- * To test:
- *
- * Use WIDTH, PRECISION and NUMBERED ARGUMENT combined.
- */
#include "setup.h"
-
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/lib/url.c b/lib/url.c
index 079e9575a..1b836c45b 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -1543,6 +1543,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
conn->protocol |= PROT_HTTP;
conn->curl_do = Curl_http;
conn->curl_done = Curl_http_done;
+ conn->curl_connect = Curl_http_connect;
}
else if (strequal(conn->protostr, "HTTPS")) {
#ifdef USE_SSLEAY