X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=http_send.c;h=6ededb275ac225d8a38d6ccbead967d53877fad4;hp=8ebbbc9c8a676d52f7b78348af10333ed6ec9dea;hb=5587494468627e20fe622b6055689717262d09ab;hpb=9d9ef4f91346188baaef1656b861151ea23437d9 diff --git a/http_send.c b/http_send.c index 8ebbbc9c..6ededb27 100644 --- a/http_send.c +++ b/http_send.c @@ -1,13 +1,15 @@ /* - * Copyright (C) 2005-2008 Andre Noll + * Copyright (C) 2005-2009 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ /** \file http_send.c paraslash's http sender */ +#include #include #include +#include #include "para.h" #include "error.h" @@ -41,7 +43,9 @@ enum http_client_status { HTTP_INVALID_GET_REQUEST }; +/** For each connected client, a structure of this type is maintained. */ struct private_http_sender_data { + /** The current state of this client. */ enum http_client_status status; }; @@ -131,7 +135,7 @@ static void http_post_select(fd_set *rfds, __a_unused fd_set *wfds) phsd->status = HTTP_CONNECTED; } -static void http_pre_select(int *max_fileno, fd_set *rfds, __a_unused fd_set *wfds) +static void http_pre_select(int *max_fileno, fd_set *rfds, fd_set *wfds) { struct sender_client *sc, *tmp; @@ -142,6 +146,9 @@ static void http_pre_select(int *max_fileno, fd_set *rfds, __a_unused fd_set *wf struct private_http_sender_data *phsd = sc->private_data; if (phsd->status == HTTP_CONNECTED) /* need to recv get request */ para_fd_set(sc->fd, rfds, max_fileno); + if (phsd->status == HTTP_GOT_GET_REQUEST || + phsd->status == HTTP_INVALID_GET_REQUEST) + para_fd_set(sc->fd, wfds, max_fileno); } }