70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
+
+
+
|
** Global initialization of the transport layer
*/
void transport_global_startup(void){
if( g.urlIsSsh ){
char *zCmd;
int i;
char zIn[200];
#ifdef __MINGW32__
fossil_fatal("the ssh:// sync method is currently only supported on unix");
#endif
if( g.urlUser && g.urlUser[0] ){
zCmd = mprintf(
"ssh -L127.0.0.1:%d:127.0.0.1:%d %s@%s "
"\"fossil server -P %d '%s'\"",
g.urlPort, g.urlPort, g.urlUser, g.urlSshHost, g.urlPort, g.urlPath
);
}else{
|
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
|
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
|
+
+
|
}
/* printf("Got line: [%s]\n", &transport.pBuf[iStart]); */
return &transport.pBuf[iStart];
}
void transport_global_shutdown(void){
if( g.urlIsSsh && g.sshPid ){
printf("Closing SSH tunnel: ");
fflush(stdout);
pclose2(g.sshIn, g.sshOut, g.sshPid);
g.sshPid = 0;
}
if( g.urlIsHttps ){
#ifdef FOSSIL_ENABLE_SSL
ssl_global_shutdown();
#endif
}else{
socket_global_shutdown();
}
}
|