aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormilo <milo@r0ot.me>2012-05-05 17:43:14 +0200
committermilo <milo@r0ot.me>2012-05-05 18:04:13 +0200
commite9cad27593347e0de4ed393eff908ea25d12670c (patch)
treee74949ca8f5ac22fb17dfc27760c03a293ef0a21
parentc2fd6341c98393741d1eeb4ae89829e9ccb78451 (diff)
downloadlibssh-e9cad27593347e0de4ed393eff908ea25d12670c.tar.gz
libssh-e9cad27593347e0de4ed393eff908ea25d12670c.tar.xz
libssh-e9cad27593347e0de4ed393eff908ea25d12670c.zip
Don't read when writing to avoid recursive callback callsHEADmaster
-rw-r--r--src/channels.c7
-rw-r--r--src/session.c5
2 files changed, 11 insertions, 1 deletions
diff --git a/src/channels.c b/src/channels.c
index c9d9753..16c7c60 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -1211,6 +1211,8 @@ error:
}
/* this termination function waits for a window growing condition */
+#if WITH_SERVER
+#else
static int ssh_channel_waitwindow_termination(void *c){
ssh_channel channel = (ssh_channel) c;
if (channel->remote_window > 0 ||
@@ -1219,7 +1221,7 @@ static int ssh_channel_waitwindow_termination(void *c){
else
return 0;
}
-
+#endif
/**
* @internal
* @brief Flushes a channel (and its session) until the output buffer
@@ -1298,9 +1300,12 @@ int channel_write_common(ssh_channel channel, const void *data,
/* nothing can be written */
ssh_log(session, SSH_LOG_PROTOCOL,
"Wait for a growing window message...");
+#if WITH_SERVER
+#else
rc = ssh_handle_packets_termination(session, SSH_TIMEOUT_USER,
ssh_channel_waitwindow_termination,channel);
if (rc == SSH_ERROR || !ssh_channel_waitwindow_termination(channel))
+#endif
goto out;
continue;
}
diff --git a/src/session.c b/src/session.c
index 1e81edc..09da62b 100644
--- a/src/session.c
+++ b/src/session.c
@@ -330,12 +330,17 @@ int ssh_blocking_flush(ssh_session session, int timeout){
return SSH_ERROR;
enter_function();
+#ifdef WITH_SERVER
+ (void)timeout;
+#else
rc = ssh_handle_packets_termination(session, timeout,
ssh_flush_termination, session);
if (rc == SSH_ERROR)
goto end;
+#endif
if (!ssh_flush_termination(session))
rc = SSH_AGAIN;
+ goto end;
end:
leave_function();
return rc;