2001-09-10 02:21:46 +00:00
|
|
|
#ifndef __SOURCE_H__
|
|
|
|
#define __SOURCE_H__
|
|
|
|
|
2003-02-02 14:33:17 +00:00
|
|
|
#include "config.h"
|
|
|
|
#include "yp.h"
|
2002-12-30 07:55:56 +00:00
|
|
|
#include "format.h"
|
|
|
|
|
2001-09-10 02:21:46 +00:00
|
|
|
typedef struct source_tag
|
|
|
|
{
|
2002-08-16 14:26:48 +00:00
|
|
|
client_t *client;
|
2001-09-10 02:21:46 +00:00
|
|
|
connection_t *con;
|
|
|
|
http_parser_t *parser;
|
|
|
|
|
|
|
|
char *mount;
|
2002-12-30 15:19:46 +00:00
|
|
|
|
|
|
|
/* If this source drops, try to move all clients to this fallback */
|
|
|
|
char *fallback_mount;
|
|
|
|
|
2002-12-30 07:55:56 +00:00
|
|
|
struct _format_plugin_tag *format;
|
2001-09-10 02:21:46 +00:00
|
|
|
|
|
|
|
avl_tree *client_tree;
|
|
|
|
avl_tree *pending_tree;
|
|
|
|
|
|
|
|
rwlock_t *shutdown_rwlock;
|
2003-02-02 14:33:17 +00:00
|
|
|
ypdata_t *ypdata[MAX_YP_DIRECTORIES];
|
|
|
|
int num_yp_directories;
|
|
|
|
long listeners;
|
2001-09-10 02:21:46 +00:00
|
|
|
} source_t;
|
|
|
|
|
2002-08-16 14:26:48 +00:00
|
|
|
source_t *source_create(client_t *client, connection_t *con, http_parser_t *parser, const char *mount, format_type_t type);
|
2001-09-10 02:21:46 +00:00
|
|
|
source_t *source_find_mount(const char *mount);
|
|
|
|
int source_compare_sources(void *arg, void *a, void *b);
|
|
|
|
int source_free_source(void *key);
|
|
|
|
void *source_main(void *arg);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|