Fossil SCM
Improvements to HTTP redirect on sync.
Commit
3a00b612d449eaf37e6ba786b8105f61b29d17ff
Parent
c556f8c61cb11f9…
2 files changed
+2
-2
+2
-1
+2
-2
| --- src/http.c | ||
| +++ src/http.c | ||
| @@ -336,17 +336,17 @@ | ||
| 336 | 336 | j = strlen(zLine) - 1; |
| 337 | 337 | while( j>4 && fossil_strcmp(&zLine[j-4],"/xfer")==0 ){ |
| 338 | 338 | j -= 4; |
| 339 | 339 | zLine[j] = 0; |
| 340 | 340 | } |
| 341 | + transport_close(&g.url); | |
| 342 | + transport_global_shutdown(&g.url); | |
| 341 | 343 | fossil_print("redirect to %s\n", &zLine[i]); |
| 342 | 344 | url_parse(&zLine[i], 0); |
| 343 | 345 | fSeenHttpAuth = 0; |
| 344 | 346 | if( g.zHttpAuth ) free(g.zHttpAuth); |
| 345 | 347 | g.zHttpAuth = get_httpauth(); |
| 346 | - transport_close(&g.url); | |
| 347 | - transport_global_shutdown(&g.url); | |
| 348 | 348 | return http_exchange(pSend, pReply, useLogin, maxRedirect); |
| 349 | 349 | }else if( fossil_strnicmp(zLine, "content-type: ", 14)==0 ){ |
| 350 | 350 | if( fossil_strnicmp(&zLine[14], "application/x-fossil-debug", -1)==0 ){ |
| 351 | 351 | isCompressed = 0; |
| 352 | 352 | }else if( fossil_strnicmp(&zLine[14], |
| 353 | 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 | 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 @@ | ||
| 41 | 41 | ** There can only be a single OpenSSL IO connection open at a time. |
| 42 | 42 | ** State information about that IO is stored in the following |
| 43 | 43 | ** local variables: |
| 44 | 44 | */ |
| 45 | 45 | 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 */ | |
| 47 | 47 | static char *sslErrMsg = 0; /* Text of most recent OpenSSL error */ |
| 48 | 48 | static SSL_CTX *sslCtx; /* SSL context */ |
| 49 | 49 | static SSL *ssl; |
| 50 | 50 | |
| 51 | 51 | |
| @@ -171,10 +171,11 @@ | ||
| 171 | 171 | */ |
| 172 | 172 | void ssl_close(void){ |
| 173 | 173 | if( iBio!=NULL ){ |
| 174 | 174 | (void)BIO_reset(iBio); |
| 175 | 175 | BIO_free_all(iBio); |
| 176 | + iBio = NULL; | |
| 176 | 177 | } |
| 177 | 178 | } |
| 178 | 179 | |
| 179 | 180 | /* See RFC2817 for details */ |
| 180 | 181 | static int establish_proxy_tunnel(UrlData *pUrlData, BIO *bio){ |
| 181 | 182 |
| --- 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 |