Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Remove support for the legacy configuration sync transfer format, that was replaced in 2011. |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
2ed7c1123d055eafff9260c028ee32a9 |
| User & Date: | drh 2017-09-20 12:10:29.005 |
Context
|
2017-09-20
| ||
| 12:25 | More legacy configuration sync code removed. check-in: fe7f0ece30 user: drh tags: trunk | |
| 12:10 | Remove support for the legacy configuration sync transfer format, that was replaced in 2011. check-in: 2ed7c1123d user: drh tags: trunk | |
| 04:08 | Correct typo in title of web page check-in: a3e50c99f3 user: andygoth tags: trunk | |
Changes
Changes to src/configure.c.
| ︙ | ︙ | |||
37 38 39 40 41 42 43 | #define CONFIGSET_USER 0x000020 /* The USER table */ #define CONFIGSET_ADDR 0x000040 /* The CONCEALED table */ #define CONFIGSET_XFER 0x000080 /* Transfer configuration */ #define CONFIGSET_ALL 0x0000ff /* Everything */ #define CONFIGSET_OVERWRITE 0x100000 /* Causes overwrite instead of merge */ | < | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | #define CONFIGSET_USER 0x000020 /* The USER table */ #define CONFIGSET_ADDR 0x000040 /* The CONCEALED table */ #define CONFIGSET_XFER 0x000080 /* Transfer configuration */ #define CONFIGSET_ALL 0x0000ff /* Everything */ #define CONFIGSET_OVERWRITE 0x100000 /* Causes overwrite instead of merge */ /* ** This mask is used for the common TH1 configuration settings (i.e. those ** that are not specific to one particular subsystem, such as the transfer ** subsystem). */ #define CONFIGSET_TH1 (CONFIGSET_SKIN|CONFIGSET_TKT|CONFIGSET_XFER) |
| ︙ | ︙ | |||
168 169 170 171 172 173 174 |
** Return name of first configuration property matching the given mask.
*/
const char *configure_first_name(int iMask){
iConfig = 0;
return configure_next_name(iMask);
}
const char *configure_next_name(int iMask){
| < < < < < < < < < | | | | | | | | | < | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
** Return name of first configuration property matching the given mask.
*/
const char *configure_first_name(int iMask){
iConfig = 0;
return configure_next_name(iMask);
}
const char *configure_next_name(int iMask){
if( iConfig==0 && (iMask & CONFIGSET_ALL)==CONFIGSET_ALL ){
iConfig = count(aGroupName);
return "/all";
}
while( iConfig<count(aGroupName)-1 ){
if( aGroupName[iConfig].groupMask & iMask ){
return aGroupName[iConfig++].zName;
}else{
iConfig++;
}
}
return 0;
}
/*
** Return a pointer to a string that contains the RHS of an IN operator
|
| ︙ | ︙ | |||
512 513 514 515 516 517 518 519 520 521 522 523 524 525 | ** /concealed $MTIME $HASH content $VALUE ** ** OLD FORMAT: ** ** The old format is retained for backwards compatibility, but is deprecated. ** The cutover from old format to new was on 2011-04-25. After sufficient ** time has passed, support for the old format will be removed. ** ** zName is either the NAME of an element of the CONFIG table, or else ** one of the special names "@shun", "@reportfmt", "@user", or "@concealed". ** If zName is a CONFIG table name, then CONTENT replaces (overwrites) the ** element in the CONFIG table. For one of the @-labels, CONTENT is raw ** SQL that is evaluated. Note that the raw SQL in CONTENT might not ** insert directly into the target table but might instead use a proxy | > | 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 | ** /concealed $MTIME $HASH content $VALUE ** ** OLD FORMAT: ** ** The old format is retained for backwards compatibility, but is deprecated. ** The cutover from old format to new was on 2011-04-25. After sufficient ** time has passed, support for the old format will be removed. ** Update: Support for the old format was remoed on 2017-09-20. ** ** zName is either the NAME of an element of the CONFIG table, or else ** one of the special names "@shun", "@reportfmt", "@user", or "@concealed". ** If zName is a CONFIG table name, then CONTENT replaces (overwrites) the ** element in the CONFIG table. For one of the @-labels, CONTENT is raw ** SQL that is evaluated. Note that the raw SQL in CONTENT might not ** insert directly into the target table but might instead use a proxy |
| ︙ | ︙ | |||
607 608 609 610 611 612 613 |
blob_append_sql(&sql, " WHERE \"%w\"=%s AND mtime<%s",
aType[ii].zPrimKey, azToken[1]/*safe-for-%s*/,
azToken[0]/*safe-for-%s*/);
db_multi_exec("%s", blob_sql_text(&sql));
}
blob_reset(&sql);
rebuildMask |= thisMask;
| < < < < < < < < < < < < < < < < < < < < < < < < < | 597 598 599 600 601 602 603 604 605 606 607 608 609 610 |
blob_append_sql(&sql, " WHERE \"%w\"=%s AND mtime<%s",
aType[ii].zPrimKey, azToken[1]/*safe-for-%s*/,
azToken[0]/*safe-for-%s*/);
db_multi_exec("%s", blob_sql_text(&sql));
}
blob_reset(&sql);
rebuildMask |= thisMask;
}
}
/*
** Process a file full of "config" cards.
*/
void configure_receive_all(Blob *pIn, int groupMask){
|
| ︙ | ︙ | |||
854 855 856 857 858 859 860 | ** the current configuration. Existing values take priority over ** values read from FILENAME. ** ** %fossil configuration pull AREA ?URL? ** ** Pull and install the configuration from a different server ** identified by URL. If no URL is specified, then the default | | < | < < | 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 | ** the current configuration. Existing values take priority over ** values read from FILENAME. ** ** %fossil configuration pull AREA ?URL? ** ** Pull and install the configuration from a different server ** identified by URL. If no URL is specified, then the default ** server is used. Use the --overwrite flag to completely ** replace local settings with content received from URL. ** ** %fossil configuration push AREA ?URL? ** ** Push the local configuration into the remote server identified ** by URL. Admin privilege is required on the remote server for ** this to work. When the same record exists both locally and on ** the remote end, the one that was most recently changed wins. ** ** %fossil configuration reset AREA ** ** Restore the configuration to the default. AREA as above. ** ** %fossil configuration sync AREA ?URL? ** |
| ︙ | ︙ | |||
930 931 932 933 934 935 936 |
}else
if( strncmp(zMethod, "pull", n)==0
|| strncmp(zMethod, "push", n)==0
|| strncmp(zMethod, "sync", n)==0
){
int mask;
const char *zServer = 0;
| < < < | 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 |
}else
if( strncmp(zMethod, "pull", n)==0
|| strncmp(zMethod, "push", n)==0
|| strncmp(zMethod, "sync", n)==0
){
int mask;
const char *zServer = 0;
int overwriteFlag = 0;
if( strncmp(zMethod,"pull",n)==0 ){
overwriteFlag = find_option("overwrite",0,0)!=0;
}
url_proxy_options();
if( g.argc!=4 && g.argc!=5 ){
usage(mprintf("%s AREA ?URL?", zMethod));
}
mask = configure_name_to_mask(g.argv[3], 1);
if( g.argc==5 ){
zServer = g.argv[4];
}
url_parse(zServer, URL_PROMPT_PW);
if( g.url.protocol==0 ) fossil_fatal("no server URL specified");
user_select();
url_enable_proxy("via proxy: ");
if( overwriteFlag ) mask |= CONFIGSET_OVERWRITE;
if( strncmp(zMethod, "push", n)==0 ){
client_sync(0,0,(unsigned)mask);
}else if( strncmp(zMethod, "pull", n)==0 ){
client_sync(0,(unsigned)mask,0);
}else{
client_sync(0,(unsigned)mask,(unsigned)mask);
|
| ︙ | ︙ |
Changes to src/xfer.c.
| ︙ | ︙ | |||
1882 1883 1884 1885 1886 1887 1888 |
if( zOpType==0 ) zOpType = "Pull";
zName = configure_first_name(configRcvMask);
while( zName ){
blob_appendf(&send, "reqconfig %s\n", zName);
zName = configure_next_name(configRcvMask);
nCardSent++;
}
| < < < < < < < < < < < < < < < | < | 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 |
if( zOpType==0 ) zOpType = "Pull";
zName = configure_first_name(configRcvMask);
while( zName ){
blob_appendf(&send, "reqconfig %s\n", zName);
zName = configure_next_name(configRcvMask);
nCardSent++;
}
origConfigRcvMask = configRcvMask;
configRcvMask = 0;
}
/* Send a request to sync unversioned files. On a clone, delay sending
** this until the second cycle since the login card might fail on
** the first cycle.
*/
if( (syncFlags & SYNC_UNVERSIONED)!=0
&& ((syncFlags & SYNC_CLONE)==0 || nCycle>0)
&& !uvHashSent
){
blob_appendf(&send, "pragma uv-hash %s\n", unversioned_content_hash(0));
nCardSent++;
uvHashSent = 1;
}
/* Send configuration parameters being pushed */
if( configSendMask ){
if( zOpType==0 ) zOpType = "Push";
nCardSent += configure_send_group(xfer.pOut, configSendMask, 0);
configSendMask = 0;
}
/* Send unversioned files present here on the client but missing or
** obsolete on the server.
**
** Or, if the SYNC_UV_REVERT flag is set, delete the local unversioned
|
| ︙ | ︙ | |||
2384 2385 2386 2387 2388 2389 2390 |
fossil_warning("%b", &xfer.err);
nErr++;
break;
}
blobarray_reset(xfer.aToken, xfer.nToken);
blob_reset(&xfer.line);
}
| < < < < < | 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 |
fossil_warning("%b", &xfer.err);
nErr++;
break;
}
blobarray_reset(xfer.aToken, xfer.nToken);
blob_reset(&xfer.line);
}
origConfigRcvMask = 0;
if( nCardRcvd>0 && (syncFlags & SYNC_VERBOSE) ){
fossil_print(zValueFormat /*works-like:"%s%d%d%d%d"*/, "Received:",
blob_size(&recv), nCardRcvd,
xfer.nFileRcvd, xfer.nDeltaRcvd + xfer.nDanglingFile);
}else{
fossil_print(zBriefFormat /*works-like:"%d%d%d"*/,
|
| ︙ | ︙ |