Fossil SCM

Output a warning if a client sync or clone gets back a keep-alive HTTP reply that lacks a content-length header.

drh 2024-04-17 14:02 trunk
Commit f4ffefe708793b036dc1d4a3c3806cdb24de73362df532779d1a80375a6347ad
1 file changed +3
+3
--- src/http.c
+++ src/http.c
@@ -713,10 +713,13 @@
713713
pReply->nUsed = nPrior;
714714
}while( iRecvLen==nReq && nReq<0x20000000 );
715715
if( mHttpFlags & HTTP_VERBOSE ){
716716
fossil_print("Reply received: %u bytes (w/o content-length)\n", nPrior);
717717
}
718
+ }else{
719
+ assert( iLength<0 && !closeConnection );
720
+ fossil_warning("\"content-length\" missing from %d keep-alive reply", rc);
718721
}
719722
if( isError ){
720723
char *z;
721724
int i, j;
722725
z = blob_str(pReply);
723726
--- src/http.c
+++ src/http.c
@@ -713,10 +713,13 @@
713 pReply->nUsed = nPrior;
714 }while( iRecvLen==nReq && nReq<0x20000000 );
715 if( mHttpFlags & HTTP_VERBOSE ){
716 fossil_print("Reply received: %u bytes (w/o content-length)\n", nPrior);
717 }
 
 
 
718 }
719 if( isError ){
720 char *z;
721 int i, j;
722 z = blob_str(pReply);
723
--- src/http.c
+++ src/http.c
@@ -713,10 +713,13 @@
713 pReply->nUsed = nPrior;
714 }while( iRecvLen==nReq && nReq<0x20000000 );
715 if( mHttpFlags & HTTP_VERBOSE ){
716 fossil_print("Reply received: %u bytes (w/o content-length)\n", nPrior);
717 }
718 }else{
719 assert( iLength<0 && !closeConnection );
720 fossil_warning("\"content-length\" missing from %d keep-alive reply", rc);
721 }
722 if( isError ){
723 char *z;
724 int i, j;
725 z = blob_str(pReply);
726

Keyboard Shortcuts

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