#include "dccp.h"
#include "error.h"
#include "string.h"
+#include "fd.h"
+#include "close_on_fork.h"
#include "server.cmdline.h"
extern struct gengetopt_args_info conf;
/** the list of connected clients **/
PARA_NOTICE_LOG("connection from %s\n", inet_ntoa(dc->addr.sin_addr));
dc->fd = ret;
list_add(&dc->node, &clients);
+ add_close_on_fork_list(dc->fd);
+ mark_fd_nonblock(dc->fd);
}
static int dccp_open(void)
if (ret < 0)
return -E_DCCP_LISTEN;
PARA_DEBUG_LOG("listening on fd %d\n", listen_fd);
+ add_close_on_fork_list(listen_fd);
+ mark_fd_nonblock(listen_fd);
return 1;
}
PARA_DEBUG_LOG("shutting down %s (fd %d)\n", inet_ntoa(dc->addr.sin_addr),
dc->fd);
close(dc->fd);
+ del_close_on_fork_list(dc->fd);
list_del(&dc->node);
free(dc);
}
hc->fd, msg);
numclients--;
close(hc->fd);
-
+ del_close_on_fork_list(hc->fd);
list_for_each_entry_safe(qp, tmp, &hc->packet_queue, node) {
free(qp->packet);
list_del(&qp->node);
CLIENT_ADDR(hc), hc->fd);
numclients++;
list_add(&hc->node, &clients);
+ add_close_on_fork_list(hc->fd);
+ mark_fd_nonblock(hc->fd);
return;
err_out:
PARA_WARNING_LOG("ignoring connect request from %s (%s)\n",