[svn-commits] mattf: trunk r26 - /trunk/mtp2.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Aug 22 14:05:36 MST 2006


Author: mattf
Date: Tue Aug 22 16:05:36 2006
New Revision: 26

URL: http://svn.digium.com/view/libss7?rev=26&view=rev
Log:
Only output debug if debug is enabled.

Modified:
    trunk/mtp2.c

Modified: trunk/mtp2.c
URL: http://svn.digium.com/view/libss7/trunk/mtp2.c?rev=26&r1=25&r2=26&view=diff
==============================================================================
--- trunk/mtp2.c (original)
+++ trunk/mtp2.c Tue Aug 22 16:05:36 2006
@@ -25,10 +25,6 @@
 #define mtp_error ss7_error
 #define mtp_message ss7_message
 #define SOCKET_TEST
-
-/* #define DEBUG_MTP2 */
-#define DEBUG_MTP2
-
 
 #if 0
 static inline int len_txbuf(struct mtp2 *link)
@@ -377,7 +373,9 @@
 static void t4_expiry(void * data)
 {
 	struct mtp2 *link = data;
-	ss7_message(link->master, "T4 expired!\n");
+
+	if (link->master->debug & SS7_DEBUG_MTP2)
+		ss7_message(link->master, "T4 expired!\n");
 
 	mtp2_setstate(link, MTP_ALIGNEDREADY);
 
@@ -399,9 +397,9 @@
 {
 	ss7_event *e;
 
-#ifdef DEBUG_MTP2
-	mtp_message(link->master, "Link state change: %s -> %s\n", linkstate2str(link->state), linkstate2str(newstate));
-#endif
+	if (link->master->debug & SS7_DEBUG_MTP2)
+		mtp_message(link->master, "Link state change: %s -> %s\n", linkstate2str(link->state), linkstate2str(newstate));
+
 	switch (link->state) {
 		case MTP_IDLE:
 			link->t2 = ss7_schedule_event(link->master, link->timers.t2, t2_expiry, link);



More information about the svn-commits mailing list