Fossil SCM
Sync server sends back private igot messages for private phantoms.
Commit
81445afb5ca1972405e900a763fadfd28c3bd418d8c3a2be465a3feade2e769f
Parent
ec93507424a5724…
1 file changed
+13
-13
+13
-13
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -527,10 +527,23 @@ | ||
| 527 | 527 | static void send_file(Xfer *pXfer, int rid, Blob *pUuid, int nativeDelta){ |
| 528 | 528 | Blob content, uuid; |
| 529 | 529 | int size = 0; |
| 530 | 530 | int isPriv = content_is_private(rid); |
| 531 | 531 | |
| 532 | + if( isPriv && pXfer->syncPrivate==0 ){ | |
| 533 | + if( pXfer->remoteDate>=20200413 && pUuid && blob_size(pUuid)>0 ){ | |
| 534 | + /* If the artifact is private and we are not doing a private sync, | |
| 535 | + ** at least tell the other side that the artifact exists and is | |
| 536 | + ** known to be private. But only do this for newer clients since | |
| 537 | + ** older ones will throw an error if they get a private igot card | |
| 538 | + ** and private syncing is disallowed */ | |
| 539 | + blob_appendf(pXfer->pOut, "igot %b 1\n", pUuid); | |
| 540 | + pXfer->nIGotSent++; | |
| 541 | + pXfer->nPrivIGot++; | |
| 542 | + } | |
| 543 | + return; | |
| 544 | + } | |
| 532 | 545 | if( db_exists("SELECT 1 FROM onremote WHERE rid=%d", rid) ){ |
| 533 | 546 | return; |
| 534 | 547 | } |
| 535 | 548 | blob_zero(&uuid); |
| 536 | 549 | db_blob(&uuid, "SELECT uuid FROM blob WHERE rid=%d AND size>=0", rid); |
| @@ -549,23 +562,10 @@ | ||
| 549 | 562 | }else{ |
| 550 | 563 | pUuid = &uuid; |
| 551 | 564 | } |
| 552 | 565 | if( uuid_is_shunned(blob_str(pUuid)) ){ |
| 553 | 566 | blob_reset(&uuid); |
| 554 | - return; | |
| 555 | - } | |
| 556 | - if( isPriv && pXfer->syncPrivate==0 ){ | |
| 557 | - if( pXfer->remoteDate>=20200413 ){ | |
| 558 | - /* If the artifact is private and we are not doing a private sync, | |
| 559 | - ** at least tell the other side that the artifact exists and is | |
| 560 | - ** known to be private. But only do this for newer clients since | |
| 561 | - ** older ones will throw an error if they get a private igot card | |
| 562 | - ** and private syncing is disallowed */ | |
| 563 | - blob_appendf(pXfer->pOut, "igot %b 1\n", pUuid); | |
| 564 | - pXfer->nIGotSent++; | |
| 565 | - pXfer->nPrivIGot++; | |
| 566 | - } | |
| 567 | 567 | return; |
| 568 | 568 | } |
| 569 | 569 | if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) || |
| 570 | 570 | pXfer->mxSend<=blob_size(pXfer->pOut) ){ |
| 571 | 571 | const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n"; |
| 572 | 572 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -527,10 +527,23 @@ | |
| 527 | static void send_file(Xfer *pXfer, int rid, Blob *pUuid, int nativeDelta){ |
| 528 | Blob content, uuid; |
| 529 | int size = 0; |
| 530 | int isPriv = content_is_private(rid); |
| 531 | |
| 532 | if( db_exists("SELECT 1 FROM onremote WHERE rid=%d", rid) ){ |
| 533 | return; |
| 534 | } |
| 535 | blob_zero(&uuid); |
| 536 | db_blob(&uuid, "SELECT uuid FROM blob WHERE rid=%d AND size>=0", rid); |
| @@ -549,23 +562,10 @@ | |
| 549 | }else{ |
| 550 | pUuid = &uuid; |
| 551 | } |
| 552 | if( uuid_is_shunned(blob_str(pUuid)) ){ |
| 553 | blob_reset(&uuid); |
| 554 | return; |
| 555 | } |
| 556 | if( isPriv && pXfer->syncPrivate==0 ){ |
| 557 | if( pXfer->remoteDate>=20200413 ){ |
| 558 | /* If the artifact is private and we are not doing a private sync, |
| 559 | ** at least tell the other side that the artifact exists and is |
| 560 | ** known to be private. But only do this for newer clients since |
| 561 | ** older ones will throw an error if they get a private igot card |
| 562 | ** and private syncing is disallowed */ |
| 563 | blob_appendf(pXfer->pOut, "igot %b 1\n", pUuid); |
| 564 | pXfer->nIGotSent++; |
| 565 | pXfer->nPrivIGot++; |
| 566 | } |
| 567 | return; |
| 568 | } |
| 569 | if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) || |
| 570 | pXfer->mxSend<=blob_size(pXfer->pOut) ){ |
| 571 | const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n"; |
| 572 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -527,10 +527,23 @@ | |
| 527 | static void send_file(Xfer *pXfer, int rid, Blob *pUuid, int nativeDelta){ |
| 528 | Blob content, uuid; |
| 529 | int size = 0; |
| 530 | int isPriv = content_is_private(rid); |
| 531 | |
| 532 | if( isPriv && pXfer->syncPrivate==0 ){ |
| 533 | if( pXfer->remoteDate>=20200413 && pUuid && blob_size(pUuid)>0 ){ |
| 534 | /* If the artifact is private and we are not doing a private sync, |
| 535 | ** at least tell the other side that the artifact exists and is |
| 536 | ** known to be private. But only do this for newer clients since |
| 537 | ** older ones will throw an error if they get a private igot card |
| 538 | ** and private syncing is disallowed */ |
| 539 | blob_appendf(pXfer->pOut, "igot %b 1\n", pUuid); |
| 540 | pXfer->nIGotSent++; |
| 541 | pXfer->nPrivIGot++; |
| 542 | } |
| 543 | return; |
| 544 | } |
| 545 | if( db_exists("SELECT 1 FROM onremote WHERE rid=%d", rid) ){ |
| 546 | return; |
| 547 | } |
| 548 | blob_zero(&uuid); |
| 549 | db_blob(&uuid, "SELECT uuid FROM blob WHERE rid=%d AND size>=0", rid); |
| @@ -549,23 +562,10 @@ | |
| 562 | }else{ |
| 563 | pUuid = &uuid; |
| 564 | } |
| 565 | if( uuid_is_shunned(blob_str(pUuid)) ){ |
| 566 | blob_reset(&uuid); |
| 567 | return; |
| 568 | } |
| 569 | if( (pXfer->maxTime != -1 && time(NULL) >= pXfer->maxTime) || |
| 570 | pXfer->mxSend<=blob_size(pXfer->pOut) ){ |
| 571 | const char *zFormat = isPriv ? "igot %b 1\n" : "igot %b\n"; |
| 572 |