X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=http_send.c;h=f06a5ac258e9a36c88cc9d9dd26acaede6fe2029;hp=111c49baf82aa58e9bb9172ad0a8deb86b9ee571;hb=b0f9ae192371acb53d020fae6d4e9aaf516a1852;hpb=c839ef92e35d5604748aa4674b400156ff7baced diff --git a/http_send.c b/http_send.c index 111c49ba..f06a5ac2 100644 --- a/http_send.c +++ b/http_send.c @@ -323,7 +323,7 @@ static void http_post_select(fd_set *rfds, fd_set *wfds) 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; @@ -371,12 +371,19 @@ static void http_pre_select(int *max_fileno, fd_set *rfds, fd_set *wfds) 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; @@ -425,7 +432,7 @@ static void add_perm_list_entry(struct sender_command_data *scd) 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)