Fossil SCM

Handle HTTP 1.1 1xx messages such as "100 Continue" instead of erroring

danshearer 2026-07-27 13:12 UTC trunk
Commit 095976a13e6f364826417b26f64f96c363d87809222dabe1ed327b59d489a67d
1 file changed +7
+7
--- src/http.c
+++ src/http.c
@@ -568,10 +568,17 @@
568568
if( mHttpFlags & HTTP_VERBOSE ){
569569
fossil_print("Read: [%s]\n", zLine);
570570
}
571571
if( fossil_strnicmp(zLine, "http/1.", 7)==0 ){
572572
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
+ }
573580
if( rc==401 ){
574581
if( fSeenHttpAuth++ < MAX_HTTP_AUTH ){
575582
if( g.zHttpAuth ){
576583
if( g.zHttpAuth ) free(g.zHttpAuth);
577584
}
578585
--- 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

Keyboard Shortcuts

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