[Telepathy-commits] [telepathy-salut/master] Don't fire the TransferredBytesChanged signal if we got a HTTP error
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Thu Nov 6 07:04:39 PST 2008
---
lib/gibber/gibber-oob-file-transfer.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/lib/gibber/gibber-oob-file-transfer.c b/lib/gibber/gibber-oob-file-transfer.c
index 86c7611..80442ff 100644
--- a/lib/gibber/gibber-oob-file-transfer.c
+++ b/lib/gibber/gibber-oob-file-transfer.c
@@ -264,6 +264,15 @@ http_client_chunk_cb (SoupMessage *msg,
/* FIXME make async */
g_io_channel_write_chars (self->priv->channel, msg->response.body,
msg->response.length, NULL, NULL);
+
+ if (msg->status_code != 200)
+ {
+ /* Something did wrong, so it's not file data. Don't fire the
+ * transferred-chunk signal. */
+ self->priv->transferred_bytes += msg->response.length;
+ return;
+ }
+
transferred_chunk (self, (guint64) msg->response.length);
}
--
1.5.6.5
More information about the Telepathy-commits
mailing list