mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-11 11:40:01 +00:00
nimble/hs: Clear tx queue when connection is dropped
This patch makes sure there is no outstanding packet in the host queue when connection is dropped
This commit is contained in:
committed by
ccollins476ad
parent
fe48d41468
commit
ad2fe32147
@@ -23,10 +23,17 @@ int
|
||||
ble_hs_atomic_conn_delete(uint16_t conn_handle)
|
||||
{
|
||||
struct ble_hs_conn *conn;
|
||||
struct os_mbuf_pkthdr *omp;
|
||||
|
||||
ble_hs_lock();
|
||||
conn = ble_hs_conn_find(conn_handle);
|
||||
if (conn != NULL) {
|
||||
|
||||
while ((omp = STAILQ_FIRST(&conn->bhc_tx_q)) != NULL) {
|
||||
STAILQ_REMOVE_HEAD(&conn->bhc_tx_q, omp_next);
|
||||
os_mbuf_free_chain(OS_MBUF_PKTHDR_TO_MBUF(omp));
|
||||
}
|
||||
|
||||
ble_hs_conn_remove(conn);
|
||||
ble_hs_conn_free(conn);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user