Merge pull request #33 from kempniu/GIOCondition-is-a-bit-field
authorMikael Berthe <mikael@lilotux.net>
Wed, 26 Sep 2018 21:45:08 +0200
changeset 724 3cd39dfd5ff7
parent 722 80579726ccb4 (current diff)
parent 723 c4953bf0a53d (diff)
child 725 05fa3e01e5b1
child 726 ea6aaf57f344
child 727 4d5bce4b7832
Merge pull request #33 from kempniu/GIOCondition-is-a-bit-field GIOCondition is a bit field committer: GitHub <noreply@github.com>
--- a/loudmouth/lm-old-socket.c	Sun May 14 12:12:09 2017 +0200
+++ b/loudmouth/lm-old-socket.c	Wed Sep 26 21:45:08 2018 +0200
@@ -517,7 +517,7 @@
     /* addr = connect_data->current_addr; */
     fd = g_io_channel_unix_get_fd (source);
 
-    if (condition == G_IO_ERR) {
+    if (condition & G_IO_ERR) {
         len = sizeof (err);
         _lm_sock_get_error (fd, &err, &len);
         if (!_lm_sock_is_blocking_error (err)) {
--- a/loudmouth/lm-proxy.c	Sun May 14 12:12:09 2017 +0200
+++ b/loudmouth/lm-proxy.c	Wed Sep 26 21:45:08 2018 +0200
@@ -218,12 +218,12 @@
 
     g_return_val_if_fail (proxy != NULL, FALSE);
 
-    if (condition == G_IO_ERR) {
+    if (condition & G_IO_ERR) {
         len = sizeof (error);
         _lm_sock_get_error (connect_data->fd, &error, &len);
         _lm_old_socket_failed_with_error (connect_data, error);
         return FALSE;
-    } else if (condition == G_IO_OUT) {
+    } else if (condition & G_IO_OUT) {
         if (!proxy_negotiate (lm_connection_get_proxy (connection), connect_data->fd, lm_connection_get_server (connection), lm_connection_get_port (connection))) {
             _lm_old_socket_failed (connect_data);
             return FALSE;