]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
write() must write ALL of the data
authorAlan T. DeKok <aland@freeradius.org>
Fri, 1 Jun 2018 17:37:43 +0000 (13:37 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 1 Jun 2018 17:37:43 +0000 (13:37 -0400)
it's the responsibility of the underlying IO routine to cache
any partial writes

src/lib/io/network.c

index f53599590c6b05288d0c2be9fc43e67cc6317d2e..83569a555727ab61aefe47e4499f195306e85515 100644 (file)
@@ -629,6 +629,18 @@ static void fr_network_write(UNUSED fr_event_list_t *el, UNUSED int sockfd, UNUS
                        return;
                }
 
+               /*
+                *
+                We MUST have written all of the data.  It is
+                *      up to the app_io->write() function to track
+                *      any partially written data.
+                */
+               rad_assert((size_t) rcode == cd->m.data_size);
+               s->pending = NULL;
+
+               /*
+                *      Reset for the next message.
+                */
                fr_message_done(&cd->m);
 
                /*