Commit 6fa19a82 authored by Ian Craggs's avatar Ian Craggs

Take account of not finding a response in writeComplete #385

parent e18db33e
...@@ -1080,7 +1080,9 @@ static void MQTTAsync_writeComplete(int socket) ...@@ -1080,7 +1080,9 @@ static void MQTTAsync_writeComplete(int socket)
break; break;
} }
if (cur_response && command->onSuccess) if (cur_response) /* we found a response */
{
if (command->onSuccess)
{ {
MQTTAsync_successData data; MQTTAsync_successData data;
...@@ -1093,11 +1095,11 @@ static void MQTTAsync_writeComplete(int socket) ...@@ -1093,11 +1095,11 @@ static void MQTTAsync_writeComplete(int socket)
Log(TRACE_MIN, -1, "Calling publish success for client %s", m->c->clientID); Log(TRACE_MIN, -1, "Calling publish success for client %s", m->c->clientID);
(*(command->onSuccess))(command->context, &data); (*(command->onSuccess))(command->context, &data);
} }
m->pending_write = NULL;
ListDetach(m->responses, com); ListDetach(m->responses, com);
MQTTAsync_freeCommand(com); MQTTAsync_freeCommand(com);
} }
m->pending_write = NULL;
}
} }
FUNC_EXIT; FUNC_EXIT;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment