Diff between fec848dba730b827e29c82c28cc34222ca89ed07 and 33523ab31c54cb5c961a13202a3d0b64168dfab3

Changed Files

File Additions Deletions Status
attrib/gattrib.c +5 -5 modified

Full Patch

diff --git a/attrib/gattrib.c b/attrib/gattrib.c
index 29c3585..a1e29a1 100644
--- a/attrib/gattrib.c
+++ b/attrib/gattrib.c
@@ -361,11 +361,6 @@ static gboolean received_data(GIOChannel *io, GIOCondition cond, gpointer data)
 	if (attrib->stale)
 		return FALSE;
 
-	if (attrib->timeout_watch > 0) {
-		g_source_remove(attrib->timeout_watch);
-		attrib->timeout_watch = 0;
-	}
-
 	if (cond & (G_IO_HUP | G_IO_ERR | G_IO_NVAL)) {
 		attrib->read_watch = 0;
 		return FALSE;
@@ -393,6 +388,11 @@ static gboolean received_data(GIOChannel *io, GIOCondition cond, gpointer data)
 	if (is_response(buf[0]) == FALSE)
 		return TRUE;
 
+	if (attrib->timeout_watch > 0) {
+		g_source_remove(attrib->timeout_watch);
+		attrib->timeout_watch = 0;
+	}
+
 	cmd = g_queue_pop_head(attrib->requests);
 	if (cmd == NULL) {
 		/* Keep the watch if we have events to report */