diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2009-11-03 16:24:25 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2009-12-09 10:05:18 -0500 |
commit | 2446a71baaae100bafee0589a2e18bb8a16dff1b (patch) | |
tree | f40afca9e6d0510ab5e832a5a03b09f5fe5f7dff /server/tests | |
parent | aa83edba323ae398f89612afeb2f35566c6f7a5c (diff) | |
download | sssd-2446a71baaae100bafee0589a2e18bb8a16dff1b.tar.gz sssd-2446a71baaae100bafee0589a2e18bb8a16dff1b.tar.bz2 sssd-2446a71baaae100bafee0589a2e18bb8a16dff1b.zip |
Change ares usage to be c-ares 1.7.0 compatible
* Rename structure accordingly to ares upstream
* Use new ares parsing functions in the wrappers
* fix tests for ares 1.7
Diffstat (limited to 'server/tests')
-rw-r--r-- | server/tests/resolv-tests.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/server/tests/resolv-tests.c b/server/tests/resolv-tests.c index bf76849a..d6b8c4f3 100644 --- a/server/tests/resolv-tests.c +++ b/server/tests/resolv-tests.c @@ -253,15 +253,13 @@ END_TEST static void test_internet(struct tevent_req *req) { - int i; int recv_status; int status; struct resolv_test_ctx *test_ctx; void *tmp_ctx; struct hostent *hostent = NULL; - struct txt_reply *txt_replies = NULL; - struct srv_reply *srv_replies = NULL; - int count; + struct ares_txt_reply *txt_replies = NULL, *txtptr; + struct ares_srv_reply *srv_replies = NULL, *srvptr; test_ctx = tevent_req_callback_data(req, struct resolv_test_ctx); @@ -278,20 +276,20 @@ static void test_internet(struct tevent_req *req) break; case TESTING_TXT: recv_status = resolv_gettxt_recv(tmp_ctx, req, &status, NULL, - &txt_replies, &count); - test_ctx->error = (count == 0) ? ENOENT : EOK; - for (i = 0; i < count; i++) { - DEBUG(2, ("TXT Record: %s\n", txt_replies[i].txt)); + &txt_replies); + test_ctx->error = (txt_replies == NULL) ? ENOENT : EOK; + for (txtptr = txt_replies; txtptr != NULL; txtptr = txtptr->next) { + DEBUG(2, ("TXT Record: %s\n", txtptr->txt)); } break; case TESTING_SRV: recv_status = resolv_getsrv_recv(tmp_ctx, req, &status, NULL, - &srv_replies, &count); - test_ctx->error = (count == 0) ? ENOENT : EOK; - for (i = 0; i < count; i++) { - DEBUG(2, ("SRV Record: %d %d %d %s\n", srv_replies[i].weight, - srv_replies[i].priority, srv_replies[i].port, - srv_replies[i].host)); + &srv_replies); + test_ctx->error = (srv_replies == NULL) ? ENOENT : EOK; + for (srvptr = srv_replies; srvptr != NULL; srvptr = srvptr->next) { + DEBUG(2, ("SRV Record: %d %d %d %s\n", srvptr->weight, + srvptr->priority, srvptr->port, + srvptr->host)); } break; } |