Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | More fixes to the transfer protocol for reporting on private phantoms. |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
ec93507424a572459b1d034f9f6ff64f |
| User & Date: | drh 2020-04-13 15:20:44.919 |
Context
|
2020-04-13
| ||
| 16:56 | Sync server sends back private igot messages for private phantoms. check-in: 81445afb5c user: drh tags: trunk | |
| 15:20 | More fixes to the transfer protocol for reporting on private phantoms. check-in: ec93507424 user: drh tags: trunk | |
| 15:01 | Correctly handle private igot cards received in the server reply. check-in: 50a7f89a77 user: drh tags: trunk | |
Changes
Changes to src/xfer.c.
| ︙ | ︙ | |||
1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 |
*/
if( xfer.nToken>=2
&& blob_eq(&xfer.aToken[0], "igot")
&& blob_is_hname(&xfer.aToken[1])
){
if( isPush ){
int rid = 0;
if( xfer.nToken==2 || blob_eq(&xfer.aToken[2],"1")==0 ){
/* Client says the artifact is public */
rid = rid_from_uuid(&xfer.aToken[1], 1, 0);
}else if( g.perm.Private ){
/* Client says the artifact is private and the client has
** permission to push private content. Create a new phantom
** artifact that is marked private. */
rid = rid_from_uuid(&xfer.aToken[1], 1, 1);
}else{
/* Client says the artifact is private and the client is unable
** or unwilling to send us the artifact. If we already hold the
** artifact here on the server as a phantom, make sure that
** phantom is marked as private so that we don't keep asking about
** it in subsequent sync requests. */
rid = rid_from_uuid(&xfer.aToken[1], 0, 1);
| > > > > | > > > > < | 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 |
*/
if( xfer.nToken>=2
&& blob_eq(&xfer.aToken[0], "igot")
&& blob_is_hname(&xfer.aToken[1])
){
if( isPush ){
int rid = 0;
int isPriv = 0;
if( xfer.nToken==2 || blob_eq(&xfer.aToken[2],"1")==0 ){
/* Client says the artifact is public */
rid = rid_from_uuid(&xfer.aToken[1], 1, 0);
}else if( g.perm.Private ){
/* Client says the artifact is private and the client has
** permission to push private content. Create a new phantom
** artifact that is marked private. */
rid = rid_from_uuid(&xfer.aToken[1], 1, 1);
isPriv = 1;
}else{
/* Client says the artifact is private and the client is unable
** or unwilling to send us the artifact. If we already hold the
** artifact here on the server as a phantom, make sure that
** phantom is marked as private so that we don't keep asking about
** it in subsequent sync requests. */
rid = rid_from_uuid(&xfer.aToken[1], 0, 1);
isPriv = 1;
}
if( rid ){
remote_has(rid);
if( isPriv ){
content_make_private(rid);
}else{
content_make_public(rid);
}
}
}
}else
/* pull SERVERCODE PROJECTCODE
** push SERVERCODE PROJECTCODE
**
|
| ︙ | ︙ | |||
2440 2441 2442 2443 2444 2445 2446 |
if( blob_eq(&xfer.aToken[0], "pragma") && xfer.nToken>=2 ){
/* pragma server-version VERSION ?DATE? ?TIME?
**
** The servger announces to the server what version of Fossil it
** is running. The DATE and TIME are a pure numeric ISO8601 time
** for the specific check-in of the client.
*/
| | | 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 |
if( blob_eq(&xfer.aToken[0], "pragma") && xfer.nToken>=2 ){
/* pragma server-version VERSION ?DATE? ?TIME?
**
** The servger announces to the server what version of Fossil it
** is running. The DATE and TIME are a pure numeric ISO8601 time
** for the specific check-in of the client.
*/
if( xfer.nToken>=3 && blob_eq(&xfer.aToken[1], "server-version") ){
xfer.remoteVersion = atoi(blob_str(&xfer.aToken[2]));
if( xfer.nToken>=5 ){
xfer.remoteDate = atoi(blob_str(&xfer.aToken[3]));
xfer.remoteTime = atoi(blob_str(&xfer.aToken[4]));
}
}
|
| ︙ | ︙ | |||
2575 2576 2577 2578 2579 2580 2581 |
xfer.nFileRcvd = 0;
xfer.nDeltaRcvd = 0;
xfer.nDanglingFile = 0;
/* If we have one or more files queued to send, then go
** another round
*/
| | > | 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 |
xfer.nFileRcvd = 0;
xfer.nDeltaRcvd = 0;
xfer.nDanglingFile = 0;
/* If we have one or more files queued to send, then go
** another round
*/
if( xfer.nFileSent+xfer.nDeltaSent>0 || uvDoPush ){
go = 1;
}
if( xfer.nPrivIGot>0 && nCycle==1 ) go = 1;
/* If this is a clone, the go at least two rounds */
if( (syncFlags & SYNC_CLONE)!=0 && nCycle==1 ) go = 1;
/* Stop the cycle if the server sends a "clone_seqno 0" card and
** we have gone at least two rounds. Always go at least two rounds
** on a clone in order to be sure to retrieve the configuration
|
| ︙ | ︙ |