Make sure we handle G_IO_IN before we handle G_IO_HUP so we don't lose
authorJoe Shaw <joe@ximian.com>
Mon, 22 Oct 2001 20:13:32 +0000 (20:13 +0000)
committerJoe Shaw <joeshaw@src.gnome.org>
Mon, 22 Oct 2001 20:13:32 +0000 (20:13 +0000)
2001-10-22  Joe Shaw  <joe@ximian.com>

* src/soup-ssl-proxy/soup-ssl-proxy.c (soup_ssl_proxy_readwrite):
Make sure we handle G_IO_IN before we handle G_IO_HUP so we don't
lose data on the pipe, as you can receive both at the same time.
Ian Peters actually found this, but I am his commit monkey.

ChangeLog
libsoup/soup-ssl-proxy.c

index da267e5..493144d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-10-22  Joe Shaw  <joe@ximian.com>
+
+       * src/soup-ssl-proxy/soup-ssl-proxy.c (soup_ssl_proxy_readwrite):
+       Make sure we handle G_IO_IN before we handle G_IO_HUP so we don't
+       lose data on the pipe, as you can receive both at the same time.
+       Ian Peters actually found this, but I am his commit monkey.
+
 2001-10-22  JP Rosevear  <jpr@ximian.com>
 
        * src/libsoup/soup-dav.c (soup_dav_response_new): use new error
index 580540e..ce73b5f 100644 (file)
@@ -111,8 +111,6 @@ soup_ssl_proxy_readwrite (GIOChannel   *iochannel,
        gint bytes_read = 0, bytes_written = 0, write_total = 0;
        GIOError error;
 
-       if (condition & (G_IO_HUP | G_IO_ERR)) goto FINISH;
-
        error = g_io_channel_read (iochannel,
                                   read_buf,
                                   sizeof (read_buf),
@@ -135,6 +133,8 @@ soup_ssl_proxy_readwrite (GIOChannel   *iochannel,
                write_total += bytes_written;
        }
 
+       if (condition & (G_IO_HUP | G_IO_ERR)) goto FINISH;
+
        return TRUE;
 
  FINISH: