diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2007-10-26 14:32:43 +0000 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2007-10-26 14:32:43 +0000 |
commit | 6bd6dada33edaeb92ed871f395fae89d850ffa5f (patch) | |
tree | e5ca0a12ca2c5acd37055b5c121f4cf82f236767 | |
parent | ba223e30a1d451afdb44735f69069fb7a88e787e (diff) | |
download | telepathy-salut-6bd6dada33edaeb92ed871f395fae89d850ffa5f.tar.gz |
tubes-channel: salut_tubes_channel_bytestream_offered: close the bytestream if there is an error
20071026143243-7fe3f-30f59ab365cec8394aa7cb76f42c147230ad653f.gz
-rw-r--r-- | src/salut-tubes-channel.c | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/salut-tubes-channel.c b/src/salut-tubes-channel.c index 7665e5fd..b64e3e73 100644 --- a/src/salut-tubes-channel.c +++ b/src/salut-tubes-channel.c @@ -36,6 +36,7 @@ #include <gibber/gibber-bytestream-muc.h> #include <gibber/gibber-xmpp-stanza.h> #include <gibber/gibber-namespaces.h> +#include <gibber/gibber-xmpp-error.h> #define DEBUG_FLAG DEBUG_TUBES #include "debug.h" @@ -2043,25 +2044,21 @@ salut_tubes_channel_bytestream_offered (SalutTubesChannel *self, tmp = gibber_xmpp_node_get_attribute (stream_node, "tube"); if (tmp == NULL) { - /* - GError e = { GABBLE_XMPP_ERROR, XMPP_ERROR_BAD_REQUEST, + GError e = { GIBBER_XMPP_ERROR, XMPP_ERROR_BAD_REQUEST, "<stream> or <muc-stream> has no tube attribute" }; - NODE_DEBUG (stream_node, e.message); - gabble_bytestream_iface_close (bytestream, &e); - */ + DEBUG ("%s", e.message); + gibber_bytestream_iface_close (bytestream, &e); return; } tube_id_tmp = strtoul (tmp, &endptr, 10); if (!endptr || *endptr || tube_id_tmp > G_MAXUINT32) { - /* - GError e = { GABBLE_XMPP_ERROR, XMPP_ERROR_BAD_REQUEST, + GError e = { GIBBER_XMPP_ERROR, XMPP_ERROR_BAD_REQUEST, "<stream> or <muc-stream> tube attribute not numeric or > 2**32" }; DEBUG ("tube id is not numeric or > 2**32: %s", tmp); - gabble_bytestream_iface_close (bytestream, &e); - */ + gibber_bytestream_iface_close (bytestream, &e); return; } tube_id = (guint) tube_id_tmp; @@ -2069,14 +2066,12 @@ salut_tubes_channel_bytestream_offered (SalutTubesChannel *self, tube = g_hash_table_lookup (priv->tubes, GUINT_TO_POINTER (tube_id)); if (tube == NULL) { - /* - GError e = { GABBLE_XMPP_ERROR, XMPP_ERROR_BAD_REQUEST, + GError e = { GIBBER_XMPP_ERROR, XMPP_ERROR_BAD_REQUEST, "<stream> or <muc-stream> tube attribute points to a nonexistent " "tube" }; DEBUG ("tube %u doesn't exist", tube_id); - gabble_bytestream_iface_close (bytestream, &e); - */ + gibber_bytestream_iface_close (bytestream, &e); return; } |