Skip to content

Commit

Permalink
Issue 169
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieucarbou committed Dec 11, 2024
1 parent 4841e26 commit 5241048
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/AsyncTCP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,10 @@ static int8_t _tcp_connected(void * arg, tcp_pcb * pcb, int8_t err) {

static int8_t _tcp_poll(void * arg, struct tcp_pcb * pcb) {
// throttle polling events queing when event queue is getting filled up, let it handle _onack's
if (uxQueueMessagesWaiting(_async_queue) > (rand() % CONFIG_ASYNC_TCP_QUEUE_SIZE / 2 + CONFIG_ASYNC_TCP_QUEUE_SIZE / 4) )
if (uxQueueMessagesWaiting(_async_queue) > (rand() % CONFIG_ASYNC_TCP_QUEUE_SIZE / 2 + CONFIG_ASYNC_TCP_QUEUE_SIZE / 4) ) {
log_d("throttling _tcp_poll");
return ERR_OK;
}

//ets_printf("+P: 0x%08x\n", pcb);
lwip_event_packet_t * e = (lwip_event_packet_t *)malloc(sizeof(lwip_event_packet_t));
Expand Down

0 comments on commit 5241048

Please sign in to comment.