From: Denis Kenzior Date: Wed, 2 Dec 2009 21:27:26 +0000 (-0600) Subject: Fix: Sometimes it is possible to cancel first cmd X-Git-Tag: 2.0_alpha~3120 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=962a4cd52d14eed73aa4897de16c928e3a5e1493;p=framework%2Fconnectivity%2Fconnman.git Fix: Sometimes it is possible to cancel first cmd Commands on the head of the queue can be canceled if none of its bytes have actually been written to the modem. This is tracked by cmd_bytes_written variable. --- diff --git a/gatchat/gatchat.c b/gatchat/gatchat.c index 1dffd89..df65906 100644 --- a/gatchat/gatchat.c +++ b/gatchat/gatchat.c @@ -1202,7 +1202,8 @@ gboolean g_at_chat_cancel(GAtChat *chat, guint id) if (!l) return FALSE; - if (l == g_queue_peek_head(chat->command_queue)) { + if (l == g_queue_peek_head(chat->command_queue) && + chat->cmd_bytes_written > 0) { struct at_command *c = l->data; /* We can't actually remove it since it is most likely