[asterisk-commits] dlee: branch dlee/ASTERISK-21096 r383597 - in /team/dlee/ASTERISK-21096: ./ c...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 22 09:24:16 CDT 2013


Author: dlee
Date: Fri Mar 22 09:24:11 2013
New Revision: 383597

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=383597
Log:
Rebased to trunk r383579; removed json_main merge source

Modified:
    team/dlee/ASTERISK-21096/   (props changed)
    team/dlee/ASTERISK-21096/channels/chan_skinny.c
    team/dlee/ASTERISK-21096/codecs/Makefile
    team/dlee/ASTERISK-21096/funcs/func_curl.c
    team/dlee/ASTERISK-21096/include/asterisk/astobj2.h
    team/dlee/ASTERISK-21096/include/asterisk/sorcery.h
    team/dlee/ASTERISK-21096/include/asterisk/stasis.h
    team/dlee/ASTERISK-21096/main/sorcery.c
    team/dlee/ASTERISK-21096/main/stasis.c
    team/dlee/ASTERISK-21096/main/stasis_message_router.c
    team/dlee/ASTERISK-21096/res/res_sorcery_memory.c
    team/dlee/ASTERISK-21096/tests/test_sorcery.c

Propchange: team/dlee/ASTERISK-21096/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/dlee/ASTERISK-21096/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Mar 22 09:24:11 2013
@@ -1,1 +1,1 @@
-/team/dlee/json_main:1-383509 /trunk:1-383315
+/trunk:1-383579

