Fossil SCM

save first version of patch for ssh from Andy Bradford (from list)

mgagnon 2013-07-10 21:31 UTC trunk
Commit 979a75de0633768c375c2549d0381b54b8e9441e
+10
--- src/clone.c
+++ src/clone.c
@@ -103,10 +103,11 @@
103103
const char *zDefaultUser; /* Optional name of the default user */
104104
int nErr = 0;
105105
int bPrivate = 0; /* Also clone private branches */
106106
107107
if( find_option("private",0,0)!=0 ) bPrivate = SYNC_PRIVATE;
108
+ clone_ssh_options();
108109
url_proxy_options();
109110
if( g.argc < 4 ){
110111
usage("?OPTIONS? FILE-OR-URL NEW-REPOSITORY");
111112
}
112113
db_open_config(0);
@@ -174,5 +175,14 @@
174175
fossil_print("project-id: %s\n", db_get("project-code", 0));
175176
zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
176177
fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword);
177178
db_end_transaction(0);
178179
}
180
+
181
+void clone_ssh_options(void){
182
+ const char *zSshRemoteCmd; /* Path to remote fossil command for SSH */
183
+
184
+ zSshRemoteCmd = find_option("sshremotecmd","s",1);
185
+ if( zSshRemoteCmd && zSshRemoteCmd[0] ){
186
+ g.fSshRemoteCmd = mprintf("%s", zSshRemoteCmd);
187
+ }
188
+}
179189
--- src/clone.c
+++ src/clone.c
@@ -103,10 +103,11 @@
103 const char *zDefaultUser; /* Optional name of the default user */
104 int nErr = 0;
105 int bPrivate = 0; /* Also clone private branches */
106
107 if( find_option("private",0,0)!=0 ) bPrivate = SYNC_PRIVATE;
 
108 url_proxy_options();
109 if( g.argc < 4 ){
110 usage("?OPTIONS? FILE-OR-URL NEW-REPOSITORY");
111 }
112 db_open_config(0);
@@ -174,5 +175,14 @@
174 fossil_print("project-id: %s\n", db_get("project-code", 0));
175 zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
176 fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword);
177 db_end_transaction(0);
178 }
 
 
 
 
 
 
 
 
 
