void *http_server;
-static LIST_HEAD(, http_path) http_paths;
+static http_path_list_t http_paths;
static struct strtab HTTP_cmdtab[] = {
{ "GET", HTTP_CMD_GET },
while (1) {
- LIST_FOREACH(hp, &http_paths, hp_link) {
+ LIST_FOREACH(hp, hc->hc_paths, hp_link) {
if(!strncmp(path, hp->hp_path, hp->hp_len)) {
if(path[hp->hp_len] == 0 ||
path[hp->hp_len] == '/' ||
memset(&hc, 0, sizeof(http_connection_t));
*opaque = &hc;
- hc.hc_fd = fd;
- hc.hc_peer = peer;
- hc.hc_self = self;
+ hc.hc_fd = fd;
+ hc.hc_peer = peer;
+ hc.hc_self = self;
+ hc.hc_paths = &http_paths;
http_serve_requests(&hc);
#include "access.h"
struct channel;
+struct http_path;
+
+typedef LIST_HEAD(, http_path) http_path_list_t;
typedef TAILQ_HEAD(http_arg_list, http_arg) http_arg_list_t;
struct sockaddr_storage *hc_self;
char *hc_representative;
+ http_path_list_t *hc_paths;
+
char *hc_url;
char *hc_url_orig;
int hc_keep_alive;