2004-01-28 20:02:12 -05:00
|
|
|
/* Icecast
|
|
|
|
*
|
|
|
|
* This program is distributed under the GNU General Public License, version 2.
|
|
|
|
* A copy of this license is included with this source.
|
|
|
|
*
|
|
|
|
* Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
|
|
|
|
* Michael Smith <msmith@xiph.org>,
|
|
|
|
* oddsock <oddsock@xiph.org>,
|
|
|
|
* Karl Heyes <karl@xiph.org>
|
|
|
|
* and others (see AUTHORS for details).
|
|
|
|
*/
|
|
|
|
|
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"
|
2004-01-14 20:01:09 -05:00
|
|
|
#include "refbuf.h"
|
|
|
|
#include "httpp/httpp.h"
|
2002-12-30 02:55:56 -05:00
|
|
|
|
2001-09-09 22:21:46 -04:00
|
|
|
typedef struct _client_tag
|
|
|
|
{
|
2004-01-14 20:01:09 -05:00
|
|
|
/* the client's connection */
|
2003-03-14 21:10:19 -05:00
|
|
|
connection_t *con;
|
2004-01-14 20:01:09 -05:00
|
|
|
/* the client's http headers */
|
2003-03-14 21:10:19 -05:00
|
|
|
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
|
|
|
|
2004-01-14 20:01:09 -05:00
|
|
|
/* Client username, if authenticated */
|
|
|
|
char *username;
|
|
|
|
|
2002-12-29 03:10:10 -05:00
|
|
|
/* Format-handler-specific data for this client */
|
|
|
|
void *format_data;
|
2004-02-29 09:38:15 -05:00
|
|
|
|
|
|
|
/* function to call to release format specific resources */
|
|
|
|
void (*free_client_data)(struct _client_tag *client);
|
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__ */
|