diff options
Diffstat (limited to 'src/daemon/internal.h')
-rw-r--r-- | src/daemon/internal.h | 67 |
1 files changed, 35 insertions, 32 deletions
diff --git a/src/daemon/internal.h b/src/daemon/internal.h index 8aa08243..8bc33c29 100644 --- a/src/daemon/internal.h +++ b/src/daemon/internal.h | |||
@@ -62,59 +62,60 @@ | |||
62 | * fprintf-like helper function for logging debug | 62 | * fprintf-like helper function for logging debug |
63 | * messages. | 63 | * messages. |
64 | */ | 64 | */ |
65 | void MHD_DLOG(const struct MHD_Daemon * daemon, | 65 | void MHD_DLOG (const struct MHD_Daemon *daemon, const char *format, ...); |
66 | const char * format, | ||
67 | ...); | ||
68 | 66 | ||
69 | 67 | ||
70 | /** | 68 | /** |
71 | * Header or cookie in HTTP request or response. | 69 | * Header or cookie in HTTP request or response. |
72 | */ | 70 | */ |
73 | struct MHD_HTTP_Header { | 71 | struct MHD_HTTP_Header |
74 | struct MHD_HTTP_Header * next; | 72 | { |
73 | struct MHD_HTTP_Header *next; | ||
75 | 74 | ||
76 | char * header; | 75 | char *header; |
77 | 76 | ||
78 | char * value; | 77 | char *value; |
79 | 78 | ||
80 | enum MHD_ValueKind kind; | 79 | enum MHD_ValueKind kind; |
81 | }; | 80 | }; |
82 | 81 | ||
83 | 82 | ||
84 | struct MHD_Access_Handler { | 83 | struct MHD_Access_Handler |
85 | struct MHD_Access_Handler * next; | 84 | { |
85 | struct MHD_Access_Handler *next; | ||
86 | 86 | ||
87 | char * uri_prefix; | 87 | char *uri_prefix; |
88 | 88 | ||
89 | MHD_AccessHandlerCallback dh; | 89 | MHD_AccessHandlerCallback dh; |
90 | 90 | ||
91 | void * dh_cls; | 91 | void *dh_cls; |
92 | }; | 92 | }; |
93 | 93 | ||
94 | 94 | ||
95 | /** | 95 | /** |
96 | * Representation of a response. | 96 | * Representation of a response. |
97 | */ | 97 | */ |
98 | struct MHD_Response { | 98 | struct MHD_Response |
99 | { | ||
99 | 100 | ||
100 | /** | 101 | /** |
101 | * Headers to send for the response. Initially | 102 | * Headers to send for the response. Initially |
102 | * the linked list is created in inverse order; | 103 | * the linked list is created in inverse order; |
103 | * the order should be inverted before sending! | 104 | * the order should be inverted before sending! |
104 | */ | 105 | */ |
105 | struct MHD_HTTP_Header * first_header; | 106 | struct MHD_HTTP_Header *first_header; |
106 | 107 | ||
107 | /** | 108 | /** |
108 | * Buffer pointing to data that we are supposed | 109 | * Buffer pointing to data that we are supposed |
109 | * to send as a response. | 110 | * to send as a response. |
110 | */ | 111 | */ |
111 | char * data; | 112 | char *data; |
112 | 113 | ||
113 | /** | 114 | /** |
114 | * Closure to give to the content reader | 115 | * Closure to give to the content reader |
115 | * free callback. | 116 | * free callback. |
116 | */ | 117 | */ |
117 | void * crc_cls; | 118 | void *crc_cls; |
118 | 119 | ||
119 | /** | 120 | /** |
120 | * How do we get more data? NULL if we are | 121 | * How do we get more data? NULL if we are |
@@ -165,27 +166,28 @@ struct MHD_Response { | |||
165 | 166 | ||
166 | 167 | ||
167 | 168 | ||
168 | struct MHD_Connection { | 169 | struct MHD_Connection |
170 | { | ||
169 | 171 | ||
170 | /** | 172 | /** |
171 | * This is a linked list. | 173 | * This is a linked list. |
172 | */ | 174 | */ |
173 | struct MHD_Connection * next; | 175 | struct MHD_Connection *next; |
174 | 176 | ||
175 | /** | 177 | /** |
176 | * Reference to the MHD_Daemon struct. | 178 | * Reference to the MHD_Daemon struct. |
177 | */ | 179 | */ |
178 | struct MHD_Daemon * daemon; | 180 | struct MHD_Daemon *daemon; |
179 | 181 | ||
180 | /** | 182 | /** |
181 | * Linked list of parsed headers. | 183 | * Linked list of parsed headers. |
182 | */ | 184 | */ |
183 | struct MHD_HTTP_Header * headers_received; | 185 | struct MHD_HTTP_Header *headers_received; |
184 | 186 | ||
185 | /** | 187 | /** |
186 | * Response to transmit (initially NULL). | 188 | * Response to transmit (initially NULL). |
187 | */ | 189 | */ |
188 | struct MHD_Response * response; | 190 | struct MHD_Response *response; |
189 | 191 | ||
190 | /** | 192 | /** |
191 | * The memory pool is created whenever we first read | 193 | * The memory pool is created whenever we first read |
@@ -197,43 +199,43 @@ struct MHD_Connection { | |||
197 | * connections) and the IP address (which persists | 199 | * connections) and the IP address (which persists |
198 | * across individual requests). | 200 | * across individual requests). |
199 | */ | 201 | */ |
200 | struct MemoryPool * pool; | 202 | struct MemoryPool *pool; |
201 | 203 | ||
202 | /** | 204 | /** |
203 | * Request method. Should be GET/POST/etc. Allocated | 205 | * Request method. Should be GET/POST/etc. Allocated |
204 | * in pool. | 206 | * in pool. |
205 | */ | 207 | */ |
206 | char * method; | 208 | char *method; |
207 | 209 | ||
208 | /** | 210 | /** |
209 | * Requested URL (everything after "GET" only). Allocated | 211 | * Requested URL (everything after "GET" only). Allocated |
210 | * in pool. | 212 | * in pool. |
211 | */ | 213 | */ |
212 | char * url; | 214 | char *url; |
213 | 215 | ||
214 | /** | 216 | /** |
215 | * HTTP version string (i.e. http/1.1). Allocated | 217 | * HTTP version string (i.e. http/1.1). Allocated |
216 | * in pool. | 218 | * in pool. |
217 | */ | 219 | */ |
218 | char * version; | 220 | char *version; |
219 | 221 | ||
220 | /** | 222 | /** |
221 | * Buffer for reading requests. Allocated | 223 | * Buffer for reading requests. Allocated |
222 | * in pool. | 224 | * in pool. |
223 | */ | 225 | */ |
224 | char * read_buffer; | 226 | char *read_buffer; |
225 | 227 | ||
226 | /** | 228 | /** |
227 | * Buffer for writing response (headers only). Allocated | 229 | * Buffer for writing response (headers only). Allocated |
228 | * in pool. | 230 | * in pool. |
229 | */ | 231 | */ |
230 | char * write_buffer; | 232 | char *write_buffer; |
231 | 233 | ||
232 | /** | 234 | /** |
233 | * Foreign address (of length addr_len). MALLOCED (not | 235 | * Foreign address (of length addr_len). MALLOCED (not |
234 | * in pool!). | 236 | * in pool!). |
235 | */ | 237 | */ |
236 | struct sockaddr_in * addr; | 238 | struct sockaddr_in *addr; |
237 | 239 | ||
238 | /** | 240 | /** |
239 | * Thread for this connection (if we are using | 241 | * Thread for this connection (if we are using |
@@ -342,20 +344,21 @@ struct MHD_Connection { | |||
342 | 344 | ||
343 | 345 | ||
344 | 346 | ||
345 | struct MHD_Daemon { | 347 | struct MHD_Daemon |
348 | { | ||
346 | 349 | ||
347 | struct MHD_Access_Handler * handlers; | 350 | struct MHD_Access_Handler *handlers; |
348 | 351 | ||
349 | struct MHD_Access_Handler default_handler; | 352 | struct MHD_Access_Handler default_handler; |
350 | 353 | ||
351 | /** | 354 | /** |
352 | * Linked list of our current connections. | 355 | * Linked list of our current connections. |
353 | */ | 356 | */ |
354 | struct MHD_Connection * connections; | 357 | struct MHD_Connection *connections; |
355 | 358 | ||
356 | MHD_AcceptPolicyCallback apc; | 359 | MHD_AcceptPolicyCallback apc; |
357 | 360 | ||
358 | void * apc_cls; | 361 | void *apc_cls; |
359 | 362 | ||
360 | /** | 363 | /** |
361 | * PID of the select thread (if we have internal select) | 364 | * PID of the select thread (if we have internal select) |
@@ -390,7 +393,7 @@ struct MHD_Daemon { | |||
390 | /** | 393 | /** |
391 | * Listen port. | 394 | * Listen port. |
392 | */ | 395 | */ |
393 | unsigned short port; | 396 | unsigned short port; |
394 | 397 | ||
395 | }; | 398 | }; |
396 | 399 | ||