Fossil SCM
In send_file(), do not send an artifact whose content cannot be rebuilt because it is a delta from something that has not arrived. A "file" card with no content was sent for it, which the receiver refused as having the wrong hash, so the sync failed.
Commit
24256a040bb9a6b8e6d6e06c0f94180f241405e3500abb24051b7551ee6bc6ed
Parent
c319e8744de96ca…
1 file changed
+7
-1
+7
-1
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -608,11 +608,17 @@ | ||
| 608 | 608 | if( size ){ |
| 609 | 609 | pXfer->nDeltaSent++; |
| 610 | 610 | } |
| 611 | 611 | } |
| 612 | 612 | if( size==0 ){ |
| 613 | - content_get(rid, &content); | |
| 613 | + if( content_get(rid, &content)==0 ){ | |
| 614 | + /* A delta whose source has not arrived yet. The content cannot | |
| 615 | + ** be rebuilt, so there is nothing that can be sent. */ | |
| 616 | + blob_reset(&content); | |
| 617 | + blob_reset(&uuid); | |
| 618 | + return; | |
| 619 | + } | |
| 614 | 620 | |
| 615 | 621 | if( !nativeDelta && blob_size(&content)>100 ){ |
| 616 | 622 | size = send_delta_parent(pXfer, rid, isPriv, &content, pUuid); |
| 617 | 623 | } |
| 618 | 624 | if( size==0 ){ |
| 619 | 625 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -608,11 +608,17 @@ | |
| 608 | if( size ){ |
| 609 | pXfer->nDeltaSent++; |
| 610 | } |
| 611 | } |
| 612 | if( size==0 ){ |
| 613 | content_get(rid, &content); |
| 614 | |
| 615 | if( !nativeDelta && blob_size(&content)>100 ){ |
| 616 | size = send_delta_parent(pXfer, rid, isPriv, &content, pUuid); |
| 617 | } |
| 618 | if( size==0 ){ |
| 619 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -608,11 +608,17 @@ | |
| 608 | if( size ){ |
| 609 | pXfer->nDeltaSent++; |
| 610 | } |
| 611 | } |
| 612 | if( size==0 ){ |
| 613 | if( content_get(rid, &content)==0 ){ |
| 614 | /* A delta whose source has not arrived yet. The content cannot |
| 615 | ** be rebuilt, so there is nothing that can be sent. */ |
| 616 | blob_reset(&content); |
| 617 | blob_reset(&uuid); |
| 618 | return; |
| 619 | } |
| 620 | |
| 621 | if( !nativeDelta && blob_size(&content)>100 ){ |
| 622 | size = send_delta_parent(pXfer, rid, isPriv, &content, pUuid); |
| 623 | } |
| 624 | if( size==0 ){ |
| 625 |