2001-09-09 22:21:46 -04:00
|
|
|
/* client.h
|
|
|
|
**
|
|
|
|
** client data structions and function definitions
|
|
|
|
**
|
|
|
|
*/
|
|
|
|
#ifndef __CLIENT_H__
|
|
|
|
#define __CLIENT_H__
|
|
|
|
|
2002-12-30 02:55:56 -05:00
|
|
|
#include "connection.h"
|
|
|
|
|
2001-09-09 22:21:46 -04:00
|
|
|
typedef struct _client_tag
|
|
|
|
{
|
2003-03-14 21:10:19 -05:00
|
|
|
/* the clients connection */
|
|
|
|
connection_t *con;
|
|
|
|
/* the clients http headers */
|
|
|
|
http_parser_t *parser;
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2003-03-14 21:10:19 -05:00
|
|
|
/* http response code for this client */
|
|
|
|
int respcode;
|
2001-09-09 22:21:46 -04:00
|
|
|
|
2003-03-14 21:10:19 -05:00
|
|
|
/* buffer queue */
|
|
|
|
refbuf_queue_t *queue;
|
|
|
|
/* position in first buffer */
|
|
|
|
unsigned long pos;
|
2002-12-29 03:10:10 -05:00
|
|
|
|
|
|
|
/* Format-handler-specific data for this client */
|
|
|
|
void *format_data;
|
2001-09-09 22:21:46 -04:00
|
|
|
} client_t;
|
|
|
|
|
|
|
|
client_t *client_create(connection_t *con, http_parser_t *parser);
|
|
|
|
void client_destroy(client_t *client);
|
2003-03-02 05:13:59 -05:00
|
|
|
void client_send_504(client_t *client, char *message);
|
2002-08-12 10:48:31 -04:00
|
|
|
void client_send_404(client_t *client, char *message);
|
2002-08-16 10:26:48 -04:00
|
|
|
void client_send_401(client_t *client);
|
2002-12-31 01:28:39 -05:00
|
|
|
void client_send_400(client_t *client, char *message);
|
2001-09-09 22:21:46 -04:00
|
|
|
|
|
|
|
#endif /* __CLIENT_H__ */
|