[asterisk-commits] irroot: branch irroot/distrotech-customers-trunk r342275 - in /team/irroot/di...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 25 10:40:59 CDT 2011


Author: irroot
Date: Tue Oct 25 10:40:55 2011
New Revision: 342275

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=342275
Log:
Multiple revisions 342112,342148,342184,342225

........
  r342112 | rmudgett | 2011-10-24 23:01:58 +0200 (Mon, 24 Oct 2011) | 8 lines
  
  Fix use of OBJ_KEY in Queue application.
  
  To use the new OBJ_KEY flag, the container hash and compare callback
  functions must be updated to support OBJ_KEY.  Otherwise, bad things
  happen.
  
  (issue ASTERISK-14769)
........
  r342148 | jrose | 2011-10-25 00:09:11 +0200 (Tue, 25 Oct 2011) | 3 lines
  
  Fixes a segfault caused by referencing null frames introduced in r338623
........
  r342184 | rmudgett | 2011-10-25 00:37:58 +0200 (Tue, 25 Oct 2011) | 5 lines
  
  Fix ao2obj.h comment typos and add missing link/unlink nolock debug defines.
  ........
  
  Merged revisions 342183 from http://svn.asterisk.org/svn/asterisk/branches/10
........
  r342225 | twilson | 2011-10-25 03:29:32 +0200 (Tue, 25 Oct 2011) | 14 lines
  
  Return NULL when no results returned for realtime_multientry
  
  It was not documented what the return value should be when no entries
  were returned with the multientry realtime callback. This change forces
  consistent behavior even if the backends return an empty ast_config.
  
  Review: https://reviewboard.asterisk.org/r/1521/
  ........
  
  Merged revisions 342223 from http://svn.asterisk.org/svn/asterisk/branches/1.8
  ........
  
  Merged revisions 342224 from http://svn.asterisk.org/svn/asterisk/branches/10
........

Merged revisions 342112,342148,342184,342225 from http://svn.asterisk.org/svn/asterisk/trunk

Modified:
    team/irroot/distrotech-customers-trunk/   (props changed)
    team/irroot/distrotech-customers-trunk/include/asterisk/astobj2.h
    team/irroot/distrotech-customers-trunk/include/asterisk/config.h
    team/irroot/distrotech-customers-trunk/main/config.c
    team/irroot/distrotech-customers-trunk/main/features.c

Propchange: team/irroot/distrotech-customers-trunk/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/irroot/distrotech-customers-trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Propchange: team/irroot/distrotech-customers-trunk/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Oct 25 10:40:55 2011
@@ -1,1 +1,1 @@
-/trunk:1-342074
+/trunk:1-342274

Modified: team/irroot/distrotech-customers-trunk/include/asterisk/astobj2.h
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/include/asterisk/astobj2.h?view=diff&rev=342275&r1=342274&r2=342275
==============================================================================
--- team/irroot/distrotech-customers-trunk/include/asterisk/astobj2.h (original)
+++ team/irroot/distrotech-customers-trunk/include/asterisk/astobj2.h Tue Oct 25 10:40:55 2011
@@ -46,7 +46,7 @@
 locks.
 
 Creating an object requires the size of the object and
-and a pointer to the destructor function:
+a pointer to the destructor function:
 
     struct foo *o;
 
@@ -127,7 +127,7 @@
 does not lock the object to be computed, so modifications of
 those fields that affect the computation of the hash should
 be done by extracting the object from the container, and
-reinserting it after the change (this is not terribly expensive).
+re-inserting it after the change (this is not terribly expensive).
 
 \note A container with a single buckets is effectively a linked
 list. However there is no ordering among elements.
@@ -142,12 +142,12 @@
 An interface to help debug refcounting is provided
 in this package. It is dependent on the REF_DEBUG macro being
 defined in a source file, before the #include of astobj2.h,
-and in using variants of the normal ao2_xxxx functions
-that are named ao2_t_xxxx instead, with an extra argument, a string,
+and in using variants of the normal ao2_xxx functions
+that are named ao2_t_xxx instead, with an extra argument, a string,
 that will be printed out into /tmp/refs when the refcount for an
 object is changed.
 
-  these ao2_t_xxxx variants are provided:
+  these ao2_t_xxx variants are provided:
 
 ao2_t_alloc(arg1, arg2, arg3)
 ao2_t_ref(arg1,arg2,arg3)
@@ -159,7 +159,7 @@
 ao2_t_iterator_next(arg1, arg2)
 
 If you study each argument list, you will see that these functions all have
-one extra argument that their ao2_xxx counterpart. The last argument in
+one extra argument than their ao2_xxx counterpart. The last argument in
 each case is supposed to be a string pointer, a "tag", that should contain
 enough of an explanation, that you can pair operations that increment the
 ref count, with operations that are meant to decrement the refcount.
@@ -194,7 +194,7 @@
 The remainder of the line specifies where in the file the call was made,
     and the function name, and the tag supplied in the function call.
 
-The **call destructor** is specified when the the destroy routine is
+The **call destructor** is specified when the destroy routine is
 run for an object. It does not affect the ref count, but is important
 in debugging, because it is possible to have the astobj2 system run it
 multiple times on the same object, commonly fatal to asterisk.
