From: Alan T. DeKok Date: Fri, 1 Jun 2018 17:37:43 +0000 (-0400) Subject: write() must write ALL of the data X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3354554891cf6a5f41b0239d8dce5609adb91c46;p=thirdparty%2Ffreeradius-server.git write() must write ALL of the data it's the responsibility of the underlying IO routine to cache any partial writes --- diff --git a/src/lib/io/network.c b/src/lib/io/network.c index f53599590c6..83569a55572 100644 --- a/src/lib/io/network.c +++ b/src/lib/io/network.c @@ -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); /*