aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/internal.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2007-06-12 06:48:11 +0000
committerChristian Grothoff <christian@grothoff.org>2007-06-12 06:48:11 +0000
commit641853be5073b9b2dc5c60fa414271ccbec0c0aa (patch)
tree7da8c1810f45ea5cd07923808ed158662c1aadc6 /src/daemon/internal.h
parentc09343fb06be96edac01bbe48d8a269d898c91fd (diff)
downloadlibmicrohttpd-641853be5073b9b2dc5c60fa414271ccbec0c0aa.tar.gz
libmicrohttpd-641853be5073b9b2dc5c60fa414271ccbec0c0aa.zip
cleaning up the code big time -- incomplete
Diffstat (limited to 'src/daemon/internal.h')
-rw-r--r--src/daemon/internal.h111
1 files changed, 111 insertions, 0 deletions
diff --git a/src/daemon/internal.h b/src/daemon/internal.h
new file mode 100644
index 00000000..e09acf3b
--- /dev/null
+++ b/src/daemon/internal.h
@@ -0,0 +1,111 @@
1/*
2 This file is part of libmicrohttpd
3 (C) 2007 Daniel Pittman
4
5 libmicrohttpd is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your
8 option) any later version.
9
10 libmicrohttpd is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with libmicrohttpd; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21/**
22 * @file internal.h
23 * @brief internal shared structures
24 * @author Daniel Pittman
25 * @author Christian Grothoff
26 * @version 0.1.0
27 */
28
29#ifndef INTERNAL_H
30#define INTERNAL_H
31
32
33#include <stdio.h>
34#include <stdlib.h>
35#include <netdb.h>
36#include <string.h>
37#include <unistd.h>
38#include <stdarg>
39#include <fcntl.h>
40#include <pthread.h>
41#include <netinet/in.h>
42
43#include "microhttpd.h"
44#include "config.h"
45
46
47/**
48 * Header or cookie in HTTP request or response.
49 */
50struct MHD_HTTP_Header {
51 struct MHD_HTTP_Header * next;
52
53 char * header;
54
55 char * value;
56
57 enum MHD_ValueKind kind;
58};
59
60
61struct MHD_Access_Handler {
62 struct MHD_Access_Handler * next;
63
64 char * uri_prefix;
65
66 MHD_AccessHandlerCallback dh;
67
68 void * dh_cls;
69};
70
71
72struct MHD_Daemon {
73
74 struct MHD_Access_Handler * handlers;
75
76 MHD_AccessHandlerCallback default_handler;
77
78 struct MHD_Session * connections;
79
80 void * dh_cls;
81
82 MHD_AcceptPolicyCallback apc;
83
84 void * apc_cls;
85
86 /**
87 * PID of the select thread (if we have internal select)
88 */
89 pthread_t pid;
90
91 /**
92 * Listen socket.
93 */
94 int socket_fd;
95
96 /**
97 * Are we shutting down?
98 */
99 int shutdown;
100
101 /**
102 * Daemon's options.
103 */
104 enum MHD_OPTION options;
105
106 unsigned short port;
107
108};
109
110
111#endif