*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
/** \file udp_send.c Para_server's udp sender. */
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
/** \file udp_send.c Para_server's udp sender. */
- size_t len = vss_get_fec_eof_packet(&buf);
-
- /*
- * 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;
+ size_t len;
+ struct udp_target *ut = sc->private_data;
+
+ if (ut->sent_fec_eof)
+ return;
+ PARA_NOTICE_LOG("sending FEC EOF\n");
+ len = vss_get_fec_eof_packet(&buf);
+ /* Ignore write() errors since we are closing the target anyway. */
+ if (write(sc->fd, buf, len) == len)
+ ut->sent_fec_eof = true;
static void udp_shutdown_targets(void)
{
struct sender_client *sc, *tmp;
static void udp_shutdown_targets(void)
{
struct sender_client *sc, *tmp;
/** Initialize UDP session and set maximum payload size. */
static int udp_init_fec(struct sender_client *sc)
{
/** Initialize UDP session and set maximum payload size. */
static int udp_init_fec(struct sender_client *sc)
{
mps = generic_max_transport_msg_size(sc->fd) - sizeof(struct udphdr);
PARA_INFO_LOG("current MPS = %d bytes\n", mps);
return mps;
mps = generic_max_transport_msg_size(sc->fd) - sizeof(struct udphdr);
PARA_INFO_LOG("current MPS = %d bytes\n", mps);
return mps;
- s->client_cmds[SENDER_ON] = udp_com_on;
- s->client_cmds[SENDER_OFF] = udp_com_off;
- s->client_cmds[SENDER_DENY] = NULL;
- s->client_cmds[SENDER_ALLOW] = NULL;
- s->client_cmds[SENDER_ADD] = udp_com_add;
- s->client_cmds[SENDER_DELETE] = udp_com_delete;
- sender_status = SENDER_OFF;
+ s->client_cmds[SENDER_on] = udp_com_on;
+ s->client_cmds[SENDER_off] = udp_com_off;
+ s->client_cmds[SENDER_deny] = NULL;
+ s->client_cmds[SENDER_allow] = NULL;
+ s->client_cmds[SENDER_add] = udp_com_add;
+ s->client_cmds[SENDER_delete] = udp_com_delete;
+ sender_status = SENDER_off;