mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
use isc_log_wouldlog() to avoid unnecessary formatting work
when the debug level does not warrant logging
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: socket.c,v 1.147 2000/07/10 19:40:06 explorer Exp $ */
|
/* $Id: socket.c,v 1.148 2000/07/13 00:25:38 gson Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -245,6 +245,9 @@ socket_log(isc_socket_t *sock, isc_sockaddr_t *address,
|
|||||||
char peerbuf[256];
|
char peerbuf[256];
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
|
if (! isc_log_wouldlog(isc_lctx, level))
|
||||||
|
return;
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
|
vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
|
Reference in New Issue
Block a user