diff options
author | Olle Johansson <oej@edvina.net> | 2010-07-16 13:32:22 +0000 |
---|---|---|
committer | Olle Johansson <oej@edvina.net> | 2010-07-16 13:32:22 +0000 |
commit | 5a1ed1f070ce40aee205558b592aef69e1dc15dd (patch) | |
tree | 31c205766e9181f5188b90f2206ebfe5aab5d6c6 /main/srv.c | |
parent | 93373d7bdfad483d38213cecef4ab75068a6384a (diff) |
Formatting changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/srv.c')
-rw-r--r-- | main/srv.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/main/srv.c b/main/srv.c index c65065033..f4e0ec39a 100644 --- a/main/srv.c +++ b/main/srv.c @@ -248,6 +248,7 @@ void ast_srv_cleanup(struct srv_context **context) { const char *host; unsigned short port; + while (!(ast_srv_lookup(context, NULL, &host, &port))); } @@ -257,16 +258,19 @@ int ast_get_srv(struct ast_channel *chan, char *host, int hostlen, int *port, co struct srv_entry *current; int ret; - if (chan && ast_autoservice_start(chan) < 0) + if (chan && ast_autoservice_start(chan) < 0) { return -1; + } ret = ast_search_dns(&context, service, C_IN, T_SRV, srv_callback); - if (context.have_weights) + if (context.have_weights) { process_weights(&context); + } - if (chan) + if (chan) { ret |= ast_autoservice_stop(chan); + } /* TODO: there could be a "." entry in the returned list of answers... if so, this requires special handling */ @@ -285,8 +289,9 @@ int ast_get_srv(struct ast_channel *chan, char *host, int hostlen, int *port, co *port = -1; } - while ((current = AST_LIST_REMOVE_HEAD(&context.entries, list))) + while ((current = AST_LIST_REMOVE_HEAD(&context.entries, list))) { ast_free(current); + } return ret; } |