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

Commit 8b139f00 authored by Stanley Tng's avatar Stanley Tng
Browse files

Fixed L2CAP Buffer Length when transmit packets

Fixed the problem of the L2CAP buffer length is incorrect than blasting
multiple small data packets from java layer. The buffer length should be
what is actually read rather than what is possible to be read.

Test: Ran the new ACTS Tests for LE CoC
Bug: 70683224
Change-Id: I6cf4d465a41e4e936420f76b49ce2dbda20d41fb
parent 2cc19163
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1010,6 +1010,11 @@ void btsock_l2cap_signaled(int fd, int flags, uint32_t user_id) {
          count = L2CAP_LE_MAX_MPS;
        }

        /* When multiple packets smaller than MTU are flushed to the socket, the
           size of the single packet read could be smaller than the ioctl
           reported total size of awaiting packets. Hence, we adjust the buffer
           length. */
        buffer->len = count;
        DVLOG(2) << __func__ << ": bytes received from socket: " << count;

        if (sock->fixed_chan) {