Fossil SCM

Add keep-alive for unauthenticated proxy tunnels. Remove port number from host.

jan 2013-10-17 09:31 UTC jan-httpsproxytunnel
Commit ca61c5e992a1513e209474bd4b4f9a54d3e3ffe4
1 file changed +5 -4
+5 -4
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -181,18 +181,19 @@
181181
char *connStr, *bbuf;
182182
Blob reply;
183183
int done=0,end=0;
184184
if( !g.urlProxyAuth ){
185185
connStr = mprintf("CONNECT %s:%d HTTP/1.1\r\n"
186
- "Host: %s:%d\r\n\r\n", g.urlHostname, g.proxyOrigPort,
187
- g.urlHostname, g.proxyOrigPort);
186
+ "Host: %s\r\n\r\n"
187
+ "Proxy-Connection: keep-alive\r\n", g.urlHostname, g.proxyOrigPort,
188
+ g.urlHostname);
188189
}else{
189190
connStr = mprintf("CONNECT %s:%d HTTP/1.1\r\n"
190
- "Host: %s:%d\r\n"
191
+ "Host: %s\r\n"
191192
"Proxy-Connection: keep-alive\r\n"
192193
"Proxy-Authorization: %s\r\n\r\n", g.urlHostname, g.proxyOrigPort,
193
- g.urlHostname, g.proxyOrigPort, g.urlProxyAuth);
194
+ g.urlHostname, g.urlProxyAuth);
194195
}
195196
BIO_write(bio, connStr, strlen(connStr));
196197
free(connStr);
197198
198199
/* Wait for end of reply */
199200
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -181,18 +181,19 @@
181 char *connStr, *bbuf;
182 Blob reply;
183 int done=0,end=0;
184 if( !g.urlProxyAuth ){
185 connStr = mprintf("CONNECT %s:%d HTTP/1.1\r\n"
186 "Host: %s:%d\r\n\r\n", g.urlHostname, g.proxyOrigPort,
187 g.urlHostname, g.proxyOrigPort);
 
188 }else{
189 connStr = mprintf("CONNECT %s:%d HTTP/1.1\r\n"
190 "Host: %s:%d\r\n"
191 "Proxy-Connection: keep-alive\r\n"
192 "Proxy-Authorization: %s\r\n\r\n", g.urlHostname, g.proxyOrigPort,
193 g.urlHostname, g.proxyOrigPort, g.urlProxyAuth);
194 }
195 BIO_write(bio, connStr, strlen(connStr));
196 free(connStr);
197
198 /* Wait for end of reply */
199
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -181,18 +181,19 @@
181 char *connStr, *bbuf;
182 Blob reply;
183 int done=0,end=0;
184 if( !g.urlProxyAuth ){
185 connStr = mprintf("CONNECT %s:%d HTTP/1.1\r\n"
186 "Host: %s\r\n\r\n"
187 "Proxy-Connection: keep-alive\r\n", g.urlHostname, g.proxyOrigPort,
188 g.urlHostname);
189 }else{
190 connStr = mprintf("CONNECT %s:%d HTTP/1.1\r\n"
191 "Host: %s\r\n"
192 "Proxy-Connection: keep-alive\r\n"
193 "Proxy-Authorization: %s\r\n\r\n", g.urlHostname, g.proxyOrigPort,
194 g.urlHostname, g.urlProxyAuth);
195 }
196 BIO_write(bio, connStr, strlen(connStr));
197 free(connStr);
198
199 /* Wait for end of reply */
200

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button