piotrnarajowski commented on code in PR #1879:
URL: https://github.com/apache/mynewt-nimble/pull/1879#discussion_r1775165963
##########
nimble/host/src/ble_att_svr.c:
##########
@@ -636,29 +638,43 @@ ble_att_svr_tx_rsp(uint16_t conn_handle, uint16_t cid,
int hs_status, struct os_
if (do_tx) {
if (hs_status == 0) {
+ conn = ble_hs_conn_find(conn_handle);
+ if (conn == NULL) {
+ hs_status = BLE_HS_ENOTCONN;
+ goto done;
+ }
+
+ chan = ble_hs_conn_chan_find_by_scid(conn, cid);
+ if (chan == NULL) {
+ hs_status = BLE_HS_ENOENT;
+ goto done;
+ }
+
+ ble_att_truncate_to_mtu(chan, om);
hs_status = ble_att_tx(conn_handle, cid, om);
om = NULL;
if (hs_status) {
err_status = BLE_ATT_ERR_UNLIKELY;
}
}
- if (hs_status != 0) {
- STATS_INC(ble_att_stats, error_rsp_tx);
+done:
+ if (hs_status != 0) {
Review Comment:
Should be ok now
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]