Fossil SCM
Only print SSH command string if --sshtrace is enabled.
Commit
0088ab83f64faf33ed0a40ec1d9032a57340e05b
Parent
e880c032e9c73db…
1 file changed
+2
-4
+2
-4
| --- src/http_transport.c | ||
| +++ src/http_transport.c | ||
| @@ -90,11 +90,10 @@ | ||
| 90 | 90 | */ |
| 91 | 91 | int transport_ssh_open(void){ |
| 92 | 92 | /* For SSH we need to create and run SSH fossil http |
| 93 | 93 | ** to talk to the remote machine. |
| 94 | 94 | */ |
| 95 | - static int fPrintSshCmd = 1; /* Print SSH command only once */ | |
| 96 | 95 | const char *zSsh; /* The base SSH command */ |
| 97 | 96 | Blob zCmd; /* The SSH command */ |
| 98 | 97 | char *zHost; /* The host name to contact */ |
| 99 | 98 | int n; /* Size of prefix string */ |
| 100 | 99 | |
| @@ -106,11 +105,11 @@ | ||
| 106 | 105 | blob_appendf(&zCmd, " -P %d", g.urlPort); |
| 107 | 106 | #else |
| 108 | 107 | blob_appendf(&zCmd, " -p %d", g.urlPort); |
| 109 | 108 | #endif |
| 110 | 109 | } |
| 111 | - if( fPrintSshCmd ){ | |
| 110 | + if( g.fSshTrace ){ | |
| 112 | 111 | fossil_force_newline(); |
| 113 | 112 | fossil_print("%s", blob_str(&zCmd)); /* Show the base of the SSH command */ |
| 114 | 113 | } |
| 115 | 114 | if( g.urlUser && g.urlUser[0] ){ |
| 116 | 115 | zHost = mprintf("%s@%s", g.urlUser, g.urlName); |
| @@ -125,13 +124,12 @@ | ||
| 125 | 124 | blob_append(&zCmd, " test-http", 10); |
| 126 | 125 | if( g.urlPath && g.urlPath[0] ){ |
| 127 | 126 | blob_append(&zCmd, " ", 1); |
| 128 | 127 | shell_escape(&zCmd, mprintf("%s", g.urlPath)); |
| 129 | 128 | } |
| 130 | - if( fPrintSshCmd ){ | |
| 129 | + if( g.fSshTrace ){ | |
| 131 | 130 | fossil_print("%s\n", blob_str(&zCmd)+n); /* Show tail of SSH command */ |
| 132 | - fPrintSshCmd = 0; | |
| 133 | 131 | } |
| 134 | 132 | free(zHost); |
| 135 | 133 | popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid); |
| 136 | 134 | if( sshPid==0 ){ |
| 137 | 135 | socket_set_errmsg("cannot start ssh tunnel using [%b]", &zCmd); |
| 138 | 136 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -90,11 +90,10 @@ | |
| 90 | */ |
| 91 | int transport_ssh_open(void){ |
| 92 | /* For SSH we need to create and run SSH fossil http |
| 93 | ** to talk to the remote machine. |
| 94 | */ |
| 95 | static int fPrintSshCmd = 1; /* Print SSH command only once */ |
| 96 | const char *zSsh; /* The base SSH command */ |
| 97 | Blob zCmd; /* The SSH command */ |
| 98 | char *zHost; /* The host name to contact */ |
| 99 | int n; /* Size of prefix string */ |
| 100 | |
| @@ -106,11 +105,11 @@ | |
| 106 | blob_appendf(&zCmd, " -P %d", g.urlPort); |
| 107 | #else |
| 108 | blob_appendf(&zCmd, " -p %d", g.urlPort); |
| 109 | #endif |
| 110 | } |
| 111 | if( fPrintSshCmd ){ |
| 112 | fossil_force_newline(); |
| 113 | fossil_print("%s", blob_str(&zCmd)); /* Show the base of the SSH command */ |
| 114 | } |
| 115 | if( g.urlUser && g.urlUser[0] ){ |
| 116 | zHost = mprintf("%s@%s", g.urlUser, g.urlName); |
| @@ -125,13 +124,12 @@ | |
| 125 | blob_append(&zCmd, " test-http", 10); |
| 126 | if( g.urlPath && g.urlPath[0] ){ |
| 127 | blob_append(&zCmd, " ", 1); |
| 128 | shell_escape(&zCmd, mprintf("%s", g.urlPath)); |
| 129 | } |
| 130 | if( fPrintSshCmd ){ |
| 131 | fossil_print("%s\n", blob_str(&zCmd)+n); /* Show tail of SSH command */ |
| 132 | fPrintSshCmd = 0; |
| 133 | } |
| 134 | free(zHost); |
| 135 | popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid); |
| 136 | if( sshPid==0 ){ |
| 137 | socket_set_errmsg("cannot start ssh tunnel using [%b]", &zCmd); |
| 138 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -90,11 +90,10 @@ | |
| 90 | */ |
| 91 | int transport_ssh_open(void){ |
| 92 | /* For SSH we need to create and run SSH fossil http |
| 93 | ** to talk to the remote machine. |
| 94 | */ |
| 95 | const char *zSsh; /* The base SSH command */ |
| 96 | Blob zCmd; /* The SSH command */ |
| 97 | char *zHost; /* The host name to contact */ |
| 98 | int n; /* Size of prefix string */ |
| 99 | |
| @@ -106,11 +105,11 @@ | |
| 105 | blob_appendf(&zCmd, " -P %d", g.urlPort); |
| 106 | #else |
| 107 | blob_appendf(&zCmd, " -p %d", g.urlPort); |
| 108 | #endif |
| 109 | } |
| 110 | if( g.fSshTrace ){ |
| 111 | fossil_force_newline(); |
| 112 | fossil_print("%s", blob_str(&zCmd)); /* Show the base of the SSH command */ |
| 113 | } |
| 114 | if( g.urlUser && g.urlUser[0] ){ |
| 115 | zHost = mprintf("%s@%s", g.urlUser, g.urlName); |
| @@ -125,13 +124,12 @@ | |
| 124 | blob_append(&zCmd, " test-http", 10); |
| 125 | if( g.urlPath && g.urlPath[0] ){ |
| 126 | blob_append(&zCmd, " ", 1); |
| 127 | shell_escape(&zCmd, mprintf("%s", g.urlPath)); |
| 128 | } |
| 129 | if( g.fSshTrace ){ |
| 130 | fossil_print("%s\n", blob_str(&zCmd)+n); /* Show tail of SSH command */ |
| 131 | } |
| 132 | free(zHost); |
| 133 | popen2(blob_str(&zCmd), &sshIn, &sshOut, &sshPid); |
| 134 | if( sshPid==0 ){ |
| 135 | socket_set_errmsg("cannot start ssh tunnel using [%b]", &zCmd); |
| 136 |