From b862fd8fe169191c3ae60786b82c158957de30ca Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Wed, 18 Apr 2018 07:03:31 +0200 Subject: [PATCH] agent: Check if callback has sent a new request In agent_receive_reply we first call the callback for the pending request (agent_finalize_pending) then try to send the next request in the queue. Check that the next request has not been sent already which could happen if it has been just queued by the callback. --- src/agent.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/agent.c b/src/agent.c index a124e636..e61010c8 100644 --- a/src/agent.c +++ b/src/agent.c @@ -227,7 +227,8 @@ static void agent_receive_reply(struct l_dbus_message *message, agent_finalize_pending(agent, message); - agent_send_next_request(agent); + if (!agent->pending_id) + agent_send_next_request(agent); } static void agent_send_next_request(struct agent *agent)