From ba377e0462513b64b4ae2d2dc8023c692bfae296 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 5 Jul 2011 18:27:09 +0300 Subject: [PATCH] gobex: Don't stop sending data if a single packet fails to encode --- gobex/gobex.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gobex/gobex.c b/gobex/gobex.c index 7cb378e2d..8f2779833 100644 --- a/gobex/gobex.c +++ b/gobex/gobex.c @@ -210,19 +210,19 @@ static gboolean write_data(GIOChannel *io, GIOCondition cond, return FALSE; if (cond & (G_IO_HUP | G_IO_ERR)) - goto done; + goto stop_tx; if (obex->tx_data == 0) { struct pending_pkt *p = g_queue_pop_head(obex->tx_queue); ssize_t len; if (p == NULL) - goto done; + goto stop_tx; /* Can't send a request while there's a pending one */ if (obex->pending_req && p->id > 0) { g_queue_push_head(obex->tx_queue, p); - goto done; + goto stop_tx; } len = g_obex_packet_encode(p->pkt, obex->tx_buf, obex->tx_mtu); @@ -243,12 +243,13 @@ static gboolean write_data(GIOChannel *io, GIOCondition cond, } if (!obex->write(obex, NULL)) - goto done; + goto stop_tx; +done: if (obex->tx_data > 0 || g_queue_get_length(obex->tx_queue) > 0) return TRUE; -done: +stop_tx: obex->tx_data = 0; obex->write_source = 0; return FALSE; -- 2.47.3