Browse code

resolve.c: logging: DBG -> LM_DBG

Ovidiu Sas authored on 13/01/2015 15:47:29
Showing 1 changed files
... ...
@@ -738,7 +738,7 @@ struct rdata* get_record(char* name, int type, int flags)
738 738
 	size=dns_func.sr_res_search(name, C_IN, type, buff.buff, sizeof(buff));
739 739
 
740 740
 	if (unlikely(size<0)) {
741
-		DBG("get_record: lookup(%s, %d) failed\n", name, type);
741
+		LM_DBG("lookup(%s, %d) failed\n", name, type);
742 742
 		goto not_found;
743 743
 	}
744 744
 	else if (unlikely(size > sizeof(buff))) size=sizeof(buff);
... ...
@@ -934,8 +934,7 @@ again:
934 934
 		flags&=~RES_AR;
935 935
 		answers_no=ntohs((unsigned short)buff.hdr.nscount);
936 936
 #ifdef RESOLVE_DBG
937
-		DBG("get_record: skipping %d NS (p=%p, end=%p)\n", answers_no, p,
938
-				end);
937
+		LM_DBG("skipping %d NS (p=%p, end=%p)\n", answers_no, p, end);
939 938
 #endif
940 939
 		for (r=0; (r<answers_no) && (p<end); r++){
941 940
 			/* skip over the ns records */
... ...
@@ -950,8 +949,7 @@ again:
950 950
 		}
951 951
 		answers_no=ntohs((unsigned short)buff.hdr.arcount);
952 952
 #ifdef RESOLVE_DBG
953
-		DBG("get_record: parsing %d ARs (p=%p, end=%p)\n", answers_no, p,
954
-				end);
953
+		LM_DBG("parsing %d ARs (p=%p, end=%p)\n", answers_no, p, end);
955 954
 #endif
956 955
 		goto again; /* add also the additional records */
957 956
 	}
... ...
@@ -1138,7 +1136,7 @@ int naptr_choose (struct naptr_rdata** crt, char* crt_proto,
1138 1138
 									struct naptr_rdata* n , char n_proto)
