]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
neater handling of no response
authorJelte Jansen <jeltejan@NLnetLabs.nl>
Thu, 7 Apr 2005 08:38:22 +0000 (08:38 +0000)
committerJelte Jansen <jeltejan@NLnetLabs.nl>
Thu, 7 Apr 2005 08:38:22 +0000 (08:38 +0000)
net.c

diff --git a/net.c b/net.c
index 2b7e8a982bd1dd50f9aa3b6be6321758d754f45c..fc941969976b89847c221852925889d9cca71ab5 100644 (file)
--- a/net.c
+++ b/net.c
@@ -105,6 +105,10 @@ ldns_send(ldns_resolver *r, ldns_pkt *query_pkt)
                        reply_bytes = ldns_send_udp(qb, ns, ns_len, ldns_resolver_timeout(r), &reply_size);
                }
                
+               if (!reply_bytes) {
+                       return NULL;
+               }
+               
                if (ldns_wire2pkt(&reply, reply_bytes, reply_size) !=
                    LDNS_STATUS_OK) {
                        printf("malformed answer\n");
@@ -216,7 +220,6 @@ ldns_send_udp(ldns_buffer *qbin, const struct sockaddr_storage *to, socklen_t to
                if (errno == EAGAIN) {
                        fprintf(stderr, "socket timeout\n");
                }
-               printf("received too little\n");
                FREE(answer);
                return NULL;
        }