From f5aef9998d2f056d591e07efaffb30e8e1341a43 Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Mon, 26 May 2014 14:36:31 +0930 Subject: [PATCH] Don't close everything when we get an error response --- msp_client.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/msp_client.c b/msp_client.c index 6d06ac66..4a95e111 100644 --- a/msp_client.c +++ b/msp_client.c @@ -781,8 +781,7 @@ static int process_packet(int mdp_sock, struct mdp_header *header, const uint8_t { // any kind of error reported by the daemon, close all related msp connections on this mdp socket if (header->flags & MDP_FLAG_ERROR){ - WHY("Error returned from daemon"); - msp_close_all(mdp_sock); + WHY("Error returned from daemon!"); return -1; } @@ -852,6 +851,7 @@ static int process_packet(int mdp_sock, struct mdp_header *header, const uint8_t uint8_t response = FLAG_STOP; // we don't have a matching socket, reply with STOP flag to force breaking the connection // TODO global rate limit? + // Note that we might recieve a queued packet after sending a MDP_FLAG_CLOSE, so this might trigger an error mdp_send(mdp_sock, header, &response, 1); if (config.debug.msp) DEBUGF("Replying to unexpected packet with STOP packet");