add congest direct callback and fix malloc failed when multi_connection notify performance test

This commit is contained in:
zhiweijian
2020-05-13 20:30:35 +08:00
committed by wangcheng
parent 418b32e71b
commit ec6c7558ef
6 changed files with 24 additions and 17 deletions

View File

@@ -3660,8 +3660,9 @@ void l2cu_check_channel_congestion (tL2C_CCB *p_ccb)
#endif
}
} else {
tL2C_LCB *p_lcb = p_ccb->p_lcb;
/* If this channel was not congested but it is congested now, tell the app */
if (q_count > p_ccb->buff_quota) {
if ((q_count > p_ccb->buff_quota) || (p_lcb && (p_ccb->local_cid == L2CAP_ATT_CID) && (p_lcb->link_xmit_quota > 0) && (p_lcb->link_xmit_quota <= p_lcb->sent_not_acked))) {
p_ccb->cong_sent = TRUE;
if (p_ccb->p_rcb && p_ccb->p_rcb->api.pL2CA_CongestionStatus_Cb) {
L2CAP_TRACE_DEBUG ("L2CAP - Calling CongestionStatus_Cb (TRUE),CID:0x%04x,XmitQ:%u,Quota:%u",