]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - http_send.c
http_send.c: Kill unused variable "i".
[paraslash.git] / http_send.c
index 40f0c0af2ee5995e7901c9aeffdb38feeb2f14fe..ce2fd09c45ac71215dda23370b73faaf75fb8dc6 100644 (file)
@@ -98,16 +98,14 @@ static void http_send(long unsigned current_chunk,
 
 static void http_post_select(fd_set *rfds, __a_unused fd_set *wfds)
 {
-       int ret, i = -1, match;
+       int ret, match;
        struct sender_client *sc, *tmp;
        struct private_http_sender_data *phsd;
 
        if (listen_fd < 0)
                return;
        list_for_each_entry_safe(sc, tmp, &clients, node) {
-               i++;
                phsd = sc->private_data;
-//             PARA_DEBUG_LOG("handling client %d: %s\n", i, remote_name(sc->fd));
                switch (phsd->status) {
                case HTTP_STREAMING: /* nothing to do */
                        break;
@@ -136,8 +134,10 @@ static void http_post_select(fd_set *rfds, __a_unused fd_set *wfds)
        if (!FD_ISSET(listen_fd, rfds))
                return;
        ret = para_accept(listen_fd, NULL, 0);
-       if (ret < 0)
-               goto err_out;
+       if (ret < 0) {
+               PARA_ERROR_LOG("%s\n", para_strerror(-ret));
+               return;
+       }
        sc = para_calloc(sizeof(*sc));
        sc->fd = ret;
        sc->name = make_message("%s", remote_name(sc->fd));
@@ -168,8 +168,7 @@ static void http_post_select(fd_set *rfds, __a_unused fd_set *wfds)
        return;
 err_out:
        PARA_WARNING_LOG("%s\n", para_strerror(-ret));
-       if (sc->fd > 0)
-               close(sc->fd);
+       close(sc->fd);
        free(sc);
 }