[Pkg-telepathy-commits] [SCM] telepathy-gabble packaging branch, debian-patches, updated. upstream/0.8.11-3-g80519bf

Simon McVittie smcv at debian.org
Tue Feb 23 18:49:39 UTC 2010


The following commit has been merged in the debian-patches branch:
commit a943882f3d92dfea1147d6618351dc5ec44136f1
Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Mon Jul 27 22:00:51 2009 +0100

    fd.o#22968: GibberUnixTransport: make credential-passing support optional and detectable
    
    Our implementation only works for Linux so far, so we need to be able to
    avoid advertising credential-passing on e.g. Darwin.

diff --git a/lib/gibber/gibber-unix-transport.c b/lib/gibber/gibber-unix-transport.c
index 244f468..7c800d8 100644
--- a/lib/gibber/gibber-unix-transport.c
+++ b/lib/gibber/gibber-unix-transport.c
@@ -194,6 +194,17 @@ gibber_unix_transport_new_from_fd (int fd)
   return transport;
 }
 
+/* Patches that reimplement these functions for non-Linux would be welcome
+ * (please file a bug) */
+
+#if defined(__linux__)
+
+gboolean
+gibber_unix_transport_supports_credentials (void)
+{
+  return TRUE;
+}
+
 gboolean
 gibber_unix_transport_send_credentials (GibberUnixTransport *transport,
     const guint8 *data,
@@ -356,3 +367,39 @@ gibber_unix_transport_recv_credentials (GibberUnixTransport *self,
   priv->recv_creds_data = user_data;
   return TRUE;
 }
+
+#else /* OSs where we have no implementation */
+
+gboolean
+gibber_unix_transport_supports_credentials (void)
+{
+  return FALSE;
+}
+
+gboolean
+gibber_unix_transport_recv_credentials (GibberUnixTransport *self,
+    GibberUnixTransportRecvCredentialsCb callback,
+    gpointer user_data)
+{
+  DEBUG ("stub implementation, failing");
+  return FALSE;
+}
+
+gboolean
+gibber_unix_transport_send_credentials (GibberUnixTransport *transport,
+    const guint8 *data,
+    gsize size)
+{
+  DEBUG ("stub implementation, failing");
+  return FALSE;
+}
+
+static GibberFdIOResult
+gibber_unix_transport_read (GibberFdTransport *transport,
+    GIOChannel *channel,
+    GError **error)
+{
+  return gibber_fd_transport_read (transport, channel, error);
+}
+
+#endif
diff --git a/lib/gibber/gibber-unix-transport.h b/lib/gibber/gibber-unix-transport.h
index b89a0dd..3aad8d4 100644
--- a/lib/gibber/gibber-unix-transport.h
+++ b/lib/gibber/gibber-unix-transport.h
@@ -79,6 +79,8 @@ GType gibber_unix_transport_get_type (void);
   (G_TYPE_INSTANCE_GET_CLASS ((obj), GIBBER_TYPE_UNIX_TRANSPORT, \
    GibberUnixTransportClass))
 
+gboolean gibber_unix_transport_supports_credentials (void);
+
 GibberUnixTransport * gibber_unix_transport_new (void);
 
 GibberUnixTransport * gibber_unix_transport_new_from_fd (int fd);

-- 
telepathy-gabble packaging



More information about the Pkg-telepathy-commits mailing list