From: Alan T. DeKok Date: Tue, 21 May 2024 18:12:29 +0000 (-0400) Subject: handle WOULD_BLOCK on connect() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=288de5311440ce194d90b52589f851753104cf86;p=thirdparty%2Ffreeradius-server.git handle WOULD_BLOCK on connect() --- diff --git a/src/bin/radclient-ng.c b/src/bin/radclient-ng.c index ff8ab2b3de..af227f0c3a 100644 --- a/src/bin/radclient-ng.c +++ b/src/bin/radclient-ng.c @@ -1222,9 +1222,16 @@ static void client_write(fr_event_list_t *el, int fd, UNUSED int flags, void *uc static void client_connect(fr_event_list_t *el, int fd, UNUSED int flags, void *uctx) { + int rcode; fr_bio_packet_t *client = uctx; - if (fr_radius_client_bio_connect(client) < 0) { + rcode = fr_radius_client_bio_connect(client); + if (rcode < 0) { + /* + * We may need to try again. If so, do that. + */ + if (rcode == fr_bio_error(IO_WOULD_BLOCK)) return; + ERROR("Failed connecting socket: %s", fr_strerror()); fr_exit_now(1); }