1139 1139
 {
1140 1140
 #ifdef NAPTR_DBG
1141
-	DBG("naptr_choose(o: %d w: %d p:%d , o: %d w:%d p:%d)\n",
1141
+	LM_DBG("o:%d w:%d p:%d, o:%d w:%d p:%d\n",
1142 1142
 			*crt?(int)(*crt)->order:-1, *crt?(int)(*crt)->pref:-1,
1143 1143
 			(int)*crt_proto,
1144 1144
 			(int)n->order, (int)n->pref, (int)n_proto);
... ...
@@ -1152,12 +1150,12 @@ int naptr_choose (struct naptr_rdata** crt, char* crt_proto,
1152 1152
 			goto change;
1153 1153
 	}
1154 1154
 #ifdef NAPTR_DBG
1155
-	DBG("naptr_choose: no change\n");
1155
+	LM_DBG("no change\n");
1156 1156
 #endif
1157 1157
 	return 0;
1158 1158
 change:
1159 1159
 #ifdef NAPTR_DBG
1160
-	DBG("naptr_choose: changed\n");
1160
+	LM_DBG("changed\n");
1161 1161
 #endif
1162 1162
 	*crt_proto=n_proto;
1163 1163
 	*crt=n;
... ...
@@ -1206,7 +1204,7 @@ struct hostent* srv_sip_resolvehost(str* name, int zt, unsigned short* port,
1206 1206
 		goto end;
1207 1207
 	}
1208 1208
 #ifdef RESOLVE_DBG
1209
-	DBG("srv_sip_resolvehost: %.*s:%d proto=%d\n", name->len, name->s,
1209
+	LM_DBG("%.*s:%d proto=%d\n", name->len, name->s,
1210 1210
 			port?(int)*port:-1, proto?(int)*proto:-1);
1211 1211
 #endif
1212 1212
 	if (is_srv){
... ...
@@ -1275,7 +1273,7 @@ do_srv:
1275 1275
 				if (he!=0){
1276 1276
 					/* we found it*/
1277 1277
 #ifdef RESOLVE_DBG
1278
-					DBG("srv_sip_resolvehost: found SRV(%s) = %s:%d in AR\n",
1278
+					LM_DBG("found SRV(%s) = %s:%d in AR\n",
1279 1279
 							srv_target, srv->name, srv->port);
1280 1280
 #endif
1281 1281
 					*port=srv->port;
... ...
@@ -1296,7 +1294,7 @@ do_srv:
1296 1296
 				if (he!=0){
1297 1297
 					/* we found it*/
1298 1298
 #ifdef RESOLVE_DBG
1299
-					DBG("srv_sip_resolvehost: SRV(%s) = %s:%d\n",
1299
+					LM_DBG("SRV(%s) = %s:%d\n",
1300 1300
 							srv_target, srv->name, srv->port);
1301 1301
 #endif
1302 1302
 					*port=srv->port;
... ...
@@ -1312,7 +1310,7 @@ do_srv:
1312 1312
 			}
1313 1313
 			/* cleanup on exit */
1314 1314
 #ifdef RESOLVE_DBG
1315
-			DBG("srv_sip_resolvehost: no SRV record found for %.*s," 
1315
+			LM_DBG("no SRV record found for %.*s," 
1316 1316
 					" trying 'normal' lookup...\n", name->len, name->s);
1317 1317
 #endif
1318 1318
 		}
... ...
@@ -1326,7 +1324,7 @@ do_srv:
1326 1326
 	}
1327 1327
 end:
1328 1328
 #ifdef RESOLVE_DBG
1329
-	DBG("srv_sip_resolvehost: returning %p (%.*s:%d proto=%d)\n",
1329
+	LM_DBG("returning %p (%.*s:%d proto=%d)\n",
1330 1330
 			he, name->len, name->s,
1331 1331
 			port?(int)*port:-1, proto?(int)*proto:-1);
1332 1332
 #endif
... ...
@@ -1388,9 +1386,8 @@ struct rdata* naptr_sip_iterate(struct rdata* naptr_head,
1388 1388
 			continue; /* already tried */
1389 1389
 		}
1390 1390
 #ifdef NAPTR_DBG
1391
-		DBG("naptr_iterate: found a valid sip NAPTR rr %.*s,"
1392
-					" proto %d\n", naptr->repl_len, naptr->repl, 
1393
-					(int)naptr_proto);
1391
+		LM_DBG("found a valid sip NAPTR rr %.*s, proto %d\n",
1392
+					naptr->repl_len, naptr->repl, (int)naptr_proto);
1394 1393
 #endif
1395 1394
 		if ((naptr_proto_supported(naptr_proto))){
1396 1395
 			if (naptr_choose(&naptr_saved, &saved_proto,
... ...
@@ -1403,8 +1400,8 @@ struct rdata* naptr_sip_iterate(struct rdata* naptr_head,
1403 1403
 	if (naptr_saved){
1404 1404
 		/* found something */
1405 1405
 #ifdef NAPTR_DBG
1406
-		DBG("naptr_iterate: choosed NAPTR rr %.*s, proto %d"
1407
-					" tried: 0x%x\n", naptr_saved->repl_len, 
1406
+		LM_DBG("choosed NAPTR rr %.*s, proto %d tried: 0x%x\n",
1407
+					naptr_saved->repl_len, 
1408 1408
 					naptr_saved->repl, (int)saved_proto, *tried);
1409 1409
 #endif
1410 1410
 		*tried|=1<<idx;
... ...
@@ -1631,8 +1628,8 @@ struct hostent* naptr_sip_resolvehost(str* name,  unsigned short* port,
1631 1631
 		}
1632 1632
 		/*clean up on exit*/
1633 1633
 #ifdef RESOLVE_DBG
1634
-		DBG("naptr_sip_resolvehost: no NAPTR record found for %.*s," 
1635
-				" trying SRV lookup...\n", name->len, name->s);
1634
+		LM_DBG("no NAPTR record found for %.*s, trying SRV lookup...\n",
1635
+					name->len, name->s);
1636 1636
 #endif
1637 1637
 	}
1638 1638
 	/* fallback to srv lookup */