continue;
if (hc->status == HTTP_READY_TO_STREAM) {
int hlen;
- char *buf = afs_get_header(&hlen);
- if (buf && hlen > 0 && current_chunk) {
+ char *hbuf = afs_get_header(&hlen);
+ if (hbuf && hlen > 0 && current_chunk) {
/* need to send header */
PARA_INFO_LOG("queueing header: %d\n", hlen);
- if (queue_packet(hc, buf, hlen) < 0)
+ if (queue_packet(hc, hbuf, hlen) < 0)
continue;
} else
PARA_INFO_LOG("%s", "no need to queue header\n");
PARA_INFO_LOG("accepted client #%d: %s (fd %d)\n", numclients,
CLIENT_ADDR(hc), hc->fd);
numclients++;
- list_add(&hc->node, &clients);
+ para_list_add(&hc->node, &clients);
add_close_on_fork_list(hc->fd);
mark_fd_nonblock(hc->fd);
return;
static int open_tcp_port(int port)
{
+ int ret;
+
server_fd = init_tcp_socket(port);
if (server_fd < 0) {
http_shutdown_clients();
self->status = SENDER_OFF;
return server_fd;
}
+ ret = mark_fd_nonblock(server_fd);
+ if (ret < 0) {
+ PARA_EMERG_LOG("%s\n", PARA_STRERROR(-ret));
+ exit(EXIT_FAILURE);
+ }
self->status = SENDER_ON;
add_close_on_fork_list(server_fd);
return 1;
ai->netmask = scd->netmask;
PARA_INFO_LOG("adding %s/%i to access list\n", inet_ntoa(ai->addr),
ai->netmask);
- list_add(&ai->node, &access_perm_list);
+ para_list_add(&ai->node, &access_perm_list);
}
static int http_com_deny(struct sender_command_data *scd)