Fossil SCM
Fix an inefficiency in uv-sync in which the uv-catalog is always sent even if the uv-hash matches. Also add preliminary change to support uv-push.
Commit
d015a269e63fe4c34bc16e41cd26695850e8a196381351d8494298d9f3f36d66
Parent
3fd84de3f42728b…
2 files changed
+1
-1
+44
-40
+1
-1
| --- src/blob.c | ||
| +++ src/blob.c | ||
| @@ -460,11 +460,11 @@ | ||
| 460 | 460 | ** Compare a blob to a string. Return TRUE if they are equal. |
| 461 | 461 | */ |
| 462 | 462 | int blob_eq_str(Blob *pBlob, const char *z, int n){ |
| 463 | 463 | Blob t; |
| 464 | 464 | blob_is_init(pBlob); |
| 465 | - if( n<=0 ) n = strlen(z); | |
| 465 | + if( n<=0 ) n = (int)strlen(z); | |
| 466 | 466 | t.aData = (char*)z; |
| 467 | 467 | t.nUsed = n; |
| 468 | 468 | t.xRealloc = blobReallocStatic; |
| 469 | 469 | return blob_compare(pBlob, &t)==0; |
| 470 | 470 | } |
| 471 | 471 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -460,11 +460,11 @@ | |
| 460 | ** Compare a blob to a string. Return TRUE if they are equal. |
| 461 | */ |
| 462 | int blob_eq_str(Blob *pBlob, const char *z, int n){ |
| 463 | Blob t; |
| 464 | blob_is_init(pBlob); |
| 465 | if( n<=0 ) n = strlen(z); |
| 466 | t.aData = (char*)z; |
| 467 | t.nUsed = n; |
| 468 | t.xRealloc = blobReallocStatic; |
| 469 | return blob_compare(pBlob, &t)==0; |
| 470 | } |
| 471 |
| --- src/blob.c | |
| +++ src/blob.c | |
| @@ -460,11 +460,11 @@ | |
| 460 | ** Compare a blob to a string. Return TRUE if they are equal. |
| 461 | */ |
| 462 | int blob_eq_str(Blob *pBlob, const char *z, int n){ |
| 463 | Blob t; |
| 464 | blob_is_init(pBlob); |
| 465 | if( n<=0 ) n = (int)strlen(z); |
| 466 | t.aData = (char*)z; |
| 467 | t.nUsed = n; |
| 468 | t.xRealloc = blobReallocStatic; |
| 469 | return blob_compare(pBlob, &t)==0; |
| 470 | } |
| 471 |
+44
-40
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -1061,29 +1061,27 @@ | ||
| 1061 | 1061 | ** If HASH is different from the unversioned content hash on this server, |
| 1062 | 1062 | ** then send a bunch of uvigot cards, one for each entry unversioned file |
| 1063 | 1063 | ** on this server. |
| 1064 | 1064 | */ |
| 1065 | 1065 | static void send_unversioned_catalog(Xfer *pXfer){ |
| 1066 | + int nUvIgot = 0; | |
| 1067 | + Stmt uvq; | |
| 1066 | 1068 | unversioned_schema(); |
| 1067 | - if( !blob_eq(&pXfer->aToken[2], unversioned_content_hash(0)) ){ | |
| 1068 | - int nUvIgot = 0; | |
| 1069 | - Stmt uvq; | |
| 1070 | - db_prepare(&uvq, | |
| 1071 | - "SELECT name, mtime, hash, sz FROM unversioned" | |
| 1072 | - ); | |
| 1073 | - while( db_step(&uvq)==SQLITE_ROW ){ | |
| 1074 | - const char *zName = db_column_text(&uvq,0); | |
| 1075 | - sqlite3_int64 mtime = db_column_int64(&uvq,1); | |
| 1076 | - const char *zHash = db_column_text(&uvq,2); | |
| 1077 | - int sz = db_column_int(&uvq,3); | |
| 1078 | - nUvIgot++; | |
| 1079 | - if( zHash==0 ){ sz = 0; zHash = "-"; } | |
| 1080 | - blob_appendf(pXfer->pOut, "uvigot %s %lld %s %d\n", | |
| 1081 | - zName, mtime, zHash, sz); | |
| 1082 | - } | |
| 1083 | - db_finalize(&uvq); | |
| 1084 | - } | |
| 1069 | + db_prepare(&uvq, | |
| 1070 | + "SELECT name, mtime, hash, sz FROM unversioned" | |
| 1071 | + ); | |
| 1072 | + while( db_step(&uvq)==SQLITE_ROW ){ | |
| 1073 | + const char *zName = db_column_text(&uvq,0); | |
| 1074 | + sqlite3_int64 mtime = db_column_int64(&uvq,1); | |
| 1075 | + const char *zHash = db_column_text(&uvq,2); | |
| 1076 | + int sz = db_column_int(&uvq,3); | |
| 1077 | + nUvIgot++; | |
| 1078 | + if( zHash==0 ){ sz = 0; zHash = "-"; } | |
| 1079 | + blob_appendf(pXfer->pOut, "uvigot %s %lld %s %d\n", | |
| 1080 | + zName, mtime, zHash, sz); | |
| 1081 | + } | |
| 1082 | + db_finalize(&uvq); | |
| 1085 | 1083 | } |
| 1086 | 1084 | |
| 1087 | 1085 | /* |
| 1088 | 1086 | ** Called when there is an attempt to transfer private content to and |
| 1089 | 1087 | ** from a server without authorization. |
| @@ -1616,18 +1614,20 @@ | ||
| 1616 | 1614 | ** "uvigot" cards. |
| 1617 | 1615 | */ |
| 1618 | 1616 | if( blob_eq(&xfer.aToken[1], "uv-hash") |
| 1619 | 1617 | && blob_is_hname(&xfer.aToken[2]) |
| 1620 | 1618 | ){ |
| 1621 | - if( !uvCatalogSent ){ | |
| 1622 | - if( g.perm.Read && g.perm.WrUnver ){ | |
| 1619 | + if( !uvCatalogSent | |
| 1620 | + && g.perm.Read | |
| 1621 | + && !blob_eq_str(&xfer.aToken[2], unversioned_content_hash(0),-1) | |
| 1622 | + ){ | |
| 1623 | + if( g.perm.WrUnver ){ | |
| 1623 | 1624 | @ pragma uv-push-ok |
| 1624 | - send_unversioned_catalog(&xfer); | |
| 1625 | 1625 | }else if( g.perm.Read ){ |
| 1626 | 1626 | @ pragma uv-pull-only |
| 1627 | - send_unversioned_catalog(&xfer); | |
| 1628 | 1627 | } |
| 1628 | + send_unversioned_catalog(&xfer); | |
| 1629 | 1629 | } |
| 1630 | 1630 | uvCatalogSent = 1; |
| 1631 | 1631 | } |
| 1632 | 1632 | |
| 1633 | 1633 | /* pragma ci-lock CHECKIN-HASH CLIENT-ID |
| @@ -1813,17 +1813,18 @@ | ||
| 1813 | 1813 | #define SYNC_PULL 0x0002 /* pull content server to client */ |
| 1814 | 1814 | #define SYNC_CLONE 0x0004 /* clone the repository */ |
| 1815 | 1815 | #define SYNC_PRIVATE 0x0008 /* Also transfer private content */ |
| 1816 | 1816 | #define SYNC_VERBOSE 0x0010 /* Extra diagnostics */ |
| 1817 | 1817 | #define SYNC_RESYNC 0x0020 /* --verily */ |
| 1818 | -#define SYNC_UNVERSIONED 0x0040 /* Sync unversioned content */ | |
| 1819 | -#define SYNC_UV_REVERT 0x0080 /* Copy server unversioned to client */ | |
| 1820 | -#define SYNC_FROMPARENT 0x0100 /* Pull from the parent project */ | |
| 1821 | -#define SYNC_UV_TRACE 0x0200 /* Describe UV activities */ | |
| 1822 | -#define SYNC_UV_DRYRUN 0x0400 /* Do not actually exchange files */ | |
| 1823 | -#define SYNC_IFABLE 0x0800 /* Inability to sync is not fatal */ | |
| 1824 | -#define SYNC_CKIN_LOCK 0x1000 /* Lock the current check-in */ | |
| 1818 | +#define SYNC_UVPULL 0x0040 /* Unversioned pull */ | |
| 1819 | +#define SYNC_FROMPARENT 0x0080 /* Pull from the parent project */ | |
| 1820 | +#define SYNC_UNVERSIONED 0x0100 /* Sync unversioned content */ | |
| 1821 | +#define SYNC_UV_REVERT 0x0200 /* Copy server unversioned to client */ | |
| 1822 | +#define SYNC_UV_TRACE 0x0400 /* Describe UV activities */ | |
| 1823 | +#define SYNC_UV_DRYRUN 0x0800 /* Do not actually exchange files */ | |
| 1824 | +#define SYNC_IFABLE 0x1000 /* Inability to sync is not fatal */ | |
| 1825 | +#define SYNC_CKIN_LOCK 0x2000 /* Lock the current check-in */ | |
| 1825 | 1826 | #endif |
| 1826 | 1827 | |
| 1827 | 1828 | /* |
| 1828 | 1829 | ** Floating-point absolute value |
| 1829 | 1830 | */ |
| @@ -1879,11 +1880,12 @@ | ||
| 1879 | 1880 | const char *zCkinLock; /* Name of check-in to lock. NULL for none */ |
| 1880 | 1881 | const char *zClientId; /* A unique identifier for this check-out */ |
| 1881 | 1882 | unsigned int mHttpFlags;/* Flags for the http_exchange() subsystem */ |
| 1882 | 1883 | |
| 1883 | 1884 | if( db_get_boolean("dont-push", 0) ) syncFlags &= ~SYNC_PUSH; |
| 1884 | - if( (syncFlags & (SYNC_PUSH|SYNC_PULL|SYNC_CLONE|SYNC_UNVERSIONED))==0 | |
| 1885 | + if( (syncFlags & (SYNC_PUSH|SYNC_PULL|SYNC_CLONE| | |
| 1886 | + SYNC_UNVERSIONED|SYNC_UVPULL))==0 | |
| 1885 | 1887 | && configRcvMask==0 && configSendMask==0 ) return 0; |
| 1886 | 1888 | if( syncFlags & SYNC_FROMPARENT ){ |
| 1887 | 1889 | configRcvMask = 0; |
| 1888 | 1890 | configSendMask = 0; |
| 1889 | 1891 | syncFlags &= ~(SYNC_PUSH); |
| @@ -2036,11 +2038,11 @@ | ||
| 2036 | 2038 | |
| 2037 | 2039 | /* Client sends a request to sync unversioned files. |
| 2038 | 2040 | ** On a clone, delay sending this until the second cycle since |
| 2039 | 2041 | ** the login card might fail on the first cycle. |
| 2040 | 2042 | */ |
| 2041 | - if( (syncFlags & SYNC_UNVERSIONED)!=0 | |
| 2043 | + if( (syncFlags & (SYNC_UNVERSIONED|SYNC_UVPULL))!=0 | |
| 2042 | 2044 | && ((syncFlags & SYNC_CLONE)==0 || nCycle>0) |
| 2043 | 2045 | && !uvHashSent |
| 2044 | 2046 | ){ |
| 2045 | 2047 | blob_appendf(&send, "pragma uv-hash %s\n", unversioned_content_hash(0)); |
| 2046 | 2048 | nCardSent++; |
| @@ -2492,19 +2494,21 @@ | ||
| 2492 | 2494 | ** this client lacks the necessary permissions) then it sends a |
| 2493 | 2495 | ** "uv-pull-only" pragma so that the client will know not to waste |
| 2494 | 2496 | ** bandwidth trying to upload unversioned content. If the server |
| 2495 | 2497 | ** does accept new unversioned content, it sends "uv-push-ok". |
| 2496 | 2498 | */ |
| 2497 | - if( blob_eq(&xfer.aToken[1], "uv-pull-only") ){ | |
| 2498 | - fossil_print( | |
| 2499 | - "Warning: uv-pull-only \n" | |
| 2500 | - " Unable to push unversioned content because you lack\n" | |
| 2501 | - " sufficient permission on the server\n" | |
| 2502 | - ); | |
| 2503 | - if( syncFlags & SYNC_UV_REVERT ) uvDoPush = 1; | |
| 2504 | - }else if( blob_eq(&xfer.aToken[1], "uv-push-ok") ){ | |
| 2505 | - uvDoPush = 1; | |
| 2499 | + if( syncFlags & SYNC_UNVERSIONED ){ | |
| 2500 | + if( blob_eq(&xfer.aToken[1], "uv-pull-only") ){ | |
| 2501 | + fossil_print( | |
| 2502 | + "Warning: uv-pull-only \n" | |
| 2503 | + " Unable to push unversioned content because you lack\n" | |
| 2504 | + " sufficient permission on the server\n" | |
| 2505 | + ); | |
| 2506 | + if( syncFlags & SYNC_UV_REVERT ) uvDoPush = 1; | |
| 2507 | + }else if( blob_eq(&xfer.aToken[1], "uv-push-ok") ){ | |
| 2508 | + uvDoPush = 1; | |
| 2509 | + } | |
| 2506 | 2510 | } |
| 2507 | 2511 | |
| 2508 | 2512 | /* pragma ci-lock-fail USER-HOLDING-LOCK LOCK-TIME |
| 2509 | 2513 | ** |
| 2510 | 2514 | ** The server generates this message when a "pragma ci-lock" |
| 2511 | 2515 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1061,29 +1061,27 @@ | |
| 1061 | ** If HASH is different from the unversioned content hash on this server, |
| 1062 | ** then send a bunch of uvigot cards, one for each entry unversioned file |
| 1063 | ** on this server. |
| 1064 | */ |
| 1065 | static void send_unversioned_catalog(Xfer *pXfer){ |
| 1066 | unversioned_schema(); |
| 1067 | if( !blob_eq(&pXfer->aToken[2], unversioned_content_hash(0)) ){ |
| 1068 | int nUvIgot = 0; |
| 1069 | Stmt uvq; |
| 1070 | db_prepare(&uvq, |
| 1071 | "SELECT name, mtime, hash, sz FROM unversioned" |
| 1072 | ); |
| 1073 | while( db_step(&uvq)==SQLITE_ROW ){ |
| 1074 | const char *zName = db_column_text(&uvq,0); |
| 1075 | sqlite3_int64 mtime = db_column_int64(&uvq,1); |
| 1076 | const char *zHash = db_column_text(&uvq,2); |
| 1077 | int sz = db_column_int(&uvq,3); |
| 1078 | nUvIgot++; |
| 1079 | if( zHash==0 ){ sz = 0; zHash = "-"; } |
| 1080 | blob_appendf(pXfer->pOut, "uvigot %s %lld %s %d\n", |
| 1081 | zName, mtime, zHash, sz); |
| 1082 | } |
| 1083 | db_finalize(&uvq); |
| 1084 | } |
| 1085 | } |
| 1086 | |
| 1087 | /* |
| 1088 | ** Called when there is an attempt to transfer private content to and |
| 1089 | ** from a server without authorization. |
| @@ -1616,18 +1614,20 @@ | |
| 1616 | ** "uvigot" cards. |
| 1617 | */ |
| 1618 | if( blob_eq(&xfer.aToken[1], "uv-hash") |
| 1619 | && blob_is_hname(&xfer.aToken[2]) |
| 1620 | ){ |
| 1621 | if( !uvCatalogSent ){ |
| 1622 | if( g.perm.Read && g.perm.WrUnver ){ |
| 1623 | @ pragma uv-push-ok |
| 1624 | send_unversioned_catalog(&xfer); |
| 1625 | }else if( g.perm.Read ){ |
| 1626 | @ pragma uv-pull-only |
| 1627 | send_unversioned_catalog(&xfer); |
| 1628 | } |
| 1629 | } |
| 1630 | uvCatalogSent = 1; |
| 1631 | } |
| 1632 | |
| 1633 | /* pragma ci-lock CHECKIN-HASH CLIENT-ID |
| @@ -1813,17 +1813,18 @@ | |
| 1813 | #define SYNC_PULL 0x0002 /* pull content server to client */ |
| 1814 | #define SYNC_CLONE 0x0004 /* clone the repository */ |
| 1815 | #define SYNC_PRIVATE 0x0008 /* Also transfer private content */ |
| 1816 | #define SYNC_VERBOSE 0x0010 /* Extra diagnostics */ |
| 1817 | #define SYNC_RESYNC 0x0020 /* --verily */ |
| 1818 | #define SYNC_UNVERSIONED 0x0040 /* Sync unversioned content */ |
| 1819 | #define SYNC_UV_REVERT 0x0080 /* Copy server unversioned to client */ |
| 1820 | #define SYNC_FROMPARENT 0x0100 /* Pull from the parent project */ |
| 1821 | #define SYNC_UV_TRACE 0x0200 /* Describe UV activities */ |
| 1822 | #define SYNC_UV_DRYRUN 0x0400 /* Do not actually exchange files */ |
| 1823 | #define SYNC_IFABLE 0x0800 /* Inability to sync is not fatal */ |
| 1824 | #define SYNC_CKIN_LOCK 0x1000 /* Lock the current check-in */ |
| 1825 | #endif |
| 1826 | |
| 1827 | /* |
| 1828 | ** Floating-point absolute value |
| 1829 | */ |
| @@ -1879,11 +1880,12 @@ | |
| 1879 | const char *zCkinLock; /* Name of check-in to lock. NULL for none */ |
| 1880 | const char *zClientId; /* A unique identifier for this check-out */ |
| 1881 | unsigned int mHttpFlags;/* Flags for the http_exchange() subsystem */ |
| 1882 | |
| 1883 | if( db_get_boolean("dont-push", 0) ) syncFlags &= ~SYNC_PUSH; |
| 1884 | if( (syncFlags & (SYNC_PUSH|SYNC_PULL|SYNC_CLONE|SYNC_UNVERSIONED))==0 |
| 1885 | && configRcvMask==0 && configSendMask==0 ) return 0; |
| 1886 | if( syncFlags & SYNC_FROMPARENT ){ |
| 1887 | configRcvMask = 0; |
| 1888 | configSendMask = 0; |
| 1889 | syncFlags &= ~(SYNC_PUSH); |
| @@ -2036,11 +2038,11 @@ | |
| 2036 | |
| 2037 | /* Client sends a request to sync unversioned files. |
| 2038 | ** On a clone, delay sending this until the second cycle since |
| 2039 | ** the login card might fail on the first cycle. |
| 2040 | */ |
| 2041 | if( (syncFlags & SYNC_UNVERSIONED)!=0 |
| 2042 | && ((syncFlags & SYNC_CLONE)==0 || nCycle>0) |
| 2043 | && !uvHashSent |
| 2044 | ){ |
| 2045 | blob_appendf(&send, "pragma uv-hash %s\n", unversioned_content_hash(0)); |
| 2046 | nCardSent++; |
| @@ -2492,19 +2494,21 @@ | |
| 2492 | ** this client lacks the necessary permissions) then it sends a |
| 2493 | ** "uv-pull-only" pragma so that the client will know not to waste |
| 2494 | ** bandwidth trying to upload unversioned content. If the server |
| 2495 | ** does accept new unversioned content, it sends "uv-push-ok". |
| 2496 | */ |
| 2497 | if( blob_eq(&xfer.aToken[1], "uv-pull-only") ){ |
| 2498 | fossil_print( |
| 2499 | "Warning: uv-pull-only \n" |
| 2500 | " Unable to push unversioned content because you lack\n" |
| 2501 | " sufficient permission on the server\n" |
| 2502 | ); |
| 2503 | if( syncFlags & SYNC_UV_REVERT ) uvDoPush = 1; |
| 2504 | }else if( blob_eq(&xfer.aToken[1], "uv-push-ok") ){ |
| 2505 | uvDoPush = 1; |
| 2506 | } |
| 2507 | |
| 2508 | /* pragma ci-lock-fail USER-HOLDING-LOCK LOCK-TIME |
| 2509 | ** |
| 2510 | ** The server generates this message when a "pragma ci-lock" |
| 2511 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -1061,29 +1061,27 @@ | |
| 1061 | ** If HASH is different from the unversioned content hash on this server, |
| 1062 | ** then send a bunch of uvigot cards, one for each entry unversioned file |
| 1063 | ** on this server. |
| 1064 | */ |
| 1065 | static void send_unversioned_catalog(Xfer *pXfer){ |
| 1066 | int nUvIgot = 0; |
| 1067 | Stmt uvq; |
| 1068 | unversioned_schema(); |
| 1069 | db_prepare(&uvq, |
| 1070 | "SELECT name, mtime, hash, sz FROM unversioned" |
| 1071 | ); |
| 1072 | while( db_step(&uvq)==SQLITE_ROW ){ |
| 1073 | const char *zName = db_column_text(&uvq,0); |
| 1074 | sqlite3_int64 mtime = db_column_int64(&uvq,1); |
| 1075 | const char *zHash = db_column_text(&uvq,2); |
| 1076 | int sz = db_column_int(&uvq,3); |
| 1077 | nUvIgot++; |
| 1078 | if( zHash==0 ){ sz = 0; zHash = "-"; } |
| 1079 | blob_appendf(pXfer->pOut, "uvigot %s %lld %s %d\n", |
| 1080 | zName, mtime, zHash, sz); |
| 1081 | } |
| 1082 | db_finalize(&uvq); |
| 1083 | } |
| 1084 | |
| 1085 | /* |
| 1086 | ** Called when there is an attempt to transfer private content to and |
| 1087 | ** from a server without authorization. |
| @@ -1616,18 +1614,20 @@ | |
| 1614 | ** "uvigot" cards. |
| 1615 | */ |
| 1616 | if( blob_eq(&xfer.aToken[1], "uv-hash") |
| 1617 | && blob_is_hname(&xfer.aToken[2]) |
| 1618 | ){ |
| 1619 | if( !uvCatalogSent |
| 1620 | && g.perm.Read |
| 1621 | && !blob_eq_str(&xfer.aToken[2], unversioned_content_hash(0),-1) |
| 1622 | ){ |
| 1623 | if( g.perm.WrUnver ){ |
| 1624 | @ pragma uv-push-ok |
| 1625 | }else if( g.perm.Read ){ |
| 1626 | @ pragma uv-pull-only |
| 1627 | } |
| 1628 | send_unversioned_catalog(&xfer); |
| 1629 | } |
| 1630 | uvCatalogSent = 1; |
| 1631 | } |
| 1632 | |
| 1633 | /* pragma ci-lock CHECKIN-HASH CLIENT-ID |
| @@ -1813,17 +1813,18 @@ | |
| 1813 | #define SYNC_PULL 0x0002 /* pull content server to client */ |
| 1814 | #define SYNC_CLONE 0x0004 /* clone the repository */ |
| 1815 | #define SYNC_PRIVATE 0x0008 /* Also transfer private content */ |
| 1816 | #define SYNC_VERBOSE 0x0010 /* Extra diagnostics */ |
| 1817 | #define SYNC_RESYNC 0x0020 /* --verily */ |
| 1818 | #define SYNC_UVPULL 0x0040 /* Unversioned pull */ |
| 1819 | #define SYNC_FROMPARENT 0x0080 /* Pull from the parent project */ |
| 1820 | #define SYNC_UNVERSIONED 0x0100 /* Sync unversioned content */ |
| 1821 | #define SYNC_UV_REVERT 0x0200 /* Copy server unversioned to client */ |
| 1822 | #define SYNC_UV_TRACE 0x0400 /* Describe UV activities */ |
| 1823 | #define SYNC_UV_DRYRUN 0x0800 /* Do not actually exchange files */ |
| 1824 | #define SYNC_IFABLE 0x1000 /* Inability to sync is not fatal */ |
| 1825 | #define SYNC_CKIN_LOCK 0x2000 /* Lock the current check-in */ |
| 1826 | #endif |
| 1827 | |
| 1828 | /* |
| 1829 | ** Floating-point absolute value |
| 1830 | */ |
| @@ -1879,11 +1880,12 @@ | |
| 1880 | const char *zCkinLock; /* Name of check-in to lock. NULL for none */ |
| 1881 | const char *zClientId; /* A unique identifier for this check-out */ |
| 1882 | unsigned int mHttpFlags;/* Flags for the http_exchange() subsystem */ |
| 1883 | |
| 1884 | if( db_get_boolean("dont-push", 0) ) syncFlags &= ~SYNC_PUSH; |
| 1885 | if( (syncFlags & (SYNC_PUSH|SYNC_PULL|SYNC_CLONE| |
| 1886 | SYNC_UNVERSIONED|SYNC_UVPULL))==0 |
| 1887 | && configRcvMask==0 && configSendMask==0 ) return 0; |
| 1888 | if( syncFlags & SYNC_FROMPARENT ){ |
| 1889 | configRcvMask = 0; |
| 1890 | configSendMask = 0; |
| 1891 | syncFlags &= ~(SYNC_PUSH); |
| @@ -2036,11 +2038,11 @@ | |
| 2038 | |
| 2039 | /* Client sends a request to sync unversioned files. |
| 2040 | ** On a clone, delay sending this until the second cycle since |
| 2041 | ** the login card might fail on the first cycle. |
| 2042 | */ |
| 2043 | if( (syncFlags & (SYNC_UNVERSIONED|SYNC_UVPULL))!=0 |
| 2044 | && ((syncFlags & SYNC_CLONE)==0 || nCycle>0) |
| 2045 | && !uvHashSent |
| 2046 | ){ |
| 2047 | blob_appendf(&send, "pragma uv-hash %s\n", unversioned_content_hash(0)); |
| 2048 | nCardSent++; |
| @@ -2492,19 +2494,21 @@ | |
| 2494 | ** this client lacks the necessary permissions) then it sends a |
| 2495 | ** "uv-pull-only" pragma so that the client will know not to waste |
| 2496 | ** bandwidth trying to upload unversioned content. If the server |
| 2497 | ** does accept new unversioned content, it sends "uv-push-ok". |
| 2498 | */ |
| 2499 | if( syncFlags & SYNC_UNVERSIONED ){ |
| 2500 | if( blob_eq(&xfer.aToken[1], "uv-pull-only") ){ |
| 2501 | fossil_print( |
| 2502 | "Warning: uv-pull-only \n" |
| 2503 | " Unable to push unversioned content because you lack\n" |
| 2504 | " sufficient permission on the server\n" |
| 2505 | ); |
| 2506 | if( syncFlags & SYNC_UV_REVERT ) uvDoPush = 1; |
| 2507 | }else if( blob_eq(&xfer.aToken[1], "uv-push-ok") ){ |
| 2508 | uvDoPush = 1; |
| 2509 | } |
| 2510 | } |
| 2511 | |
| 2512 | /* pragma ci-lock-fail USER-HOLDING-LOCK LOCK-TIME |
| 2513 | ** |
| 2514 | ** The server generates this message when a "pragma ci-lock" |
| 2515 |