Fossil SCM
Enable client to control how much time skew is allowed before warning. This can be useful if one is not in control of the time on the remote server.
Commit
526b0c29979ce4fe898b9a60a10669481450c686366f083aa29bffcab06a3b13
Parent
e19dcc1ab12658c…
2 files changed
+6
+2
-2
M
src/db.c
+6
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -3586,10 +3586,16 @@ | ||
| 3586 | 3586 | ** SETTING: th1-uri-regexp width=40 block-text |
| 3587 | 3587 | ** Specify which URI's are allowed in HTTP requests from |
| 3588 | 3588 | ** TH1 scripts. If empty, no HTTP requests are allowed |
| 3589 | 3589 | ** whatsoever. |
| 3590 | 3590 | */ |
| 3591 | +/* | |
| 3592 | +** SETTING: time-skew-tolerance width=25 default=10 | |
| 3593 | +** The number of seconds of skew against server time that | |
| 3594 | +** the client will tolerate before issuing a warning. | |
| 3595 | +** The default is 10 seconds. | |
| 3596 | +*/ | |
| 3591 | 3597 | /* |
| 3592 | 3598 | ** SETTING: uv-sync boolean default=off |
| 3593 | 3599 | ** If true, automatically send unversioned files as part |
| 3594 | 3600 | ** of a "fossil clone" or "fossil sync" command. The |
| 3595 | 3601 | ** default is false, in which case the -u option is |
| 3596 | 3602 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -3586,10 +3586,16 @@ | |
| 3586 | ** SETTING: th1-uri-regexp width=40 block-text |
| 3587 | ** Specify which URI's are allowed in HTTP requests from |
| 3588 | ** TH1 scripts. If empty, no HTTP requests are allowed |
| 3589 | ** whatsoever. |
| 3590 | */ |
| 3591 | /* |
| 3592 | ** SETTING: uv-sync boolean default=off |
| 3593 | ** If true, automatically send unversioned files as part |
| 3594 | ** of a "fossil clone" or "fossil sync" command. The |
| 3595 | ** default is false, in which case the -u option is |
| 3596 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -3586,10 +3586,16 @@ | |
| 3586 | ** SETTING: th1-uri-regexp width=40 block-text |
| 3587 | ** Specify which URI's are allowed in HTTP requests from |
| 3588 | ** TH1 scripts. If empty, no HTTP requests are allowed |
| 3589 | ** whatsoever. |
| 3590 | */ |
| 3591 | /* |
| 3592 | ** SETTING: time-skew-tolerance width=25 default=10 |
| 3593 | ** The number of seconds of skew against server time that |
| 3594 | ** the client will tolerate before issuing a warning. |
| 3595 | ** The default is 10 seconds. |
| 3596 | */ |
| 3597 | /* |
| 3598 | ** SETTING: uv-sync boolean default=off |
| 3599 | ** If true, automatically send unversioned files as part |
| 3600 | ** of a "fossil clone" or "fossil sync" command. The |
| 3601 | ** default is false, in which case the -u option is |
| 3602 |
+2
-2
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -2508,15 +2508,15 @@ | ||
| 2508 | 2508 | content_enable_dephantomize(1); |
| 2509 | 2509 | } |
| 2510 | 2510 | db_end_transaction(0); |
| 2511 | 2511 | }; |
| 2512 | 2512 | transport_stats(&nSent, &nRcvd, 1); |
| 2513 | - if( (rSkew*24.0*3600.0) > 10.0 ){ | |
| 2513 | + if( (rSkew*24.0*3600.0) > 1.0*db_get_int("time-skew-tolerance", 10) ){ | |
| 2514 | 2514 | fossil_warning("*** time skew *** server is fast by %s", |
| 2515 | 2515 | db_timespan_name(rSkew)); |
| 2516 | 2516 | g.clockSkewSeen = 1; |
| 2517 | - }else if( rSkew*24.0*3600.0 < -10.0 ){ | |
| 2517 | + }else if( rSkew*24.0*3600.0 < -1.0*db_get_int("time-skew-tolerance", 10) ){ | |
| 2518 | 2518 | fossil_warning("*** time skew *** server is slow by %s", |
| 2519 | 2519 | db_timespan_name(-rSkew)); |
| 2520 | 2520 | g.clockSkewSeen = 1; |
| 2521 | 2521 | } |
| 2522 | 2522 | |
| 2523 | 2523 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -2508,15 +2508,15 @@ | |
| 2508 | content_enable_dephantomize(1); |
| 2509 | } |
| 2510 | db_end_transaction(0); |
| 2511 | }; |
| 2512 | transport_stats(&nSent, &nRcvd, 1); |
| 2513 | if( (rSkew*24.0*3600.0) > 10.0 ){ |
| 2514 | fossil_warning("*** time skew *** server is fast by %s", |
| 2515 | db_timespan_name(rSkew)); |
| 2516 | g.clockSkewSeen = 1; |
| 2517 | }else if( rSkew*24.0*3600.0 < -10.0 ){ |
| 2518 | fossil_warning("*** time skew *** server is slow by %s", |
| 2519 | db_timespan_name(-rSkew)); |
| 2520 | g.clockSkewSeen = 1; |
| 2521 | } |
| 2522 | |
| 2523 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -2508,15 +2508,15 @@ | |
| 2508 | content_enable_dephantomize(1); |
| 2509 | } |
| 2510 | db_end_transaction(0); |
| 2511 | }; |
| 2512 | transport_stats(&nSent, &nRcvd, 1); |
| 2513 | if( (rSkew*24.0*3600.0) > 1.0*db_get_int("time-skew-tolerance", 10) ){ |
| 2514 | fossil_warning("*** time skew *** server is fast by %s", |
| 2515 | db_timespan_name(rSkew)); |
| 2516 | g.clockSkewSeen = 1; |
| 2517 | }else if( rSkew*24.0*3600.0 < -1.0*db_get_int("time-skew-tolerance", 10) ){ |
| 2518 | fossil_warning("*** time skew *** server is slow by %s", |
| 2519 | db_timespan_name(-rSkew)); |
| 2520 | g.clockSkewSeen = 1; |
| 2521 | } |
| 2522 | |
| 2523 |