zephyr/subsys/net/lib
Marcin Niestroj ab2f616641 net: http: use shutdown(..., SHUT_RD) in receive timeout handler
So far close() was called on underlying socket when timeout has expired.
This is wrong in several ways. First of all POSIX specification of
close() does not specify what should happen on blocking recv() call and
different systems have different behaviors (e.g. Linux does not wake up
recv() caller if there was no new incoming data, while other systems
might wakeup recv() caller immediately). Another (and much more severe)
problem is that HTTP client user does not know whether underlying socket
was already closed or not after HTTP request has finished. As a result
it was not clear whether close() should be called by HTTP client user.

Use shutdown(..., SHUT_RD) in internal HTTP client implementation, so
that recv() is woken up immediately with 0 as result (which means EOF).
This will allow to gracefully handle timeouts and make it clear that it
is application responsibility to always call close() after HTTP
request (successful or not).

Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2022-03-02 10:05:09 -08:00
..
capture net: lib: capture: drop DEV_DATA/DEV_CFG usage 2022-01-19 18:16:02 +01:00
coap net: coap: Update coap context using payload length 2022-02-02 11:10:57 +01:00
config net: lib: config: Fix the timeout when waiting on network 2021-11-02 13:23:10 +01:00
conn_mgr kconfig: net: experimental settings now uses select EXPERIMENTAL 2021-10-25 10:46:48 +02:00
dns kernel: workq: Fix type errors in delayable work handlers 2022-02-02 18:43:12 -05:00
http net: http: use shutdown(..., SHUT_RD) in receive timeout handler 2022-03-02 10:05:09 -08:00
lwm2m net: lwm2m: Resource Instance level read access. 2022-02-25 10:12:23 -08:00
mqtt net: mqtt: Fix SOCKS5 setsockopt error handling 2021-12-01 13:54:30 -06:00
openthread net: openthread: bring back LOG_MODE_MINIMAL support 2022-03-01 12:49:36 +01:00
sntp
sockets net: sockets: tls: implement shutdown() method for TLS sockets 2022-03-02 10:05:09 -08:00
socks
tftp kconfig: net: experimental settings now uses select EXPERIMENTAL 2021-10-25 10:46:48 +02:00
tls_credentials
utils
websocket net: websockets: Fix send with large payload 2021-11-23 13:21:09 -05:00
CMakeLists.txt
Kconfig