Browse code

msg_translator.c: logging: DBG -> LM_DBG

Ovidiu Sas authored on 13/01/2015 17:31:43
Showing 1 changed files
... ...
@@ -155,8 +155,7 @@ static int check_via_address(struct ip_addr* ip, str *name,
155 155
 	/* maybe we are lucky and name it's an ip */
156 156
 	s=ip_addr2a(ip);
157 157
 	if (s){
158
-		DBG("check_via_address(%s, %.*s, %d)\n",
159
-			s, name->len, name->s, resolver);
158
+		LM_DBG("(%s, %.*s, %d)\n", s, name->len, name->s, resolver);
160 159
 
161 160
 		len=strlen(s);
162 161
 
... ...
@@ -181,7 +180,7 @@ static int check_via_address(struct ip_addr* ip, str *name,
181 181
 
182 182
 	if (port==0) port=SIP_PORT;
183 183
 	if (resolver&DO_DNS){
184
-		DBG("check_via_address: doing dns lookup\n");
184
+		LM_DBG("doing dns lookup\n");
185 185
 		/* try all names ips */
186 186
 		lproto = PROTO_NONE;
187 187
 		he=sip_resolvehost(name, &port, &lproto); /* don't use naptr */
... ...
@@ -193,7 +192,7 @@ static int check_via_address(struct ip_addr* ip, str *name,
193 193
 		}
194 194
 	}
195 195
 	if (resolver&DO_REV_DNS){
196
-		DBG("check_via_address: doing rev. dns lookup\n");
196
+		LM_DBG("doing rev. dns lookup\n");
197 197
 		/* try reverse dns */
198 198
 		he=rev_resolvehost(ip);
199 199
 		if (he && (strncmp(he->h_name, name->s, name->len)==0))
... ...
@@ -420,7 +419,7 @@ char* clen_builder(	struct sip_msg* msg, int *clen_len, int diff,
420 420
 	}
421 421
 	value=msg->len-(int)(body-msg->buf)+diff;
422 422
 	value_s=int2str(value, &value_len);
423
-	DBG("clen_builder: content-length: %d (%s)\n", value, value_s);
423
+	LM_DBG("content-length: %d (%s)\n", value, value_s);
424 424
 
425 425
 	if (body_only) {
426 426
 		len=value_len;
... ...
@@ -1350,7 +1349,7 @@ skip_after:
1350 1350
 			case LUMP_DEL:
1351 1351
 				/* copy till offset */
1352 1352
 				if (s_offset>t->u.offset){
1353
-					DBG("Warning: (%d) overlapped lumps offsets,"
1353
+					LM_DBG("WARNING: (%d) overlapped lumps offsets,"
1354 1354
 						" ignoring(%x, %x)\n", t->op, s_offset,t->u.offset);
1355 1355
 					/* this should've been fixed above (when computing len) */
1356 1356
 					/* just ignore it*/
... ...
@@ -1523,8 +1522,7 @@ static inline int adjust_clen(struct sip_msg* msg, int body_delta, int proto)
1523 1523
 				}
1524 1524
 				body_only=0;
1525 1525
 			} /* else
1526
-				DBG("adjust_clen: UDP packet with no clen => "
1527
-						"not adding one \n"); */
1526
+				LM_DBG("UDP packet with no clen => not adding one \n"); */
1528 1527
 		}else{
1529 1528
 			/* Content-Length has been found, remove it */
1530 1529
 			anchor = del_lump(	msg, msg->content_length->body.s - msg->buf,
... ...
@@ -2228,7 +2226,7 @@ char * generate_res_buf_from_sip_res( struct sip_msg* msg,
2228 2228
 	new_len=len+body_delta+lumps_len(msg, msg->add_rm, 0); /*FIXME: we don't
2229 2229
 														know the send sock */
2230 2230
 
2231
-	DBG(" old size: %d, new size: %d\n", len, new_len);
2231
+	LM_DBG("old size: %d, new size: %d\n", len, new_len);
2232 2232
 	new_buf=(char*)pkg_malloc(new_len+1); /* +1 is for debugging
2233 2233
 											 (\0 to print it )*/
2234 2234
 	if (new_buf==0){
... ...
@@ -2245,8 +2243,8 @@ char * generate_res_buf_from_sip_res( struct sip_msg* msg,
2245 2245
 		buf+s_offset,
2246 2246
 		len-s_offset);
2247 2247
 	 /* send it! */
2248
-	DBG("copied size: orig:%d, new: %d, rest: %d"
2249
-			" msg=\n%s\n", s_offset, offset, len-s_offset, new_buf);
2248
+	LM_DBG("copied size: orig:%d, new: %d, rest: %d msg=\n%s\n",
2249
+			s_offset, offset, len-s_offset, new_buf);
2250 2250
 
2251 2251
 	*returned_len=new_len;
2252 2252
 	return new_buf;
... ...
@@ -2842,7 +2840,7 @@ char* create_via_hf( unsigned int *len,
2842 2842
 			return 0; /* we don't need to free anything,
2843 2843
 			                 nothing alloc'ed yet*/
2844 2844
 		}
2845
-		DBG("create_via_hf: id added: <%.*s>, rcv proto=%d\n",
2845
+		LM_DBG("id added: <%.*s>, rcv proto=%d\n",
2846 2846
 				(int)id_len, id_buf, msg->rcv.proto);
2847 2847
 		extra_params.s=id_buf;
2848 2848
 		extra_params.len=id_len;