[gtk-vnc] Reset 'blocking' flag after I/O wait



commit e7c0fce768d0abe2952e50c3864932a133e32673
Author: Daniel P. Berrange <berrange redhat com>
Date:   Mon Sep 16 13:32:38 2013 +0100

    Reset 'blocking' flag after I/O wait
    
    If the 'vnc_connection_read_wire' goes into an I/O wait
    due to blocking I/O, the 'blocking' flag gets set to
    true. Upon returning from the wait, it jumps back to
    the start of the function, but does not reset the 'blocking'
    flag to false. If the I/O attempt succeeds, this doesn't
    matter, but if it fails for an error reason, this gets
    mistakenly treated as blocking I/O again.
    
    This is seen most often when the remote server drops the
    connection. If the client was blocking on I/O at this
    time, it could get into a potentially infinite loop.
    
      https://bugzilla.gnome.org/show_bug.cgi?id=704098
    
    Signed-off-by: Daniel P. Berrange <berrange redhat com>

 src/vncconnection.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/src/vncconnection.c b/src/vncconnection.c
index d476dd4..3f6f1bd 100644
--- a/src/vncconnection.c
+++ b/src/vncconnection.c
@@ -713,6 +713,7 @@ static int vnc_connection_read_wire(VncConnection *conn, void *data, size_t len)
             } else {
                 g_io_wait(priv->sock, G_IO_IN);
             }
+            blocking = FALSE;
             goto reread;
         } else {
             priv->has_error = TRUE;


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