[hotssh] libgssh: Don't process read/write tasks multiple times



commit 64d58f42a79058e6fd677649dce292f1c854ac1f
Author: Colin Walters <walters verbum org>
Date:   Thu Oct 10 21:59:05 2013 -0400

    libgssh: Don't process read/write tasks multiple times

 libgssh/gssh-channel-input-stream.c  |    3 +++
 libgssh/gssh-channel-output-stream.c |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/libgssh/gssh-channel-input-stream.c b/libgssh/gssh-channel-input-stream.c
index fe0f310..e392d06 100644
--- a/libgssh/gssh-channel-input-stream.c
+++ b/libgssh/gssh-channel-input-stream.c
@@ -190,6 +190,9 @@ _gssh_channel_input_stream_iteration (GSshChannelInputStream     *self)
   GError *local_error = NULL;
   GTask *prev_task = self->read_task;
 
+  if (!prev_task)
+    return;
+
   g_assert (!self->is_closed);
   rc = libssh2_channel_read (self->channel->libsshchannel,
                              self->buf, self->count);
diff --git a/libgssh/gssh-channel-output-stream.c b/libgssh/gssh-channel-output-stream.c
index b931fc9..2d5d02d 100644
--- a/libgssh/gssh-channel-output-stream.c
+++ b/libgssh/gssh-channel-output-stream.c
@@ -235,6 +235,9 @@ _gssh_channel_output_stream_iteration (GSshChannelOutputStream     *self)
         const guint8 *data;
         GTask *prev_write_task = self->write_task;
 
+        if (!prev_write_task)
+          return;
+
         data = g_bytes_get_data (self->buf, &bufsize);
         rc = libssh2_channel_write (self->channel->libsshchannel,
                                     (const char*)data, bufsize);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]