Modified: team/dlee/ASTERISK-21096/channels/chan_skinny.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-21096/channels/chan_skinny.c?view=diff&rev=383597&r1=383596&r2=383597
==============================================================================
--- team/dlee/ASTERISK-21096/channels/chan_skinny.c (original)
+++ team/dlee/ASTERISK-21096/channels/chan_skinny.c Fri Mar 22 09:24:11 2013
@@ -8571,6 +8571,9 @@
 		   We do not want to free the line here, that
 		   will happen below. */
 		while ((l = AST_LIST_REMOVE_HEAD(&d->lines, list))) {
+			if (l->mwi_event_sub) {
+				l->mwi_event_sub = stasis_unsubscribe(l->mwi_event_sub);
+			}
 		}
 		/* Delete all speeddials for this device */
 		while ((sd = AST_LIST_REMOVE_HEAD(&d->speeddials, list))) {

Modified: team/dlee/ASTERISK-21096/codecs/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-21096/codecs/Makefile?view=diff&rev=383597&r1=383596&r2=383597
==============================================================================
--- team/dlee/ASTERISK-21096/codecs/Makefile (original)
+++ team/dlee/ASTERISK-21096/codecs/Makefile Fri Mar 22 09:24:11 2013
@@ -53,8 +53,8 @@
 	for dir in $(SUB_DIRS); do \
 		$(MAKE) -C $$dir clean; \
 	done
-	rm -f g722/*.[oa]
-	rm -f speex/*.[oa]
+	rm -f g722/*.[oai]
+	rm -f speex/*.[oai]
 
 .PHONY: $(SUB_DIRS)
 

Modified: team/dlee/ASTERISK-21096/funcs/func_curl.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-21096/funcs/func_curl.c?view=diff&rev=383597&r1=383596&r2=383597
==============================================================================
--- team/dlee/ASTERISK-21096/funcs/func_curl.c (original)
+++ team/dlee/ASTERISK-21096/funcs/func_curl.c Fri Mar 22 09:24:11 2013
@@ -581,6 +581,7 @@
 	struct ast_datastore *store = NULL;
 	int hashcompat = 0;
 	AST_LIST_HEAD(global_curl_info, curl_settings) *list = NULL;
+	char curl_errbuf[CURL_ERROR_SIZE + 1]; /* add one to be safe */
 
 	if (buf) {
 		*buf = '\0';
@@ -642,7 +643,19 @@
 		curl_easy_setopt(*curl, CURLOPT_POSTFIELDS, args.postdata);
 	}
 
-	curl_easy_perform(*curl);
+	/* Temporarily assign a buffer for curl to write errors to. */
+	curl_errbuf[0] = curl_errbuf[CURL_ERROR_SIZE] = '\0';
+	curl_easy_setopt(*curl, CURLOPT_ERRORBUFFER, curl_errbuf);
+
+	if (curl_easy_perform(*curl) != 0) {
+		ast_log(LOG_WARNING, "%s ('%s')\n", curl_errbuf, args.url);
+	}
+
+	/* Reset buffer to NULL so curl doesn't try to write to it when the
+	 * buffer is deallocated. Documentation is vague about allowing NULL
+	 * here, but the source allows it. See: "typecheck: allow NULL to unset
+	 * CURLOPT_ERRORBUFFER" (62bcf005f4678a93158358265ba905bace33b834). */
+	curl_easy_setopt(*curl, CURLOPT_ERRORBUFFER, (char*)NULL);
 
 	if (store) {
 		AST_LIST_UNLOCK(list);
@@ -665,20 +678,11 @@
 			int rowcount = 0;
 			while (fields && values && (piece = strsep(&remainder, "&"))) {
 				char *name = strsep(&piece, "=");
-				/* Do this before the decode, because if something has encoded
-				 * a literal plus-sign, we don't want to translate that to a
-				 * space. */
-				if (hashcompat == HASHCOMPAT_LEGACY) {
-					if (piece) {
-						ast_uri_decode(piece, ast_uri_http_legacy);
-					}
-					ast_uri_decode(name, ast_uri_http_legacy);
-				} else {
-					if (piece) {
-						ast_uri_decode(piece, ast_uri_http);
-					}
-					ast_uri_decode(name, ast_uri_http);
+				struct ast_flags mode = (hashcompat == HASHCOMPAT_LEGACY ? ast_uri_http_legacy : ast_uri_http);
+				if (piece) {
+					ast_uri_decode(piece, mode);
 				}
+				ast_uri_decode(name, mode);
 				ast_str_append(&fields, 0, "%s%s", rowcount ? "," : "", ast_str_set_escapecommas(&escapebuf, 0, name, INT_MAX));
 				ast_str_append(&values, 0, "%s%s", rowcount ? "," : "", ast_str_set_escapecommas(&escapebuf, 0, S_OR(piece, ""), INT_MAX));
 				rowcount++;

Modified: team/dlee/ASTERISK-21096/include/asterisk/astobj2.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-21096/include/asterisk/astobj2.h?view=diff&rev=383597&r1=383596&r2=383597
==============================================================================
--- team/dlee/ASTERISK-21096/include/asterisk/astobj2.h (original)
+++ team/dlee/ASTERISK-21096/include/asterisk/astobj2.h Fri Mar 22 09:24:11 2013
@@ -1433,8 +1433,8 @@
  * \param flags search_flags to control linking the object.  (OBJ_NOLOCK)
  * \param tag used for debugging.
  *
- * \retval NULL on errors.
- * \retval !NULL on success.
+ * \retval 0 on errors.
+ * \retval 1 on success.
  *
  * This function inserts an object in a container according its key.
  *

Modified: team/dlee/ASTERISK-21096/include/asterisk/sorcery.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-21096/include/asterisk/sorcery.h?view=diff&rev=383597&r1=383596&r2=383597
==============================================================================
--- team/dlee/ASTERISK-21096/include/asterisk/sorcery.h (original)
+++ team/dlee/ASTERISK-21096/include/asterisk/sorcery.h Fri Mar 22 09:24:11 2013
@@ -203,7 +203,7 @@
 	void (*reload)(void *data, const struct ast_sorcery *sorcery, const char *type);
 
 	/*! \brief Callback for creating an object */
-	int (*create)(void *data, void *object);
+	int (*create)(const struct ast_sorcery *sorcery, void *data, void *object);
 
 	/*! \brief Callback for retrieving an object using an id */
 	void *(*retrieve_id)(const struct ast_sorcery *sorcery, void *data, const char *type, const char *id);
@@ -218,10 +218,10 @@
 	void (*retrieve_multiple)(const struct ast_sorcery *sorcery, void *data, const char *type, struct ao2_container *objects, const struct ast_variable *fields);
 
 	/*! \brief Callback for updating an object */
-	int (*update)(void *data, void *object);
+	int (*update)(const struct ast_sorcery *sorcery, void *data, void *object);
 
 	/*! \brief Callback for deleting an object */
-	int (*delete)(void *data, void *object);
+	int (*delete)(const struct ast_sorcery *sorcery, void *data, void *object);
 
 	/*! \brief Callback for closing a wizard */
 	void (*close)(void *data);

Modified: team/dlee/ASTERISK-21096/include/asterisk/stasis.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-21096/include/asterisk/stasis.h?view=diff&rev=383597&r1=383596&r2=383597
==============================================================================
--- team/dlee/ASTERISK-21096/include/asterisk/stasis.h (original)
+++ team/dlee/ASTERISK-21096/include/asterisk/stasis.h Fri Mar 22 09:24:11 2013
@@ -54,9 +54,7 @@
  * enforced in code). Messages themselves are reference-counted, AO2 objects,
  * along with their values. By being both reference counted and immutable,
  * messages can be shared throughout the system without any concerns for
- * threading. (Well, the objects must be allocated with \ref
- * AO2_ALLOC_OPT_LOCK_MUTEX so that the reference counting operations are thread
- * safe. But other than that, no worries).
+ * threading.
  *
  * The type of a message is defined by an instance of \ref stasis_message_type,
  * which can be created by calling stasis_message_type_create(). Message types

Modified: team/dlee/ASTERISK-21096/main/sorcery.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-21096/main/sorcery.c?view=diff&rev=383597&r1=383596&r2=383597
==============================================================================
--- team/dlee/ASTERISK-21096/main/sorcery.c (original)
+++ team/dlee/ASTERISK-21096/main/sorcery.c Fri Mar 22 09:24:11 2013
@@ -888,16 +888,25 @@
 	}
 }
 
+/*! \brief Structure used when calling create, update, or delete */
+struct sorcery_details {
+	/*! \brief Pointer to the sorcery instance */
+	const struct ast_sorcery *sorcery;
+	/*! \brief Pointer to the object itself */
+	void *obj;
+};
+
 /*! \brief Internal function used to create an object in caching wizards */
 static int sorcery_cache_create(void *obj, void *arg, int flags)
 {
-	struct ast_sorcery_object_wizard *object_wizard = obj;
+	const struct ast_sorcery_object_wizard *object_wizard = obj;
+	const struct sorcery_details *details = arg;
 
 	if (!object_wizard->caching || !object_wizard->wizard->create) {
 		return 0;
 	}
 
-	object_wizard->wizard->create(object_wizard->data, arg);
+	object_wizard->wizard->create(details->sorcery, object_wizard->data, details->obj);
 
 	return 0;
 }
@@ -1014,8 +1023,9 @@
 static int sorcery_wizard_create(void *obj, void *arg, int flags)
 {
 	const struct ast_sorcery_object_wizard *object_wizard = obj;
-
-	return (!object_wizard->caching && !object_wizard->wizard->create(object_wizard->data, arg)) ? CMP_MATCH | CMP_STOP : 0;
+	const struct sorcery_details *details = arg;
+
+	return (!object_wizard->caching && !object_wizard->wizard->create(details->sorcery, object_wizard->data, details->obj)) ? CMP_MATCH | CMP_STOP : 0;
 }
 
 int ast_sorcery_create(const struct ast_sorcery *sorcery, void *object)
@@ -1023,12 +1033,16 @@
 	const struct ast_sorcery_object_details *details = object;
 	RAII_VAR(struct ast_sorcery_object_type *, object_type, ao2_find(sorcery->types, details->type, OBJ_KEY), ao2_cleanup);
 	RAII_VAR(struct ast_sorcery_object_wizard *, object_wizard, NULL, ao2_cleanup);
+	struct sorcery_details sdetails = {
+		.sorcery = sorcery,
+		.obj = object,
+	};
 
 	if (!object_type) {
 		return -1;
 	}
 
-	object_wizard = ao2_callback(object_type->wizards, 0, sorcery_wizard_create, object);
+	object_wizard = ao2_callback(object_type->wizards, 0, sorcery_wizard_create, &sdetails);
 
 	return object_wizard ? 0 : -1;
 }
