/*
- * Copyright (C) 1997-2012 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 1997-2014 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
* senders.
*/
+#include <sys/socket.h>
+#include <netinet/in.h>
#include <regex.h>
#include <osl.h>
+#include <sys/types.h>
+#include <arpa/inet.h>
+#include <sys/un.h>
+#include <netdb.h>
#include "para.h"
#include "error.h"
if (payload_size < g->slice_bytes)
memset(fc->extra_header_buf + payload_size, 0,
g->slice_bytes - payload_size);
- fc->src_data[i] = fc->extra_header_buf;
- assert(i == g->num_header_slices - 1);
+ /*
+ * There might be more than one header slice to fill although
+ * only the first one will be used. Set all header slices to
+ * our extra buffer.
+ */
+ while (i < g->num_header_slices)
+ fc->src_data[i++] = fc->extra_header_buf;
+ break; /* we don't want i to be increased. */
}
/*
}
}
-static void vss_post_select(struct sched *s, struct task *t)
+static int vss_post_select(struct sched *s, struct task *t)
{
int ret, i;
struct vss_task *vsst = container_of(t, struct vss_task, task);
-
if (mmd->sender_cmd_data.cmd_num >= 0) {
int num = mmd->sender_cmd_data.cmd_num,
sender_num = mmd->sender_cmd_data.sender_num;
recv_afs_result(vsst, &s->rfds);
else if (FD_ISSET(vsst->afs_socket, &s->wfds)) {
PARA_NOTICE_LOG("requesting new fd from afs\n");
- ret = send_buffer(vsst->afs_socket, "new");
+ ret = write_buffer(vsst->afs_socket, "new");
if (ret < 0)
PARA_CRIT_LOG("%s\n", para_strerror(-ret));
else
(vss_next() && vss_playing()))
tv_add(now, &vsst->announce_tv, &vsst->data_send_barrier);
vss_send(vsst);
+ return 0;
}
/**