Fossil SCM

Improvements to HTTP redirect on sync.

drh 2014-12-16 02:37 trunk
Commit 3a00b612d449eaf37e6ba786b8105f61b29d17ff
2 files changed +2 -2 +2 -1
+2 -2
--- src/http.c
+++ src/http.c
@@ -336,17 +336,17 @@
336336
j = strlen(zLine) - 1;
337337
while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
338338
j -= 4;
339339
zLine[j] = 0;
340340
}
341
+ transport_close(&g.url);
342
+ transport_global_shutdown(&g.url);
341343
fossil_print("redirect to %s\n", &zLine[i]);
342344
url_parse(&zLine[i], 0);
343345
fSeenHttpAuth = 0;
344346
if( g.zHttpAuth ) free(g.zHttpAuth);
345347
g.zHttpAuth = get_httpauth();
346
- transport_close(&g.url);
347
- transport_global_shutdown(&g.url);
348348
return http_exchange(pSend, pReply, useLogin, maxRedirect);
349349
}else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
350350
if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){
351351
isCompressed = 0;
352352
}else if( fossil_strnicmp(&zLine[14],
353353
--- src/http.c
+++ src/http.c
@@ -336,17 +336,17 @@
336 j = strlen(zLine) - 1;
337 while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
338 j -= 4;
339 zLine[j] = 0;
340 }
 
 
341 fossil_print("redirect to %s\n", &zLine[i]);
342 url_parse(&zLine[i], 0);
343 fSeenHttpAuth = 0;
344 if( g.zHttpAuth ) free(g.zHttpAuth);
345 g.zHttpAuth = get_httpauth();
346 transport_close(&g.url);
347 transport_global_shutdown(&g.url);
348 return http_exchange(pSend, pReply, useLogin, maxRedirect);
349 }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
350 if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){
351 isCompressed = 0;
352 }else if( fossil_strnicmp(&zLine[14],
353
--- src/http.c
+++ src/http.c
@@ -336,17 +336,17 @@
336 j = strlen(zLine) - 1;
337 while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){
338 j -= 4;
339 zLine[j] = 0;
340 }
341 transport_close(&g.url);
342 transport_global_shutdown(&g.url);
343 fossil_print("redirect to %s\n", &zLine[i]);
344 url_parse(&zLine[i], 0);
345 fSeenHttpAuth = 0;
346 if( g.zHttpAuth ) free(g.zHttpAuth);
347 g.zHttpAuth = get_httpauth();
 
 
348 return http_exchange(pSend, pReply, useLogin, maxRedirect);
349 }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){
350 if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){
351 isCompressed = 0;
352 }else if( fossil_strnicmp(&zLine[14],
353
+2 -1
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -41,11 +41,11 @@
4141
** There can only be a single OpenSSL IO connection open at a time.
4242
** State information about that IO is stored in the following
4343
** local variables:
4444
*/
4545
static int sslIsInit = 0; /* True after global initialization */
46
-static BIO *iBio; /* OpenSSL I/O abstraction */
46
+static BIO *iBio = 0; /* OpenSSL I/O abstraction */
4747
static char *sslErrMsg = 0; /* Text of most recent OpenSSL error */
4848
static SSL_CTX *sslCtx; /* SSL context */
4949
static SSL *ssl;
5050
5151
@@ -171,10 +171,11 @@
171171
*/
172172
void ssl_close(void){
173173
if( iBio!=NULL ){
174174
(void)BIO_reset(iBio);
175175
BIO_free_all(iBio);
176
+ iBio = NULL;
176177
}
177178
}
178179
179180
/* See RFC2817 for details */
180181
static int establish_proxy_tunnel(UrlData *pUrlData, BIO *bio){
181182
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -41,11 +41,11 @@
41 ** There can only be a single OpenSSL IO connection open at a time.
42 ** State information about that IO is stored in the following
43 ** local variables:
44 */
45 static int sslIsInit = 0; /* True after global initialization */
46 static BIO *iBio; /* OpenSSL I/O abstraction */
47 static char *sslErrMsg = 0; /* Text of most recent OpenSSL error */
48 static SSL_CTX *sslCtx; /* SSL context */
49 static SSL *ssl;
50
51
@@ -171,10 +171,11 @@
171 */
172 void ssl_close(void){
173 if( iBio!=NULL ){
174 (void)BIO_reset(iBio);
175 BIO_free_all(iBio);
 
176 }
177 }
178
179 /* See RFC2817 for details */
180 static int establish_proxy_tunnel(UrlData *pUrlData, BIO *bio){
181
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -41,11 +41,11 @@
41 ** There can only be a single OpenSSL IO connection open at a time.
42 ** State information about that IO is stored in the following
43 ** local variables:
44 */
45 static int sslIsInit = 0; /* True after global initialization */
46 static BIO *iBio = 0; /* OpenSSL I/O abstraction */
47 static char *sslErrMsg = 0; /* Text of most recent OpenSSL error */
48 static SSL_CTX *sslCtx; /* SSL context */
49 static SSL *ssl;
50
51
@@ -171,10 +171,11 @@
171 */
172 void ssl_close(void){
173 if( iBio!=NULL ){
174 (void)BIO_reset(iBio);
175 BIO_free_all(iBio);
176 iBio = NULL;
177 }
178 }
179
180 /* See RFC2817 for details */
181 static int establish_proxy_tunnel(UrlData *pUrlData, BIO *bio){
182

Keyboard Shortcuts

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