]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
reset timer, and add some assertions
authorAlan T. DeKok <aland@freeradius.org>
Wed, 22 May 2024 17:41:08 +0000 (13:41 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 22 May 2024 18:06:49 +0000 (14:06 -0400)
src/lib/bio/retry.c

index 3bb3b1c3acad775137aee6a4ff93c2e0bba6d5ad..9657a5dd6cb1fda6914d75d67c4b2ef5796d339b 100644 (file)
@@ -548,6 +548,7 @@ static void fr_bio_retry_timer(UNUSED fr_event_list_t *el, fr_time_t now, void *
        fr_assert(my->partial == NULL);
 
        item = my->first;
+       my->first = NULL;
 
        /*
         *      Retry one item.
@@ -562,9 +563,12 @@ static void fr_bio_retry_timer(UNUSED fr_event_list_t *el, fr_time_t now, void *
        }
 
        /*
-        *      Partial write - no timers get set.
+        *      Partial write - no timers get set.  We need to wait until the descriptor is writable.
         */
-       if (rcode == 0) return;
+       if (rcode == 0) {
+               fr_assert(my->partial != NULL);
+               return;
+       }
 
        /*
         *      We successfull wrote this item.  Reset the timer to the next one, which is likely to be a