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.
Commit
2b8ac4d15b4385dc360ae0799267cff58598df5fafadd9e4c93de8ffdf33a0ab
Parent
9abbd35b8e77f1b…
2 files changed
+6
+6
-2
+6
| --- src/sync.c | ||
| +++ src/sync.c | ||
| @@ -146,10 +146,13 @@ | ||
| 146 | 146 | *pSyncFlags |= SYNC_PRIVATE; |
| 147 | 147 | } |
| 148 | 148 | if( find_option("verbose","v",0)!=0 ){ |
| 149 | 149 | *pSyncFlags |= SYNC_VERBOSE; |
| 150 | 150 | } |
| 151 | + if( find_option("no-http-compression",0,0)!=0 ){ | |
| 152 | + *pSyncFlags |= SYNC_NOHTTPCOMPRESS; | |
| 153 | + } | |
| 151 | 154 | url_proxy_options(); |
| 152 | 155 | clone_ssh_find_options(); |
| 153 | 156 | if( !uvOnly ) db_find_and_open_repository(0, 0); |
| 154 | 157 | db_open_config(0, 1); |
| 155 | 158 | if( g.argc==2 ){ |
| @@ -206,10 +209,11 @@ | ||
| 206 | 209 | ** |
| 207 | 210 | ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol, |
| 208 | 211 | ** if required by the remote website |
| 209 | 212 | ** --from-parent-project Pull content from the parent project |
| 210 | 213 | ** --ipv4 Use only IPv4, not IPv6 |
| 214 | +** --no-http-compression Do not compress HTTP traffic | |
| 211 | 215 | ** --once Do not remember URL for subsequent syncs |
| 212 | 216 | ** --private Pull private branches too |
| 213 | 217 | ** --project-code CODE Use CODE as the project code |
| 214 | 218 | ** --proxy PROXY Use the specified HTTP proxy |
| 215 | 219 | ** -R|--repository REPO Local repository to pull into |
| @@ -256,10 +260,11 @@ | ||
| 256 | 260 | ** Options: |
| 257 | 261 | ** |
| 258 | 262 | ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol, |
| 259 | 263 | ** if required by the remote website |
| 260 | 264 | ** --ipv4 Use only IPv4, not IPv6 |
| 265 | +** --no-http-compression Do not compress HTTP traffic | |
| 261 | 266 | ** --once Do not remember URL for subsequent syncs |
| 262 | 267 | ** --proxy PROXY Use the specified HTTP proxy |
| 263 | 268 | ** --private Push private branches too |
| 264 | 269 | ** -R|--repository REPO Local repository to push from |
| 265 | 270 | ** --ssl-identity FILE Local SSL credentials, if requested by remote |
| @@ -301,10 +306,11 @@ | ||
| 301 | 306 | ** Options: |
| 302 | 307 | ** |
| 303 | 308 | ** -B|--httpauth USER:PASS Credentials for the simple HTTP auth protocol, |
| 304 | 309 | ** if required by the remote website |
| 305 | 310 | ** --ipv4 Use only IPv4, not IPv6 |
| 311 | +** --no-http-compression Do not compress HTTP traffic | |
| 306 | 312 | ** --once Do not remember URL for subsequent syncs |
| 307 | 313 | ** --proxy PROXY Use the specified HTTP proxy |
| 308 | 314 | ** --private Sync private branches too |
| 309 | 315 | ** -R|--repository REPO Local repository to sync with |
| 310 | 316 | ** --ssl-identity FILE Local SSL credentials, if requested by remote |
| 311 | 317 |
| --- 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 @@ | ||
| 1820 | 1820 | #define SYNC_UV_REVERT 0x0200 /* Copy server unversioned to client */ |
| 1821 | 1821 | #define SYNC_UV_TRACE 0x0400 /* Describe UV activities */ |
| 1822 | 1822 | #define SYNC_UV_DRYRUN 0x0800 /* Do not actually exchange files */ |
| 1823 | 1823 | #define SYNC_IFABLE 0x1000 /* Inability to sync is not fatal */ |
| 1824 | 1824 | #define SYNC_CKIN_LOCK 0x2000 /* Lock the current check-in */ |
| 1825 | +#define SYNC_NOHTTPCOMPRESS 0x4000 /* Do not compression HTTP messages */ | |
| 1825 | 1826 | #endif |
| 1826 | 1827 | |
| 1827 | 1828 | /* |
| 1828 | 1829 | ** Floating-point absolute value |
| 1829 | 1830 | */ |
| @@ -2127,10 +2128,13 @@ | ||
| 2127 | 2128 | if( (syncFlags & SYNC_CLONE)!=0 && nCycle==0 ){ |
| 2128 | 2129 | /* Do not send a login card on the first round-trip of a clone */ |
| 2129 | 2130 | mHttpFlags = 0; |
| 2130 | 2131 | }else{ |
| 2131 | 2132 | mHttpFlags = HTTP_USE_LOGIN; |
| 2133 | + } | |
| 2134 | + if( syncFlags & SYNC_NOHTTPCOMPRESS ){ | |
| 2135 | + mHttpFlags |= HTTP_NOCOMPRESS; | |
| 2132 | 2136 | } |
| 2133 | 2137 | if( http_exchange(&send, &recv, mHttpFlags, MAX_REDIRECTS, 0) ){ |
| 2134 | 2138 | nErr++; |
| 2135 | 2139 | go = 2; |
| 2136 | 2140 | break; |
| @@ -2673,15 +2677,15 @@ | ||
| 2673 | 2677 | g.clockSkewSeen = 1; |
| 2674 | 2678 | } |
| 2675 | 2679 | |
| 2676 | 2680 | fossil_force_newline(); |
| 2677 | 2681 | fossil_print( |
| 2678 | - "%s done, sent: %lld received: %lld ip: %s\n", | |
| 2682 | + "%s done, wire bytes sent: %lld received: %lld ip: %s\n", | |
| 2679 | 2683 | zOpType, nSent, nRcvd, g.zIpAddr); |
| 2680 | 2684 | if( syncFlags & SYNC_VERBOSE ){ |
| 2681 | 2685 | fossil_print( |
| 2682 | - "Uncompressed sent: %lld received: %lld\n", nUncSent, nUncRcvd); | |
| 2686 | + "Uncompressed payload sent: %lld received: %lld\n", nUncSent, nUncRcvd); | |
| 2683 | 2687 | } |
| 2684 | 2688 | transport_close(&g.url); |
| 2685 | 2689 | transport_global_shutdown(&g.url); |
| 2686 | 2690 | if( nErr && go==2 ){ |
| 2687 | 2691 | db_multi_exec("DROP TABLE onremote; DROP TABLE unk;"); |
| 2688 | 2692 |
| --- 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 |