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: Robert Lubos <robert.lubos@nordicsemi.no> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| getaddrinfo.c | ||
| getnameinfo.c | ||
| Kconfig | ||
| socket_offload.c | ||
| socketpair.c | ||
| sockets_can.c | ||
| sockets_internal.h | ||
| sockets_misc.c | ||
| sockets_net_mgmt.c | ||
| sockets_packet.c | ||
| sockets_select.c | ||
| sockets_tls.c | ||
| sockets.c | ||