static void ssh_size(void *handle, int width, int height);
static void ssh_special(void *handle, Telnet_Special);
static int ssh2_try_send(struct ssh_channel *c);
-static void ssh2_add_channel_data(struct ssh_channel *c,
- const char *buf, int len);
+static int ssh2_send_channel_data(struct ssh_channel *c,
+ const char *buf, int len);
static void ssh_throttle_all(Ssh ssh, int enable, int bufsize);
static void ssh2_set_window(struct ssh_channel *c, int newwin);
static int ssh_sendbuffer(void *handle);
replylen = 5;
}
if (ssh->version == 2) {
- ssh2_add_channel_data(c, sentreply, replylen);
- ssh2_try_send(c);
+ ssh2_send_channel_data(c, sentreply, replylen);
} else {
send_packet(ssh, SSH1_MSG_CHANNEL_DATA,
PKT_INT, c->remoteid,
*/
return 0;
} else {
- ssh2_add_channel_data(c, buf, len);
- return ssh2_try_send(c);
+ return ssh2_send_channel_data(c, buf, len);
}
}
}
/*
- * Add data to an SSH-2 channel output buffer.
+ * Add data to an SSH-2 channel output buffer and send it if possible.
*/
-static void ssh2_add_channel_data(struct ssh_channel *c, const char *buf,
- int len)
+static int ssh2_send_channel_data(struct ssh_channel *c, const char *buf,
+ int len)
{
bufchain_add(&c->v.v2.outbuffer, buf, len);
+ return ssh2_try_send(c);
}
/*
/*
* We have spare data. Add it to the channel buffer.
*/
- ssh2_add_channel_data(ssh->mainchan, (char *)in, inlen);
- ssh2_try_send(ssh->mainchan);
+ ssh2_send_channel_data(ssh->mainchan, (char *)in, inlen);
}
}