Fix: Make remote disconnect detection work
authorDenis Kenzior <denkenz@gmail.com>
Thu, 14 Jan 2010 16:25:14 +0000 (10:25 -0600)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 14 Jan 2010 20:51:41 +0000 (12:51 -0800)
gatchat/gatchat.c

index ea17335..8af927e 100644 (file)
@@ -801,7 +801,7 @@ static gboolean received_data(GIOChannel *channel, GIOCondition cond,
        if (cond & (G_IO_HUP | G_IO_ERR))
                return FALSE;
 
-       if (err != G_IO_ERROR_NONE && err != G_IO_ERROR_AGAIN)
+       if (rbytes == 0 && err != G_IO_ERROR_AGAIN)
                return FALSE;
 
        return TRUE;