Fossil SCM

work time to time.. *** rely on a delay, which is not good don't work all the time... need to build more solid logic..

martine 2012-09-12 02:19 mg_sshfix
Commit 5d00d241f78610c3b37336dfd1ea37871e8707f6
1 file changed +3 -1
--- src/http_transport.c
+++ src/http_transport.c
@@ -159,13 +159,15 @@
159159
160160
/* Send an "echo" command to the other side to make sure that the
161161
** connection is up and working.
162162
*/
163163
zIn = fossil_malloc(16000);
164
- fprintf(sshOut, "echo .\n");
164
+ fprintf(sshOut, "echo toto\n");
165165
fflush(sshOut);
166
+ usleep(2000000);
166167
sshin_read(zIn, 16000);
168
+ fossil_print("Second Read: [%s]\n", zIn);
167169
fprintf(sshOut, "echo test\n");
168170
fflush(sshOut);
169171
sshin_read(zIn, 16000);
170172
if( memcmp(zIn, "test", 4)!=0 ){
171173
pclose2(sshIn, sshOut, sshPid);
172174
--- src/http_transport.c
+++ src/http_transport.c
@@ -159,13 +159,15 @@
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
--- src/http_transport.c
+++ src/http_transport.c
@@ -159,13 +159,15 @@
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 toto\n");
165 fflush(sshOut);
166 usleep(2000000);
167 sshin_read(zIn, 16000);
168 fossil_print("Second Read: [%s]\n", zIn);
169 fprintf(sshOut, "echo test\n");
170 fflush(sshOut);
171 sshin_read(zIn, 16000);
172 if( memcmp(zIn, "test", 4)!=0 ){
173 pclose2(sshIn, sshOut, sshPid);
174

Keyboard Shortcuts

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