| | @@ -47,11 +47,10 @@ |
| 47 | 47 | int nFileRcvd; /* Number of files received */ |
| 48 | 48 | int nDeltaRcvd; /* Number of deltas received */ |
| 49 | 49 | int nDanglingFile; /* Number of dangling deltas received */ |
| 50 | 50 | int mxSend; /* Stop sending "file" when pOut reaches this size */ |
| 51 | 51 | int resync; /* Send igot cards for all holdings */ |
| 52 | | - int fHasFork; /* True if a fork has been seen */ |
| 53 | 52 | u8 syncPrivate; /* True to enable syncing private content */ |
| 54 | 53 | u8 nextIsPrivate; /* If true, next "file" received is a private */ |
| 55 | 54 | time_t maxTime; /* Time when this transfer should be finished */ |
| 56 | 55 | }; |
| 57 | 56 | |
| | @@ -203,14 +202,10 @@ |
| 203 | 202 | blob_appendf(&pXfer->err, "%s", g.zErrMsg); |
| 204 | 203 | blob_reset(&content); |
| 205 | 204 | }else{ |
| 206 | 205 | if( !isPriv ) content_make_public(rid); |
| 207 | 206 | manifest_crosslink(rid, &content, MC_NO_ERRORS); |
| 208 | | - if( cloneFlag==0 && |
| 209 | | - count_nonbranch_children(primary_parent_pid_from_rid(rid))>1 ){ |
| 210 | | - pXfer->fHasFork = 1; |
| 211 | | - } |
| 212 | 207 | } |
| 213 | 208 | assert( blob_is_reset(&content) ); |
| 214 | 209 | remote_has(rid); |
| 215 | 210 | } |
| 216 | 211 | |
| | @@ -283,14 +278,10 @@ |
| 283 | 278 | } |
| 284 | 279 | rid = content_put_ex(&content, blob_str(&pXfer->aToken[1]), srcid, |
| 285 | 280 | szC, isPriv); |
| 286 | 281 | Th_AppendToList(pzUuidList, pnUuidList, blob_str(&pXfer->aToken[1]), |
| 287 | 282 | blob_size(&pXfer->aToken[1])); |
| 288 | | - if( cloneFlag==0 && |
| 289 | | - count_nonbranch_children(primary_parent_pid_from_rid(rid))>1 ){ |
| 290 | | - pXfer->fHasFork = 1; |
| 291 | | - } |
| 292 | 283 | remote_has(rid); |
| 293 | 284 | blob_reset(&content); |
| 294 | 285 | } |
| 295 | 286 | |
| 296 | 287 | /* |
| | @@ -933,11 +924,10 @@ |
| 933 | 924 | */ |
| 934 | 925 | void page_xfer(void){ |
| 935 | 926 | int isPull = 0; |
| 936 | 927 | int isPush = 0; |
| 937 | 928 | int nErr = 0; |
| 938 | | - int fForkSeen = 0; /* True if fork was seen while receiving content */ |
| 939 | 929 | Xfer xfer; |
| 940 | 930 | int deltaFlag = 0; |
| 941 | 931 | int isClone = 0; |
| 942 | 932 | int nGimme = 0; |
| 943 | 933 | int size; |
| | @@ -988,11 +978,10 @@ |
| 988 | 978 | if( zScript ){ /* NOTE: Are TH1 transfer hooks enabled? */ |
| 989 | 979 | pzUuidList = &zUuidList; |
| 990 | 980 | pnUuidList = &nUuidList; |
| 991 | 981 | } |
| 992 | 982 | while( blob_line(xfer.pIn, &xfer.line) ){ |
| 993 | | - xfer.fHasFork = 0; |
| 994 | 983 | if( blob_buffer(&xfer.line)[0]=='#' ) continue; |
| 995 | 984 | if( blob_size(&xfer.line)==0 ) continue; |
| 996 | 985 | xfer.nToken = blob_tokenize(&xfer.line, xfer.aToken, count(xfer.aToken)); |
| 997 | 986 | |
| 998 | 987 | /* file UUID SIZE \n CONTENT |
| | @@ -1006,13 +995,10 @@ |
| 1006 | 995 | @ error not\sauthorized\sto\swrite |
| 1007 | 996 | nErr++; |
| 1008 | 997 | break; |
| 1009 | 998 | } |
| 1010 | 999 | xfer_accept_file(&xfer, 0, pzUuidList, pnUuidList); |
| 1011 | | - if( xfer.fHasFork ){ |
| 1012 | | - fForkSeen = 1; |
| 1013 | | - } |
| 1014 | 1000 | if( blob_size(&xfer.err) ){ |
| 1015 | 1001 | cgi_reset_content(); |
| 1016 | 1002 | @ error %T(blob_str(&xfer.err)) |
| 1017 | 1003 | nErr++; |
| 1018 | 1004 | break; |
| | @@ -1030,13 +1016,10 @@ |
| 1030 | 1016 | @ error not\sauthorized\sto\swrite |
| 1031 | 1017 | nErr++; |
| 1032 | 1018 | break; |
| 1033 | 1019 | } |
| 1034 | 1020 | xfer_accept_compressed_file(&xfer, 0, pzUuidList, pnUuidList); |
| 1035 | | - if( xfer.fHasFork ){ |
| 1036 | | - fForkSeen = 1; |
| 1037 | | - } |
| 1038 | 1021 | if( blob_size(&xfer.err) ){ |
| 1039 | 1022 | cgi_reset_content(); |
| 1040 | 1023 | @ error %T(blob_str(&xfer.err)) |
| 1041 | 1024 | nErr++; |
| 1042 | 1025 | break; |
| | @@ -1315,13 +1298,10 @@ |
| 1315 | 1298 | @ error bad\scommand:\s%F(blob_str(&xfer.line)) |
| 1316 | 1299 | } |
| 1317 | 1300 | blobarray_reset(xfer.aToken, xfer.nToken); |
| 1318 | 1301 | blob_reset(&xfer.line); |
| 1319 | 1302 | } |
| 1320 | | - if( fForkSeen ){ |
| 1321 | | - @ message *****\s\sWARNING:\sa\sfork\shas\soccurred\s\s***** |
| 1322 | | - } |
| 1323 | 1303 | if( isPush ){ |
| 1324 | 1304 | if( rc==TH_OK ){ |
| 1325 | 1305 | rc = xfer_run_script(zScript, zUuidList, 1); |
| 1326 | 1306 | if( rc==TH_ERROR ){ |
| 1327 | 1307 | cgi_reset_content(); |
| | @@ -1456,11 +1436,10 @@ |
| 1456 | 1436 | int lastPctDone = -1; /* Last displayed pctDone */ |
| 1457 | 1437 | double rArrivalTime; /* Time at which a message arrived */ |
| 1458 | 1438 | const char *zSCode = db_get("server-code", "x"); |
| 1459 | 1439 | const char *zPCode = db_get("project-code", 0); |
| 1460 | 1440 | int nErr = 0; /* Number of errors */ |
| 1461 | | - int fForkSeen = 0; /* True if a fork was seen during pull */ |
| 1462 | 1441 | int nRoundtrip= 0; /* Number of HTTP requests */ |
| 1463 | 1442 | int nArtifactSent = 0; /* Total artifacts sent */ |
| 1464 | 1443 | int nArtifactRcvd = 0; /* Total artifacts received */ |
| 1465 | 1444 | const char *zOpType = 0;/* Push, Pull, Sync, Clone */ |
| 1466 | 1445 | double rSkew = 0.0; /* Maximum time skew */ |
| | @@ -1474,10 +1453,11 @@ |
| 1474 | 1453 | memset(&xfer, 0, sizeof(xfer)); |
| 1475 | 1454 | xfer.pIn = &recv; |
| 1476 | 1455 | xfer.pOut = &send; |
| 1477 | 1456 | xfer.mxSend = db_get_int("max-upload", 250000); |
| 1478 | 1457 | xfer.maxTime = -1; |
| 1458 | + g.forkSeen = 0; |
| 1479 | 1459 | if( syncFlags & SYNC_PRIVATE ){ |
| 1480 | 1460 | g.perm.Private = 1; |
| 1481 | 1461 | xfer.syncPrivate = 1; |
| 1482 | 1462 | } |
| 1483 | 1463 | |
| | @@ -1672,11 +1652,10 @@ |
| 1672 | 1652 | } |
| 1673 | 1653 | nCardRcvd++; |
| 1674 | 1654 | continue; |
| 1675 | 1655 | } |
| 1676 | 1656 | xfer.nToken = blob_tokenize(&xfer.line, xfer.aToken, count(xfer.aToken)); |
| 1677 | | - xfer.fHasFork = 0; |
| 1678 | 1657 | nCardRcvd++; |
| 1679 | 1658 | if( (syncFlags & SYNC_VERBOSE)!=0 && recv.nUsed>0 ){ |
| 1680 | 1659 | pctDone = (recv.iCursor*100)/recv.nUsed; |
| 1681 | 1660 | if( pctDone!=lastPctDone ){ |
| 1682 | 1661 | fossil_print("\rprocessed: %d%% ", pctDone); |
| | @@ -1690,13 +1669,10 @@ |
| 1690 | 1669 | ** |
| 1691 | 1670 | ** Receive a file transmitted from the server. |
| 1692 | 1671 | */ |
| 1693 | 1672 | if( blob_eq(&xfer.aToken[0],"file") ){ |
| 1694 | 1673 | xfer_accept_file(&xfer, (syncFlags & SYNC_CLONE)!=0, 0, 0); |
| 1695 | | - if( (syncFlags & SYNC_PULL) && xfer.fHasFork ){ |
| 1696 | | - fForkSeen = 1; |
| 1697 | | - } |
| 1698 | 1674 | nArtifactRcvd++; |
| 1699 | 1675 | }else |
| 1700 | 1676 | |
| 1701 | 1677 | /* cfile UUID USIZE CSIZE \n CONTENT |
| 1702 | 1678 | ** cfile UUID DELTASRC USIZE CSIZE \n CONTENT |
| | @@ -1703,13 +1679,10 @@ |
| 1703 | 1679 | ** |
| 1704 | 1680 | ** Receive a compressed file transmitted from the server. |
| 1705 | 1681 | */ |
| 1706 | 1682 | if( blob_eq(&xfer.aToken[0],"cfile") ){ |
| 1707 | 1683 | xfer_accept_compressed_file(&xfer, (syncFlags & SYNC_CLONE)!=0, 0, 0); |
| 1708 | | - if( (syncFlags & SYNC_PULL) && xfer.fHasFork ){ |
| 1709 | | - fForkSeen = 1; |
| 1710 | | - } |
| 1711 | 1684 | nArtifactRcvd++; |
| 1712 | 1685 | }else |
| 1713 | 1686 | |
| 1714 | 1687 | /* gimme UUID |
| 1715 | 1688 | ** |
| | @@ -1978,13 +1951,10 @@ |
| 1978 | 1951 | manifest_crosslink_end(MC_PERMIT_HOOKS); |
| 1979 | 1952 | content_enable_dephantomize(1); |
| 1980 | 1953 | } |
| 1981 | 1954 | db_end_transaction(0); |
| 1982 | 1955 | }; |
| 1983 | | - if( fForkSeen ){ |
| 1984 | | - fossil_warning("***** WARNING: a fork has occurred *****"); |
| 1985 | | - } |
| 1986 | 1956 | transport_stats(&nSent, &nRcvd, 1); |
| 1987 | 1957 | if( (rSkew*24.0*3600.0) > 10.0 ){ |
| 1988 | 1958 | fossil_warning("*** time skew *** server is fast by %s", |
| 1989 | 1959 | db_timespan_name(rSkew)); |
| 1990 | 1960 | g.clockSkewSeen = 1; |
| | @@ -2004,7 +1974,10 @@ |
| 2004 | 1974 | db_multi_exec("DROP TABLE onremote"); |
| 2005 | 1975 | manifest_crosslink_end(MC_PERMIT_HOOKS); |
| 2006 | 1976 | content_enable_dephantomize(1); |
| 2007 | 1977 | db_end_transaction(0); |
| 2008 | 1978 | } |
| 1979 | + if( (syncFlags & SYNC_CLONE)==0 && g.forkSeen ){ |
| 1980 | + fossil_warning("***** WARNING: a fork has occurred *****"); |
| 1981 | + } |
| 2009 | 1982 | return nErr; |
| 2010 | 1983 | } |
| 2011 | 1984 | |