osx_write.c: Add doxygen description for struct private_osx_write_data
[paraslash.git] / http_send.c
index f0c9851fbe722889a46f12ff39741a7298b5929f..1d970a5df561a3395effa19abf0960a70af9c3ef 100644 (file)
@@ -208,11 +208,11 @@ static void http_send( long unsigned current_chunk,
                        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");
@@ -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;