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

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Mar 9 12:10:48 CDT 2015


Author: file
Date: Mon Mar  9 12:10:46 2015
New Revision: 432659

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=432659
Log:
Tweak documentation and constify.

Modified:
    team/group/dns/include/asterisk/dns_core.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=432659&r1=432658&r2=432659
==============================================================================
--- team/group/dns/include/asterisk/dns_core.h (original)
+++ team/group/dns/include/asterisk/dns_core.h Mon Mar  9 12:10:46 2015
@@ -64,6 +64,8 @@
  * \param query The DNS query
  *
  * \return the user specific data
+ *
+ * \note The reference count of the data is NOT incremented on return
  */
 void *ast_dns_query_get_data(const struct ast_dns_query *query);
 
@@ -184,7 +186,7 @@
  *
  * \return the next DNS record
  */
-struct ast_dns_record *ast_dns_record_get_next(const struct ast_dns_record *record);
+const struct ast_dns_record *ast_dns_record_get_next(const struct ast_dns_record *record);
 
 /*!
  * \brief Asynchronously resolve a DNS query
@@ -203,6 +205,8 @@
  * \note The user data MUST be an ao2 object
  *
  * \note This function increments the reference count of the user data, it does NOT steal
+ *
+ * \note The query must be released upon completion or cancellation using ao2_ref
  */
 struct ast_dns_query *ast_dns_resolve_async(const char *name, int rr_type, int rr_class, ast_dns_resolve_callback callback, void *data);
 

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=432659&r1=432658&r2=432659
==============================================================================
--- team/group/dns/include/asterisk/dns_resolver.h (original)
+++ team/group/dns/include/asterisk/dns_resolver.h Mon Mar  9 12:10:46 2015
@@ -32,12 +32,21 @@
 struct ast_dns_resolver {
     /*! \brief The name of the resolver implementation */
     const char *name;
-    /*! \brief Priority for this resolver if multiple exist */
+
+    /*! \brief Priority for this resolver if multiple exist, lower being higher priority */
     unsigned int priority;
-    /*! \brief Perform resolution of a DNS query */
+
+    /*!
+     * \brief Perform resolution of a DNS query
+     *
+     * \note The reference count of the query should be increased and released
+     *       upon the query completing or being successfully cancelled
+     */
     int (*resolve)(struct ast_dns_query *query);
+
     /*! \brief Cancel resolution of a DNS query */
     int (*cancel)(struct ast_dns_query *query);
+
     /*! \brief Linked list information */
     AST_RWLIST_ENTRY(ast_dns_resolver) next;
 };
@@ -65,6 +74,8 @@
  * \param query The DNS query
  *
  * \return the resolver specific data
+ *
+ * \note The reference count of the resolver data is NOT incremented on return
  */
 void *ast_dns_resolver_get_data(const struct ast_dns_query *query);
 
@@ -102,8 +113,6 @@
  * \brief Mark a DNS query as having been completed
  *
  * \param query The DNS query
- *
- * \note Once this is invoked the resolver data on the query will be removed
  */
 void ast_dns_resolver_completed(struct ast_dns_query *query);
 

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=432659&r1=432658&r2=432659
==============================================================================
--- team/group/dns/main/dns_core.c (original)
+++ team/group/dns/main/dns_core.c Mon Mar  9 12:10:46 2015
@@ -125,7 +125,7 @@
 	return record->data;
 }
 
-struct ast_dns_record *ast_dns_record_get_next(const struct ast_dns_record *record)
+const struct ast_dns_record *ast_dns_record_get_next(const struct ast_dns_record *record)
 {
 	return AST_LIST_NEXT(record, list);
 }




More information about the svn-commits mailing list