2001-09-09 22:21:46 -04:00
|
|
|
#ifndef __SOURCE_H__
|
|
|
|
#define __SOURCE_H__
|
|
|
|
|
2003-02-02 09:33:17 -05:00
|
|
|
#include "config.h"
|
|
|
|
#include "yp.h"
|
2002-12-30 02:55:56 -05:00
|
|
|
#include "format.h"
|
|
|
|
|
2001-09-09 22:21:46 -04:00
|
|
|
typedef struct source_tag
|
|
|
|
{
|
2002-08-16 10:26:48 -04:00
|
|
|
client_t *client;
|
2001-09-09 22:21:46 -04:00
|
|
|
connection_t *con;
|
|
|
|
http_parser_t *parser;
|
|
|
|
|
|
|
|
char *mount;
|
2002-12-30 10:19:46 -05:00
|
|
|
|
|
|
|
/* If this source drops, try to move all clients to this fallback */
|
|
|
|
char *fallback_mount;
|
|
|
|
|
2003-02-06 08:10:48 -05:00
|
|
|
/* set to zero to request the source to shutdown without causing a global
|
|
|
|
* shutdown */
|
|
|
|
int running;
|
|
|
|
|
2002-12-30 02:55:56 -05:00
|
|
|
struct _format_plugin_tag *format;
|
2001-09-09 22:21:46 -04:00
|
|
|
|
|
|
|
avl_tree *client_tree;
|
|
|
|
avl_tree *pending_tree;
|
|
|
|
|
|
|
|
rwlock_t *shutdown_rwlock;
|
2003-02-02 09:33:17 -05:00
|
|
|
ypdata_t *ypdata[MAX_YP_DIRECTORIES];
|
|
|
|
int num_yp_directories;
|
2003-02-11 09:23:34 -05:00
|
|
|
long listeners;
|
|
|
|
long max_listeners;
|
2001-09-09 22:21:46 -04:00
|
|
|
} source_t;
|
|
|
|
|
2002-08-16 10:26:48 -04:00
|
|
|
source_t *source_create(client_t *client, connection_t *con, http_parser_t *parser, const char *mount, format_type_t type);
|
2001-09-09 22:21:46 -04: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
|
|
|
|
|
|
|
|
|