Fossil SCM
Output a warning if a client sync or clone gets back a keep-alive HTTP reply that lacks a content-length header.
Commit
f4ffefe708793b036dc1d4a3c3806cdb24de73362df532779d1a80375a6347ad
Parent
71919ad1b542832…
1 file changed
+3
+3
| --- src/http.c | ||
| +++ src/http.c | ||
| @@ -713,10 +713,13 @@ | ||
| 713 | 713 | pReply->nUsed = nPrior; |
| 714 | 714 | }while( iRecvLen==nReq && nReq<0x20000000 ); |
| 715 | 715 | if( mHttpFlags & HTTP_VERBOSE ){ |
| 716 | 716 | fossil_print("Reply received: %u bytes (w/o content-length)\n", nPrior); |
| 717 | 717 | } |
| 718 | + }else{ | |
| 719 | + assert( iLength<0 && !closeConnection ); | |
| 720 | + fossil_warning("\"content-length\" missing from %d keep-alive reply", rc); | |
| 718 | 721 | } |
| 719 | 722 | if( isError ){ |
| 720 | 723 | char *z; |
| 721 | 724 | int i, j; |
| 722 | 725 | z = blob_str(pReply); |
| 723 | 726 |
| --- 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 |