1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/lwip
iosabi afddb46c51 lwip_sock: Fix computation of last_offset on partial reads.
lwip receives network buffers that are made available to lwip_sock_tcp
calling `netconn_recv_tcp_pbuf`. The size of these buffers depends on
the size of the network packets. An application calling `sock_tcp_read`
can pass any arbitrary buffer size to read (copy) from these internal
network buffers, which may be smaller. lwip_sock_tcp keeps around the
last network buffer (`struct pbuf last_buf`) and the offset into this
buffer already consumed by the application (`last_offset`).

However, when multiple application reads from the same `pbuf` buffer
occur, the `last_offset` must be updated incrementing it. The code had
a bug that would work only when `last_offset` was either 0 (no previous
partial read) or when the current read was consuming all the remaining
data (when `buf_len == copylen`).

This patch fixes the issue an allows multiple reads from the same
buffer.
2021-04-04 12:45:54 +02:00
..
contrib lwip_sock: Fix computation of last_offset on partial reads. 2021-04-04 12:45:54 +02:00
include pkg/lwip: Set link state properly when supported 2021-03-01 23:55:08 +01:00
patches pkg/lwip: Add patch for lowpan6 printf formatters 2021-02-23 11:48:13 +01:00
doc.txt lwip: improve and fix documentation 2019-10-09 14:45:30 +02:00
Makefile pkg: silent make commands with RIOT_CI_BUILD=1 2021-03-12 16:05:18 +01:00
Makefile.dep drivers/Makefile.dep: don't pull netdev on netdev_default 2021-03-10 14:18:12 +01:00
Makefile.include pkg/lwip: add mips32 ssize_t fix 2020-11-25 17:52:34 +01:00