Commit b9d14993 authored by rswindell's avatar rswindell
Browse files

Enforce log_level specified in startup structure in server's lprintf/lputs.

parent 5690b61d
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -134,7 +134,7 @@ static int lprintf(int level, const char *fmt, ...)
va_list argptr;
char sbuf[1024];
if(startup==NULL || startup->lputs==NULL)
if(startup==NULL || startup->lputs==NULL || level > startup->log_level)
return(0);
va_start(argptr,fmt);
......
......@@ -128,7 +128,7 @@ static int lprintf(int level, const char *fmt, ...)
va_list argptr;
char sbuf[1024];
if(startup==NULL || startup->lputs==NULL)
if(startup==NULL || startup->lputs==NULL || level > startup->log_level)
return(0);
va_start(argptr,fmt);
......
......@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* Copyright 2008 Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 2009 Rob Swindell - http://www.synchro.net/copyright.html *
* *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
......@@ -151,7 +151,7 @@ static void thread_down()
int lputs(int level, const char* str)
{
if(startup==NULL || startup->lputs==NULL || str==NULL)
if(startup==NULL || startup->lputs==NULL || str==NULL || level > startup->log_level)
return(0);
return(startup->lputs(startup->cbdata,level,str));
......
......@@ -119,7 +119,7 @@ static int lprintf(int level, const char *fmt, ...)
va_list argptr;
char sbuf[1024];
if(startup==NULL || startup->lputs==NULL)
if(startup==NULL || startup->lputs==NULL || level > startup->log_level)
return(0);
#if defined(_WIN32)
......
......@@ -485,7 +485,7 @@ static int lprintf(int level, const char *fmt, ...)
va_list argptr;
char sbuf[1024];
if(startup==NULL || startup->lputs==NULL)
if(startup==NULL || startup->lputs==NULL || level > startup->log_level)
return(0);
va_start(argptr,fmt);
......
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