179
--- src/clone.c
+++ src/clone.c
@@ -103,10 +103,11 @@
103 const char *zDefaultUser; /* Optional name of the default user */
104 int nErr = 0;
105 int bPrivate = 0; /* Also clone private branches */
106
107 if( find_option("private",0,0)!=0 ) bPrivate = SYNC_PRIVATE;
108 clone_ssh_options();
109 url_proxy_options();
110 if( g.argc < 4 ){
111 usage("?OPTIONS? FILE-OR-URL NEW-REPOSITORY");
112 }
113 db_open_config(0);
@@ -174,5 +175,14 @@
175 fossil_print("project-id: %s\n", db_get("project-code", 0));
176 zPassword = db_text(0, "SELECT pw FROM user WHERE login=%Q", g.zLogin);
177 fossil_print("admin-user: %s (password is \"%s\")\n", g.zLogin, zPassword);
178 db_end_transaction(0);
179 }
180
181 void clone_ssh_options(void){
182 const char *zSshRemoteCmd; /* Path to remote fossil command for SSH */
183
184 zSshRemoteCmd = find_option("sshremotecmd","s",1);
185 if( zSshRemoteCmd && zSshRemoteCmd[0] ){
186 g.fSshRemoteCmd = mprintf("%s", zSshRemoteCmd);
187 }
188 }
189
--- src/http_transport.c
+++ src/http_transport.c
@@ -183,13 +183,24 @@
183183
** and run an SSH command to talk to the remote machine.
184184
*/
185185
const char *zSsh; /* The base SSH command */
186186
Blob zCmd; /* The SSH command */
187187
char *zHost; /* The host name to contact */
188
+ char *zPath; /* The path to the remote file for SSH */
189
+ char *zfCmd; /* The path to remote fossil for SSH */
188190
int n; /* Size of prefix string */
189191
190192
zSsh = db_get("ssh-command", zDefaultSshCmd);
193
+ if( g.fSshRemoteCmd && g.fSshRemoteCmd[0] ){
194
+ zfCmd = g.fSshRemoteCmd;
195
+ db_set("last-ssh-remote-cmd", zfCmd, 0);
196
+ }else{
197
+ zfCmd = db_get("last-ssh-remote-cmd", 0);
198
+ if( zfCmd==0 ){
199
+ zfCmd = "fossil";
200
+ }
201
+ }
191202
blob_init(&zCmd, zSsh, -1);
192203
if( g.urlPort!=g.urlDfltPort ){
193204
#ifdef __MINGW32__
194205
blob_appendf(&zCmd, " -P %d", g.urlPort);
195206
#else
@@ -223,34 +234,24 @@
223234
zHost = mprintf("%s", g.urlName);
224235
}
225236
n = blob_size(&zCmd);
226237
blob_append(&zCmd, " ", 1);
227238
shell_escape(&zCmd, zHost);
228
- if( g.urlShell ){
229
- blob_appendf(&zCmd, " %s", g.urlShell);
230
- }else{
231
-#if defined(FOSSIL_ENABLE_SSH_FAR_SIDE)
232
- /* The following works. But only if the fossil on the remote side
233
- ** is recent enough to support the test-ssh-far-side command. That
234
- ** command was added on 2013-02-06. We will leave this turned off
235
- ** until most fossil servers have upgraded to that version or a later
236
- ** version. The sync will still work as long as the shell on the far
237
- ** side is bash and not tcsh. And if the default far side shell is
238
- ** tcsh, then the shell=/bin/bash query parameter can be used as a
239
- ** work-around. Enable this code after about a year...
240
- */
241
- blob_appendf(&zCmd, " exec %s test-ssh-far-side", g.urlFossil);
242
-#endif
239
+ blob_append(&zCmd, " ", 1);
240
+ shell_escape(&zCmd, zfCmd);
241
+ blob_append(&zCmd, " http ", 6);
242
+ if( g.urlPath && g.urlPath[0] ){
243
+ zPath = mprintf("%s", g.urlPath);
244
+ shell_escape(&zCmd, zPath);
243245
}
244246
fossil_print("%s\n", blob_str(&zCmd)+n); /* Show tail of SSH command */
245247
free(zHost);
246248
popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid);
247249
if( sshPid==0 ){
248250
fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd);
249251
}
250252
blob_reset(&zCmd);
251
- transport_ssh_startup();
252253
}
253254
}
254255
255256
/*
256257
** COMMAND: test-ssh-far-side
@@ -288,19 +289,11 @@
288289
*/
289290
int transport_open(void){
290291
int rc = 0;
291292
if( transport.isOpen==0 ){
292293
if( g.urlIsSsh ){
293
- Blob cmd;
294
- blob_zero(&cmd);
295
- shell_escape(&cmd, g.urlFossil);
296
- blob_append(&cmd, " test-http ", -1);
297
- shell_escape(&cmd, g.urlPath);
298
- fprintf(sshOut, "%s || true\n", blob_str(&cmd));
299
- fflush(sshOut);
300
- if( g.fSshTrace ) printf("Sent: [%s]\n", blob_str(&cmd));
301
- blob_reset(&cmd);
294
+ /* no-op now */
302295
}else if( g.urlIsHttps ){
303296
#ifdef FOSSIL_ENABLE_SSL
304297
rc = ssl_open();
305298
if( rc==0 ) transport.isOpen = 1;
306299
#else
@@ -582,19 +575,23 @@
582575
if( g.fSshTrace ) printf("Got line: [%s]\n", &transport.pBuf[iStart]);
583576
return &transport.pBuf[iStart];
584577
}
585578
586579
void transport_global_shutdown(void){
587
- if( g.urlIsSsh && sshPid ){
588
- /*printf("Closing SSH tunnel: ");*/
589
- fflush(stdout);
590
- pclose2(sshIn, sshOut, sshPid);
591
- sshPid = 0;
592
- }
580
+ transport_global_ssh_shutdown();
593581
if( g.urlIsHttps ){
594582
#ifdef FOSSIL_ENABLE_SSL
595583
ssl_global_shutdown();
596584
#endif
597585
}else{
598586
socket_global_shutdown();
599587
}
600588
}
589
+
590
+void transport_global_ssh_shutdown(void){
591
+ if( g.urlIsSsh && sshPid ){
592
+ /*printf("Closing SSH tunnel: ");*/
593
+ fflush(stdout);
594
+ pclose2(sshIn, sshOut, sshPid);
595
+ sshPid = 0;
596
+ }
597
+}
601598
--- src/http_transport.c
+++ src/http_transport.c
@@ -183,13 +183,24 @@
183 ** and run an SSH command to talk to the remote machine.
184 */
185 const char *zSsh; /* The base SSH command */
186 Blob zCmd; /* The SSH command */
187 char *zHost; /* The host name to contact */
 
 
188 int n; /* Size of prefix string */
189
190 zSsh = db_get("ssh-command", zDefaultSshCmd);
 
 
 
 
 
 
 
 
 
191 blob_init(&zCmd, zSsh, -1);
192 if( g.urlPort!=g.urlDfltPort ){
193 #ifdef __MINGW32__
194 blob_appendf(&zCmd, " -P %d", g.urlPort);
195 #else
@@ -223,34 +234,24 @@
223 zHost = mprintf("%s", g.urlName);
224 }
225 n = blob_size(&zCmd);
226 blob_append(&zCmd, " ", 1);
227 shell_escape(&zCmd, zHost);
228 if( g.urlShell ){
229 blob_appendf(&zCmd, " %s", g.urlShell);
230 }else{
231 #if defined(FOSSIL_ENABLE_SSH_FAR_SIDE)
232 /* The following works. But only if the fossil on the remote side
233 ** is recent enough to support the test-ssh-far-side command. That
234 ** command was added on 2013-02-06. We will leave this turned off
235 ** until most fossil servers have upgraded to that version or a later
236 ** version. The sync will still work as long as the shell on the far
237 ** side is bash and not tcsh. And if the default far side shell is
238 ** tcsh, then the shell=/bin/bash query parameter can be used as a
239 ** work-around. Enable this code after about a year...
240 */
241 blob_appendf(&zCmd, " exec %s test-ssh-far-side", g.urlFossil);
242 #endif
243 }
244 fossil_print("%s\n", blob_str(&zCmd)+n); /* Show tail of SSH command */
245 free(zHost);
246 popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid);
247 if( sshPid==0 ){
248 fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd);
249 }
250 blob_reset(&zCmd);
251 transport_ssh_startup();
252 }
253 }
254
255 /*
256 ** COMMAND: test-ssh-far-side
@@ -288,19 +289,11 @@
288 */
289 int transport_open(void){
290 int rc = 0;
291 if( transport.isOpen==0 ){
292 if( g.urlIsSsh ){
293 Blob cmd;
294 blob_zero(&cmd);
295 shell_escape(&cmd, g.urlFossil);
296 blob_append(&cmd, " test-http ", -1);
297 shell_escape(&cmd, g.urlPath);
298 fprintf(sshOut, "%s || true\n", blob_str(&cmd));
299 fflush(sshOut);
300 if( g.fSshTrace ) printf("Sent: [%s]\n", blob_str(&cmd));
301 blob_reset(&cmd);
302 }else if( g.urlIsHttps ){
303 #ifdef FOSSIL_ENABLE_SSL
304 rc = ssl_open();
305 if( rc==0 ) transport.isOpen = 1;
306 #else
@@ -582,19 +575,23 @@
582 if( g.fSshTrace ) printf("Got line: [%s]\n", &transport.pBuf[iStart]);
583 return &transport.pBuf[iStart];
584 }
585
586 void transport_global_shutdown(void){
587 if( g.urlIsSsh && sshPid ){
588 /*printf("Closing SSH tunnel: ");*/
589 fflush(stdout);
590 pclose2(sshIn, sshOut, sshPid);
591 sshPid = 0;
592 }
593 if( g.urlIsHttps ){
594 #ifdef FOSSIL_ENABLE_SSL
595 ssl_global_shutdown();
596 #endif
597 }else{
598 socket_global_shutdown();
599 }
600 }
 
 
 
 
 
 
 
 
 
601
--- src/http_transport.c
+++ src/http_transport.c
@@ -183,13 +183,24 @@
183 ** and run an SSH command to talk to the remote machine.
184 */
185 const char *zSsh; /* The base SSH command */
186 Blob zCmd; /* The SSH command */
187 char *zHost; /* The host name to contact */
188 char *zPath; /* The path to the remote file for SSH */
189 char *zfCmd; /* The path to remote fossil for SSH */
190 int n; /* Size of prefix string */
191
192 zSsh = db_get("ssh-command", zDefaultSshCmd);
193 if( g.fSshRemoteCmd && g.fSshRemoteCmd[0] ){
194 zfCmd = g.fSshRemoteCmd;
195 db_set("last-ssh-remote-cmd", zfCmd, 0);
196 }else{
197 zfCmd = db_get("last-ssh-remote-cmd", 0);
198 if( zfCmd==0 ){
199 zfCmd = "fossil";
200 }
201 }
202 blob_init(&zCmd, zSsh, -1);
203 if( g.urlPort!=g.urlDfltPort ){
204 #ifdef __MINGW32__
205 blob_appendf(&zCmd, " -P %d", g.urlPort);
206 #else
@@ -223,34 +234,24 @@
234 zHost = mprintf("%s", g.urlName);
235 }
236 n = blob_size(&zCmd);
237 blob_append(&zCmd, " ", 1);
238 shell_escape(&zCmd, zHost);
239 blob_append(&zCmd, " ", 1);
240 shell_escape(&zCmd, zfCmd);
241 blob_append(&zCmd, " http ", 6);
242 if( g.urlPath && g.urlPath[0] ){
243 zPath = mprintf("%s", g.urlPath);
244 shell_escape(&zCmd, zPath);
 
 
 
 
 
 
 
 
 
245 }
246 fossil_print("%s\n", blob_str(&zCmd)+n); /* Show tail of SSH command */
247 free(zHost);
248 popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid);
249 if( sshPid==0 ){
250 fossil_fatal("cannot start ssh tunnel using [%b]", &zCmd);
251 }
252 blob_reset(&zCmd);
 
253 }
254 }
255
256 /*
257 ** COMMAND: test-ssh-far-side
@@ -288,19 +289,11 @@
289 */
290 int transport_open(void){
291 int rc = 0;
292 if( transport.isOpen==0 ){
293 if( g.urlIsSsh ){
294 /* no-op now */
 
 
 
 
 
 
 
 
295 }else if( g.urlIsHttps ){
296 #ifdef FOSSIL_ENABLE_SSL
297 rc = ssl_open();
298 if( rc==0 ) transport.isOpen = 1;
299 #else
@@ -582,19 +575,23 @@
575 if( g.fSshTrace ) printf("Got line: [%s]\n", &transport.pBuf[iStart]);
576 return &transport.pBuf[iStart];
577 }
578
579 void transport_global_shutdown(void){
580 transport_global_ssh_shutdown();
 
 
 
 
 
581 if( g.urlIsHttps ){
582 #ifdef FOSSIL_ENABLE_SSL
583 ssl_global_shutdown();
584 #endif
585 }else{
586 socket_global_shutdown();
587 }
588 }
589
590 void transport_global_ssh_shutdown(void){
591 if( g.urlIsSsh && sshPid ){
592 /*printf("Closing SSH tunnel: ");*/
593 fflush(stdout);
594 pclose2(sshIn, sshOut, sshPid);
595 sshPid = 0;
596 }
597 }
598
+2
--- src/main.c
+++ src/main.c
@@ -134,10 +134,11 @@
134134
int fSqlPrint; /* True if -sqlprint flag is present */
135135
int fQuiet; /* True if -quiet flag is present */
136136
int fHttpTrace; /* Trace outbound HTTP requests */
137137
int fSystemTrace; /* Trace calls to fossil_system(), --systemtrace */
138138
int fSshTrace; /* Trace the SSH setup traffic */
139
+ char *fSshRemoteCmd; /* Path to remoe fossil command for SSH */
139140
int fNoSync; /* Do not do an autosync ever. --nosync */
140141
char *zPath; /* Name of webpage being served */
141142
char *zExtra; /* Extra path information past the webpage name */
142143
char *zBaseURL; /* Full text of the URL being served */
143144
char *zTop; /* Parent directory of zPath */
@@ -578,10 +579,11 @@
578579
g.fQuiet = find_option("quiet", 0, 0)!=0;
579580
g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
580581
g.fSqlStats = find_option("sqlstats", 0, 0)!=0;
581582
g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
582583
g.fSshTrace = find_option("sshtrace", 0, 0)!=0;
584
+ g.fSshRemoteCmd = 0;
583585
if( g.fSqlTrace ) g.fSqlStats = 1;
584586
g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
585587
g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
586588
g.zLogin = find_option("user", "U", 1);
587589
g.zSSLIdentity = find_option("ssl-identity", 0, 1);
588590
--- src/main.c
+++ src/main.c
@@ -134,10 +134,11 @@
134 int fSqlPrint; /* True if -sqlprint flag is present */
135 int fQuiet; /* True if -quiet flag is present */
136 int fHttpTrace; /* Trace outbound HTTP requests */
137 int fSystemTrace; /* Trace calls to fossil_system(), --systemtrace */
138 int fSshTrace; /* Trace the SSH setup traffic */
 
139 int fNoSync; /* Do not do an autosync ever. --nosync */
140 char *zPath; /* Name of webpage being served */
141 char *zExtra; /* Extra path information past the webpage name */
142 char *zBaseURL; /* Full text of the URL being served */
143 char *zTop; /* Parent directory of zPath */
@@ -578,10 +579,11 @@
578 g.fQuiet = find_option("quiet", 0, 0)!=0;
579 g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
580 g.fSqlStats = find_option("sqlstats", 0, 0)!=0;
581 g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
582 g.fSshTrace = find_option("sshtrace", 0, 0)!=0;
 
583 if( g.fSqlTrace ) g.fSqlStats = 1;
584 g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
585 g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
586 g.zLogin = find_option("user", "U", 1);
587 g.zSSLIdentity = find_option("ssl-identity", 0, 1);
588
--- src/main.c
+++ src/main.c
@@ -134,10 +134,11 @@
134 int fSqlPrint; /* True if -sqlprint flag is present */
135 int fQuiet; /* True if -quiet flag is present */
136 int fHttpTrace; /* Trace outbound HTTP requests */
137 int fSystemTrace; /* Trace calls to fossil_system(), --systemtrace */
138 int fSshTrace; /* Trace the SSH setup traffic */
139 char *fSshRemoteCmd; /* Path to remoe fossil command for SSH */
140 int fNoSync; /* Do not do an autosync ever. --nosync */
141 char *zPath; /* Name of webpage being served */
142 char *zExtra; /* Extra path information past the webpage name */
143 char *zBaseURL; /* Full text of the URL being served */
144 char *zTop; /* Parent directory of zPath */
@@ -578,10 +579,11 @@
579 g.fQuiet = find_option("quiet", 0, 0)!=0;
580 g.fSqlTrace = find_option("sqltrace", 0, 0)!=0;
581 g.fSqlStats = find_option("sqlstats", 0, 0)!=0;
582 g.fSystemTrace = find_option("systemtrace", 0, 0)!=0;
583 g.fSshTrace = find_option("sshtrace", 0, 0)!=0;
584 g.fSshRemoteCmd = 0;
585 if( g.fSqlTrace ) g.fSqlStats = 1;
586 g.fSqlPrint = find_option("sqlprint", 0, 0)!=0;
587 g.fHttpTrace = find_option("httptrace", 0, 0)!=0;
588 g.zLogin = find_option("user", "U", 1);
589 g.zSSLIdentity = find_option("ssl-identity", 0, 1);
590
+1
--- src/sync.c
+++ src/sync.c
@@ -94,10 +94,11 @@
9494
*pSyncFlags |= SYNC_PRIVATE;
9595
}
9696
if( find_option("verbose","v",0)!=0 ){
9797
*pSyncFlags |= SYNC_VERBOSE;
9898
}
99
+ clone_ssh_options();
99100
url_proxy_options();
100101
db_find_and_open_repository(0, 0);
101102
db_open_config(0);
102103
if( g.argc==2 ){
103104
if( db_get_boolean("auto-shun",1) ) configSync = CONFIGSET_SHUN;
104105
--- src/sync.c
+++ src/sync.c
@@ -94,10 +94,11 @@
94 *pSyncFlags |= SYNC_PRIVATE;
95 }
96 if( find_option("verbose","v",0)!=0 ){
97 *pSyncFlags |= SYNC_VERBOSE;
98 }
 
99 url_proxy_options();
100 db_find_and_open_repository(0, 0);
101 db_open_config(0);
102 if( g.argc==2 ){
103 if( db_get_boolean("auto-shun",1) ) configSync = CONFIGSET_SHUN;
104
--- src/sync.c
+++ src/sync.c
@@ -94,10 +94,11 @@
94 *pSyncFlags |= SYNC_PRIVATE;
95 }
96 if( find_option("verbose","v",0)!=0 ){
97 *pSyncFlags |= SYNC_VERBOSE;
98 }
99 clone_ssh_options();
100 url_proxy_options();
101 db_find_and_open_repository(0, 0);
102 db_open_config(0);
103 if( g.argc==2 ){
104 if( db_get_boolean("auto-shun",1) ) configSync = CONFIGSET_SHUN;
105
+3 -2
--- src/xfer.c
+++ src/xfer.c
@@ -1387,16 +1387,16 @@
13871387
blob_appendf(&send, "push %s %s\n", zSCode, zPCode);
13881388
nCardSent++;
13891389
if( (syncFlags & SYNC_PULL)==0 ) zOpType = "Push";
13901390
}
13911391
manifest_crosslink_begin();
1392
- transport_global_startup();
13931392
if( syncFlags & SYNC_VERBOSE ){
13941393
fossil_print(zLabelFormat, "", "Bytes", "Cards", "Artifacts", "Deltas");
13951394
}
13961395
13971396
while( go ){
1397
+ transport_global_startup();
13981398
int newPhantom = 0;
13991399
char *zRandomness;
14001400
14011401
/* Send make the most recently received cookie. Let the server
14021402
** figure out if this is a cookie that it cares about.
@@ -1483,11 +1483,11 @@
14831483
xfer.nFileSent = 0;
14841484
xfer.nDeltaSent = 0;
14851485
xfer.nGimmeSent = 0;
14861486
xfer.nIGotSent = 0;
14871487
if( syncFlags & SYNC_VERBOSE ){
1488
- fossil_print("waiting for server...");
1488
+ fossil_print("waiting for server...\n");
14891489
}
14901490
fflush(stdout);
14911491
if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0,
14921492
MAX_REDIRECTS) ){
14931493
nErr++;
@@ -1824,10 +1824,11 @@
18241824
** we have gone at least two rounds. Always go at least two rounds
18251825
** on a clone in order to be sure to retrieve the configuration
18261826
** information which is only sent on the second round.
18271827
*/
18281828
if( cloneSeqno<=0 && nCycle>1 ) go = 0;
1829
+ transport_global_ssh_shutdown();
18291830
};
18301831
transport_stats(&nSent, &nRcvd, 1);
18311832
fossil_force_newline();
18321833
fossil_print(
18331834
"%s finished with %lld bytes sent, %lld bytes received\n",
18341835
--- src/xfer.c
+++ src/xfer.c
@@ -1387,16 +1387,16 @@
1387 blob_appendf(&send, "push %s %s\n", zSCode, zPCode);
1388 nCardSent++;
1389 if( (syncFlags & SYNC_PULL)==0 ) zOpType = "Push";
1390 }
1391 manifest_crosslink_begin();
1392 transport_global_startup();
1393 if( syncFlags & SYNC_VERBOSE ){
1394 fossil_print(zLabelFormat, "", "Bytes", "Cards", "Artifacts", "Deltas");
1395 }
1396
1397 while( go ){
 
1398 int newPhantom = 0;
1399 char *zRandomness;
1400
1401 /* Send make the most recently received cookie. Let the server
1402 ** figure out if this is a cookie that it cares about.
@@ -1483,11 +1483,11 @@
1483 xfer.nFileSent = 0;
1484 xfer.nDeltaSent = 0;
1485 xfer.nGimmeSent = 0;
1486 xfer.nIGotSent = 0;
1487 if( syncFlags & SYNC_VERBOSE ){
1488 fossil_print("waiting for server...");
1489 }
1490 fflush(stdout);
1491 if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0,
1492 MAX_REDIRECTS) ){
1493 nErr++;
@@ -1824,10 +1824,11 @@
1824 ** we have gone at least two rounds. Always go at least two rounds
1825 ** on a clone in order to be sure to retrieve the configuration
1826 ** information which is only sent on the second round.
1827 */
1828 if( cloneSeqno<=0 && nCycle>1 ) go = 0;
 
1829 };
1830 transport_stats(&nSent, &nRcvd, 1);
1831 fossil_force_newline();
1832 fossil_print(
1833 "%s finished with %lld bytes sent, %lld bytes received\n",
1834
--- src/xfer.c
+++ src/xfer.c
@@ -1387,16 +1387,16 @@
1387 blob_appendf(&send, "push %s %s\n", zSCode, zPCode);
1388 nCardSent++;
1389 if( (syncFlags & SYNC_PULL)==0 ) zOpType = "Push";
1390 }
1391 manifest_crosslink_begin();
 
1392 if( syncFlags & SYNC_VERBOSE ){
1393 fossil_print(zLabelFormat, "", "Bytes", "Cards", "Artifacts", "Deltas");
1394 }
1395
1396 while( go ){
1397 transport_global_startup();
1398 int newPhantom = 0;
1399 char *zRandomness;
1400
1401 /* Send make the most recently received cookie. Let the server
1402 ** figure out if this is a cookie that it cares about.
@@ -1483,11 +1483,11 @@
1483 xfer.nFileSent = 0;
1484 xfer.nDeltaSent = 0;
1485 xfer.nGimmeSent = 0;
1486 xfer.nIGotSent = 0;
1487 if( syncFlags & SYNC_VERBOSE ){
1488 fossil_print("waiting for server...\n");
1489 }
1490 fflush(stdout);
1491 if( http_exchange(&send, &recv, (syncFlags & SYNC_CLONE)==0 || nCycle>0,
1492 MAX_REDIRECTS) ){
1493 nErr++;
@@ -1824,10 +1824,11 @@
1824 ** we have gone at least two rounds. Always go at least two rounds
1825 ** on a clone in order to be sure to retrieve the configuration
1826 ** information which is only sent on the second round.
1827 */
1828 if( cloneSeqno<=0 && nCycle>1 ) go = 0;
1829 transport_global_ssh_shutdown();
1830 };
1831 transport_stats(&nSent, &nRcvd, 1);
1832 fossil_force_newline();
1833 fossil_print(
1834 "%s finished with %lld bytes sent, %lld bytes received\n",
1835

Keyboard Shortcuts

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