Merge "res_pjsip_transport_websocket: Fix crash on receiving large SIP packets"
authorMatt Jordan <mjordan@digium.com>
Sun, 24 May 2015 18:55:34 +0000 (13:55 -0500)
committerGerrit Code Review <gerrit2@gerrit.digium.api>
Sun, 24 May 2015 18:55:34 +0000 (13:55 -0500)
include/asterisk/astobj2.h
main/astobj2.c

index e02a4cd..4a7aeee 100644 (file)
@@ -612,6 +612,8 @@ void *__ao2_weakproxy_get_object(void *weakproxy, int flags,
  * \retval 0 Success
  * \retval -1 Failure
  *
+ * \note Callbacks are run in the reverse order of subscriptions.
+ *
  * \note This procedure will allow the same cb / data pair to be added to
  *       the same weakproxy multiple times.
  *
index 1db2dd4..ed91577 100644 (file)
@@ -928,7 +928,7 @@ int ao2_weakproxy_subscribe(void *weakproxy, ao2_weakproxy_notification_cb cb, v
                if (sub) {
                        sub->cb = cb;
                        sub->data = data;
-                       AST_LIST_INSERT_TAIL(&weak->destroyed_cb, sub, list);
+                       AST_LIST_INSERT_HEAD(&weak->destroyed_cb, sub, list);
                        ret = 0;
                }
        } else {