Fossil SCM
Handle HTTP 1.1 1xx messages such as "100 Continue" instead of erroring
Commit
095976a13e6f364826417b26f64f96c363d87809222dabe1ed327b59d489a67d
Parent
62dc86c2315bf3c…
1 file changed
+7
+7
| --- src/http.c | ||
| +++ src/http.c | ||
| @@ -568,10 +568,17 @@ | ||
| 568 | 568 | if( mHttpFlags & HTTP_VERBOSE ){ |
| 569 | 569 | fossil_print("Read: [%s]\n", zLine); |
| 570 | 570 | } |
| 571 | 571 | if( fossil_strnicmp(zLine, "http/1.", 7)==0 ){ |
| 572 | 572 | if( sscanf(zLine, "HTTP/1.%d %d", &iHttpVersion, &rc)!=2 ) goto write_err; |
| 573 | + if( rc/100==1 ){ | |
| 574 | + /* Parse and discard an unexpected 1xx interim reply, most commonly "100 Continue". | |
| 575 | + ** Skip the remaining header lines of the reply. (A 1xx reply has no body.) */ | |
| 576 | + while( (zLine = transport_receive_line(&g.url))!=0 && zLine[0]!=0 ){} | |
| 577 | + if( zLine==0 ) goto write_err; | |
| 578 | + continue; | |
| 579 | + } | |
| 573 | 580 | if( rc==401 ){ |
| 574 | 581 | if( fSeenHttpAuth++ < MAX_HTTP_AUTH ){ |
| 575 | 582 | if( g.zHttpAuth ){ |
| 576 | 583 | if( g.zHttpAuth ) free(g.zHttpAuth); |
| 577 | 584 | } |
| 578 | 585 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -568,10 +568,17 @@ | |
| 568 | if( mHttpFlags & HTTP_VERBOSE ){ |
| 569 | fossil_print("Read: [%s]\n", zLine); |
| 570 | } |
| 571 | if( fossil_strnicmp(zLine, "http/1.", 7)==0 ){ |
| 572 | if( sscanf(zLine, "HTTP/1.%d %d", &iHttpVersion, &rc)!=2 ) goto write_err; |
| 573 | if( rc==401 ){ |
| 574 | if( fSeenHttpAuth++ < MAX_HTTP_AUTH ){ |
| 575 | if( g.zHttpAuth ){ |
| 576 | if( g.zHttpAuth ) free(g.zHttpAuth); |
| 577 | } |
| 578 |
| --- src/http.c | |
| +++ src/http.c | |
| @@ -568,10 +568,17 @@ | |
| 568 | if( mHttpFlags & HTTP_VERBOSE ){ |
| 569 | fossil_print("Read: [%s]\n", zLine); |
| 570 | } |
| 571 | if( fossil_strnicmp(zLine, "http/1.", 7)==0 ){ |
| 572 | if( sscanf(zLine, "HTTP/1.%d %d", &iHttpVersion, &rc)!=2 ) goto write_err; |
| 573 | if( rc/100==1 ){ |
| 574 | /* Parse and discard an unexpected 1xx interim reply, most commonly "100 Continue". |
| 575 | ** Skip the remaining header lines of the reply. (A 1xx reply has no body.) */ |
| 576 | while( (zLine = transport_receive_line(&g.url))!=0 && zLine[0]!=0 ){} |
| 577 | if( zLine==0 ) goto write_err; |
| 578 | continue; |
| 579 | } |
| 580 | if( rc==401 ){ |
| 581 | if( fSeenHttpAuth++ < MAX_HTTP_AUTH ){ |
| 582 | if( g.zHttpAuth ){ |
| 583 | if( g.zHttpAuth ) free(g.zHttpAuth); |
| 584 | } |
| 585 |