2 * This file is in the public domain.
6 #define QUERY_MAXLEN 1025 /* including NUL */
22 #define DPRINTF log_debug
24 #define DPRINTF(...) do {} while (0)
30 struct fcgi *clt_fcgi;
31 char *clt_server_name;
32 char *clt_script_name;
39 SPLAY_ENTRY(client) clt_nodes;
41 SPLAY_HEAD(client_tree, client);
46 struct client_tree fcg_clients;
47 struct bufferevent *fcg_bev;
58 SPLAY_ENTRY(fcgi) fcg_nodes;
60 SPLAY_HEAD(fcgi_tree, fcgi);
64 struct event env_sockev;
65 struct event env_pausev;
66 struct fcgi_tree env_fcgi_socks;
68 struct sqlite3 *env_db;
69 struct sqlite3_stmt *env_query;
73 int fcgi_end_request(struct client *, int);
74 int fcgi_abort_request(struct client *);
75 void fcgi_accept(int, short, void *);
76 void fcgi_read(struct bufferevent *, void *);
77 void fcgi_write(struct bufferevent *, void *);
78 void fcgi_error(struct bufferevent *, short, void *);
79 void fcgi_free(struct fcgi *);
80 int clt_putc(struct client *, char);
81 int clt_puts(struct client *, const char *);
82 int clt_putsan(struct client *, const char *);
83 int clt_putmatch(struct client *, const char *);
84 int clt_write_bufferevent(struct client *, struct bufferevent *);
85 int clt_flush(struct client *);
86 int clt_write(struct client *, const uint8_t *, size_t);
87 int clt_printf(struct client *, const char *, ...)
88 __attribute__((__format__(printf, 2, 3)))
89 __attribute__((__nonnull__(2)));
90 int fcgi_cmp(struct fcgi *, struct fcgi *);
91 int fcgi_client_cmp(struct client *, struct client *);
94 extern const char *tmpl_head;
95 extern const char *tmpl_search;
96 extern const char *tmpl_search_header;
97 extern const char *tmpl_foot;
100 int server_main(const char *);
101 int server_handle(struct env *, struct client *);
102 void server_client_free(struct client *);
104 SPLAY_PROTOTYPE(client_tree, client, clt_nodes, fcgi_client_cmp);
105 SPLAY_PROTOTYPE(fcgi_tree, fcgi, fcg_nodes, fcgi_cmp);