Browse code

dns_cache.c: logging: convert LOG to LM_*

Ovidiu Sas authored on 04/10/2014 00:14:38
Showing 1 changed files
... ...
@@ -297,13 +297,13 @@ void fix_dns_flags(str *gname, str *name)
297 297
 #ifdef DNS_SRV_LB
298 298
 		dns_flags|=DNS_SRV_RR_LB;
299 299
 #else
300
-		LOG(L_WARN, "WARNING: fix_dns_flags: SRV loadbalaning is set, but"
300
+		LM_WARN("SRV loadbalaning is set, but"
301 301
 					" support for it is not compiled -- ignoring\n");
302 302
 #endif
303 303
 	}
304 304
 	if (cfg_get(core, core_cfg, dns_try_naptr)) {
305 305
 #ifndef USE_NAPTR
306
-	LOG(L_WARN, "WARNING: fix_dns_flags: NAPTR support is enabled, but"
306
+	LM_WARN("NAPTR support is enabled, but"
307 307
 				" support for it is not compiled -- ignoring\n");
308 308
 #endif
309 309
 		dns_flags|=DNS_TRY_NAPTR;
... ...
@@ -316,8 +316,7 @@ void fix_dns_flags(str *gname, str *name)
316 316
 int use_dns_failover_fixup(void *handle, str *gname, str *name, void **val)
317 317
 {
318 318
 	if ((int)(long)(*val) && !cfg_get(core, handle, use_dns_cache)) {
319
-		LOG(L_ERR, "ERROR: use_dns_failover_fixup(): "
320
-			"DNS cache is turned off, failover cannot be enabled. "
319
+		LM_ERR("DNS cache is turned off, failover cannot be enabled. "
321 320
 			"(set use_dns_cache to 1)\n");
322 321
 		return -1;
323 322
 	}
... ...
@@ -330,14 +329,12 @@ int use_dns_failover_fixup(void *handle, str *gname, str *name, void **val)
330 330
 int use_dns_cache_fixup(void *handle, str *gname, str *name, void **val)
331 331
 {
332 332
 	if ((int)(long)(*val) && !dns_cache_init) {
333
-		LOG(L_ERR, "ERROR: use_dns_cache_fixup(): "
334
-			"DNS cache is turned off by dns_cache_init=0, "
333
+		LM_ERR("DNS cache is turned off by dns_cache_init=0, "
335 334
 			"it cannot be enabled runtime.\n");
336 335
 		return -1;
337 336
 	}
338 337
 	if (((int)(long)(*val)==0) && cfg_get(core, handle, use_dns_failover)) {
339
-		LOG(L_ERR, "ERROR: use_dns_failover_fixup(): "
340
-			"DNS failover depends on use_dns_cache, set use_dns_failover "
338
+		LM_ERR("DNS failover depends on use_dns_cache, set use_dns_failover "
341 339
 			"to 0 before disabling the DNS cache\n");
342 340
 		return -1;
343 341
 	}
... ...
@@ -369,7 +366,7 @@ int init_dns_cache()
369 369
 	ret=0;
370 370
 	/* sanity check */
371 371
 	if (E_DNS_CRITICAL>=sizeof(dns_str_errors)/sizeof(char*)){
372
-		LOG(L_CRIT, "BUG: dns_cache_init: bad dns error table\n");
372
+		LM_CRIT("bad dns error table\n");
373 373
 		ret=E_BUG;
374 374
 		goto error;
375 375
 	}
... ...
@@ -430,7 +427,7 @@ int init_dns_cache()
430 430
 	if (dns_timer_interval){
431 431
 		timer_init(dns_timer_h, dns_timer, 0, 0); /* "slow" timer */
432 432
 		if (timer_add(dns_timer_h, S_TO_TICKS(dns_timer_interval))<0){
433
-			LOG(L_CRIT, "BUG: dns_cache_init: failed to add the timer\n");
433
+			LM_CRIT("failed to add the timer\n");
434 434
 			timer_free(dns_timer_h);
435 435
 			dns_timer_h=0;
436 436
 			goto error;
... ...
@@ -481,7 +478,7 @@ int init_dns_cache_stats(int iproc_num)
481 481
 							((l)!=dns_last_used_lst))
482 482
 
483 483
 #define dbg_lu_lst(txt, l) \
484
-		LOG(L_CRIT, "BUG: %s: crt(%p, %p, %p)," \
484
+		LM_CRIT("%s: crt(%p, %p, %p)," \
485 485
 					" prev(%p, %p, %p), next(%p, %p, %p)\n", txt, \
486 486
 					(l), (l)->next, (l)->prev, \
487 487
 					(l)->prev, (l)->prev->next, (l)->prev->prev, \
... ...
@@ -617,8 +614,8 @@ again:
617 617
 					  return the last cname */
618 618
 			/* this is a cname => retry using its value */
619 619
 			if (cname_chain> MAX_CNAME_CHAIN){
620
-				LOG(L_ERR, "ERROR: _dns_hash_find: cname chain too long "
621
-						"or recursive (\"%.*s\")\n", name->len, name->s);
620
+				LM_ERR("cname chain too long or recursive (\"%.*s\")\n",
621
+						name->len, name->s);
622 622
 				ret=0; /* error*/
623 623
 				*err=-1;
624 624
 				break;
... ...
@@ -814,12 +811,12 @@ inline static int dns_cache_add(struct dns_hash_entry* e)
814 814
 #ifdef USE_DNS_CACHE_STATS
815 815
 		dns_cache_stats[process_no].dc_lru_cnt++;
816 816
 #endif
817
-		LOG(L_WARN, "WARNING: dns_cache_add: cache full, trying to free...\n");
817
+		LM_WARN("cache full, trying to free...\n");
818 818
 		/* free ~ 12% of the cache */
819 819
 		dns_cache_free_mem(*dns_cache_mem_used/16*14,
820 820
 					!cfg_get(core, core_cfg, dns_cache_del_nonexp));
821 821
 		if ((*dns_cache_mem_used+e->total_size)>=cfg_get(core, core_cfg, dns_cache_max_mem)){
822
-			LOG(L_ERR, "ERROR: dns_cache_add: max. cache mem size exceeded\n");
822
+			LM_ERR("max. cache mem size exceeded\n");
823 823
 			return -1;
824 824
 		}
825 825
 	}
... ...
@@ -854,14 +851,14 @@ inline static int dns_cache_add_unsafe(struct dns_hash_entry* e)
854 854
 #ifdef USE_DNS_CACHE_STATS
855 855
 		dns_cache_stats[process_no].dc_lru_cnt++;
856 856
 #endif
857
-		LOG(L_WARN, "WARNING: dns_cache_add: cache full, trying to free...\n");
857
+		LM_WARN("cache full, trying to free...\n");
858 858
 		/* free ~ 12% of the cache */
859 859
 		UNLOCK_DNS_HASH();
860 860
 		dns_cache_free_mem(*dns_cache_mem_used/16*14,
861 861
 					!cfg_get(core, core_cfg, dns_cache_del_nonexp));
862 862
 		LOCK_DNS_HASH();
863 863
 		if ((*dns_cache_mem_used+e->total_size)>=cfg_get(core, core_cfg, dns_cache_max_mem)){
864
-			LOG(L_ERR, "ERROR: dns_cache_add: max. cache mem size exceeded\n");
864
+			LM_ERR("max. cache mem size exceeded\n");
865 865
 			return -1;
866 866
 		}
867 867
 	}
... ...
@@ -899,7 +896,7 @@ inline static struct dns_hash_entry* dns_cache_mk_bad_entry(str* name,
899 899
 	size=sizeof(struct dns_hash_entry)+name->len-1+1;
900 900
 	e=shm_malloc(size);
901 901
 	if (e==0){
902
-		LOG(L_ERR, "ERROR: dns_cache_mk_bad_entry: out of memory\n");
902
+		LM_ERR("out of memory\n");
903 903
 		return 0;
904 904
 	}
905 905
 	memset(e, 0, size); /* init with 0*/
... ...
@@ -940,7 +937,7 @@ inline static struct dns_hash_entry* dns_cache_mk_ip_entry(str* name,
940 940
 			sizeof(struct dns_rr)+ ip->len;
941 941
 	e=shm_malloc(size);
942 942
 	if (e==0){
943
-		LOG(L_ERR, "ERROR: dns_cache_mk_ip_entry: out of memory\n");
943
+		LM_ERR("out of memory\n");
944 944
 		return 0;
945 945
 	}
946 946
 	memset(e, 0, size); /* init with 0*/
... ...
@@ -993,7 +990,7 @@ static struct dns_hash_entry* dns_cache_mk_srv_entry(str* name,
993 993
 
994 994
 	e=shm_malloc(size);
995 995
 	if (e==0){
996
-		LOG(L_ERR, "ERROR: dns_cache_srv_ip_entry: out of memory\n");
996
+		LM_ERR("out of memory\n");
997 997
 		return 0;
998 998
 	}
999 999
 	memset(e, 0, size); /* init with 0*/
... ...
@@ -1232,8 +1229,7 @@ inline static struct dns_hash_entry* dns_cache_mk_rd_entry(str* name, int type,
1232 1232
 			}
1233 1233
 			break;
1234 1234
 		default:
1235
-			LOG(L_CRIT, "BUG: dns_cache_mk_rd_entry: type %d not "
1236
-							"supported\n", type);
1235
+			LM_CRIT("type %d not supported\n", type);
1237 1236
 			/* we don't know what to do with it, so don't
1238 1237
 			 * add it to the tmp_lst */
1239 1238
 			return 0; /* error */
... ...
@@ -1250,7 +1246,7 @@ inline static struct dns_hash_entry* dns_cache_mk_rd_entry(str* name, int type,
1250 1250
 	size+=ROUND_POINTER(sizeof(struct dns_hash_entry)+name->len-1+1);
1251 1251
 	e=shm_malloc(size);
1252 1252
 	if (e==0){
1253
-		LOG(L_ERR, "ERROR: dns_cache_mk_rd_entry: out of memory\n");
1253
+		LM_ERR("out of memory\n");
1254 1254
 		return 0;
1255 1255
 	}
1256 1256
 	memset(e, 0, size); /* init with 0 */
... ...
@@ -1421,8 +1417,7 @@ inline static struct dns_hash_entry* dns_cache_mk_rd_entry(str* name, int type,
1421 1421
 			break;
1422 1422
 		default:
1423 1423
 			/* do nothing */
1424
-			LOG(L_CRIT, "BUG: dns_cache_mk_rd_entry: create: type %d not "
1425
-							"supported\n", type);
1424
+			LM_CRIT("type %d not supported\n", type);
1426 1425
 				;
1427 1426
 	}
1428 1427
 	*tail_rr=0; /* terminate the list */
... ...
@@ -1498,8 +1493,7 @@ inline static struct dns_hash_entry* dns_cache_mk_rd_entry2(struct rdata* rd)
1498 1498
 							rec[r].rd->name_len-1+1);
1499 1499
 			no_records++;
1500 1500
 		}else{
1501
-			LOG(L_ERR, "ERROR: dns_cache_mk_rd_entry2: too many records: %d\n",
1502
-						no_records);
1501
+			LM_ERR("too many records: %d\n", no_records);
1503 1502
 			/* skip */
1504 1503
 			continue;
1505 1504
 		}
... ...
@@ -1550,8 +1544,7 @@ found:
1550 1550
 							PTR_RDATA_SIZE(*(struct ptr_rdata*)l->rdata));
1551 1551
 				break;
1552 1552
 			default:
1553
-				LOG(L_CRIT, "BUG: dns_cache_mk_rd_entry: type %d not "
1554
-							"supported\n", l->type);
1553
+				LM_CRIT("type %d not supported\n", l->type);
1555 1554
 		}
1556 1555
 	}
1557 1556
 
... ...
@@ -1560,7 +1553,7 @@ found:
1560 1560
 	for (r=0; r<no_records; r++){
1561 1561
 		rec[r].e=shm_malloc(rec[r].size);
1562 1562
 		if (rec[r].e==0){
1563
-			LOG(L_ERR, "ERROR: dns_cache_mk_rd_entry: out of memory\n");
1563
+			LM_ERR("out of memory\n");
1564 1564
 			goto error;
1565 1565
 		}
1566 1566
 		memset(rec[r].e, 0, rec[r].size); /* init with 0*/
... ...
@@ -1915,8 +1908,7 @@ inline static struct dns_hash_entry* dns_cache_do_request(str* name, int type)
1915 1915
 		goto end; /* the servers are down, needless to perform the query */
1916 1916
 #endif
1917 1917
 	if (name->len>=MAX_DNS_NAME){
1918
-		LOG(L_ERR, "ERROR: dns_cache_do_request: name too long (%d chars)\n",
1919
-					name->len);
1918
+		LM_ERR("name too long (%d chars)\n", name->len);
1920 1919
 		goto end;
1921 1920
 	}
1922 1921
 	/* null terminate the string, needed by get_record */
... ...
@@ -2133,8 +2125,8 @@ inline static struct dns_hash_entry* dns_get_entry(str* name, int type)
2133 2133
 
2134 2134
 	e=0;
2135 2135
 	if (rec_cnt>MAX_CNAME_CHAIN){
2136
-		LOG(L_WARN, "WARNING: dns_get_entry: CNAME chain too long or"
2137
-				" recursive CNAMEs (\"%.*s\")\n", name->len, name->s);
2136
+		LM_WARN("CNAME chain too long or recursive CNAMEs (\"%.*s\")\n",
2137
+				name->len, name->s);
2138 2138
 		goto error;
2139 2139
 	}
2140 2140
 	rec_cnt++;
... ...
@@ -2414,7 +2406,7 @@ inline static struct hostent* dns_entry2he(struct dns_hash_entry* e)
2414 2414
 			len=16;
2415 2415
 			break;
2416 2416
 		default:
2417
-			LOG(L_CRIT, "BUG: dns_entry2he: wrong entry type %d for %.*s\n",
2417
+			LM_CRIT("wrong entry type %d for %.*s\n",
2418 2418
 					e->type, e->name_len, e->name);
2419 2419
 			return 0;
2420 2420
 	}
... ...
@@ -2676,8 +2668,8 @@ struct hostent* dns_srv_sip_resolvehost(str* name, unsigned short* port,
2676 2676
 		*port=(srv_proto==PROTO_TLS)?SIPS_PORT:SIP_PORT; /* just in case we
2677 2677
 														 don't find another */
2678 2678
 		if ((name->len+SRV_MAX_PREFIX_LEN+1)>MAX_DNS_NAME){
2679
-			LOG(L_WARN, "WARNING: dns_sip_resolvehost: domain name too long"
2680
-						" (%d), unable to perform SRV lookup\n", name->len);
2679
+			LM_WARN("domain name too long (%d), unable to perform SRV lookup\n",
2680
+						name->len);
2681 2681
 		}else{
2682 2682
 			/* check if it's an ip address */
2683 2683
 			if ( ((ip=str2ip(name))!=0)
... ...
@@ -2700,8 +2692,7 @@ struct hostent* dns_srv_sip_resolvehost(str* name, unsigned short* port,
2700 2700
 					create_srv_name(srv_proto, name, tmp);
2701 2701
 					break;
2702 2702
 				default:
2703
-					LOG(L_CRIT, "BUG: sip_resolvehost: unknown proto %d\n",
2704
-							(int)srv_proto);
2703
+					LM_CRIT("unknown proto %d\n", (int)srv_proto);
2705 2704
 					return 0;
2706 2705
 			}
2707 2706
 
... ...
@@ -2713,7 +2704,7 @@ struct hostent* dns_srv_sip_resolvehost(str* name, unsigned short* port,
2713 2713
 	}
2714 2714
 /*skip_srv:*/
2715 2715
 	if (name->len >= MAX_DNS_NAME) {
2716
-		LOG(L_ERR, "dns_sip_resolvehost: domain name too long\n");
2716
+		LM_ERR("domain name too long\n");
2717 2717
 		return 0;
2718 2718
 	}
2719 2719
 	he=dns_get_he(name, dns_flags);
... ...
@@ -2758,7 +2749,7 @@ struct naptr_rdata* dns_naptr_sip_iterate(struct dns_rr* naptr_head,
2758 2758
 	for(l=naptr_head; l && (i<MAX_NAPTR_RRS); l=l->next){
2759 2759
 		naptr=(struct naptr_rdata*) l->rdata;
2760 2760
 		if (naptr==0){
2761
-				LOG(L_CRIT, "naptr_iterate: BUG: null rdata\n");
2761
+			LM_CRIT("null rdata\n");
2762 2762
 			goto end;
2763 2763
 		}
2764 2764
 		/* check if valid and get proto */
... ...
@@ -2820,8 +2811,7 @@ struct hostent* dns_naptr_sip_resolvehost(str* name, unsigned short* port,
2820 2820
 	origproto=*proto;
2821 2821
 	he=0;
2822 2822
 	if (dns_hash==0){ /* not init => use normal, non-cached version */
2823
-		LOG(L_WARN, "WARNING: dns_sip_resolvehost: called before dns cache"
2824
-					" initialization\n");
2823
+		LM_WARN("called before dns cache initialization\n");
2825 2824
 		return _sip_resolvehost(name, port, proto);
2826 2825
 	}
2827 2826
 	if (proto && port && (*proto==0) && (*port==0)){
... ...
@@ -3085,8 +3075,7 @@ inline static int dns_ip_resolve(	struct dns_hash_entry** e,
3085 3085
 			dns_hash_put(orig);
3086 3086
 		}
3087 3087
 	}else{
3088
-		LOG(L_CRIT, "BUG: dns_ip_resolve: invalid record type %d\n",
3089
-					(*e)->type);
3088
+		LM_CRIT("invalid record type %d\n", (*e)->type);
3090 3089
 	}
3091 3090
 	return ret;
3092 3091
 }
... ...
@@ -3232,8 +3221,7 @@ inline static int dns_srv_sip_resolve(struct dns_srv_handle* h,  str* name,
3232 3232
 
3233 3233
 	origproto = *proto;
3234 3234
 	if (dns_hash==0){ /* not init => use normal, non-cached version */
3235
-		LOG(L_WARN, "WARNING: dns_srv_sip_resolve: called before dns cache"
3236
-					" initialization\n");
3235
+		LM_WARN("called before dns cache initialization\n");
3237 3236
 		h->srv=h->a=0;
3238 3237
 		he=_sip_resolvehost(name, port, proto);
3239 3238
 		if (he){
... ...
@@ -3254,8 +3242,7 @@ inline static int dns_srv_sip_resolve(struct dns_srv_handle* h,  str* name,
3254 3254
 				/* try SRV if initial call & no port specified
3255 3255
 				 * (draft-ietf-sip-srv-06) */
3256 3256
 				if ((name->len+SRV_MAX_PREFIX_LEN+1)>MAX_DNS_NAME){
3257
-					LOG(L_WARN, "WARNING: dns_srv_sip_resolve: domain name too"
3258
-								" long (%d), unable to perform SRV lookup\n",
3257
+					LM_WARN("domain name too long (%d), unable to perform SRV lookup\n",
3259 3258
 								name->len);
3260 3259
 				}else{
3261 3260
 					/* check if it's an ip address */
... ...
@@ -3284,8 +3271,7 @@ inline static int dns_srv_sip_resolve(struct dns_srv_handle* h,  str* name,
3284 3284
 								create_srv_name(srv_proto_list[i].proto, name, tmp);
3285 3285
 								break;
3286 3286
 							default:
3287
-								LOG(L_CRIT, "BUG: dns_srv_sip_resolve: "
3288
-										"unknown proto %d\n", (int)srv_proto_list[i].proto);
3287
+								LM_CRIT("unknown proto %d\n", (int)srv_proto_list[i].proto);
3289 3288
 								return -E_DNS_CRITICAL;
3290 3289
 						}
3291 3290
 						srv_name.s=tmp;
... ...
@@ -3318,7 +3304,7 @@ inline static int dns_srv_sip_resolve(struct dns_srv_handle* h,  str* name,
3318 3318
 			return ret;
3319 3319
 	}
3320 3320
 	if (name->len >= MAX_DNS_NAME) {
3321
-		LOG(L_ERR, "dns_srv_sip_resolve: domain name too long\n");
3321
+		LM_ERR("domain name too long\n");
3322 3322
 		return -E_DNS_NAME_TOO_LONG;
3323 3323
 	}
3324 3324
 	ret=dns_ip_resolve(&h->a, &h->ip_no, name, ip, flags);
... ...
@@ -3364,8 +3350,7 @@ inline static int dns_naptr_sip_resolve(struct dns_srv_handle* h,  str* name,
3364 3364
 	ret=-E_DNS_NO_NAPTR;
3365 3365
 	origproto=*proto;
3366 3366
 	if (dns_hash==0){ /* not init => use normal, non-cached version */
3367
-		LOG(L_WARN, "WARNING: dns_sip_resolve: called before dns cache"
3368
-					" initialization\n");
3367
+		LM_WARN("called before dns cache initialization\n");
3369 3368
 		h->srv=h->a=0;
3370 3369
 		he=_sip_resolvehost(name, port, proto);
3371 3370
 		if (he){
... ...
@@ -4027,8 +4012,7 @@ static struct dns_hash_entry *dns_cache_clone_entry(struct dns_hash_entry *e,
4027 4027
 				rr_size = sizeof(struct dns_rr);
4028 4028
 				break;
4029 4029
 			default:
4030
-				LOG(L_ERR, "ERROR: dns_cache_clone_entry: type %d not "
4031
-							"supported\n", e->type);
4030
+				LM_ERR("type %d not supported\n", e->type);
4032 4031
 				return NULL;
4033 4032
 		}
4034 4033
 	} else {
... ...
@@ -4039,7 +4023,7 @@ static struct dns_hash_entry *dns_cache_clone_entry(struct dns_hash_entry *e,
4039 4039
 
4040 4040
 	new=shm_malloc(rounded_size+rr_size+rdata_size);
4041 4041
 	if (!new) {
4042
-		LOG(L_ERR, "ERROR: dns_cache_clone_entry: out of memory\n");
4042
+		LM_ERR("out of memory\n");
4043 4043
 		return NULL;
4044 4044
 	}
4045 4045
 	memset(new, 0, rounded_size+rr_size+rdata_size);
... ...
@@ -4167,13 +4151,12 @@ int dns_cache_add_record(unsigned short type,
4167 4167
 	rr_name.len = 0;
4168 4168
 
4169 4169
 	if (!cfg_get(core, core_cfg, use_dns_cache)){
4170
-		LOG(L_ERR, "ERROR: dns cache support disabled (see use_dns_cache)\n");
4170
+		LM_ERR("dns cache support disabled (see use_dns_cache)\n");
4171 4171
 		return -1;
4172 4172
 	}
4173 4173
 	
4174 4174
 	if ((type != T_A) && (type != T_AAAA) && (type != T_SRV)) {
4175
-		LOG(L_ERR, "ERROR: rr type %d is not implemented\n",
4176
-			type);
4175
+		LM_ERR("rr type %d is not implemented\n", type);
4177 4176
 		return -1;
4178 4177
 	}
4179 4178
 
... ...
@@ -4183,7 +4166,7 @@ int dns_cache_add_record(unsigned short type,
4183 4183
 		case T_A:
4184 4184
 			ip_addr = str2ip(value);
4185 4185
 			if (!ip_addr) {
4186
-				LOG(L_ERR, "ERROR: Malformed ip address: %.*s\n",
4186
+				LM_ERR("Malformed ip address: %.*s\n",
4187 4187
 					value->len, value->s);
4188 4188
 				return -1;
4189 4189
 			}
... ...
@@ -4191,7 +4174,7 @@ int dns_cache_add_record(unsigned short type,
4191 4191
 		case T_AAAA:
4192 4192
 			ip_addr = str2ip6(value);
4193 4193
 			if (!ip_addr) {
4194
-				LOG(L_ERR, "ERROR: Malformed ip address: %.*s\n",
4194
+				LM_ERR("Malformed ip address: %.*s\n",
4195 4195
 					value->len, value->s);
4196 4196
 				return -1;
4197 4197
 			}
... ...
@@ -4215,7 +4198,7 @@ int dns_cache_add_record(unsigned short type,
4215 4215
 		&& (old->ent_flags & DNS_FLAG_PERMANENT)
4216 4216
 		&& ((flags & DNS_FLAG_PERMANENT) == 0)
4217 4217
 	) {
4218
-		LOG(L_ERR, "ERROR: A non-permanent record cannot overwrite "
4218
+		LM_ERR("A non-permanent record cannot overwrite "
4219 4219
 				"a permanent entry\n");
4220 4220
 		goto error;
4221 4221
 	}
... ...
@@ -4224,7 +4207,7 @@ int dns_cache_add_record(unsigned short type,
4224 4224
 		/* negative entry */
4225 4225
 		new = dns_cache_mk_bad_entry(name, type, ttl, flags);
4226 4226
 		if (!new) {
4227
-			LOG(L_ERR, "ERROR: Failed to create a negative "
4227
+			LM_ERR("Failed to create a negative "
4228 4228
 					"DNS cache entry\n");
4229 4229
 			goto error;
4230 4230
 		}
... ...
@@ -4244,7 +4227,7 @@ int dns_cache_add_record(unsigned short type,
4244 4244
 			case T_AAAA:
4245 4245
 				new = dns_cache_mk_ip_entry(name, ip_addr);
4246 4246
 				if (!new) {
4247
-					LOG(L_ERR, "ERROR: Failed to create an A/AAAA record\n");
4247
+					LM_ERR("Failed to create an A/AAAA record\n");
4248 4248
 					goto error;
4249 4249
 				}
4250 4250
 				/* fix the expiration time, dns_cache_mk_ip_entry() sets it 
... ...
@@ -4257,7 +4240,7 @@ int dns_cache_add_record(unsigned short type,
4257 4257
 				new = dns_cache_mk_srv_entry(name, priority, weight, port,
4258 4258
 												&rr_name, ttl);
4259 4259
 				if (!new) {
4260
-					LOG(L_ERR, "ERROR: Failed to create an SRV record\n");
4260
+					LM_ERR("Failed to create an SRV record\n");
4261 4261
 					goto error;
4262 4262
 				}
4263 4263
 			}
... ...
@@ -4284,7 +4267,7 @@ int dns_cache_add_record(unsigned short type,
4284 4284
 				/* the rr was found in the list */
4285 4285
 				new = dns_cache_clone_entry(old, 0, 0, 0);
4286 4286
 				if (!new) {
4287
-					LOG(L_ERR, "ERROR: Failed to clone an existing "
4287
+					LM_ERR("Failed to clone an existing "
4288 4288
 							"DNS cache entry\n");
4289 4289
 					goto error;
4290 4290
 				}
... ...
@@ -4322,7 +4305,7 @@ int dns_cache_add_record(unsigned short type,
4322 4322
 				}
4323 4323
 				new = dns_cache_clone_entry(old, size, ttl, &rr);
4324 4324
 				if (!new) {
4325
-					LOG(L_ERR, "ERROR: Failed to clone an existing "
4325
+					LM_ERR("Failed to clone an existing "
4326 4326
 							"DNS cache entry\n");
4327 4327
 					goto error;
4328 4328
 				}
... ...
@@ -4372,7 +4355,7 @@ int dns_cache_add_record(unsigned short type,
4372 4372
 						rr_p = &((*rr_p)->next)
4373 4373
 					);
4374 4374
 				if (!rr_p) {
4375
-					LOG(L_ERR, "ERROR: Failed to correct the orderd list of SRV resource records\n");
4375
+					LM_ERR("Failed to correct the orderd list of SRV resource records\n");
4376 4376
 					goto error;
4377 4377
 				}
4378 4378
 
... ...
@@ -4389,7 +4372,7 @@ int dns_cache_add_record(unsigned short type,
4389 4389
 
4390 4390
 	LOCK_DNS_HASH();
4391 4391
 	if (dns_cache_add_unsafe(new)) {
4392
-		LOG(L_ERR, "ERROR: Failed to add the entry to the cache\n");
4392
+		LM_ERR("Failed to add the entry to the cache\n");
4393 4393
 		UNLOCK_DNS_HASH();
4394 4394
 		goto error;
4395 4395
 	} else {
... ...
@@ -4470,13 +4453,12 @@ int dns_cache_delete_single_record(unsigned short type,
4470 4470
 	ip_addr = 0;
4471 4471
 
4472 4472
 	if (!cfg_get(core, core_cfg, use_dns_cache)){
4473
-		LOG(L_ERR, "ERROR: dns cache support disabled (see use_dns_cache)\n");
4473
+		LM_ERR("dns cache support disabled (see use_dns_cache)\n");
4474 4474
 		return -1;
4475 4475
 	}
4476 4476
 	
4477 4477
 	if ((type != T_A) && (type != T_AAAA) && (type != T_SRV)) {
4478
-		LOG(L_ERR, "ERROR: rr type %d is not implemented\n",
4479
-			type);
4478
+		LM_ERR("rr type %d is not implemented\n", type);
4480 4479
 		return -1;
4481 4480
 	}
4482 4481
 
... ...
@@ -4486,7 +4468,7 @@ int dns_cache_delete_single_record(unsigned short type,
4486 4486
 		case T_A:
4487 4487
 			ip_addr = str2ip(value);
4488 4488
 			if (!ip_addr) {
4489
-				LOG(L_ERR, "ERROR: Malformed ip address: %.*s\n",
4489
+				LM_ERR("Malformed ip address: %.*s\n",
4490 4490
 					value->len, value->s);
4491 4491
 				return -1;
4492 4492
 			}
... ...
@@ -4494,7 +4476,7 @@ int dns_cache_delete_single_record(unsigned short type,
4494 4494
 		case T_AAAA:
4495 4495
 			ip_addr = str2ip6(value);
4496 4496
 			if (!ip_addr) {
4497
-				LOG(L_ERR, "ERROR: Malformed ip address: %.*s\n",
4497
+				LM_ERR("Malformed ip address: %.*s\n",
4498 4498
 					value->len, value->s);
4499 4499
 				return -1;
4500 4500
 			}
... ...
@@ -4546,8 +4528,7 @@ int dns_cache_delete_single_record(unsigned short type,
4546 4546
 		* automatically destroyed when its refcnt will be 0*/
4547 4547
 		new = dns_cache_clone_entry(old, 0, 0, 0);
4548 4548
 		if (!new) {
4549
-			LOG(L_ERR, "ERROR: Failed to clone an existing "
4550
-				"DNS cache entry\n");
4549
+			LM_ERR("Failed to clone an existing DNS cache entry\n");
4551 4550
 			dns_hash_put(old);
4552 4551
 			return -1;
4553 4552
 		}
... ...
@@ -4568,7 +4549,7 @@ delete:
4568 4568
 	if (new) {
4569 4569
 		/* delete the old entry only if the new one can be added */
4570 4570
 		if (dns_cache_add_unsafe(new)) {
4571
-			LOG(L_ERR, "ERROR: Failed to add the entry to the cache\n");
4571
+			LM_ERR("Failed to add the entry to the cache\n");
4572 4572
 			UNLOCK_DNS_HASH();
4573 4573
 			if (old)
4574 4574
 				dns_hash_put(old);
... ...
@@ -4588,7 +4569,7 @@ delete:
4588 4588
 	return 0;
4589 4589
 
4590 4590
 not_found:
4591
-	LOG(L_ERR, "ERROR: No matching record found\n");
4591
+	LM_ERR("No matching record found\n");
4592 4592
 	if (old)
4593 4593
 		dns_hash_put(old);
4594 4594
 	return -1;