summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2023-06-26 10:28:13 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2023-06-26 10:28:13 +0000
commit6fa9b443073a1e992172554b63dfbfeed096debb (patch)
treed46a18c9e9384328bee7ec56207c6887a9c264b0
parentd196d42b33908899df8daa4e7e12a1fb59ebcbbd (diff)
Improve the conn_err() bufferevent error callback. To better report errors.
OK kn@
-rw-r--r--usr.sbin/ldapd/conn.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/ldapd/conn.c b/usr.sbin/ldapd/conn.c
index f63c684e6c5..821ac336a2c 100644
--- a/usr.sbin/ldapd/conn.c
+++ b/usr.sbin/ldapd/conn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conn.c,v 1.20 2023/04/30 23:49:14 jsg Exp $ */
+/* $OpenBSD: conn.c,v 1.21 2023/06/26 10:28:12 claudio Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martin@bzero.se>
@@ -242,7 +242,8 @@ conn_err(struct bufferevent *bev, short why, void *data)
else if ((why & EVBUFFER_TIMEOUT) == EVBUFFER_TIMEOUT)
log_debug("timeout on connection %d", conn->fd);
else
- log_warnx("error 0x%02X on connection %d", why, conn->fd);
+ log_warn("%s error on connection %d",
+ why & EVBUFFER_WRITE ? "write" : "read", conn->fd);
conn_close(conn);
}