@@ -538,7 +538,7 @@
 	OBJ_UNLINK - to remove the object, once found, from the container.
 	OBJ_NODATA - don't return the object if found (no ref count change)
 	OBJ_MULTIPLE - don't stop at first match
-	OBJ_POINTER	- if set, 'arg' is an object pointer, and a hashtable
+	OBJ_POINTER	- if set, 'arg' is an object pointer, and a hash table
                   search will be done. If not, a traversal is done.
 
   -  \b ao2_callback(c, flags, fn, arg)
@@ -550,9 +550,9 @@
 	     OBJ_UNLINK   - to remove the object, once found, from the container.
 	     OBJ_NODATA   - don't return the object if found (no ref count change)
 	     OBJ_MULTIPLE - don't stop at first match
-	     OBJ_POINTER  - if set, 'arg' is an object pointer, and a hashtable
+	     OBJ_POINTER  - if set, 'arg' is an object pointer, and a hash table
                         search will be done. If not, a traversal is done through
-                        all the hashtable 'buckets'..
+                        all the hash table 'buckets'..
       - fn is a func that returns int, and takes 3 args:
         (void *obj, void *arg, int flags);
           obj is an object
@@ -564,7 +564,7 @@
            CMP_MATCH: This object is matched.
 
 	Note that the entire operation is run with the container
-	locked, so noone else can change its content while we work on it.
+	locked, so nobody else can change its content while we work on it.
 	However, we pay this with the fact that doing
 	anything blocking in the callback keeps the container
 	blocked.
@@ -714,9 +714,8 @@
  *
  * \param arg1 Number of buckets for hash
  * \param arg2 Pointer to a function computing a hash value.
- * \param arg3 Pointer to a function comparating key-value
- * 			with a string. (can be NULL)
- * \param arg4
+ * \param arg3 Pointer to a compare function used by ao2_find. (NULL to match everything)
+ * \param arg4 used for debugging.
  *
  * \return A pointer to a struct container.
  *
@@ -767,7 +766,7 @@
  *
  * \param arg1 the container to operate on.
  * \param arg2 the object to be added.
- * \param arg3 used for debuging.
+ * \param arg3 used for debugging.
  *
  * \retval NULL on errors.
  * \retval newobj on success.
@@ -781,15 +780,17 @@
  */
 #ifdef REF_DEBUG
 
-#define ao2_t_link(arg1, arg2, arg3) __ao2_link_debug((arg1), (arg2), 0, (arg3),  __FILE__, __LINE__, __PRETTY_FUNCTION__)
-#define ao2_link(arg1, arg2)         __ao2_link_debug((arg1), (arg2), 0, "",  __FILE__, __LINE__, __PRETTY_FUNCTION__)
-#define ao2_link_nolock(arg1, arg2)  __ao2_link_debug((arg1), (arg2), OBJ_NOLOCK, "",  __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define ao2_t_link(arg1, arg2, arg3)        __ao2_link_debug((arg1), (arg2), 0, (arg3),  __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define ao2_link(arg1, arg2)                __ao2_link_debug((arg1), (arg2), 0, "",  __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define ao2_t_link_nolock(arg1, arg2, arg3) __ao2_link_debug((arg1), (arg2), OBJ_NOLOCK, (arg3),  __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define ao2_link_nolock(arg1, arg2)         __ao2_link_debug((arg1), (arg2), OBJ_NOLOCK, "",  __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
 #else
 
-#define ao2_t_link(arg1, arg2, arg3) __ao2_link((arg1), (arg2), 0)
-#define ao2_link(arg1, arg2)         __ao2_link((arg1), (arg2), 0)
-#define ao2_link_nolock(arg1, arg2)  __ao2_link((arg1), (arg2), OBJ_NOLOCK)
+#define ao2_t_link(arg1, arg2, arg3)        __ao2_link((arg1), (arg2), 0)
+#define ao2_link(arg1, arg2)                __ao2_link((arg1), (arg2), 0)
+#define ao2_t_link_nolock(arg1, arg2, arg3) __ao2_link((arg1), (arg2), OBJ_NOLOCK)
+#define ao2_link_nolock(arg1, arg2)         __ao2_link((arg1), (arg2), OBJ_NOLOCK)
 
 #endif
 
@@ -815,15 +816,17 @@
  */
 #ifdef REF_DEBUG
 
-#define ao2_t_unlink(arg1, arg2, arg3) __ao2_unlink_debug((arg1), (arg2), 0, (arg3),  __FILE__, __LINE__, __PRETTY_FUNCTION__)
-#define ao2_unlink(arg1, arg2)         __ao2_unlink_debug((arg1), (arg2), 0, "",  __FILE__, __LINE__, __PRETTY_FUNCTION__)
-#define ao2_unlink_nolock(arg1, arg2)  __ao2_unlink_debug((arg1), (arg2), OBJ_NOLOCK, "",  __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define ao2_t_unlink(arg1, arg2, arg3)          __ao2_unlink_debug((arg1), (arg2), 0, (arg3),  __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define ao2_unlink(arg1, arg2)                  __ao2_unlink_debug((arg1), (arg2), 0, "",  __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define ao2_t_unlink_nolock(arg1, arg2, arg3)   __ao2_unlink_debug((arg1), (arg2), OBJ_NOLOCK, (arg3),  __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define ao2_unlink_nolock(arg1, arg2)           __ao2_unlink_debug((arg1), (arg2), OBJ_NOLOCK, "",  __FILE__, __LINE__, __PRETTY_FUNCTION__)
 
 #else
 
