Fossil SCM
attemp to fix ssh problem on debian linux host when non interactive shell still print some message (motd and mail checking stuff). *** not really working yet..
Commit
66a45382ebd52f0216ea375f85aaf89a640798cd
Parent
274d8a1dcd3b1ea…
1 file changed
+4
-1
+4
-1
| --- src/http_transport.c | ||
| +++ src/http_transport.c | ||
| @@ -158,13 +158,16 @@ | ||
| 158 | 158 | blob_reset(&zCmd); |
| 159 | 159 | |
| 160 | 160 | /* Send an "echo" command to the other side to make sure that the |
| 161 | 161 | ** connection is up and working. |
| 162 | 162 | */ |
| 163 | + zIn = fossil_malloc(16000); | |
| 164 | + fprintf(sshOut, "echo .\n"); | |
| 165 | + fflush(sshOut); | |
| 166 | + sshin_read(zIn, 16000); | |
| 163 | 167 | fprintf(sshOut, "echo test\n"); |
| 164 | 168 | fflush(sshOut); |
| 165 | - zIn = fossil_malloc(16000); | |
| 166 | 169 | sshin_read(zIn, 16000); |
| 167 | 170 | if( memcmp(zIn, "test", 4)!=0 ){ |
| 168 | 171 | pclose2(sshIn, sshOut, sshPid); |
| 169 | 172 | fossil_fatal("ssh connection failed: [%s]", zIn); |
| 170 | 173 | } |
| 171 | 174 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -158,13 +158,16 @@ | |
| 158 | blob_reset(&zCmd); |
| 159 | |
| 160 | /* Send an "echo" command to the other side to make sure that the |
| 161 | ** connection is up and working. |
| 162 | */ |
| 163 | fprintf(sshOut, "echo test\n"); |
| 164 | fflush(sshOut); |
| 165 | zIn = fossil_malloc(16000); |
| 166 | sshin_read(zIn, 16000); |
| 167 | if( memcmp(zIn, "test", 4)!=0 ){ |
| 168 | pclose2(sshIn, sshOut, sshPid); |
| 169 | fossil_fatal("ssh connection failed: [%s]", zIn); |
| 170 | } |
| 171 |
| --- src/http_transport.c | |
| +++ src/http_transport.c | |
| @@ -158,13 +158,16 @@ | |
| 158 | blob_reset(&zCmd); |
| 159 | |
| 160 | /* Send an "echo" command to the other side to make sure that the |
| 161 | ** connection is up and working. |
| 162 | */ |
| 163 | zIn = fossil_malloc(16000); |
| 164 | fprintf(sshOut, "echo .\n"); |
| 165 | fflush(sshOut); |
| 166 | sshin_read(zIn, 16000); |
| 167 | fprintf(sshOut, "echo test\n"); |
| 168 | fflush(sshOut); |
| 169 | sshin_read(zIn, 16000); |
| 170 | if( memcmp(zIn, "test", 4)!=0 ){ |
| 171 | pclose2(sshIn, sshOut, sshPid); |
| 172 | fossil_fatal("ssh connection failed: [%s]", zIn); |
| 173 | } |
| 174 |