Fossil SCM
Don't use global data any more in establish_proxy_tunnel()
Commit
12e917a1cd150b98ae24d7311ec5a227307d7cd4
Parent
1f1848dd07aa5e2…
1 file changed
+7
-7
+7
-7
| --- src/http_ssl.c | ||
| +++ src/http_ssl.c | ||
| @@ -175,21 +175,21 @@ | ||
| 175 | 175 | BIO_free_all(iBio); |
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | /* See RFC2817 for details */ |
| 180 | -static int establish_proxy_tunnel(BIO *bio){ | |
| 180 | +static int establish_proxy_tunnel(UrlData *pUrlData, BIO *bio){ | |
| 181 | 181 | int rc, httpVerMin; |
| 182 | 182 | char *bbuf; |
| 183 | 183 | Blob snd, reply; |
| 184 | 184 | int done=0,end=0; |
| 185 | 185 | blob_zero(&snd); |
| 186 | - blob_appendf(&snd, "CONNECT %s:%d HTTP/1.1\r\n", g.urlHostname, | |
| 187 | - g.proxyOrigPort); | |
| 188 | - blob_appendf(&snd, "Host: %s:%d\r\n", g.urlHostname, g.proxyOrigPort); | |
| 189 | - if( g.urlProxyAuth ){ | |
| 190 | - blob_appendf(&snd, "Proxy-Authorization: %s\r\n", g.urlProxyAuth); | |
| 186 | + blob_appendf(&snd, "CONNECT %s:%d HTTP/1.1\r\n", pUrlData->hostname, | |
| 187 | + pUrlData->proxyOrigPort); | |
| 188 | + blob_appendf(&snd, "Host: %s:%d\r\n", pUrlData->hostname, pUrlData->proxyOrigPort); | |
| 189 | + if( pUrlData->proxyAuth ){ | |
| 190 | + blob_appendf(&snd, "Proxy-Authorization: %s\r\n", pUrlData->proxyAuth); | |
| 191 | 191 | } |
| 192 | 192 | blob_append(&snd, "Proxy-Connection: keep-alive\r\n", -1); |
| 193 | 193 | blob_append(&snd, "User-Agent: Fossil/" RELEASE_VERSION "\r\n", -1); |
| 194 | 194 | blob_append(&snd, "\r\n", 2); |
| 195 | 195 | BIO_write(bio, blob_buffer(&snd), blob_size(&snd)); |
| @@ -262,11 +262,11 @@ | ||
| 262 | 262 | ssl_set_errmsg("SSL: cannot connect to proxy %s:%d (%s)", |
| 263 | 263 | pUrlData->name, pUrlData->port, ERR_reason_error_string(ERR_get_error())); |
| 264 | 264 | ssl_close(); |
| 265 | 265 | return 1; |
| 266 | 266 | } |
| 267 | - rc = establish_proxy_tunnel(sBio); | |
| 267 | + rc = establish_proxy_tunnel(pUrlData, sBio); | |
| 268 | 268 | if( rc<200||rc>299 ){ |
| 269 | 269 | ssl_set_errmsg("SSL: proxy connect failed with HTTP status code %d", rc); |
| 270 | 270 | return 1; |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 |
| --- src/http_ssl.c | |
| +++ src/http_ssl.c | |
| @@ -175,21 +175,21 @@ | |
| 175 | BIO_free_all(iBio); |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | /* See RFC2817 for details */ |
| 180 | static int establish_proxy_tunnel(BIO *bio){ |
| 181 | int rc, httpVerMin; |
| 182 | char *bbuf; |
| 183 | Blob snd, reply; |
| 184 | int done=0,end=0; |
| 185 | blob_zero(&snd); |
| 186 | blob_appendf(&snd, "CONNECT %s:%d HTTP/1.1\r\n", g.urlHostname, |
| 187 | g.proxyOrigPort); |
| 188 | blob_appendf(&snd, "Host: %s:%d\r\n", g.urlHostname, g.proxyOrigPort); |
| 189 | if( g.urlProxyAuth ){ |
| 190 | blob_appendf(&snd, "Proxy-Authorization: %s\r\n", g.urlProxyAuth); |
| 191 | } |
| 192 | blob_append(&snd, "Proxy-Connection: keep-alive\r\n", -1); |
| 193 | blob_append(&snd, "User-Agent: Fossil/" RELEASE_VERSION "\r\n", -1); |
| 194 | blob_append(&snd, "\r\n", 2); |
| 195 | BIO_write(bio, blob_buffer(&snd), blob_size(&snd)); |
| @@ -262,11 +262,11 @@ | |
| 262 | ssl_set_errmsg("SSL: cannot connect to proxy %s:%d (%s)", |
| 263 | pUrlData->name, pUrlData->port, ERR_reason_error_string(ERR_get_error())); |
| 264 | ssl_close(); |
| 265 | return 1; |
| 266 | } |
| 267 | rc = establish_proxy_tunnel(sBio); |
| 268 | if( rc<200||rc>299 ){ |
| 269 | ssl_set_errmsg("SSL: proxy connect failed with HTTP status code %d", rc); |
| 270 | return 1; |
| 271 | } |
| 272 | |
| 273 |
| --- src/http_ssl.c | |
| +++ src/http_ssl.c | |
| @@ -175,21 +175,21 @@ | |
| 175 | BIO_free_all(iBio); |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | /* See RFC2817 for details */ |
| 180 | static int establish_proxy_tunnel(UrlData *pUrlData, BIO *bio){ |
| 181 | int rc, httpVerMin; |
| 182 | char *bbuf; |
| 183 | Blob snd, reply; |
| 184 | int done=0,end=0; |
| 185 | blob_zero(&snd); |
| 186 | blob_appendf(&snd, "CONNECT %s:%d HTTP/1.1\r\n", pUrlData->hostname, |
| 187 | pUrlData->proxyOrigPort); |
| 188 | blob_appendf(&snd, "Host: %s:%d\r\n", pUrlData->hostname, pUrlData->proxyOrigPort); |
| 189 | if( pUrlData->proxyAuth ){ |
| 190 | blob_appendf(&snd, "Proxy-Authorization: %s\r\n", pUrlData->proxyAuth); |
| 191 | } |
| 192 | blob_append(&snd, "Proxy-Connection: keep-alive\r\n", -1); |
| 193 | blob_append(&snd, "User-Agent: Fossil/" RELEASE_VERSION "\r\n", -1); |
| 194 | blob_append(&snd, "\r\n", 2); |
| 195 | BIO_write(bio, blob_buffer(&snd), blob_size(&snd)); |
| @@ -262,11 +262,11 @@ | |
| 262 | ssl_set_errmsg("SSL: cannot connect to proxy %s:%d (%s)", |
| 263 | pUrlData->name, pUrlData->port, ERR_reason_error_string(ERR_get_error())); |
| 264 | ssl_close(); |
| 265 | return 1; |
| 266 | } |
| 267 | rc = establish_proxy_tunnel(pUrlData, sBio); |
| 268 | if( rc<200||rc>299 ){ |
| 269 | ssl_set_errmsg("SSL: proxy connect failed with HTTP status code %d", rc); |
| 270 | return 1; |
| 271 | } |
| 272 | |
| 273 |