-#define ao2_t_unlink(arg1, arg2, arg3) __ao2_unlink((arg1), (arg2), 0)
-#define ao2_unlink(arg1, arg2)         __ao2_unlink((arg1), (arg2), 0)
-#define ao2_unlink_nolock(arg1, arg2)  __ao2_unlink((arg1), (arg2), OBJ_NOLOCK)
+#define ao2_t_unlink(arg1, arg2, arg3)          __ao2_unlink((arg1), (arg2), 0)
+#define ao2_unlink(arg1, arg2)                  __ao2_unlink((arg1), (arg2), 0)
+#define ao2_t_unlink_nolock(arg1, arg2, arg3)   __ao2_unlink((arg1), (arg2), OBJ_NOLOCK)
+#define ao2_unlink_nolock(arg1, arg2)           __ao2_unlink((arg1), (arg2), OBJ_NOLOCK)
 
 #endif
 
@@ -862,7 +865,7 @@
           flags is the same as flags passed into ao2_callback (flags are
            also used by ao2_callback).
  * \param arg passed to the callback.
- * \param tag used for debuging.
+ * \param tag used for debugging.
  * \return when OBJ_MULTIPLE is not included in the flags parameter,
  *         the return value will be either the object found or NULL if no
  *         no matching object was found. if OBJ_MULTIPLE is included,
@@ -890,7 +893,7 @@
  * The p pointer can be a pointer to an object or to a key,
  * we can say this looking at flags value.
  * If p points to an object we will search for the object pointed
- * by this value, otherwise we serch for a key value.
+ * by this value, otherwise we search for a key value.
  * If the key is not unique we only find the first matching valued.
  *
  * The use of flags argument is the follow:

Modified: team/irroot/distrotech-customers-trunk/include/asterisk/config.h
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/include/asterisk/config.h?view=diff&rev=342275&r1=342274&r2=342275
==============================================================================
--- team/irroot/distrotech-customers-trunk/include/asterisk/config.h (original)
+++ team/irroot/distrotech-customers-trunk/include/asterisk/config.h Tue Oct 25 10:40:55 2011
@@ -357,6 +357,9 @@
  * the ast_load_realtime, this function can return more than one entry and
  * is thus stored inside a traditional ast_config structure rather than
  * just returning a linked list of variables.
+ *
+ * \return An ast_config with one or more results
+ * \retval NULL Error or no results returned
  *
  * \note You should use the constant SENTINEL to terminate arguments, in
  * order to preserve cross-platform compatibility.

Modified: team/irroot/distrotech-customers-trunk/main/config.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/main/config.c?view=diff&rev=342275&r1=342274&r2=342275
==============================================================================
--- team/irroot/distrotech-customers-trunk/main/config.c (original)
+++ team/irroot/distrotech-customers-trunk/main/config.c Tue Oct 25 10:40:55 2011
@@ -2446,6 +2446,11 @@
 	for (i = 1; ; i++) {
 		if ((eng = find_engine(family, i, db, sizeof(db), table, sizeof(table)))) {
 			if (eng->realtime_multi_func && (res = eng->realtime_multi_func(db, table, ap))) {
+				/* If we were returned an empty cfg, destroy it and return NULL */
+				if (!res->root) {
+					ast_config_destroy(res);
+					res = NULL;
+				}
 				break;
 			}
 		} else {

Modified: team/irroot/distrotech-customers-trunk/main/features.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/main/features.c?view=diff&rev=342275&r1=342274&r2=342275
==============================================================================
--- team/irroot/distrotech-customers-trunk/main/features.c (original)
+++ team/irroot/distrotech-customers-trunk/main/features.c Tue Oct 25 10:40:55 2011
@@ -4053,11 +4053,11 @@
 					   digits to come in for features. */
 					ast_debug(1, "Timed out for feature!\n");
 					if (!ast_strlen_zero(peer_featurecode)) {
-						ast_dtmf_stream(chan, peer, peer_featurecode, 0, f->len);
+						ast_dtmf_stream(chan, peer, peer_featurecode, 0, f ? f->len : 0);
 						memset(peer_featurecode, 0, sizeof(peer_featurecode));
 					}
 					if (!ast_strlen_zero(chan_featurecode)) {
-						ast_dtmf_stream(peer, chan, chan_featurecode, 0, f->len);
+						ast_dtmf_stream(peer, chan, chan_featurecode, 0, f ? f->len : 0);
 						memset(chan_featurecode, 0, sizeof(chan_featurecode));
 					}
 					if (f)




More information about the asterisk-commits mailing list