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

Commit c92b527e authored by Pomai Ahlo's avatar Pomai Ahlo Committed by Gerrit Code Review
Browse files

Merge "Comment cleanup: btif_sock_l2cap.cc" into main

parents ce886f7c 88d53489
Loading
Loading
Loading
Loading
+12 −17
Original line number Diff line number Diff line
@@ -110,18 +110,13 @@ static int pth = -1;
static void btsock_l2cap_cbk(tBTA_JV_EVT event, tBTA_JV* p_data, uint32_t l2cap_socket_id);

/* TODO: Consider to remove this buffer, as we have a buffer in l2cap as well,
 * and we risk
 *       a buffer overflow with this implementation if the socket data is not
 * read from
 *       JAVA for a while. In such a case we should use flow control to tell the
 * sender to
 *       back off.
 * and we risk a buffer overflow with this implementation if the socket data is not
 * read from JAVA for a while. In such a case we should use flow control to tell the
 * sender to back off.
 * BUT remember we need to avoid blocking the BTA task execution - hence
 * we cannot
 *       directly write to the socket.
 *       we should be able to change to store the data pointer here, and just
 * wait
 *       confirming the l2cap_ind until we have more space in the buffer. */
 * we cannot directly write to the socket.  We should be able to change to store the
 * data pointer here, and just wait confirming the l2cap_ind until we have more space
 * in the buffer. */

/* returns false if none - caller must free "data" memory when done with it */
static char packet_get_head_l(l2cap_socket* sock, uint8_t** data, uint32_t* len) {
@@ -395,7 +390,7 @@ static l2cap_socket* btsock_l2cap_alloc_l(const char* name, const RawAddress* ad
    while (t && t->id != sock->id) {
      t = t->next;
    }
    if (!t && sock->id) { /* non-zeor handle is unique -> we're done */
    if (!t && sock->id) { /* non-zero handle is unique -> we're done */
      break;
    }
    /* if we're here, we found a duplicate */