aboutsummaryrefslogtreecommitdiff
path: root/lib/urldata.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-06-07 23:02:26 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-06-14 23:43:52 +0200
commit5113ad0424044458ac497fa1458ebe0101356b22 (patch)
treea0fa92f49271bf09338e45fbed4173d303a4ae50 /lib/urldata.h
parent1213baba27a30a14f917e3c8c044f22cac2389b6 (diff)
http-proxy: do the HTTP CONNECT process entirely non-blocking
Mentioned as a problem since 2007 (8f87c15bdac63) and of course it existed even before that. Closes #1547
Diffstat (limited to 'lib/urldata.h')
-rw-r--r--lib/urldata.h27
1 files changed, 18 insertions, 9 deletions
diff --git a/lib/urldata.h b/lib/urldata.h
index 2d0f46a17..681fef1fb 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -892,6 +892,23 @@ struct proxy_info {
char *passwd; /* proxy password string, allocated */
};
+#define CONNECT_BUFFER_SIZE 16384
+
+/* struct for HTTP CONNECT state data */
+struct http_connect_state {
+ char connect_buffer[CONNECT_BUFFER_SIZE];
+ int perline; /* count bytes per line */
+ int keepon;
+ char *line_start;
+ char *ptr; /* where to store more data */
+ curl_off_t cl; /* size of content to read and ignore */
+ enum {
+ TUNNEL_INIT, /* init/default/no tunnel state */
+ TUNNEL_CONNECT, /* CONNECT has been sent off */
+ TUNNEL_COMPLETE /* CONNECT response received completely */
+ } tunnel_state;
+};
+
/*
* The connectdata struct contains all fields and variables that should be
* unique for an entire connection.
@@ -1134,17 +1151,9 @@ struct connectdata {
char *localdev;
unsigned short localport;
int localportrange;
-
- /* tunnel as in tunnel through a HTTP proxy with CONNECT */
- enum {
- TUNNEL_INIT, /* init/default/no tunnel state */
- TUNNEL_CONNECT, /* CONNECT has been sent off */
- TUNNEL_COMPLETE /* CONNECT response received completely */
- } tunnel_state[2]; /* two separate ones to allow FTP */
+ struct http_connect_state *connect_state; /* for HTTP CONNECT */
struct connectbundle *bundle; /* The bundle we are member of */
-
int negnpn; /* APLN or NPN TLS negotiated protocol, CURL_HTTP_VERSION* */
- char *connect_buffer; /* for CONNECT business */
#ifdef USE_UNIX_SOCKETS
char *unix_domain_socket;