[asterisk-commits] kmoore: branch 11 r381282 - in /branches/11/channels: ./ sip/ sip/include/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Feb 12 14:16:48 CST 2013


Author: kmoore
Date: Tue Feb 12 14:16:45 2013
New Revision: 381282

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=381282
Log:
Fix some more REF_DEBUG-related build errors

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.

Modified:
    branches/11/channels/chan_sip.c
    branches/11/channels/sip/include/sip.h
    branches/11/channels/sip/security_events.c

Modified: branches/11/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/chan_sip.c?view=diff&rev=381282&r1=381281&r2=381282
==============================================================================
--- branches/11/channels/chan_sip.c (original)
+++ branches/11/channels/chan_sip.c Tue Feb 12 14:16:45 2013
@@ -229,6 +229,8 @@
    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 @@
 }
 
 #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 @@
 	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);

Modified: branches/11/channels/sip/include/sip.h
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/sip/include/sip.h?view=diff&rev=381282&r1=381281&r2=381282
==============================================================================
--- branches/11/channels/sip/include/sip.h (original)
+++ branches/11/channels/sip/include/sip.h Tue Feb 12 14:16:45 2013
@@ -1917,7 +1917,15 @@
 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);
+
+#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);
-struct sip_peer *sip_ref_peer(struct sip_peer *peer, char *tag);
+#endif /* REF_DEBUG */
 
 #endif

Modified: branches/11/channels/sip/security_events.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/sip/security_events.c?view=diff&rev=381282&r1=381281&r2=381282
==============================================================================
--- branches/11/channels/sip/security_events.c (original)
+++ branches/11/channels/sip/security_events.c Tue Feb 12 14:16:45 2013
@@ -31,6 +31,8 @@
 #include "asterisk.h"
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
+/* #define  REF_DEBUG 1 */
 
 #include "include/sip.h"
 #include "include/security_events.h"




More information about the asterisk-commits mailing list