@@ -1037,8 +1051,9 @@
 static int sorcery_wizard_update(void *obj, void *arg, int flags)
 {
 	const struct ast_sorcery_object_wizard *object_wizard = obj;
-
-	return (object_wizard->wizard->update && !object_wizard->wizard->update(object_wizard->data, arg) &&
+	const struct sorcery_details *details = arg;
+
+	return (object_wizard->wizard->update && !object_wizard->wizard->update(details->sorcery, object_wizard->data, details->obj) &&
 		!object_wizard->caching) ? CMP_MATCH | CMP_STOP : 0;
 }
 
@@ -1047,12 +1062,16 @@
 	const struct ast_sorcery_object_details *details = object;
 	RAII_VAR(struct ast_sorcery_object_type *, object_type, ao2_find(sorcery->types, details->type, OBJ_KEY), ao2_cleanup);
 	RAII_VAR(struct ast_sorcery_object_wizard *, object_wizard, NULL, ao2_cleanup);
+	struct sorcery_details sdetails = {
+		.sorcery = sorcery,
+		.obj = object,
+	};
 
 	if (!object_type) {
 		return -1;
 	}
 
-	object_wizard = ao2_callback(object_type->wizards, 0, sorcery_wizard_update, object);
+	object_wizard = ao2_callback(object_type->wizards, 0, sorcery_wizard_update, &sdetails);
 
 	return object_wizard ? 0 : -1;
 }
