]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10453 [kazoo] fix dropped messages
authorlazedo <luis.azedo@factorlusitano.com>
Fri, 30 Jun 2017 11:38:32 +0000 (12:38 +0100)
committerlazedo <luis.azedo@factorlusitano.com>
Fri, 30 Jun 2017 11:38:32 +0000 (12:38 +0100)
src/mod/event_handlers/mod_kazoo/kazoo_node.c

index 1748b7c3eeeb09924e7ca090cb6c69e64a773478..17da6dc5820a5400626007a3f7f7b62d29b50aa3 100644 (file)
@@ -1312,8 +1312,8 @@ static void *SWITCH_THREAD_FUNC handle_node(switch_thread_t *thread, void *obj)
                        }
                }
 
-               while (switch_queue_trypop(ei_node->send_msgs, &pop) == SWITCH_STATUS_SUCCESS
-                          && ++send_msg_count <= kazoo_globals.send_msg_batch) {
+               while (++send_msg_count <= kazoo_globals.send_msg_batch
+                          && switch_queue_trypop(ei_node->send_msgs, &pop) == SWITCH_STATUS_SUCCESS) {
                        ei_send_msg_t *send_msg = (ei_send_msg_t *) pop;
                        ei_helper_send(ei_node, &send_msg->pid, &send_msg->buf);
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sent erlang message to %s <%d.%d.%d>\n"