X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=test-server%2Ftest-server.h;h=7158abc6898ab821765dd4a6029355878bdc849f;hb=86ab060cd9a3faa5449021a9544a68ccda665411;hp=30bc634f7d66246778a69756f62aeb223fa1853e;hpb=00c6d1579c7507ab744075c61ac9babb9d9b8618;p=platform%2Fupstream%2Flibwebsockets.git diff --git a/test-server/test-server.h b/test-server/test-server.h index 30bc634..7158abc 100644 --- a/test-server/test-server.h +++ b/test-server/test-server.h @@ -1,3 +1,29 @@ +/* + * libwebsockets-test-server - libwebsockets test implementation + * + * Copyright (C) 2010-2016 Andy Green + * + * This file is made available under the Creative Commons CC0 1.0 + * Universal Public Domain Dedication. + * + * The person who associated a work with this deed has dedicated + * the work to the public domain by waiving all of his or her rights + * to the work worldwide under copyright law, including all related + * and neighboring rights, to the extent allowed by law. You can copy, + * modify, distribute and perform the work, even for commercial purposes, + * all without asking permission. + * + * The test apps are intended to be adapted for use in your code, which + * may be proprietary. So unlike the library itself, they are licensed + * Public Domain. + */ + +#if defined(_WIN32) && defined(EXTERNAL_POLL) +#define WINVER 0x0600 +#define _WIN32_WINNT 0x0600 +#define poll(fdArray, fds, timeout) WSAPoll((LPWSAPOLLFD)(fdArray), (ULONG)(fds), (INT)(timeout)) +#endif + #include "lws_config.h" #include @@ -13,9 +39,6 @@ #ifdef _WIN32 #include -#ifdef EXTERNAL_POLL -#define poll WSAPoll -#endif #include "gettimeofday.h" #else #include @@ -34,6 +57,9 @@ extern int count_pollfds; extern volatile int force_exit; extern struct lws_context *context; extern char *resource_path; +#if defined(LWS_OPENSSL_SUPPORT) && defined(LWS_HAVE_SSL_CTX_set1_param) +extern char crl_path[1024]; +#endif extern void test_server_lock(int care); extern void test_server_unlock(int care); @@ -44,6 +70,22 @@ extern void test_server_unlock(int care); struct per_session_data__http { lws_filefd_type fd; +#ifdef LWS_WITH_CGI + struct lws_cgi_args args; +#endif +#if defined(LWS_WITH_CGI) || !defined(LWS_NO_CLIENT) + int reason_bf; +#endif + unsigned int client_finished:1; + + + struct lws_spa *spa; + char result[500 + LWS_PRE]; + int result_len; + + char filename[256]; + long file_length; + lws_filefd_type post_fd; }; /* @@ -63,6 +105,24 @@ struct per_session_data__lws_mirror { int ringbuffer_tail; }; +struct per_session_data__echogen { + size_t total; + size_t total_rx; + int fd; + int fragsize; + int wr; +}; + +struct per_session_data__lws_status { + struct per_session_data__lws_status *list; + struct timeval tv_established; + int last; + char ip[270]; + char user_agent[512]; + const char *pos; + int len; +}; + extern int callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len); @@ -72,6 +132,13 @@ callback_lws_mirror(struct lws *wsi, enum lws_callback_reasons reason, extern int callback_dumb_increment(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len); +extern int +callback_lws_echogen(struct lws *wsi, enum lws_callback_reasons reason, + void *user, void *in, size_t len); +extern int +callback_lws_status(struct lws *wsi, enum lws_callback_reasons reason, + void *user, void *in, size_t len); + extern void dump_handshake_info(struct lws *wsi);