From d2e51e448f98efc84683e91121cbee3dcd9efca1 Mon Sep 17 00:00:00 2001 From: claudio Date: Mon, 26 Jun 2023 10:28:12 +0000 Subject: [PATCH] Improve the conn_err() bufferevent error callback. To better report errors. OK kn@ --- usr.sbin/ldapd/conn.c | 5 +++-- 1 file 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 @@ -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); } -- 2.20.1