Commit 8ae20c36 authored by rswindell's avatar rswindell
Browse files

Make the strings passed to startup->errormsg() more consistent (a 4-char

left-justified server prefix), e.g. "term" now added for terminal server
errors.
parent 6e2d99bf
......@@ -155,7 +155,7 @@ static int lprintf(int level, const char *fmt, ...)
if(level <= LOG_ERR) {
char errmsg[sizeof(sbuf)+16];
SAFEPRINTF(errmsg, "ftp %s", sbuf);
SAFEPRINTF(errmsg, "ftp %s", sbuf);
errorlog(&scfg, startup==NULL ? NULL:startup->host_name, errmsg);
if(startup!=NULL && startup->errormsg!=NULL)
startup->errormsg(startup->cbdata,level,errmsg);
......
......@@ -215,9 +215,11 @@ static void thread_down()
int lputs(int level, const char* str)
{
if(level <= LOG_ERR) {
errorlog(&scfg,startup==NULL ? NULL:startup->host_name, str);
char errmsg[1024];
SAFEPRINTF(errmsg, "term %s", str);
errorlog(&scfg,startup==NULL ? NULL:startup->host_name, errmsg);
if(startup!=NULL && startup->errormsg!=NULL)
startup->errormsg(startup->cbdata,level,str);
startup->errormsg(startup->cbdata,level,errmsg);
}
if(startup==NULL || startup->lputs==NULL || str==NULL || level > startup->log_level)
......
......@@ -533,7 +533,7 @@ static int lprintf(int level, const char *fmt, ...)
if(level <= LOG_ERR) {
char errmsg[sizeof(sbuf)+16];
SAFEPRINTF(errmsg, "web %s", sbuf);
SAFEPRINTF(errmsg, "web %s", sbuf);
errorlog(&scfg,startup==NULL ? NULL:startup->host_name, errmsg);
if(startup!=NULL && startup->errormsg!=NULL)
startup->errormsg(startup->cbdata,level,errmsg);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment