Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 652eab02 authored by zzy's avatar zzy Committed by Android Git Automerger
Browse files

am c8a31eb4: am 6b51794b: Added available size check to fix zero byte data available issue

* commit 'c8a31eb4':
  Added available size check to fix zero byte data available issue
parents 0a88a851 c8a31eb4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1437,6 +1437,8 @@ int PORT_WriteDataCO (UINT16 handle, int* p_len)
        RFCOMM_TRACE_ERROR1("p_data_co_callback DATA_CO_CALLBACK_TYPE_INCOMING_SIZE failed, available:%d", available);
        return (PORT_UNKNOWN_ERROR);
    }
    if(available == 0)
        return PORT_SUCCESS;
    /* Length for each buffer is the smaller of GKI buffer, peer MTU, or max_len */
    length = RFCOMM_DATA_POOL_BUF_SIZE -
            (UINT16)(sizeof(BT_HDR) + L2CAP_MIN_OFFSET + RFCOMM_DATA_OVERHEAD);
@@ -1455,6 +1457,7 @@ int PORT_WriteDataCO (UINT16 handle, int* p_len)

        {
            error("p_data_co_callback DATA_CO_CALLBACK_TYPE_OUTGOING failed, available:%d", available);
            PORT_SCHEDULE_UNLOCK;
            return (PORT_UNKNOWN_ERROR);
        }
        //memcpy ((UINT8 *)(p_buf + 1) + p_buf->offset + p_buf->len, p_data, max_len);