diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-03-03 16:42:35 +0000 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-03-03 16:42:35 +0000 |
commit | a88b16252a7ee5fec15f07435d50280bd2485cd7 (patch) | |
tree | b5216ad0d430baafdd7c34680bf388d02c756641 /src/bytestream-multiple.c | |
parent | b154dcd80af232b2a3a9d8f39fadd684019f543f (diff) | |
parent | 7a541e01e8f731469b40beb83e685150b6fbe5fc (diff) | |
download | telepathy-gabble-a88b16252a7ee5fec15f07435d50280bd2485cd7.tar.gz |
Merge branch 'master' into socks5
Diffstat (limited to 'src/bytestream-multiple.c')
-rw-r--r-- | src/bytestream-multiple.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/bytestream-multiple.c b/src/bytestream-multiple.c index 331077353..753e4877b 100644 --- a/src/bytestream-multiple.c +++ b/src/bytestream-multiple.c @@ -77,6 +77,7 @@ struct _GabbleBytestreamMultiplePrivate /* List of (gchar *) containing the NS of a stream method */ GList *fallback_stream_methods; GabbleBytestreamIface *active_bytestream; + gboolean read_blocked; gboolean dispose_has_run; }; @@ -584,6 +585,10 @@ bytestream_activate_next (GabbleBytestreamMultiple *self) g_free (stream_method); + /* block the new bytestream if needed */ + gabble_bytestream_iface_block_reading (priv->active_bytestream, + priv->read_blocked); + g_signal_connect (priv->active_bytestream, "connection-error", G_CALLBACK (bytestream_connection_error_cb), self); g_signal_connect (priv->active_bytestream, "data-received", @@ -632,6 +637,23 @@ gabble_bytestream_multiple_has_stream_method (GabbleBytestreamMultiple *self) } static void +gabble_bytestream_multiple_block_reading (GabbleBytestreamIface *iface, + gboolean block) +{ + GabbleBytestreamMultiple *self = GABBLE_BYTESTREAM_MULTIPLE (iface); + GabbleBytestreamMultiplePrivate *priv = + GABBLE_BYTESTREAM_MULTIPLE_GET_PRIVATE (self); + + if (priv->read_blocked == block) + return; + + priv->read_blocked = block; + + g_assert (priv->active_bytestream != NULL); + gabble_bytestream_iface_block_reading (priv->active_bytestream, block); +} + +static void bytestream_iface_init (gpointer g_iface, gpointer iface_data) { @@ -641,4 +663,5 @@ bytestream_iface_init (gpointer g_iface, klass->send = gabble_bytestream_multiple_send; klass->close = gabble_bytestream_multiple_close; klass->accept = gabble_bytestream_multiple_accept; + klass->block_reading = gabble_bytestream_multiple_block_reading; } |