Module: sip-router
Branch: master
Commit: b198224d607e88808ce60a1f316215cfc7d75f36
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b198224…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Mon Mar 7 13:55:10 2011 +0100
core: several error messages printed to corelog level
- instead of static level L_ERR use now the global config option corelog
- corelog value can be updated at runtime without restart via RPC
commands
---
parser/msg_parser.c | 2 +-
receive.c | 3 ++-
tcp_read.c | 6 ++++--
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/parser/msg_parser.c b/parser/msg_parser.c
index f65cf85..01bb40e 100644
--- a/parser/msg_parser.c
+++ b/parser/msg_parser.c
@@ -710,7 +710,7 @@ int parse_msg(char* buf, unsigned int len, struct sip_msg* msg)
error:
/* more debugging, msg->orig is/should be null terminated*/
- LOG(L_ERR, "ERROR: parse_msg: message=<%.*s>\n",
+ LOG(cfg_get(core, core_cfg, corelog), "ERROR: parse_msg:
message=<%.*s>\n",
(int)msg->len, ZSW(msg->buf));
return -1;
}
diff --git a/receive.c b/receive.c
index 7f49fdc..183d03b 100644
--- a/receive.c
+++ b/receive.c
@@ -139,7 +139,8 @@ int receive_msg(char* buf, unsigned int len, struct receive_info*
rcv_info)
msg->set_global_port=default_global_port;
if (parse_msg(buf,len, msg)!=0){
- LOG(L_ERR, "ERROR: receive_msg: parse_msg failed\n");
+ LOG(cfg_get(core, core_cfg, corelog),
+ "ERROR: receive_msg: parse_msg failed\n");
goto error02;
}
DBG("After parse_msg...\n");
diff --git a/tcp_read.c b/tcp_read.c
index 1fe5a91..be67f9a 100644
--- a/tcp_read.c
+++ b/tcp_read.c
@@ -266,7 +266,8 @@ again:
break;
}
}
- LOG(L_ERR, "error reading: %s (%d)\n", strerror(errno), errno);
+ LOG(cfg_get(core, core_cfg, corelog),
+ "error reading: %s (%d)\n", strerror(errno), errno);
return -1;
}
}else if (unlikely((bytes_read==0) ||
@@ -879,7 +880,8 @@ again:
req->start);
#endif
if (unlikely(bytes==-1)){
- LOG(L_ERR, "ERROR: tcp_read_req: error reading \n");
+ LOG(cfg_get(core, core_cfg, corelog),
+ "ERROR: tcp_read_req: error reading \n");
resp=CONN_ERROR;
goto end_req;
}