Skip to content
Commit 9cdc1bb9 authored by Robert Lubos's avatar Robert Lubos Committed by Christopher Friedt
Browse files

net: sockets: tls: Fix TLS POLLHUP notification



The `poll()` function did not report POLLHUP if the peer ended the DTLS
session, making it impossible to detect such event on the application
side.

On the other hand, TLS erroneusely reported POLLHUP along with each
POLLIN event, as the 0 returned by the `recv()` socket call was
wrongly interpreted (it was expected to get 0 in return as 0 bytes were
requested).

Fix this by introducing a helper function to process the mbedtls context
and verify if new application data is pendingi or session has ended.
Use this new function in the poll handler, instead of a socket `recv()`
call, to remove any ambiguity in the usage, for both TLS and DTLS.

Signed-off-by: default avatarRobert Lubos <robert.lubos@nordicsemi.no>
parent d0affeff
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment