[hotssh] libgssh: Only iterate on input/output streams if they've been allocated



commit 67c5b37a8015d4958c2788bec8ec6fe92faa87d3
Author: Colin Walters <walters verbum org>
Date:   Fri Oct 18 14:33:33 2013 -0400

    libgssh: Only iterate on input/output streams if they've been allocated
    
    It's possible for channels to still be in the process of creation.

 libgssh/gssh-connection.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/libgssh/gssh-connection.c b/libgssh/gssh-connection.c
index 09997c6..9f90fbf 100644
--- a/libgssh/gssh-connection.c
+++ b/libgssh/gssh-connection.c
@@ -196,7 +196,8 @@ process_channel_reads (GSshConnection   *self)
   while (g_hash_table_iter_next (&hiter, &hkey, &hvalue))
     {
       GSshChannel *channel = hkey;
-      _gssh_channel_input_stream_iteration (channel->input_stream);
+      if (channel->input_stream)
+        _gssh_channel_input_stream_iteration (channel->input_stream);
     }
 }
 
@@ -210,7 +211,8 @@ process_channel_writes (GSshConnection   *self)
   while (g_hash_table_iter_next (&hiter, &hkey, &hvalue))
     {
       GSshChannel *channel = hkey;
-      _gssh_channel_output_stream_iteration (channel->output_stream);
+      if (channel->output_stream)
+        _gssh_channel_output_stream_iteration (channel->output_stream);
     }
 }
 


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