[asterisk-commits] file: branch group/dns r432515 - in /team/group/dns: include/asterisk/ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 6 07:58:27 CST 2015


Author: file
Date: Fri Mar  6 07:58:25 2015
New Revision: 432515

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=432515
Log:
In an effort to keep the core DNS API simple the recurring functionality will be implemented as a higher level API.

Modified:
    team/group/dns/include/asterisk/dns_core.h
    team/group/dns/include/asterisk/dns_internal.h
    team/group/dns/include/asterisk/dns_resolver.h
    team/group/dns/main/dns_core.c

Modified: team/group/dns/include/asterisk/dns_core.h
URL: http://svnview.digium.com/svn/asterisk/team/group/dns/include/asterisk/dns_core.h?view=diff&rev=432515&r1=432514&r2=432515
==============================================================================
--- team/group/dns/include/asterisk/dns_core.h (original)
+++ team/group/dns/include/asterisk/dns_core.h Fri Mar  6 07:58:25 2015
@@ -212,26 +212,6 @@
 struct ast_dns_query *ast_dns_resolve_async(const char *name, int rr_type, int rr_class, ast_dns_resolve_callback callback, void *data);
 
 /*!
- * \brief Asynchronously resolve a DNS query, and continue resolving it according to the lowest TTL available
- *
- * \param name The name of what to resolve
- * \param rr_type Resource record type
- * \param rr_class Resource record class
- * \param callback The callback to invoke upon completion
- * \param data User data to make available on the query
- *
- * \retval non-NULL success - query has been sent for resolution
- * \retval NULL failure
- *
- * \note The user data passed in to this function must be ao2 allocated
- *
- * \note This query will continue to happen according to the lowest TTL unless cancelled using ast_dns_resolve_cancel
- *
- * \note It is NOT possible for the callback to be invoked concurrently for the query multiple times
- */
-struct ast_dns_query *ast_dns_resolve_async_recurring(const char *name, int rr_type, int rr_class, ast_dns_resolve_callback callback, void *data);
-
-/*!
  * \brief Cancel an asynchronous DNS resolution
  *
  * \param query The DNS query returned from ast_dns_resolve_async

Modified: team/group/dns/include/asterisk/dns_internal.h
URL: http://svnview.digium.com/svn/asterisk/team/group/dns/include/asterisk/dns_internal.h?view=diff&rev=432515&r1=432514&r2=432515
==============================================================================
--- team/group/dns/include/asterisk/dns_internal.h (original)
+++ team/group/dns/include/asterisk/dns_internal.h Fri Mar  6 07:58:25 2015
@@ -99,10 +99,6 @@
 	void *resolver_data;
 	/*! \brief Result of the DNS query */
 	struct ast_dns_result *result;
-	/*! \brief If the query is recurring or not */
-	unsigned int recurring;
-	/*! \brief Timer for recurring resolution */
-	int timer;
 	/*! \brief Resource record type */
 	int rr_type;
 	/*! \brief Resource record class */

Modified: team/group/dns/include/asterisk/dns_resolver.h
URL: http://svnview.digium.com/svn/asterisk/team/group/dns/include/asterisk/dns_resolver.h?view=diff&rev=432515&r1=432514&r2=432515
==============================================================================
--- team/group/dns/include/asterisk/dns_resolver.h (original)
+++ team/group/dns/include/asterisk/dns_resolver.h Fri Mar  6 07:58:25 2015
@@ -99,7 +99,7 @@
  *
  * \note Once this is invoked the resolver data on the query will be removed
  */
-void ast_dns_resolver_completed(const struct ast_dns_query *query);
+void ast_dns_resolver_completed(struct ast_dns_query *query);
 
 /*!
  * \brief Register a DNS resolver

Modified: team/group/dns/main/dns_core.c
URL: http://svnview.digium.com/svn/asterisk/team/group/dns/main/dns_core.c?view=diff&rev=432515&r1=432514&r2=432515
==============================================================================
--- team/group/dns/main/dns_core.c (original)
+++ team/group/dns/main/dns_core.c Fri Mar  6 07:58:25 2015
@@ -144,7 +144,7 @@
 	ast_dns_result_free(query->result);
 }
 
-static struct ast_dns_query *dns_resolve_async(const char *name, int rr_type, int rr_class, ast_dns_resolve_callback callback, void *data, unsigned int recurring)
+struct ast_dns_query *ast_dns_resolve_async(const char *name, int rr_type, int rr_class, ast_dns_resolve_callback callback, void *data)
 {
 	struct ast_dns_query *query;
 
@@ -152,19 +152,13 @@
 		return NULL;
 	}
 
-	if (!recurring) {
-		query = ao2_alloc_options(sizeof(*query) + strlen(name) + 1, dns_query_destroy, AO2_ALLOC_OPT_LOCK_NOLOCK);
-	} else {
-		query = ao2_alloc(sizeof(*query) + strlen(name) + 1, dns_query_destroy);
-	}
-
+	query = ao2_alloc_options(sizeof(*query) + strlen(name) + 1, dns_query_destroy, AO2_ALLOC_OPT_LOCK_NOLOCK);
 	if (!query) {
 		return NULL;
 	}
 
 	query->callback = callback;
 	query->user_data = ao2_bump(data);
-	query->recurring = recurring;
 	query->rr_type = rr_type;
 	query->rr_class = rr_class;
 	strcpy(query->name, name); /* SAFE */
@@ -188,16 +182,6 @@
 	}
 
 	return query;
-}
-
-struct ast_dns_query *ast_dns_resolve_async(const char *name, int rr_type, int rr_class, ast_dns_resolve_callback callback, void *data)
-{
-	return dns_resolve_async(name, rr_type, rr_class, callback, data, 0);
-}
-
-struct ast_dns_query *ast_dns_resolve_async_recurring(const char *name, int rr_type, int rr_class, ast_dns_resolve_callback callback, void *data)
-{
-	return dns_resolve_async(name, rr_type, rr_class, callback, data, 1);
 }
 
 int ast_dns_resolve_cancel(struct ast_dns_query *query)
@@ -445,15 +429,9 @@
 	return 0;
 }
 
-void ast_dns_resolver_completed(const struct ast_dns_query *query)
+void ast_dns_resolver_completed(struct ast_dns_query *query)
 {
 	query->callback(query);
-
-	if (!query->recurring) {
-		return;
-	}
-
-
 }
 
 static void dns_shutdown(void)




More information about the asterisk-commits mailing list