]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix some more REF_DEBUG-related build errors
authorKinsey Moore <kmoore@digium.com>
Tue, 12 Feb 2013 20:16:45 +0000 (20:16 +0000)
committerKinsey Moore <kmoore@digium.com>
Tue, 12 Feb 2013 20:16:45 +0000 (20:16 +0000)
When sip_ref_peer and sip_unref_peer were exported to be usable in
channels/sip/security_events.c, modifications to those functions when
building under REF_DEBUG were not taken into account. This change
moves the necessary defines into sip.h to make them accessible to
other parts of chan_sip that need them.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@381282 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c
channels/sip/include/sip.h
channels/sip/security_events.c

index 4a95ef93d58eee37ed6f480c6b416f06312f6595..917850291f25136234d478414f28fa969a2bfba2 100644 (file)
@@ -229,6 +229,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
    balanced, along with the complete history for that object.
    In normal operation, the macros defined will throw away the tags, so they do not
    affect the speed of the program at all. They can be considered to be documentation.
+
+   Note: This must also be enabled in channels/sip/security_events.c
 */
 /* #define  REF_DEBUG 1 */
 
@@ -3240,9 +3242,7 @@ cleanup:
 }
 
 #ifdef REF_DEBUG
-#define sip_ref_peer(arg1,arg2) _ref_peer((arg1),(arg2), __FILE__, __LINE__, __PRETTY_FUNCTION__)
-#define sip_unref_peer(arg1,arg2) _unref_peer((arg1),(arg2), __FILE__, __LINE__, __PRETTY_FUNCTION__)
-static struct sip_peer *_ref_peer(struct sip_peer *peer, char *tag, char *file, int line, const char *func)
+struct sip_peer *_ref_peer(struct sip_peer *peer, char *tag, char *file, int line, const char *func)
 {
        if (peer)
                __ao2_ref_debug(peer, 1, tag, file, line, func);
@@ -3251,7 +3251,7 @@ static struct sip_peer *_ref_peer(struct sip_peer *peer, char *tag, char *file,
        return peer;
 }
 
-static struct sip_peer *_unref_peer(struct sip_peer *peer, char *tag, char *file, int line, const char *func)
+void *_unref_peer(struct sip_peer *peer, char *tag, char *file, int line, const char *func)
 {
        if (peer)
                __ao2_ref_debug(peer, -1, tag, file, line, func);
index 17841096ca22c5ca8dcec36246c4e4a96285b8ac..5f173176ea53811afdbb26f4be0b3f3c53fc0694 100644 (file)
@@ -1917,7 +1917,15 @@ struct sip_peer *sip_find_peer(const char *peer, struct ast_sockaddr *addr, int
 void sip_auth_headers(enum sip_auth_type code, char **header, char **respheader);
 const char *sip_get_header(const struct sip_request *req, const char *name);
 const char *sip_get_transport(enum sip_transport t);
-void *sip_unref_peer(struct sip_peer *peer, char *tag);
+
+#ifdef REF_DEBUG
+#define sip_ref_peer(arg1,arg2) _ref_peer((arg1),(arg2), __FILE__, __LINE__, __PRETTY_FUNCTION__)
+#define sip_unref_peer(arg1,arg2) _unref_peer((arg1),(arg2), __FILE__, __LINE__, __PRETTY_FUNCTION__)
+struct sip_peer *_ref_peer(struct sip_peer *peer, char *tag, char *file, int line, const char *func);
+void *_unref_peer(struct sip_peer *peer, char *tag, char *file, int line, const char *func);
+#else
 struct sip_peer *sip_ref_peer(struct sip_peer *peer, char *tag);
+void *sip_unref_peer(struct sip_peer *peer, char *tag);
+#endif /* REF_DEBUG */
 
 #endif
index cde9f12f3d2fbc9ec44823503082aa6b64353e2a..4045ae14d098f2c5fc2680298d163a5e89af6fdb 100644 (file)
@@ -32,6 +32,8 @@
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
+/* #define  REF_DEBUG 1 */
+
 #include "include/sip.h"
 #include "include/security_events.h"