Block reading if queue is full
@@ -199,11 +199,10 @@ netconn_evt(esp_evt_t* evt) {
return espOKIGNOREMORE; /* Return OK to free the memory and ignore further data */
}
nc->mbox_receive_entries++; /* Increase number of packets in receive mbox */
-
#if ESP_CFG_CONN_MANUAL_TCP_RECEIVE
/* Check against 1 less to still allow potential close event to be written to queue */
if (nc->mbox_receive_entries >= (ESP_CFG_NETCONN_RECEIVE_QUEUE_LEN - 1)) {
- /* Todo: Here we should suspend manual reading */
+ conn->status.f.receive_blocked = 1; /* Block reading more data */
}
#endif /* ESP_CFG_CONN_MANUAL_TCP_RECEIVE */
@@ -690,7 +689,7 @@ esp_netconn_receive(esp_netconn_p nc, esp_pbuf_p* pbuf) {
#if ESP_CFG_CONN_MANUAL_TCP_RECEIVE
else {
esp_core_lock();
- /* todo: Resume manual reading */
+ nc->conn->status.f.receive_blocked = 0; /* Resume reading more data */
esp_conn_recved(nc->conn, *pbuf); /* Notify stack about received data */
esp_core_unlock();
}