@@ -1061,8 +1080,9 @@
 static int sorcery_wizard_delete(void *obj, void *arg, int flags)
 {
 	const struct ast_sorcery_object_wizard *object_wizard = obj;
-
-	return (object_wizard->wizard->delete && !object_wizard->wizard->delete(object_wizard->data, arg) &&
+	const struct sorcery_details *details = arg;
+
+	return (object_wizard->wizard->delete && !object_wizard->wizard->delete(details->sorcery, object_wizard->data, details->obj) &&
 		!object_wizard->caching) ? CMP_MATCH | CMP_STOP : 0;
 }
 
@@ -1071,12 +1091,16 @@
 	const struct ast_sorcery_object_details *details = object;
 	RAII_VAR(struct ast_sorcery_object_type *, object_type, ao2_find(sorcery->types, details->type, OBJ_KEY), ao2_cleanup);
 	RAII_VAR(struct ast_sorcery_object_wizard *, object_wizard, NULL, ao2_cleanup);
+	struct sorcery_details sdetails = {
+		.sorcery = sorcery,
+		.obj = object,
+	};
 
 	if (!object_type) {
 		return -1;
 	}
 
-	object_wizard = ao2_callback(object_type->wizards, 0, sorcery_wizard_delete, object);
+	object_wizard = ao2_callback(object_type->wizards, 0, sorcery_wizard_delete, &sdetails);
 
 	return object_wizard ? 0 : -1;
 }

Modified: team/dlee/ASTERISK-21096/main/stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-21096/main/stasis.c?view=diff&rev=383597&r1=383596&r2=383597
==============================================================================
--- team/dlee/ASTERISK-21096/main/stasis.c (original)
+++ team/dlee/ASTERISK-21096/main/stasis.c Fri Mar 22 09:24:11 2013
@@ -131,7 +131,7 @@
 
 static void send_subscription_change_message(struct stasis_topic *topic, char *uniqueid, char *description);
 
-static struct stasis_subscription *__stasis_subscribe(struct stasis_topic *topic, stasis_subscription_cb callback, void *data, int needs_mailbox)
+struct stasis_subscription *stasis_subscribe(struct stasis_topic *topic, stasis_subscription_cb callback, void *data)
 {
 	RAII_VAR(struct stasis_subscription *, sub, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_uuid *, id, NULL, ast_free);
@@ -148,11 +148,10 @@
 		return NULL;
 	}
 	ast_uuid_to_str(id, uniqueid, sizeof(uniqueid));
-	if (needs_mailbox) {
-		sub->mailbox = ast_threadpool_serializer(uniqueid, pool);
-		if (!sub->mailbox) {
-			return NULL;
-		}
+
+	sub->mailbox = ast_threadpool_serializer(uniqueid, pool);
+	if (!sub->mailbox) {
+		return NULL;
 	}
 
 	sub->uniqueid = ast_strdup(uniqueid);
@@ -168,11 +167,6 @@
 
 	ao2_ref(sub, +1);
 	return sub;
-}
-
-struct stasis_subscription *stasis_subscribe(struct stasis_topic *topic, stasis_subscription_cb callback, void *data)
-{
-	return __stasis_subscribe(topic, callback, data, 1);
 }
 
 struct stasis_subscription *stasis_unsubscribe(struct stasis_subscription *sub)
