aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libssh/channels.h5
-rw-r--r--src/channels.c12
-rw-r--r--src/connect.c1
3 files changed, 12 insertions, 6 deletions
diff --git a/include/libssh/channels.h b/include/libssh/channels.h
index fc03965a..bbabcfd1 100644
--- a/include/libssh/channels.h
+++ b/include/libssh/channels.h
@@ -97,8 +97,9 @@ SSH_PACKET_CALLBACK(channel_rcv_close);
SSH_PACKET_CALLBACK(channel_rcv_request);
SSH_PACKET_CALLBACK(channel_rcv_data);
-int channel_default_bufferize(ssh_channel channel, void *data, int len,
- int is_stderr);
+int channel_default_bufferize(ssh_channel channel,
+ void *data, size_t len,
+ bool is_stderr);
int ssh_channel_flush(ssh_channel channel);
uint32_t ssh_channel_new_id(ssh_session session);
ssh_channel ssh_channel_from_local(ssh_session session, uint32_t id);
diff --git a/src/channels.c b/src/channels.c
index ebec0a6a..eeb94c0b 100644
--- a/src/channels.c
+++ b/src/channels.c
@@ -844,8 +844,10 @@ SSH_PACKET_CALLBACK(channel_rcv_request) {
*
* FIXME is the window changed?
*/
-int channel_default_bufferize(ssh_channel channel, void *data, int len,
- int is_stderr) {
+int channel_default_bufferize(ssh_channel channel,
+ void *data, size_t len,
+ bool is_stderr)
+{
ssh_session session;
if(channel == NULL) {
@@ -860,8 +862,10 @@ int channel_default_bufferize(ssh_channel channel, void *data, int len,
}
SSH_LOG(SSH_LOG_PACKET,
- "placing %d bytes into channel buffer (stderr=%d)", len, is_stderr);
- if (is_stderr == 0) {
+ "placing %zu bytes into channel buffer (%s)",
+ len,
+ is_stderr ? "stderr" : "stdout");
+ if (!is_stderr) {
/* stdout */
if (channel->stdout_buffer == NULL) {
channel->stdout_buffer = ssh_buffer_new();
diff --git a/src/connect.c b/src/connect.c
index 124b9f56..252e2c63 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -25,6 +25,7 @@
#include <errno.h>
#include <fcntl.h>
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>