You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2019/03/22 22:00:27 UTC
[mynewt-nimble] branch master updated: nimble/hs: Clear tx queue
when connection is dropped
This is an automated email from the ASF dual-hosted git repository.
ccollins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new ad2fe32 nimble/hs: Clear tx queue when connection is dropped
ad2fe32 is described below
commit ad2fe321474ba770f9d4a1098696de763f66a8d7
Author: Ćukasz Rymanowski <lu...@codecoup.pl>
AuthorDate: Fri Mar 22 16:11:16 2019 +0100
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
---
nimble/host/src/ble_hs_atomic.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/nimble/host/src/ble_hs_atomic.c b/nimble/host/src/ble_hs_atomic.c
index 5d51fbe..f32ba8a 100644
--- a/nimble/host/src/ble_hs_atomic.c
+++ b/nimble/host/src/ble_hs_atomic.c
@@ -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);