Fossil SCM

Include User-Agent when connecting to proxy for https tunnels. Fixed a misplaced EOL.

jan 2013-10-17 10:04 jan-httpsproxytunnel
Commit 08b02fe828a1b8932b744e028a92317053fb510e
1 file changed +7 -5
+7 -5
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -181,19 +181,21 @@
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\r\n\r\n"
187
- "Proxy-Connection: keep-alive\r\n", g.urlHostname, g.proxyOrigPort,
188
- g.urlHostname);
186
+ "Host: %s\r\n"
187
+ "Proxy-Connection: keep-alive\r\n",
188
+ "User-Agent: Fossil/" RELEASE_VERSION "\r\n\r\n",
189
+ g.urlHostname, g.proxyOrigPort, g.urlHostname);
189190
}else{
190191
connStr = mprintf("CONNECT %s:%d HTTP/1.1\r\n"
191192
"Host: %s\r\n"
192193
"Proxy-Connection: keep-alive\r\n"
193
- "Proxy-Authorization: %s\r\n\r\n", g.urlHostname, g.proxyOrigPort,
194
- g.urlHostname, g.urlProxyAuth);
194
+ "User-Agent: Fossil/" RELEASE_VERSION "\r\n",
195
+ "Proxy-Authorization: %s\r\n\r\n",
196
+ g.urlHostname, g.proxyOrigPort, g.urlHostname, g.urlProxyAuth);
195197
}
196198
BIO_write(bio, connStr, strlen(connStr));
197199
free(connStr);
198200
199201
/* Wait for end of reply */
200202
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -181,19 +181,21 @@
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
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -181,19 +181,21 @@
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"
187 "Proxy-Connection: keep-alive\r\n",
188 "User-Agent: Fossil/" RELEASE_VERSION "\r\n\r\n",
189 g.urlHostname, g.proxyOrigPort, g.urlHostname);
190 }else{
191 connStr = mprintf("CONNECT %s:%d HTTP/1.1\r\n"
192 "Host: %s\r\n"
193 "Proxy-Connection: keep-alive\r\n"
194 "User-Agent: Fossil/" RELEASE_VERSION "\r\n",
195 "Proxy-Authorization: %s\r\n\r\n",
196 g.urlHostname, g.proxyOrigPort, g.urlHostname, g.urlProxyAuth);
197 }
198 BIO_write(bio, connStr, strlen(connStr));
199 free(connStr);
200
201 /* Wait for end of reply */
202

Keyboard Shortcuts

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