From abe8bb2d3b423f0271c8713025a656822250173e Mon Sep 17 00:00:00 2001 From: Luiz Augusto Von Dentz Date: Wed, 24 Mar 2010 23:26:24 +0200 Subject: [PATCH] Make abort requests to have a shorter timeout Regular request takes 4 secs to timeout, but this may be too long to wait for abort command so it is now reduced to 2 secs. --- audio/avdtp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/audio/avdtp.c b/audio/avdtp.c index 905830316..4e5ff1422 100644 --- a/audio/avdtp.c +++ b/audio/avdtp.c @@ -88,6 +88,7 @@ #define AVDTP_MSG_TYPE_REJECT 0x03 #define REQ_TIMEOUT 4 +#define ABORT_TIMEOUT 2 #define DISCONNECT_TIMEOUT 1 #define STREAM_TIMEOUT 20 @@ -2558,7 +2559,8 @@ static int send_req(struct avdtp *session, gboolean priority, session->req = req; - req->timeout = g_timeout_add_seconds(REQ_TIMEOUT, + req->timeout = g_timeout_add_seconds(req->signal_id == AVDTP_ABORT ? + ABORT_TIMEOUT : REQ_TIMEOUT, request_timeout, session); return 0;