[Telepathy-commits] [telepathy-gabble/master] implement gabble_bytestream_socks5_block_read

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Tue Jan 6 08:41:38 PST 2009


---
 src/bytestream-socks5.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/bytestream-socks5.c b/src/bytestream-socks5.c
index 04c8fe3..c0e9ec5 100644
--- a/src/bytestream-socks5.c
+++ b/src/bytestream-socks5.c
@@ -1406,6 +1406,23 @@ gabble_bytestream_socks5_initiate (GabbleBytestreamIface *iface)
 }
 
 static void
+gabble_bytestream_socks5_block_read (GabbleBytestreamIface *iface,
+                                     gboolean block)
+{
+  GabbleBytestreamSocks5 *self = GABBLE_BYTESTREAM_SOCKS5 (iface);
+  GabbleBytestreamSocks5Private *priv =
+      GABBLE_BYTESTREAM_SOCKS5_GET_PRIVATE (self);
+
+  if (priv->read_blocked == block)
+    return;
+
+  priv->read_blocked = block;
+
+  DEBUG ("%s the transport bytestream", block ? "block": "unblock");
+  gibber_transport_block_receiving (priv->transport, block);
+}
+
+static void
 bytestream_iface_init (gpointer g_iface,
                        gpointer iface_data)
 {
@@ -1415,4 +1432,5 @@ bytestream_iface_init (gpointer g_iface,
   klass->send = gabble_bytestream_socks5_send;
   klass->close = gabble_bytestream_socks5_close;
   klass->accept = gabble_bytestream_socks5_accept;
+  klass->block_read = gabble_bytestream_socks5_block_read;
 }
-- 
1.5.6.5




More information about the Telepathy-commits mailing list