From: Alan T. DeKok Date: Sun, 8 Dec 2024 14:24:10 +0000 (-0500) Subject: call error handler on connect error X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=332a150d9eeb8dda6c853b50a587bb6e3709828f;p=thirdparty%2Ffreeradius-server.git call error handler on connect error --- diff --git a/src/lib/bio/fd.c b/src/lib/bio/fd.c index d17d3eb20a5..38ebc62f7d8 100644 --- a/src/lib/bio/fd.c +++ b/src/lib/bio/fd.c @@ -1243,6 +1243,12 @@ int fr_bio_fd_connect_full(fr_bio_t *bio, fr_event_list_t *el, fr_bio_callback_t */ if (my->info.type == FR_BIO_FD_UNCONNECTED) { error: +#ifdef ECONNABORTED + my->info.connect_errno = ECONNABORTED; +#else + my->info.connect_errno = ECONNREFUSED; +#endif + if (error_cb) error_cb(bio); fr_bio_shutdown(&my->bio); return fr_bio_error(GENERIC); } @@ -1279,7 +1285,10 @@ int fr_bio_fd_connect_full(fr_bio_t *bio, fr_event_list_t *el, fr_bio_callback_t ssize_t rcode; rcode = fr_bio_fd_try_connect(my); - if (rcode < 0) return rcode; /* it already called shutdown */ + if (rcode < 0) { + if (error_cb) error_cb(bio); + return rcode; /* it already called shutdown */ + } return 1; }