From: Christian Grothoff Date: Sat, 6 Jan 2018 20:36:15 +0000 (+0100) Subject: handle error properly, do not just log but continue gracefully X-Git-Tag: gnunet-0.11.0rc0~2^2~16^2~2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f3ea2e1338054ec0143ac7054e5e91373bcbd558;p=oweals%2Fgnunet.git handle error properly, do not just log but continue gracefully --- diff --git a/src/gns/gnunet-dns2gns.c b/src/gns/gnunet-dns2gns.c index 424677d14..bf7cca042 100644 --- a/src/gns/gnunet-dns2gns.c +++ b/src/gns/gnunet-dns2gns.c @@ -533,14 +533,21 @@ read_dns4 (void *cls) } { char buf[size + 1]; + ssize_t sret; addrlen = sizeof (v4); - GNUNET_break (size == - GNUNET_NETWORK_socket_recvfrom (listen_socket4, - buf, - size + 1, - (struct sockaddr *) &v4, - &addrlen)); + sret = GNUNET_NETWORK_socket_recvfrom (listen_socket4, + buf, + size + 1, + (struct sockaddr *) &v4, + &addrlen); + if (0 > sret) + { + GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, + "recvfrom"); + return; + } + GNUNET_break (size == (size_t) sret); handle_request (listen_socket4, &v4, addrlen,