Fossil SCM

Add the --no-http-compression option to "fossil sync" and similar. Extra explanation of compressed and uncompressed values in the response output from the sync.

drh 2021-07-14 12:52 trunk
Commit 2b8ac4d15b4385dc360ae0799267cff58598df5fafadd9e4c93de8ffdf33a0ab
2 files changed +6 +6 -2
+6
--- src/sync.c
+++ src/sync.c
@@ -146,10 +146,13 @@
146146
*pSyncFlags |= SYNC_PRIVATE;
147147
}
148148
if( find_option("verbose","v",0)!=0 ){
149149
*pSyncFlags |= SYNC_VERBOSE;
150150
}
151
+ if( find_option("no-http-compression",0,0)!=0 ){
152
+ *pSyncFlags |= SYNC_NOHTTPCOMPRESS;
153
+ }
151154
url_proxy_options();
152155
clone_ssh_find_options();
153156
if( !uvOnly ) db_find_and_open_repository(0, 0);
154157
db_open_config(0, 1);
155158
if( g.argc==2 ){
@@ -206,10 +209,11 @@
206209
**
207210
** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
208211
** if required by the remote website
209212
** --from-parent-project Pull content from the parent project
210213
** --ipv4 Use only IPv4, not IPv6
214
+** --no-http-compression Do not compress HTTP traffic
211215
** --once Do not remember URL for subsequent syncs
212216
** --private Pull private branches too
213217
** --project-code CODE Use CODE as the project code
214218
** --proxy PROXY Use the specified HTTP proxy
215219
** -R|--repository REPO Local repository to pull into
@@ -256,10 +260,11 @@
256260
** Options:
257261
**
258262
** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
259263
** if required by the remote website
260264
** --ipv4 Use only IPv4, not IPv6
265
+** --no-http-compression Do not compress HTTP traffic
261266
** --once Do not remember URL for subsequent syncs
262267
** --proxy PROXY Use the specified HTTP proxy
263268
** --private Push private branches too
264269
** -R|--repository REPO Local repository to push from
265270
** --ssl-identity FILE Local SSL credentials, if requested by remote
@@ -301,10 +306,11 @@
301306
** Options:
302307
**
303308
** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
304309
** if required by the remote website
305310
** --ipv4 Use only IPv4, not IPv6
311
+** --no-http-compression Do not compress HTTP traffic
306312
** --once Do not remember URL for subsequent syncs
307313
** --proxy PROXY Use the specified HTTP proxy
308314
** --private Sync private branches too
309315
** -R|--repository REPO Local repository to sync with
310316
** --ssl-identity FILE Local SSL credentials, if requested by remote
311317
--- src/sync.c
+++ src/sync.c
@@ -146,10 +146,13 @@
146 *pSyncFlags |= SYNC_PRIVATE;
147 }
148 if( find_option("verbose","v",0)!=0 ){
149 *pSyncFlags |= SYNC_VERBOSE;
150 }
 
 
 
