diff options
Diffstat (limited to 'src/client.h')
-rw-r--r-- | src/client.h | 139 |
1 files changed, 0 insertions, 139 deletions
diff --git a/src/client.h b/src/client.h deleted file mode 100644 index 6217b271..00000000 --- a/src/client.h +++ /dev/null | |||
@@ -1,139 +0,0 @@ | |||
1 | /* Copyrights 2002 Luis Figueiredo (stdio@netc.pt) All rights reserved. | ||
2 | * | ||
3 | * See the LICENSE file | ||
4 | * | ||
5 | * The origin of this software must not be misrepresented, either by | ||
6 | * explicit claim or by omission. Since few users ever read sources, | ||
7 | * credits must appear in the documentation. | ||
8 | * | ||
9 | * date: Sat Mar 30 14:44:42 GMT 2002 | ||
10 | * | ||
11 | * | ||
12 | * -- | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef _CLIENT_H_ | ||
17 | #define _CLIENT_H_ | ||
18 | |||
19 | #ifdef HAVE_CONFIG_H | ||
20 | #include "config.h" | ||
21 | #endif | ||
22 | |||
23 | #include <stdio.h> | ||
24 | #include <fcntl.h> | ||
25 | #include <string.h> | ||
26 | #include <errno.h> | ||
27 | |||
28 | #include "socket.h" | ||
29 | #include "memory.h" | ||
30 | #include "utils.h" | ||
31 | #include "fnmatch.h" | ||
32 | #include "clientinfo.h" | ||
33 | |||
34 | #ifdef WIN32 | ||
35 | #include "flock.h" // my flock | ||
36 | #include "dirent.h" | ||
37 | #else | ||
38 | #include <sys/file.h> // for flock | ||
39 | #include <dirent.h> | ||
40 | #endif | ||
41 | |||
42 | struct gethandler { | ||
43 | char * str; | ||
44 | void (*func)(); | ||
45 | void * ctx; | ||
46 | struct gethandler * next; | ||
47 | }; | ||
48 | |||
49 | |||
50 | |||
51 | #define READMAX 100000 // 1Mb upload | ||
52 | |||
53 | #define WRITEMAX 100000 // 1Mb download 1mb per client? // smaller is better for multi read bigger is better for big downloads | ||
54 | |||
55 | #define MAXURLSIZE 2000 // | ||
56 | |||
57 | extern int WEBTIMEOUT; //to be changed externaly | ||
58 | //#define WEBTIMEOUT 10000 // TIMEOUT WITHOUT RECEIVING DATA (not in seconds but in read tries) | ||
59 | |||
60 | struct web_var { | ||
61 | char *name; | ||
62 | char *value; | ||
63 | struct web_var *next; | ||
64 | }; | ||
65 | |||
66 | struct web_client { | ||
67 | int socket; | ||
68 | struct sockaddr_in sa; | ||
69 | unsigned int salen; | ||
70 | char *HTTPdirective; | ||
71 | unsigned char stat; /* 0001b idle,0010b down streaming, 0011 done down streaming, 0100b out streaming,0101 done out streaming */ | ||
72 | // Read control | ||
73 | char *rbuf; | ||
74 | unsigned long rbufsize; | ||
75 | int newdata_try; | ||
76 | unsigned long contentlength; // for read propose (optimize speed 0.5.1) | ||
77 | unsigned long headersize; | ||
78 | |||
79 | // Write control | ||
80 | struct outstream *outstream; | ||
81 | struct web_var *varlist; | ||
82 | char *cookies; // cookie header (0.5.1) | ||
83 | long writelength; | ||
84 | long readsize; | ||
85 | long range; | ||
86 | int skipped; | ||
87 | long wheadersize; | ||
88 | struct web_client * next; | ||
89 | }; | ||
90 | |||
91 | struct web_client *__ILWS_init_client_list(void); | ||
92 | |||
93 | int __ILWS_add_client(struct web_client *, | ||
94 | struct web_client *); | ||
95 | |||
96 | void __ILWS_delete_next_client(struct web_client *); | ||
97 | |||
98 | void __ILWS_delete_client_list(struct web_client *); | ||
99 | |||
100 | void __ILWS_read_client(struct web_client *); | ||
101 | |||
102 | void __ILWS_process_client(struct web_client *,struct gethandler *); | ||
103 | |||
104 | void __ILWS_output_client(struct web_client *); | ||
105 | |||
106 | void __ILWS_web_client_writef(struct web_client *,const char *,...); | ||
107 | |||
108 | int web_client_addfile(char *); | ||
109 | |||
110 | void web_client_contenttype(char *); // new on 0.5.2 | ||
111 | |||
112 | void web_client_HTTPdirective(char *); | ||
113 | |||
114 | char *__ILWS_web_client_getreqline(); | ||
115 | |||
116 | char *__ILWS_web_client_getreq(); | ||
117 | |||
118 | // new (0.5.1) | ||
119 | int web_client_setvar(char *,char *); | ||
120 | |||
121 | char *web_client_getvar(char *); | ||
122 | |||
123 | int web_client_delvar(char *); | ||
124 | |||
125 | // put in var.h | ||
126 | struct web_var *__ILWS_init_var_list(); | ||
127 | |||
128 | int __ILWS_add_var(struct web_var *, char *, char *); | ||
129 | |||
130 | int __ILWS_del_var(struct web_var *, char *); | ||
131 | |||
132 | void __ILWS_delete_var_list(struct web_var *); | ||
133 | |||
134 | char *__ILWS_get_var(struct web_var *list , char *name); | ||
135 | |||
136 | int __ILWS_lws_list(char *); // new on 0.5.2 | ||
137 | |||
138 | #endif | ||
139 | |||