diff options
Diffstat (limited to 'hcid')
-rw-r--r-- | hcid/dbus-test.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/hcid/dbus-test.c b/hcid/dbus-test.c index b15965d4..c78baeee 100644 --- a/hcid/dbus-test.c +++ b/hcid/dbus-test.c @@ -237,11 +237,6 @@ static gboolean l2raw_data_callback(GIOChannel *io, GIOCondition cond, struct au return FALSE; } - if (audit->timeout) { - g_timeout_remove(audit->timeout); - audit->timeout = 0; - } - if (cond & (G_IO_ERR | G_IO_HUP)) goto failed; @@ -254,6 +249,14 @@ static gboolean l2raw_data_callback(GIOChannel *io, GIOCondition cond, struct au goto failed; } + if (cmd->code != L2CAP_INFO_RSP) + return TRUE; + + if (audit->timeout) { + g_timeout_remove(audit->timeout); + audit->timeout = 0; + } + switch (audit->state) { case AUDIT_STATE_MTU: handle_mtu_response(audit, rsp); @@ -286,6 +289,11 @@ static gboolean l2raw_data_callback(GIOChannel *io, GIOCondition cond, struct au audit->mask_result, audit->mask); failed: + if (audit->timeout) { + g_timeout_remove(audit->timeout); + audit->timeout = 0; + } + send_audit_status(audit, "AuditRemoteDeviceComplete"); g_io_channel_close(io); |