Fossil SCM

Make a sync round-trip fail when the reply is empty. Previously "fossil sync", "fossil push" and "fossil clone" reported success when the request never reached a Fossil server.

dmestas 2026-11-12 04:04 UTC small-fixes
Commit 516bb19ea81589e05aab1b6d463ce9c203f33c41ed9d956a245ac220b0323a99
1 file changed +12
+12
--- src/xfer.c
+++ src/xfer.c
@@ -2431,10 +2431,22 @@
24312431
if( http_exchange(&send, &recv, mHttpFlags, MAX_REDIRECTS, 0) ){
24322432
nErr++;
24332433
go = 2;
24342434
break;
24352435
}
2436
+
2437
+ /* Every reply from a Fossil server holds at least one card: the
2438
+ ** "# timestamp" line that ends a normal reply, or an "error" card.
2439
+ ** A reply with no content at all means that the request never reached
2440
+ ** a Fossil server, or that the reply was lost on the way back. Either
2441
+ ** way the round-trip failed. */
2442
+ if( blob_size(&recv)==0 ){
2443
+ fossil_warning("server sent an empty reply");
2444
+ nErr++;
2445
+ go = 2;
2446
+ break;
2447
+ }
24362448
24372449
/* Remember the URL of the sync target in the config file on the
24382450
** first successful round-trip */
24392451
if( nCycle==0 && db_is_writeable("repository") ){
24402452
xfer_syncwith(g.url.canonical, 0);
24412453
--- src/xfer.c
+++ src/xfer.c
@@ -2431,10 +2431,22 @@
2431 if( http_exchange(&send, &recv, mHttpFlags, MAX_REDIRECTS, 0) ){
2432 nErr++;
2433 go = 2;
2434 break;
2435 }
 
 
 
 
 
 
 
 
 
 
 
 
2436
2437 /* Remember the URL of the sync target in the config file on the
2438 ** first successful round-trip */
2439 if( nCycle==0 && db_is_writeable("repository") ){
2440 xfer_syncwith(g.url.canonical, 0);
2441
--- src/xfer.c
+++ src/xfer.c
@@ -2431,10 +2431,22 @@
2431 if( http_exchange(&send, &recv, mHttpFlags, MAX_REDIRECTS, 0) ){
2432 nErr++;
2433 go = 2;
2434 break;
2435 }
2436
2437 /* Every reply from a Fossil server holds at least one card: the
2438 ** "# timestamp" line that ends a normal reply, or an "error" card.
2439 ** A reply with no content at all means that the request never reached
2440 ** a Fossil server, or that the reply was lost on the way back. Either
2441 ** way the round-trip failed. */
2442 if( blob_size(&recv)==0 ){
2443 fossil_warning("server sent an empty reply");
2444 nErr++;
2445 go = 2;
2446 break;
2447 }
2448
2449 /* Remember the URL of the sync target in the config file on the
2450 ** first successful round-trip */
2451 if( nCycle==0 && db_is_writeable("repository") ){
2452 xfer_syncwith(g.url.canonical, 0);
2453

Keyboard Shortcuts

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