]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
handle WOULD_BLOCK on connect()
authorAlan T. DeKok <aland@freeradius.org>
Tue, 21 May 2024 18:12:29 +0000 (14:12 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 21 May 2024 22:20:57 +0000 (18:20 -0400)
src/bin/radclient-ng.c

index ff8ab2b3de2335a14cfb9cdb9ed559012caa9de9..af227f0c3af3da058efe58819cfe426e34071057 100644 (file)
@@ -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);
        }