/[resiprocate]/main/contrib/ares/ares_destroy.c
ViewVC logotype

Contents of /main/contrib/ares/ares_destroy.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5295 - (show annotations) (download)
Mon Aug 22 00:30:05 2005 UTC (14 years, 2 months ago) by jason
File MIME type: text/plain
File size: 1382 byte(s)
merged 5270:HEAD from b-directory-reorg
1 /* Copyright 1998 by the Massachusetts Institute of Technology.
2 *
3 * Permission to use, copy, modify, and distribute this
4 * software and its documentation for any purpose and without
5 * fee is hereby granted, provided that the above copyright
6 * notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting
8 * documentation, and that the name of M.I.T. not be used in
9 * advertising or publicity pertaining to distribution of the
10 * software without specific, written prior permission.
11 * M.I.T. makes no representations about the suitability of
12 * this software for any purpose. It is provided "as is"
13 * without express or implied warranty.
14 */
15
16
17 #include <stdlib.h>
18 #include "ares.h"
19 #include "ares_private.h"
20
21 void ares_destroy(ares_channel channel)
22 {
23 int i;
24 struct query *query;
25
26 for (i = 0; i < channel->nservers; i++)
27 ares__close_sockets(&channel->servers[i]);
28 free(channel->servers);
29 for (i = 0; i < channel->ndomains; i++)
30 free(channel->domains[i]);
31 free(channel->domains);
32 free(channel->sortlist);
33 free(channel->lookups);
34 while (channel->queries)
35 {
36 query = channel->queries;
37 channel->queries = query->next;
38 query->callback(query->arg, ARES_EDESTRUCTION, NULL, 0);
39 free(query->tcpbuf);
40 free(query->skip_server);
41 free(query);
42 }
43 free(channel);
44 }

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27