From 6419c9df8c947b387fe474dd7bc012c6fdd1d99f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 11 Dec 2007 20:39:55 +0000 Subject: [PATCH] fix enum git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6669 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_enum/mod_enum.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mod/applications/mod_enum/mod_enum.c b/src/mod/applications/mod_enum/mod_enum.c index ca596c50d8..35dd51ef8e 100644 --- a/src/mod/applications/mod_enum/mod_enum.c +++ b/src/mod/applications/mod_enum/mod_enum.c @@ -55,6 +55,7 @@ struct query { unsigned char dn[DNS_MAXDN]; enum dns_type qtyp; /* type of the query */ enum_record_t *results; + int errs; }; typedef struct query enum_query_t; @@ -203,9 +204,10 @@ static char *reverse_number(char *in, char *root) static void dnserror(enum_query_t * q, int errnum) { - + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "unable to lookup %s record for %s: %s\n", dns_typename(q->qtyp), dns_dntosp(q->dn), dns_strerror(errnum)); + q->errs++; } @@ -501,7 +503,7 @@ static switch_status_t enum_lookup(char *root, char *in, enum_record_t ** result j += i; - if (j > globals.timeout || query.results) { + if (j > globals.timeout || query.results || query.errs) { break; } @@ -509,8 +511,9 @@ static switch_status_t enum_lookup(char *root, char *in, enum_record_t ** result tv.tv_usec = 0; i = select((int) (fd + 1), &fds, 0, 0, &tv); now = time(NULL); - if (i > 0) + if (i > 0) { dns_ioevent(nctx, now); + } } if (!query.results) {