diff --git a/mongoose.c b/mongoose.c index e7be5e00..0f6241f3 100644 --- a/mongoose.c +++ b/mongoose.c @@ -15052,16 +15052,6 @@ static err_t mg_lwip_tcp_recv_cb(void *arg, struct tcp_pcb *tpcb, mgos_lock(); if (cs->rx_chain == NULL) { cs->rx_offset = 0; - } else if (pbuf_clen(cs->rx_chain) >= 4) { - /* ESP SDK has a limited pool of 5 pbufs. We must not hog them all or RX - * will be completely blocked. We already have at least 4 in the chain, - * this one is the last, so we have to make a copy and release this one. */ - struct pbuf *np = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM); - if (np != NULL) { - pbuf_copy(np, p); - pbuf_free(p); - p = np; - } } mg_lwip_recv_common(nc, p); mgos_unlock(); diff --git a/src/common/platforms/lwip/mg_lwip_net_if.c b/src/common/platforms/lwip/mg_lwip_net_if.c index d6fdb52d..281ddd3f 100644 --- a/src/common/platforms/lwip/mg_lwip_net_if.c +++ b/src/common/platforms/lwip/mg_lwip_net_if.c @@ -187,16 +187,6 @@ static err_t mg_lwip_tcp_recv_cb(void *arg, struct tcp_pcb *tpcb, mgos_lock(); if (cs->rx_chain == NULL) { cs->rx_offset = 0; - } else if (pbuf_clen(cs->rx_chain) >= 4) { - /* ESP SDK has a limited pool of 5 pbufs. We must not hog them all or RX - * will be completely blocked. We already have at least 4 in the chain, - * this one is the last, so we have to make a copy and release this one. */ - struct pbuf *np = pbuf_alloc(PBUF_RAW, p->tot_len, PBUF_RAM); - if (np != NULL) { - pbuf_copy(np, p); - pbuf_free(p); - p = np; - } } mg_lwip_recv_common(nc, p); mgos_unlock();