mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 13:38:26 +00:00
netmgr: log TCP connection errors
This commit is contained in:
parent
0260d31d26
commit
c4ad0466d6
@ -177,7 +177,8 @@ LIBISC_EXTERNAL_DATA extern isc_logmodule_t isc_modules[];
|
||||
#define ISC_LOGMODULE_INTERFACE (&isc_modules[2])
|
||||
#define ISC_LOGMODULE_TIMER (&isc_modules[3])
|
||||
#define ISC_LOGMODULE_FILE (&isc_modules[4])
|
||||
#define ISC_LOGMODULE_OTHER (&isc_modules[5])
|
||||
#define ISC_LOGMODULE_NETMGR (&isc_modules[5])
|
||||
#define ISC_LOGMODULE_OTHER (&isc_modules[6])
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
|
@ -192,6 +192,7 @@ LIBISC_EXTERNAL_DATA isc_logmodule_t isc_modules[] = {
|
||||
{ "interface", 0 },
|
||||
{ "timer", 0 },
|
||||
{ "file", 0 },
|
||||
{ "netmgr", 0 },
|
||||
{ "other", 0 },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <isc/atomic.h>
|
||||
#include <isc/buffer.h>
|
||||
#include <isc/condition.h>
|
||||
#include <isc/log.h>
|
||||
#include <isc/magic.h>
|
||||
#include <isc/mem.h>
|
||||
#include <isc/netmgr.h>
|
||||
@ -500,15 +501,19 @@ accept_connection(isc_nmsocket_t *ssock) {
|
||||
static void
|
||||
tcp_connection_cb(uv_stream_t *server, int status) {
|
||||
isc_nmsocket_t *ssock = server->data;
|
||||
isc_result_t result = accept_connection(ssock);
|
||||
isc_result_t result;
|
||||
|
||||
UNUSED(status);
|
||||
|
||||
result = accept_connection(ssock);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
if (result == ISC_R_QUOTA || result == ISC_R_SOFTQUOTA) {
|
||||
ssock->overquota = true;
|
||||
}
|
||||
/* TODO: Log the error. */
|
||||
isc_log_write(isc_lctx, ISC_LOGCATEGORY_GENERAL,
|
||||
ISC_LOGMODULE_NETMGR, ISC_LOG_ERROR,
|
||||
"TCP connection failed: %s",
|
||||
isc_result_totext(result));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user