@@ -338,58 +332,29 @@
 
 void stasis_forward_message(struct stasis_topic *topic, struct stasis_topic *publisher_topic, struct stasis_message *message)
 {
-	struct stasis_subscription **subscribers = NULL;
-	size_t num_subscribers, i;
+	size_t i;
+	SCOPED_AO2LOCK(lock, topic);
 
 	ast_assert(topic != NULL);
 	ast_assert(publisher_topic != NULL);
 	ast_assert(message != NULL);
 
-	/* Copy the subscribers, so we don't have to hold the mutex for long */
-	{
-		SCOPED_AO2LOCK(lock, topic);
-		num_subscribers = topic->num_subscribers_current;
-		subscribers = ast_malloc(num_subscribers * sizeof(*subscribers));
-		if (subscribers) {
-			for (i = 0; i < num_subscribers; ++i) {
-				ao2_ref(topic->subscribers[i], +1);
-				subscribers[i] = topic->subscribers[i];
-			}
+	for (i = 0; i < topic->num_subscribers_current; ++i) {
+		struct stasis_subscription *sub = topic->subscribers[i];
+		RAII_VAR(struct dispatch *, dispatch, NULL, ao2_cleanup);
+
+		ast_assert(sub != NULL);
+
+		dispatch = dispatch_create(publisher_topic, message, sub);
+		if (!dispatch) {
+			ast_log(LOG_DEBUG, "Dropping dispatch\n");
+			break;
 		}
-	}
-
-	if (!subscribers) {
-		ast_log(LOG_ERROR, "Dropping message\n");
-		return;
-	}
-
-	for (i = 0; i < num_subscribers; ++i) {
-		struct stasis_subscription *sub = subscribers[i];
-
-		ast_assert(sub != NULL);
-
-		if (sub->mailbox) {
-			RAII_VAR(struct dispatch *, dispatch, NULL, ao2_cleanup);
-
-			dispatch = dispatch_create(publisher_topic, message, sub);
-			if (!dispatch) {
-				ast_log(LOG_DEBUG, "Dropping dispatch\n");
-				break;
-			}
-
-			if (ast_taskprocessor_push(sub->mailbox, dispatch_exec, dispatch) == 0) {
-				dispatch = NULL; /* Ownership transferred to mailbox */
-			}
-		} else {
-			/* No mailbox; dispatch directly */
-			sub->callback(sub->data, sub, sub->topic, message);
+
+		if (ast_taskprocessor_push(sub->mailbox, dispatch_exec, dispatch) == 0) {
+			dispatch = NULL; /* Ownership transferred to mailbox */
 		}
 	}
-
-	for (i = 0; i < num_subscribers; ++i) {
-		ao2_cleanup(subscribers[i]);
-	}
-	ast_free(subscribers);
 }
 
 void stasis_publish(struct stasis_topic *topic, struct stasis_message *message)
@@ -414,8 +379,8 @@
 	if (!from_topic || !to_topic) {
 		return NULL;
 	}
-	/* Subscribe without a mailbox, since we're just forwarding messages */
-	sub = __stasis_subscribe(from_topic, stasis_forward_cb, to_topic, 0);
+
+	sub = stasis_subscribe(from_topic, stasis_forward_cb, to_topic);
 	if (sub) {
 		/* hold a ref to to_topic for this forwarding subscription */
 		ao2_ref(to_topic, +1);

Modified: team/dlee/ASTERISK-21096/main/stasis_message_router.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-21096/main/stasis_message_router.c?view=diff&rev=383597&r1=383596&r2=383597
==============================================================================
--- team/dlee/ASTERISK-21096/main/stasis_message_router.c (original)
+++ team/dlee/ASTERISK-21096/main/stasis_message_router.c Fri Mar 22 09:24:11 2013
@@ -91,6 +91,7 @@
 			    struct stasis_message *message)
 {
 	struct stasis_message_router *router = data;
+	RAII_VAR(struct stasis_message_router *, router_needs_cleanup, NULL, ao2_cleanup);
 	RAII_VAR(struct stasis_message_route *, route, NULL, ao2_cleanup);
 	struct stasis_message_type *type = stasis_message_type(message);
 	size_t i;
@@ -123,7 +124,7 @@
 	}
 
 	if (stasis_subscription_final_message(sub, message)) {
-		ao2_cleanup(router);
+		router_needs_cleanup = router;
 		return;
 	}
 

Modified: team/dlee/ASTERISK-21096/res/res_sorcery_memory.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-21096/res/res_sorcery_memory.c?view=diff&rev=383597&r1=383596&r2=383597
==============================================================================
--- team/dlee/ASTERISK-21096/res/res_sorcery_memory.c (original)
+++ team/dlee/ASTERISK-21096/res/res_sorcery_memory.c Fri Mar 22 09:24:11 2013
@@ -42,14 +42,14 @@
 #define OBJECT_BUCKETS 53
 
 static void *sorcery_memory_open(const char *data);
-static int sorcery_memory_create(void *data, void *object);
+static int sorcery_memory_create(const struct ast_sorcery *sorcery, void *data, void *object);
 static void *sorcery_memory_retrieve_id(const struct ast_sorcery *sorcery, void *data, const char *type, const char *id);
 static void *sorcery_memory_retrieve_fields(const struct ast_sorcery *sorcery, void *data, const char *type, const struct ast_variable *fields);
 static void sorcery_memory_retrieve_multiple(const struct ast_sorcery *sorcery, void *data, const char *type, struct ao2_container *objects,
 					     const struct ast_variable *fields);
 static void sorcery_memory_retrieve_regex(const struct ast_sorcery *sorcery, void *data, const char *type, struct ao2_container *objects, const char *regex);
-static int sorcery_memory_update(void *data, void *object);
-static int sorcery_memory_delete(void *data, void *object);
+static int sorcery_memory_update(const struct ast_sorcery *sorcery, void *data, void *object);
+static int sorcery_memory_delete(const struct ast_sorcery *sorcery, void *data, void *object);
 static void sorcery_memory_close(void *data);
 
 static struct ast_sorcery_wizard memory_object_wizard = {
@@ -96,7 +96,7 @@
 	return !strcmp(ast_sorcery_object_get_id(obj), flags & OBJ_KEY ? id : ast_sorcery_object_get_id(arg)) ? CMP_MATCH | CMP_STOP : 0;
 }
 
-static int sorcery_memory_create(void *data, void *object)
+static int sorcery_memory_create(const struct ast_sorcery *sorcery, void *data, void *object)
 {
 	ao2_link(data, object);
 	return 0;
@@ -184,7 +184,7 @@
 	regfree(&expression);
 }
 
-static int sorcery_memory_update(void *data, void *object)
+static int sorcery_memory_update(const struct ast_sorcery *sorcery, void *data, void *object)
 {
 	RAII_VAR(void *, existing, NULL, ao2_cleanup);
 
@@ -202,7 +202,7 @@
 	return 0;
 }
 
-static int sorcery_memory_delete(void *data, void *object)
+static int sorcery_memory_delete(const struct ast_sorcery *sorcery, void *data, void *object)
 {
 	RAII_VAR(void *, existing, ao2_find(data, ast_sorcery_object_get_id(object), OBJ_KEY | OBJ_UNLINK), ao2_cleanup);
 

Modified: team/dlee/ASTERISK-21096/tests/test_sorcery.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/ASTERISK-21096/tests/test_sorcery.c?view=diff&rev=383597&r1=383596&r2=383597
==============================================================================
--- team/dlee/ASTERISK-21096/tests/test_sorcery.c (original)
+++ team/dlee/ASTERISK-21096/tests/test_sorcery.c Fri Mar 22 09:24:11 2013
@@ -138,7 +138,7 @@
 /*! \brief Global scope caching structure for testing */
 static struct sorcery_test_caching cache = { 0, };
 
-static int sorcery_test_create(void *data, void *object)
+static int sorcery_test_create(const struct ast_sorcery *sorcery, void *data, void *object)
 {
 	cache.created = 1;
 	cache.updated = 0;
@@ -151,13 +151,13 @@
 	return (cache.created && !cache.deleted) ? ast_sorcery_alloc(sorcery, type, id) : NULL;
 }
 
-static int sorcery_test_update(void *data, void *object)
+static int sorcery_test_update(const struct ast_sorcery *sorcery, void *data, void *object)
 {
 	cache.updated = 1;
 	return 0;
 }
 
-static int sorcery_test_delete(void *data, void *object)
+static int sorcery_test_delete(const struct ast_sorcery *sorcery, void *data, void *object)
 {
 	cache.deleted = 1;
 	return 0;




More information about the asterisk-commits mailing list