/* Pure Load Balancer - (C)opyleft 2003 Jedi/Sector One <j@pureftpd.org> */
#include <config.h>
#include "plb.h"
#include "plb_globals.h"
#ifdef WITH_DMALLOC
# include <dmalloc.h>
#endif
void client_read(const int evfd, short event, void * const client_)
{
Client * const client = client_;
(void) evfd;
if (handle_timeout(event, client) != 0) {
return;
}
switch(client->state) {
case STATE_HEADER:
client_read_header(client);
break;
case STATE_SEND_HEADER: /* user probably clicked "STOP" */
client_disconnect(client);
break;
case STATE_IGNORE:
break;
case STATE_HEADER_SENT:
client_forward_request(client);
break;
default:
plb_log(LL_DEBUG, "*** UNHANDLED STATE ***");
client_disconnect(client);
}
}
syntax highlighted by Code2HTML, v. 0.9.1