[gssdp] Minor style fix



commit 899327e9f6d399db36cd8d5862ae03c02a0236c1
Author: Jens Georg <mail jensge org>
Date:   Sun May 7 17:07:43 2017 +0200

    Minor style fix

 libgssdp/gssdp-client.c        |   21 +++++++++++----------
 libgssdp/gssdp-socket-source.c |   10 +++++-----
 2 files changed, 16 insertions(+), 15 deletions(-)
---
diff --git a/libgssdp/gssdp-client.c b/libgssdp/gssdp-client.c
index b123475..bf7949a 100644
--- a/libgssdp/gssdp-client.c
+++ b/libgssdp/gssdp-client.c
@@ -193,14 +193,14 @@ gssdp_client_initable_init (GInitable                   *initable,
                                          priv->socket_ttl,
                                          priv->device.iface_name,
                                          &internal_error);
-        if (priv->request_socket != NULL) {
-                gssdp_socket_source_set_callback
+        if (priv->request_socket == NULL) {
+                goto errors;
+        }
+
+        gssdp_socket_source_set_callback
                         (priv->request_socket,
                         (GSourceFunc) request_socket_source_cb,
                         client);
-        } else {
-                goto errors;
-        }
 
         priv->multicast_socket =
                 gssdp_socket_source_new (GSSDP_SOCKET_SOURCE_TYPE_MULTICAST,
@@ -208,14 +208,14 @@ gssdp_client_initable_init (GInitable                   *initable,
                                          priv->socket_ttl,
                                          priv->device.iface_name,
                                          &internal_error);
-        if (priv->multicast_socket != NULL) {
-                gssdp_socket_source_set_callback
+        if (priv->multicast_socket == NULL) {
+            goto errors;
+        }
+
+        gssdp_socket_source_set_callback
                         (priv->multicast_socket,
                          (GSourceFunc) multicast_socket_source_cb,
                          client);
-        } else {
-                goto errors;
-        }
 
         /* Setup send socket. For security reasons, it is not recommended to
          * send M-SEARCH with source port == SSDP_PORT */
@@ -236,6 +236,7 @@ gssdp_client_initable_init (GInitable                   *initable,
                                          (GSourceFunc) search_socket_source_cb,
                                          client);
         }
+
  errors:
         if (!priv->request_socket ||
             !priv->multicast_socket ||
diff --git a/libgssdp/gssdp-socket-source.c b/libgssdp/gssdp-socket-source.c
index 48c3226..bdeb3fe 100644
--- a/libgssdp/gssdp-socket-source.c
+++ b/libgssdp/gssdp-socket-source.c
@@ -213,9 +213,9 @@ gssdp_socket_source_do_init (GInitable                   *initable,
 
         /* Create socket */
         priv->socket = g_socket_new (G_SOCKET_FAMILY_IPV4,
-                                           G_SOCKET_TYPE_DATAGRAM,
-                                           G_SOCKET_PROTOCOL_UDP,
-                                           &inner_error);
+                                     G_SOCKET_TYPE_DATAGRAM,
+                                     G_SOCKET_PROTOCOL_UDP,
+                                     &inner_error);
 
         if (!priv->socket) {
                 g_propagate_prefixed_error (error,
@@ -330,8 +330,8 @@ gssdp_socket_source_do_init (GInitable                   *initable,
         }
 
         priv->source = g_socket_create_source (priv->socket,
-                                                     G_IO_IN | G_IO_ERR,
-                                                     NULL);
+                                               G_IO_IN | G_IO_ERR,
+                                               NULL);
         success = TRUE;
 
 error:


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