diff options
author | drh <> | 2025-05-03 10:35:32 +0000 |
---|---|---|
committer | drh <> | 2025-05-03 10:35:32 +0000 |
commit | d7b83224bb86ccbbca340bb0c39b3366cd185bcd (patch) | |
tree | c5179011a5b19b73f87d1b1c866832ae008e6f96 /tool/sqlite3_rsync.c | |
parent | f4d435dc0dd409167dd5cc28d3643052e91993a7 (diff) | |
download | sqlite-d7b83224bb86ccbbca340bb0c39b3366cd185bcd.tar.gz sqlite-d7b83224bb86ccbbca340bb0c39b3366cd185bcd.zip |
Promote the --protocol option to sqlite3_rsync from being an undocumented
debug option to being a supported and user-visible option. This is
sometimes needed to work around bugs in prior versions running on the
remote.
FossilOrigin-Name: 4855e04e44e8fce2d6e37dd468eb6e9f4565c36cbc964156e65ac0449d7c212f
Diffstat (limited to 'tool/sqlite3_rsync.c')
-rw-r--r-- | tool/sqlite3_rsync.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/tool/sqlite3_rsync.c b/tool/sqlite3_rsync.c index 760559aec..6607e1fb0 100644 --- a/tool/sqlite3_rsync.c +++ b/tool/sqlite3_rsync.c @@ -30,12 +30,13 @@ static const char zUsage[] = "\n" "OPTIONS:\n" "\n" - " --exe PATH Name of the sqlite3_rsync program on the remote side\n" - " --help Show this help screen\n" - " --ssh PATH Name of the SSH program used to reach the remote side\n" - " -v Verbose. Multiple v's for increasing output\n" - " --version Show detailed version information\n" - " --wal-only Do not sync unless both databases are in WAL mode\n" + " --exe PATH Name of the sqlite3_rsync program on the remote side\n" + " --help Show this help screen\n" + " --protocol N Use sync protocol version N.\n" + " --ssh PATH Name of the SSH program used to reach the remote side\n" + " -v Verbose. Multiple v's for increasing output\n" + " --version Show detailed version information\n" + " --wal-only Do not sync unless both databases are in WAL mode\n" ; typedef unsigned char u8; @@ -2029,6 +2030,15 @@ int main(int argc, char const * const *argv){ ctx.eVerbose += numVs(z); continue; } + if( strcmp(z, "-protocol")==0 ){ + ctx.iProtocol = atoi(cli_opt_val); + if( ctx.iProtocol<1 ){ + ctx.iProtocol = 1; + }else if( ctx.iProtocol>PROTOCOL_VERSION ){ + ctx.iProtocol = PROTOCOL_VERSION; + } + continue; + } if( strcmp(z, "-ssh")==0 ){ zSsh = cli_opt_val; continue; @@ -2089,17 +2099,6 @@ int main(int argc, char const * const *argv){ zRemoteDebugFile = cli_opt_val; continue; } - if( strcmp(z, "-protocol")==0 ){ - /* DEBUG OPTION: --protocool N - ** Set the protocol version to N */ - ctx.iProtocol = atoi(cli_opt_val); - if( ctx.iProtocol<1 ){ - ctx.iProtocol = 1; - }else if( ctx.iProtocol>PROTOCOL_VERSION ){ - ctx.iProtocol = PROTOCOL_VERSION; - } - continue; - } if( strcmp(z,"-commcheck")==0 ){ /* DEBUG ONLY */ /* Run a communication check with the remote side. Do not attempt ** to exchange any database connection */ |