drivers: modem: hl7800: socket RX could drop data

net_buf_skipcrlf() will remove all \r\n characters from the buffer.
If the data after CONNECT\r\n contained \r or \n it would
be removed, resulting in dropped data.
Fix this to only remove two bytes to ensure data is not dropped.

Signed-off-by: Ryan Erickson <ryan.erickson@lairdconnect.com>
This commit is contained in:
Ryan Erickson 2021-06-28 10:00:42 -05:00 committed by Christopher Friedt
commit 8d6832b256

View file

@ -2823,7 +2823,8 @@ static void sock_read(struct net_buf **buf, uint16_t len)
/* wait for \n to be RXd. \r was already RXd. */
wait_for_modem_data(buf, 0, 1);
}
net_buf_skipcrlf(buf);
/* remove \r\n */
net_buf_remove(buf, 2);
if (!*buf) {
wait_for_modem_data(buf, 0, sock->rx_size);
}