mbedtls/programs/ssl
Hanno Becker adfa64f0c4 Abort idle-loop in ssl_server2 if sockets gets invalid
Previously, the idling loop in ssl_server2 didn't check whether
the underlying call to mbedtls_net_poll signalled that the socket
became invalid. This had the consequence that during idling, the
server couldn't be terminated through a SIGTERM, as the corresponding
handler would only close the sockets and expect the remainder of
the program to shutdown gracefully as a consequence of this.
This was subsequently attempted to be fixed through a change
in ssl-opt.sh by terminating the server through a KILL signal,
which however lead to other problems when the latter was run
under valgrind.

This commit changes the idling loop in ssl_server2 and ssl_client2
to obey the return code of mbedtls_net_poll and gracefully shutdown
if an error occurs, e.g. because the socket was closed.

As a consequence, the server termination via a KILL signal in
ssl-opt.sh is no longer necessary, with the previous `kill; wait`
pattern being sufficient. The commit reverts the corresponding
change.
2018-03-15 11:43:41 +00:00
..
CMakeLists.txt Fix whitespace in CMakeLists.txt 2015-06-25 10:59:57 +02:00
dtls_client.c Fix examples that failed to compile without PEM 2017-02-04 22:59:46 +00:00
dtls_server.c Rename net.{c,h} to net_sockets.{c,h} 2016-09-26 23:23:52 +01:00
mini_client.c Rename net.{c,h} to net_sockets.{c,h} 2016-09-26 23:23:52 +01:00
ssl_client1.c Fix default hostname for verification used in ssl_client1 2017-02-28 22:23:41 +00:00
ssl_client2.c Abort idle-loop in ssl_server2 if sockets gets invalid 2018-03-15 11:43:41 +00:00
ssl_fork_server.c Rename net.{c,h} to net_sockets.{c,h} 2016-09-26 23:23:52 +01:00
ssl_mail_client.c Fix examples that failed to compile without PEM 2017-02-04 22:59:46 +00:00
ssl_pthread_server.c Rename net.{c,h} to net_sockets.{c,h} 2016-09-26 23:23:52 +01:00
ssl_server.c Rename net.{c,h} to net_sockets.{c,h} 2016-09-26 23:23:52 +01:00
ssl_server2.c Abort idle-loop in ssl_server2 if sockets gets invalid 2018-03-15 11:43:41 +00:00