crypt_common.c: Add missing doxygen documentation.
[paraslash.git] / udp_send.c
index 003757ef8a94b2af8c7218d31fdaca6489ed765b..7a1a89f73e1ab79d91fa2e0978072eaf9e10fc46 100644 (file)
@@ -9,11 +9,11 @@
 
 #include <regex.h>
 #include <sys/time.h>
-#include <dirent.h>
 #include <sys/socket.h>
 #include <netinet/udp.h>
 #include <net/if.h>
 #include <osl.h>
+#include <stdbool.h>
 
 #include "server.cmdline.h"
 #include "para.h"
@@ -56,8 +56,13 @@ static void udp_close_target(struct sender_client *sc)
        const char *buf;
        size_t len = vss_get_fec_eof_packet(&buf);
 
-       /* ignore return value, closing the target anyway. */
-       (void)write(sc->fd, buf, len);
+       /*
+        * Ignore the return value of wirte() since we are closing the target
+        * anyway. The sole purpose of the "do_nothing" statement is to silence
+        * gcc.
+        */
+       if (write(sc->fd, buf, len))
+               do_nothing;
 }
 
 static void udp_delete_target(struct sender_client *sc, const char *msg)
@@ -317,6 +322,7 @@ static int udp_com_add(struct sender_command_data *scd)
        ut->fcp.data_slices_per_group = scd->data_slices_per_group;
        ut->fcp.init_fec              = udp_init_fec;
        ut->fcp.send_fec              = udp_send_fec;
+       ut->fcp.need_periodic_header  = true;
 
        sc->private_data = ut;
        sc->fd = -1;