r24712: No longer expose the 'BOOL' data type in any interfaces.
[kai/samba-autobuild/.git] / source4 / web_server / web_server.h
1 /* 
2    Unix SMB/CIFS implementation.
3    
4    Copyright (C) Andrew Tridgell              2005
5    
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10    
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15    
16    You should have received a copy of the GNU General Public License
17    along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include "smbd/process_model.h"
21
22 /*
23   context of one open web connection
24 */
25 struct websrv_context {
26         struct task_server *task;
27         struct stream_connection *conn;
28         struct {
29                 bool tls_detect;
30                 bool tls_first_char;
31                 uint8_t first_byte;
32                 DATA_BLOB partial;
33                 bool end_of_headers;
34                 char *url;
35                 unsigned content_length;
36                 bool post_request;
37                 const char *content_type;
38                 const char *query_string;
39                 const char *user_agent;
40                 const char *referer;
41                 const char *host;
42                 const char *accept_encoding;
43                 const char *accept_language;
44                 const char *accept_charset;
45                 const char *cookie;
46                 const char *session_key;
47         } input;
48         struct {
49                 bool output_pending;
50                 DATA_BLOB content;
51                 int fd;
52                 unsigned nsent;
53                 int response_code;
54                 const char **headers;
55         } output;
56         struct session_data *session;
57 };
58
59
60 /*
61   context for long term storage in the web server, to support session[]
62   and application[] data. Stored in task->private.
63 */
64 struct esp_data {
65         struct session_data {
66                 struct session_data *next, *prev;
67                 struct esp_data *edata;
68                 const char *id;
69                 struct MprVar *data;
70                 struct timed_event *te;
71                 int lifetime;
72         } *sessions;
73         struct MprVar *application_data;
74         struct tls_params *tls_params;
75 };
76
77 #include "web_server/proto.h"
78