151 url_proxy_options();
152 clone_ssh_find_options();
153 if( !uvOnly ) db_find_and_open_repository(0, 0);
154 db_open_config(0, 1);
155 if( g.argc==2 ){
@@ -206,10 +209,11 @@
206 **
207 ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
208 ** if required by the remote website
209 ** --from-parent-project Pull content from the parent project
210 ** --ipv4 Use only IPv4, not IPv6
 
211 ** --once Do not remember URL for subsequent syncs
212 ** --private Pull private branches too
213 ** --project-code CODE Use CODE as the project code
214 ** --proxy PROXY Use the specified HTTP proxy
215 ** -R|--repository REPO Local repository to pull into
@@ -256,10 +260,11 @@
256 ** Options:
257 **
258 ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
259 ** if required by the remote website
260 ** --ipv4 Use only IPv4, not IPv6
 
261 ** --once Do not remember URL for subsequent syncs
262 ** --proxy PROXY Use the specified HTTP proxy
263 ** --private Push private branches too
264 ** -R|--repository REPO Local repository to push from
265 ** --ssl-identity FILE Local SSL credentials, if requested by remote
@@ -301,10 +306,11 @@
301 ** Options:
302 **
303 ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
304 ** if required by the remote website
305 ** --ipv4 Use only IPv4, not IPv6
 
306 ** --once Do not remember URL for subsequent syncs
307 ** --proxy PROXY Use the specified HTTP proxy
308 ** --private Sync private branches too
309 ** -R|--repository REPO Local repository to sync with
310 ** --ssl-identity FILE Local SSL credentials, if requested by remote
311
--- src/sync.c
+++ src/sync.c
@@ -146,10 +146,13 @@
146 *pSyncFlags |= SYNC_PRIVATE;
147 }
148 if( find_option("verbose","v",0)!=0 ){
149 *pSyncFlags |= SYNC_VERBOSE;
150 }
151 if( find_option("no-http-compression",0,0)!=0 ){
152 *pSyncFlags |= SYNC_NOHTTPCOMPRESS;
153 }
154 url_proxy_options();
155 clone_ssh_find_options();
156 if( !uvOnly ) db_find_and_open_repository(0, 0);
157 db_open_config(0, 1);
158 if( g.argc==2 ){
@@ -206,10 +209,11 @@
209 **
210 ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
211 ** if required by the remote website
212 ** --from-parent-project Pull content from the parent project
213 ** --ipv4 Use only IPv4, not IPv6
214 ** --no-http-compression Do not compress HTTP traffic
215 ** --once Do not remember URL for subsequent syncs
216 ** --private Pull private branches too
217 ** --project-code CODE Use CODE as the project code
218 ** --proxy PROXY Use the specified HTTP proxy
219 ** -R|--repository REPO Local repository to pull into
@@ -256,10 +260,11 @@
260 ** Options:
261 **
262 ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
263 ** if required by the remote website
264 ** --ipv4 Use only IPv4, not IPv6
265 ** --no-http-compression Do not compress HTTP traffic
266 ** --once Do not remember URL for subsequent syncs
267 ** --proxy PROXY Use the specified HTTP proxy
268 ** --private Push private branches too
269 ** -R|--repository REPO Local repository to push from
270 ** --ssl-identity FILE Local SSL credentials, if requested by remote
@@ -301,10 +306,11 @@
306 ** Options:
307 **
308 ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol,
309 ** if required by the remote website
310 ** --ipv4 Use only IPv4, not IPv6
311 ** --no-http-compression Do not compress HTTP traffic
312 ** --once Do not remember URL for subsequent syncs
313 ** --proxy PROXY Use the specified HTTP proxy
314 ** --private Sync private branches too
315 ** -R|--repository REPO Local repository to sync with
316 ** --ssl-identity FILE Local SSL credentials, if requested by remote
317
+6 -2
--- src/xfer.c
+++ src/xfer.c
@@ -1820,10 +1820,11 @@
18201820
#define SYNC_UV_REVERT 0x0200 /* Copy server unversioned to client */
18211821
#define SYNC_UV_TRACE 0x0400 /* Describe UV activities */
18221822
#define SYNC_UV_DRYRUN 0x0800 /* Do not actually exchange files */
18231823
#define SYNC_IFABLE 0x1000 /* Inability to sync is not fatal */
18241824
#define SYNC_CKIN_LOCK 0x2000 /* Lock the current check-in */
1825
+#define SYNC_NOHTTPCOMPRESS 0x4000 /* Do not compression HTTP messages */
18251826
#endif
18261827
18271828
/*
18281829
** Floating-point absolute value
18291830
*/
@@ -2127,10 +2128,13 @@
21272128
if( (syncFlags & SYNC_CLONE)!=0 && nCycle==0 ){
21282129
/* Do not send a login card on the first round-trip of a clone */
21292130
mHttpFlags = 0;
21302131
}else{
21312132
mHttpFlags = HTTP_USE_LOGIN;
2133
+ }
2134
+ if( syncFlags & SYNC_NOHTTPCOMPRESS ){
2135
+ mHttpFlags |= HTTP_NOCOMPRESS;
21322136
}
21332137
if( http_exchange(&send, &recv, mHttpFlags, MAX_REDIRECTS, 0) ){
21342138
nErr++;
21352139
go = 2;
21362140
break;
@@ -2673,15 +2677,15 @@
26732677
g.clockSkewSeen = 1;
26742678
}
26752679
26762680
fossil_force_newline();
26772681
fossil_print(
2678
- "%s done, sent: %lld received: %lld ip: %s\n",
2682
+ "%s done, wire bytes sent: %lld received: %lld ip: %s\n",
26792683
zOpType, nSent, nRcvd, g.zIpAddr);
26802684
if( syncFlags & SYNC_VERBOSE ){
26812685
fossil_print(
2682
- "Uncompressed sent: %lld received: %lld\n", nUncSent, nUncRcvd);
2686
+ "Uncompressed payload sent: %lld received: %lld\n", nUncSent, nUncRcvd);
26832687
}
26842688
transport_close(&g.url);
26852689
transport_global_shutdown(&g.url);
26862690
if( nErr && go==2 ){
26872691
db_multi_exec("DROP TABLE onremote; DROP TABLE unk;");
26882692
--- src/xfer.c
+++ src/xfer.c
@@ -1820,10 +1820,11 @@
1820 #define SYNC_UV_REVERT 0x0200 /* Copy server unversioned to client */
1821 #define SYNC_UV_TRACE 0x0400 /* Describe UV activities */
1822 #define SYNC_UV_DRYRUN 0x0800 /* Do not actually exchange files */
1823 #define SYNC_IFABLE 0x1000 /* Inability to sync is not fatal */
1824 #define SYNC_CKIN_LOCK 0x2000 /* Lock the current check-in */
 
1825 #endif
1826
1827 /*
1828 ** Floating-point absolute value
1829 */
@@ -2127,10 +2128,13 @@
2127 if( (syncFlags & SYNC_CLONE)!=0 && nCycle==0 ){
2128 /* Do not send a login card on the first round-trip of a clone */
2129 mHttpFlags = 0;
2130 }else{
2131 mHttpFlags = HTTP_USE_LOGIN;
 
 
 
2132 }
2133 if( http_exchange(&send, &recv, mHttpFlags, MAX_REDIRECTS, 0) ){
2134 nErr++;
2135 go = 2;
2136 break;
@@ -2673,15 +2677,15 @@
2673 g.clockSkewSeen = 1;
2674 }
2675
2676 fossil_force_newline();
2677 fossil_print(
2678 "%s done, sent: %lld received: %lld ip: %s\n",
2679 zOpType, nSent, nRcvd, g.zIpAddr);
2680 if( syncFlags & SYNC_VERBOSE ){
2681 fossil_print(
2682 "Uncompressed sent: %lld received: %lld\n", nUncSent, nUncRcvd);
2683 }
2684 transport_close(&g.url);
2685 transport_global_shutdown(&g.url);
2686 if( nErr && go==2 ){
2687 db_multi_exec("DROP TABLE onremote; DROP TABLE unk;");
2688
--- src/xfer.c
+++ src/xfer.c
@@ -1820,10 +1820,11 @@
1820 #define SYNC_UV_REVERT 0x0200 /* Copy server unversioned to client */
1821 #define SYNC_UV_TRACE 0x0400 /* Describe UV activities */
1822 #define SYNC_UV_DRYRUN 0x0800 /* Do not actually exchange files */
1823 #define SYNC_IFABLE 0x1000 /* Inability to sync is not fatal */
1824 #define SYNC_CKIN_LOCK 0x2000 /* Lock the current check-in */
1825 #define SYNC_NOHTTPCOMPRESS 0x4000 /* Do not compression HTTP messages */
1826 #endif
1827
1828 /*
1829 ** Floating-point absolute value
1830 */
@@ -2127,10 +2128,13 @@
2128 if( (syncFlags & SYNC_CLONE)!=0 && nCycle==0 ){
2129 /* Do not send a login card on the first round-trip of a clone */
2130 mHttpFlags = 0;
2131 }else{
2132 mHttpFlags = HTTP_USE_LOGIN;
2133 }
2134 if( syncFlags & SYNC_NOHTTPCOMPRESS ){
2135 mHttpFlags |= HTTP_NOCOMPRESS;
2136 }
2137 if( http_exchange(&send, &recv, mHttpFlags, MAX_REDIRECTS, 0) ){
2138 nErr++;
2139 go = 2;
2140 break;
@@ -2673,15 +2677,15 @@
2677 g.clockSkewSeen = 1;
2678 }
2679
2680 fossil_force_newline();
2681 fossil_print(
2682 "%s done, wire bytes sent: %lld received: %lld ip: %s\n",
2683 zOpType, nSent, nRcvd, g.zIpAddr);
2684 if( syncFlags & SYNC_VERBOSE ){
2685 fossil_print(
2686 "Uncompressed payload sent: %lld received: %lld\n", nUncSent, nUncRcvd);
2687 }
2688 transport_close(&g.url);
2689 transport_global_shutdown(&g.url);
2690 if( nErr && go==2 ){
2691 db_multi_exec("DROP TABLE onremote; DROP TABLE unk;");
2692

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button