/** \file http_send.c paraslash's http sender */
+#include <regex.h>
#include <sys/types.h>
#include <dirent.h>
+#include <osl.h>
#include "para.h"
#include "error.h"
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;
};
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;
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);
}
}