- return nbytes + loaded < UDP_RECV_CHUNK_SIZE;
-}
-
-static int add_rn_output(struct receiver_node *rn, char *buf, size_t len)
-{
- if (!len)
- return 1;
- if (!enough_space(len, rn->loaded))
- return -E_UDP_OVERRUN;
- memcpy(rn->buf + rn->loaded, buf, len);
- rn->loaded += len;
- return 1;
+ if (sz < FEC_EOF_PACKET_LEN)
+ return 0;
+ if (iov[0].iov_len >= FEC_EOF_PACKET_LEN) {
+ if (memcmp(iov[0].iov_base, FEC_EOF_PACKET,
+ FEC_EOF_PACKET_LEN) != 0)
+ return 0;
+ return -E_RECV_EOF;
+ }
+ if (memcmp(iov[0].iov_base, FEC_EOF_PACKET, iov[0].iov_len) != 0)
+ return 0;
+ if (memcmp(iov[1].iov_base, FEC_EOF_PACKET + iov[0].iov_len,
+ FEC_EOF_PACKET_LEN - iov[0].iov_len) != 0)
+ return 0;
+ return -E_RECV_EOF;