[Telepathy-commits] [telepathy-salut/master] src/tube-stream.c: reorder checks in salut_tube_stream_accept_stream_tube

Alban Crequy alban.crequy at collabora.co.uk
Fri Feb 6 03:14:57 PST 2009


---
 src/tube-stream.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/tube-stream.c b/src/tube-stream.c
index f9041a9..e9ed66e 100644
--- a/src/tube-stream.c
+++ b/src/tube-stream.c
@@ -2261,6 +2261,15 @@ salut_tube_stream_accept_stream_tube (SalutSvcChannelTypeStreamTube *iface,
   SalutTubeStreamPrivate *priv = SALUT_TUBE_STREAM_GET_PRIVATE (self);
   GError *error = NULL;
 
+  if (priv->state != SALUT_TUBE_CHANNEL_STATE_LOCAL_PENDING)
+    {
+      GError e = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
+          "Tube is not in the local pending state" };
+
+      dbus_g_method_return_error (context, &e);
+      return;
+    }
+
   if (address_type != TP_SOCKET_ADDRESS_TYPE_UNIX &&
       address_type != TP_SOCKET_ADDRESS_TYPE_IPV4 &&
       address_type != TP_SOCKET_ADDRESS_TYPE_IPV6)
@@ -2282,15 +2291,6 @@ salut_tube_stream_accept_stream_tube (SalutSvcChannelTypeStreamTube *iface,
       return;
     }
 
-  if (priv->state != SALUT_TUBE_CHANNEL_STATE_LOCAL_PENDING)
-    {
-      GError e = { TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
-          "Tube is not in the local pending state" };
-
-      dbus_g_method_return_error (context, &e);
-      return;
-    }
-
   if (!salut_tube_stream_accept (SALUT_TUBE_IFACE (self), &error))
     {
       dbus_g_method_return_error (context, error);
-- 
1.5.6.5




More information about the telepathy-commits mailing list