[glib-networking/wip/openssl: 26/27] bio: return 0 if we have nothing to read or to write



commit bfe3bf99016a5ddf8fd509d6e26d0b7eb1aaae56
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed Oct 28 23:10:39 2015 +0100

    bio: return 0 if we have nothing to read or to write

 tls/openssl/gtlsbio.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/tls/openssl/gtlsbio.c b/tls/openssl/gtlsbio.c
index a8b317d..24dd48f 100644
--- a/tls/openssl/gtlsbio.c
+++ b/tls/openssl/gtlsbio.c
@@ -112,6 +112,9 @@ gtls_bio_write (BIO        *bio,
 {
   GTlsBio *gbio;
 
+  if (in == NULL || inl == 0)
+    return 0;
+
   gbio = (GTlsBio *)bio->ptr;
 
   return g_pollable_stream_write (g_io_stream_get_output_stream (gbio->io_stream),
@@ -128,6 +131,9 @@ gtls_bio_read (BIO  *bio,
 {
   GTlsBio *gbio;
 
+  if (out == NULL || outl == 0)
+    return 0;
+
   gbio = (GTlsBio *)bio->ptr;
 
   return g_pollable_stream_read (g_io_stream_get_input_stream (gbio->io_stream),


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