Willy Tarreau 1afaa7b59d MINOR: rawsock: introduce CO_RFL_TRY_HARDER to detect closures on complete reads
Normally, when reading a full buffer, or exactly the requested size, it
is not really possible to know if the peer had closed immediately after,
and usually we don't care. There's a problematic case, though, which is
with SSL: the SSL layer reads in small chunks of a few bytes, and can
consume a client_hello this way, then start computation without knowing
yet that the client has aborted. In order to permit knowing more, we now
introduce a new read flag, CO_RFL_TRY_HARDER, which says that if we've
read up to the permitted limit and the flag is set, then we attempt one
extra byte using MSG_PEEK to detect whether the connection was closed
immediately after that content or not. The first use case will obviously
be related to SSL and client_hello, but it might possibly also make sense
on HTTP responses to detect a pending FIN at the end of a response (e.g.
if a close was already advertised).
2025-10-01 10:23:01 +02:00
..
2023-08-01 10:49:06 +02:00
2024-05-16 10:31:17 +02:00
2024-11-29 07:22:32 +01:00
2025-04-30 17:00:27 +02:00
2024-12-10 16:04:11 +01:00
2022-11-29 15:14:39 +01:00
2025-01-30 18:12:40 +01:00
2024-12-12 11:19:10 +01:00
2024-07-12 15:27:04 +02:00
2024-08-07 15:40:52 +02:00
2025-05-28 16:46:34 +02:00