summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2005-08-06 01:02:06 +0000
committerLennart Poettering <lennart@poettering.net>2005-08-06 01:02:06 +0000
commit26a4d2b3d1bbe6eeb5e95ce3a0900e31b89e42ce (patch)
tree1dcc82f732bbad2b332a221208b01c3653478085
parent2932bd287383151f9e469d90c6de2bcee6276175 (diff)
some minor updates
git-svn-id: file:///home/lennart/svn/public/libasyncns/trunk@22 cc0fb855-19ed-0310-866e-8c1d96e4abae
-rw-r--r--libasyncns/asyncns-test.c5
-rw-r--r--libasyncns/asyncns.h3
2 files changed, 2 insertions, 6 deletions
diff --git a/libasyncns/asyncns-test.c b/libasyncns/asyncns-test.c
index e3169ec..a6e2d72 100644
--- a/libasyncns/asyncns-test.c
+++ b/libasyncns/asyncns-test.c
@@ -41,16 +41,13 @@ int main(int argc, char *argv[]) {
}
/* Make a name -> address query */
-
memset(&hints, 0, sizeof(hints));
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
q1 = asyncns_getaddrinfo(asyncns, argc >= 2 ? argv[1] : "www.heise.de", NULL, &hints);
-
/* Make an address -> name query */
-
memset(&sa, 0, sizeof(sa));
sa.sin_family = AF_INET;
sa.sin_addr.s_addr = inet_addr(argc >= 3 ? argv[2] : "193.99.144.71");
@@ -58,9 +55,7 @@ int main(int argc, char *argv[]) {
q2 = asyncns_getnameinfo(asyncns, (struct sockaddr*) &sa, sizeof(sa), 0, 1, 1);
-
/* Wait until the two queries are completed */
-
while (!asyncns_isdone(asyncns, q1) || !asyncns_isdone(asyncns, q2)) {
if (asyncns_wait(asyncns, 1) < 0)
goto fail;
diff --git a/libasyncns/asyncns.h b/libasyncns/asyncns.h
index 2bf4e62..6d3b542 100644
--- a/libasyncns/asyncns.h
+++ b/libasyncns/asyncns.h
@@ -109,7 +109,8 @@ int asyncns_getnameinfo_done(asyncns_t *asyncns, asyncns_query_t* q, char *ret_h
* asyncns_wait() before this function will return sensible data. */
asyncns_query_t* asyncns_getnext(asyncns_t *asyncns);
-/** Return the number of query objects (completed or not) attached to this session */
+/** Return the number of query objects (completed or not) attached to
+ * this session */
int asyncns_getnqueries(asyncns_t *asyncns);
/** Cancel a currently running query. q is is destroyed by this call