Don't close everything when we get an error response

This commit is contained in:
Jeremy Lakeman 2014-05-26 14:36:31 +09:30
parent c1fc33542d
commit f5aef9998d

View File

@ -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");