post example in test server
[platform/upstream/libwebsockets.git] / lwsws / lwsws.h
1 #if defined(_WIN32) && defined(EXTERNAL_POLL)
2 #define WINVER 0x0600
3 #define _WIN32_WINNT 0x0600
4 #define poll(fdArray, fds, timeout)  WSAPoll((LPWSAPOLLFD)(fdArray), (ULONG)(fds), (INT)(timeout))
5 #endif
6
7 #include "lws_config.h"
8
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include <getopt.h>
12 #include <signal.h>
13 #include <string.h>
14 #include <sys/stat.h>
15 #include <fcntl.h>
16 #include <assert.h>
17 #ifndef _WIN32
18 #include <dirent.h>
19 #endif
20
21 #include "../lib/libwebsockets.h"
22 #include "lejp.h"
23
24 #ifdef _WIN32
25 #include <io.h>
26 #include "gettimeofday.h"
27 #else
28 #include <syslog.h>
29 #include <sys/time.h>
30 #include <unistd.h>
31 #endif
32
33 extern void test_server_lock(int care);
34 extern void test_server_unlock(int care);
35
36 #ifndef __func__
37 #define __func__ __FUNCTION__
38 #endif
39
40 struct per_session_data__http {
41         lws_filefd_type fd;
42 #ifdef LWS_WITH_CGI
43         struct lws_cgi_args args;
44 #endif
45 #if defined(LWS_WITH_CGI) || !defined(LWS_NO_CLIENT)
46         int reason_bf;
47 #endif
48         char post_string[256];
49         unsigned int client_finished:1;
50 };
51
52 extern int
53 lwsws_get_config_globals(struct lws_context_creation_info *info, const char *d,
54                 char **config_strings, int *len);
55
56 extern int
57 lwsws_get_config_vhosts(struct lws_context *context,
58                         struct lws_context_creation_info *info, const char *d,
59                         char **config_strings, int *len);
60
61 extern int
62 callback_http(struct lws *wsi, enum lws_callback_reasons reason,
63               void *user, void *in, size_t len);