Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1713561831, "reponame":"libwebsockets", "desc":"libwebsockets lightweight C networking library", "owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://libwebsockets.org/repo/libwebsockets", "f":3, "items": [ {"schema":"libjg2-1", "cid":"7e61d15718f091b0f5b0302a01d0edbe", "commit": {"type":"commit", "time": 1524827810, "time_ofs": 480, "oid_tree": { "oid": "31edf39eb5e662969719921a0ac39af2a417aa3a", "alias": []}, "oid":{ "oid": "ac6c48d98f6b97ccfaa47c89847ba2398a6d9552", "alias": []}, "msg": "refactor: most preparation for -DLWS_ROLE_H1\u003d0", "sig_commit": { "git_time": { "time": 1524827810, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }, "sig_author": { "git_time": { "time": 1524827810, "offset": 480 }, "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" }}, "body": "refactor: most preparation for -DLWS_ROLE_H1\u003d0" , "diff": "diff --git a/CMakeLists.txt b/CMakeLists.txt\nindex 79223f4..6690934 100644\n--- a/CMakeLists.txt\n+++ b/CMakeLists.txt\n@@ -199,7 +199,6 @@ if(GIT_EXECUTABLE)\n endif()\n \n # translate old functionality enables to set up ROLE enables so nothing changes\n-\n if (LWS_WITH_HTTP2)\n \tset(LWS_ROLE_H2 1)\n endif()\n@@ -215,6 +214,8 @@ if (LWS_WITH_HTTP2 AND LWS_WITHOUT_SERVER)\n \tmessage(FATAL_ERROR \u0022HTTP2 can only be used with server at the moment\u0022)\n endif()\n \n+\n+\n if (LWS_WITH_LWSWS)\n message(STATUS \u0022LWS_WITH_LWSWS --\u003e Enabling LWS_WITH_PLUGINS and LWS_WITH_LIBUV\u0022)\n set(LWS_WITH_PLUGINS 1)\n@@ -290,6 +291,40 @@ if (LWS_WITHOUT_SERVER)\n set(LWS_WITH_LWSWS OFF)\n endif()\n \n+\n+# confirm H1 relationships\n+\n+if (NOT LWS_ROLE_H1 AND LWS_ROLE_H2)\n+\tmessage(FATAL_ERROR \u0022H2 requires LWS_ROLE_H1\u0022)\n+endif()\n+\n+if (NOT LWS_ROLE_H1 AND LWS_ROLE_WS)\n+\tmessage(FATAL_ERROR \u0022WS requires LWS_ROLE_H1\u0022)\n+endif()\n+\n+if (NOT LWS_ROLE_H1 AND LWS_ROLE_CGI)\n+\tmessage(FATAL_ERROR \u0022CGI requires LWS_ROLE_H1\u0022)\n+endif()\n+\n+# confirm HTTP relationships\n+\n+if (NOT LWS_ROLE_H1 AND NOT LWS_ROLE_H2 AND LWS_WITH_HTTP_PROXY)\n+\tmessage(FATAL_ERROR \u0022LWS_WITH_LWSWS requires LWS_ROLE_H1\u0022)\n+endif()\n+\n+if (NOT LWS_ROLE_H1 AND NOT LWS_ROLE_H2 AND LWS_WITH_HTTP_PROXY)\n+\tmessage(FATAL_ERROR \u0022LWS_WITH_HTTP_PROXY requires LWS_ROLE_H1\u0022)\n+endif()\n+\n+if (NOT LWS_ROLE_H1 AND NOT LWS_ROLE_H2 AND LWS_WITH_RANGES)\n+\tmessage(FATAL_ERROR \u0022LWS_WITH_RANGES requires LWS_ROLE_H1\u0022)\n+endif()\n+\n+if (NOT LWS_ROLE_H1 AND NOT LWS_ROLE_H2 AND LWS_WITH_ACCESS_LOG)\n+\tmessage(FATAL_ERROR \u0022LWS_WITH_ACCESS_LOG requires LWS_ROLE_H1\u0022)\n+endif()\n+\n+\n if (LWS_WITH_HTTP_PROXY AND (LWS_WITHOUT_CLIENT OR LWS_WITHOUT_SERVER))\n \tmessage(FATAL_ERROR \u0022You have to enable both client and server for http proxy\u0022)\n endif()\n@@ -695,13 +730,17 @@ set(SOURCES\n \tlib/service.c\n \tlib/pollfd.c\n \tlib/output.c\n-\tlib/roles/http/server/parsers.c\n \tlib/context.c\n \tlib/alloc.c\n-\tlib/roles/http/header.c\n \tlib/roles/pipe/ops-pipe.c\n \tlib/misc/lws-ring.c)\n \n+if (LWS_ROLE_H1 OR LWS_ROLE_H2)\n+\tlist(APPEND SOURCES\n+\t\tlib/roles/http/header.c\n+\t\tlib/roles/http/server/parsers.c)\n+endif()\n+\n if (LWS_ROLE_H1)\n \tlist(APPEND SOURCES\n \t\tlib/roles/h1/ops-h1.c)\n@@ -888,13 +927,13 @@ else()\n \tendif()\n endif()\n \n-if (NOT LWS_WITHOUT_SERVER)\n+if ((LWS_ROLE_H1 OR LWS_ROLE_H2) AND NOT LWS_WITHOUT_SERVER)\n \tlist(APPEND SOURCES\n \t\tlib/roles/http/server/server.c\n \t\tlib/roles/http/server/lws-spa.c)\n endif()\n \n-if (NOT LWS_WITHOUT_EXTENSIONS)\n+if (LWS_ROLE_WS AND NOT LWS_WITHOUT_EXTENSIONS)\n \tlist(APPEND HDR_PRIVATE\n \t\tlib/roles/ws/ext/extension-permessage-deflate.h)\n \tlist(APPEND SOURCES\n@@ -1481,7 +1520,7 @@ endif()\n # Test applications\n #\n set(TEST_APP_LIST)\n-if (NOT LWS_WITHOUT_TESTAPPS)\n+if ((LWS_ROLE_H1 OR LWS_ROLE_H2) AND NOT LWS_WITHOUT_TESTAPPS)\n \t#\n \t# Helper function for adding a test app.\n \t#\ndiff --git a/lib/context.c b/lib/context.c\nindex 6ae8029..6474f47 100644\n--- a/lib/context.c\n+++ b/lib/context.c\n@@ -288,6 +288,7 @@ lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason,\n #endif\n \n \tswitch (reason) {\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \tcase LWS_CALLBACK_HTTP:\n #ifndef LWS_NO_SERVER\n \t\tif (lws_return_http_status(wsi, HTTP_STATUS_NOT_FOUND, NULL))\n@@ -315,7 +316,7 @@ lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason,\n \t\t\t}\n \t\t\tif (!n)\n \t\t\t\tlws_rx_flow_control(\n-\t\t\t\t\twsi-\u003ecgi-\u003estdwsi[LWS_STDOUT], 1);\n+\t\t\t\t\twsi-\u003ehttp.cgi-\u003estdwsi[LWS_STDOUT], 1);\n \n \t\t\tif (wsi-\u003ereason_bf \u0026 LWS_CB_REASON_AUX_BF__CGI_HEADERS)\n \t\t\t\twsi-\u003ereason_bf \u0026\u003d\n@@ -456,10 +457,10 @@ lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason,\n \n \tcase LWS_CALLBACK_CGI_TERMINATED:\n \t\tlwsl_debug(\u0022LWS_CALLBACK_CGI_TERMINATED: %d %\u0022 PRIu64 \u0022\u005cn\u0022,\n-\t\t\t\twsi-\u003ecgi-\u003eexplicitly_chunked,\n-\t\t\t\t(uint64_t)wsi-\u003ecgi-\u003econtent_length);\n-\t\tif (!wsi-\u003ecgi-\u003eexplicitly_chunked \u0026\u0026\n-\t\t !wsi-\u003ecgi-\u003econtent_length) {\n+\t\t\t\twsi-\u003ehttp.cgi-\u003eexplicitly_chunked,\n+\t\t\t\t(uint64_t)wsi-\u003ehttp.cgi-\u003econtent_length);\n+\t\tif (!wsi-\u003ehttp.cgi-\u003eexplicitly_chunked \u0026\u0026\n+\t\t !wsi-\u003ehttp.cgi-\u003econtent_length) {\n \t\t\t/* send terminating chunk */\n \t\t\tlwsl_debug(\u0022LWS_CALLBACK_CGI_TERMINATED: ending\u005cn\u0022);\n \t\t\twsi-\u003ereason_bf |\u003d LWS_CB_REASON_AUX_BF__CGI_CHUNK_END;\n@@ -481,7 +482,7 @@ lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason,\n \t\t\t\t \u0022sent %d only %d went\u0022, n, args-\u003elen);\n \t\treturn n;\n #endif\n-\n+#endif\n \tcase LWS_CALLBACK_SSL_INFO:\n \t\tsi \u003d in;\n \n@@ -1150,9 +1151,10 @@ lws_create_context(const struct lws_context_creation_info *info)\n \t\tcontext-\u003ept[n].context \u003d context;\n #endif\n \t\tcontext-\u003ept[n].tid \u003d n;\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \t\tcontext-\u003ept[n].http.ah_list \u003d NULL;\n \t\tcontext-\u003ept[n].http.ah_pool_length \u003d 0;\n-\n+#endif\n \t\tlws_pt_mutex_init(\u0026context-\u003ept[n]);\n \t}\n \n@@ -1220,7 +1222,7 @@ lws_create_context(const struct lws_context_creation_info *info)\n \t\t (long)sizeof(struct lws_context),\n \t\t (long)context-\u003ecount_threads,\n \t\t context-\u003ept_serv_buf_size);\n-\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \tlwsl_info(\u0022 mem: http hdr rsvd: %5lu B (%u thr x (%u + %lu) x %u))\u005cn\u0022,\n \t\t (long)(context-\u003emax_http_header_data +\n \t\t sizeof(struct allocated_headers)) *\n@@ -1229,6 +1231,7 @@ lws_create_context(const struct lws_context_creation_info *info)\n \t\t context-\u003emax_http_header_data,\n \t\t (long)sizeof(struct allocated_headers),\n \t\t context-\u003emax_http_header_pool);\n+#endif\n \tn \u003d sizeof(struct lws_pollfd) * context-\u003ecount_threads *\n \t context-\u003efd_limit_per_thread;\n \tcontext-\u003ept[0].fds \u003d lws_zalloc(n, \u0022fds table\u0022);\n@@ -1723,8 +1726,10 @@ lws_context_destroy(struct lws_context *context)\n \n \t\tlws_free_set_NULL(context-\u003ept[n].serv_buf);\n \n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \t\twhile (pt-\u003ehttp.ah_list)\n \t\t\t_lws_destroy_ah(pt, pt-\u003ehttp.ah_list);\n+#endif\n \t}\n \tlws_plat_context_early_destroy(context);\n \ndiff --git a/lib/libwebsockets.c b/lib/libwebsockets.c\nindex f883f0a..c7f6754 100644\n--- a/lib/libwebsockets.c\n+++ b/lib/libwebsockets.c\n@@ -74,16 +74,32 @@ void lwsi_set_state(struct lws *wsi, lws_wsi_state_t lrs)\n }\n #endif\n \n+signed char char_to_hex(const char c)\n+{\n+\tif (c \u003e\u003d '0' \u0026\u0026 c \u003c\u003d '9')\n+\t\treturn c - '0';\n+\n+\tif (c \u003e\u003d 'a' \u0026\u0026 c \u003c\u003d 'f')\n+\t\treturn c - 'a' + 10;\n+\n+\tif (c \u003e\u003d 'A' \u0026\u0026 c \u003c\u003d 'F')\n+\t\treturn c - 'A' + 10;\n+\n+\treturn -1;\n+}\n+\n void\n __lws_free_wsi(struct lws *wsi)\n {\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \tstruct lws_context_per_thread *pt;\n-\tstruct allocated_headers *ah;\n+#endif\n \n \tif (!wsi)\n \t\treturn;\n-\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \tpt \u003d \u0026wsi-\u003econtext-\u003ept[(int)wsi-\u003etsi];\n+#endif\n \n \t/*\n \t * Protocol user data may be allocated either internally by lws\n@@ -97,24 +113,29 @@ __lws_free_wsi(struct lws *wsi)\n \tlws_free_set_NULL(wsi-\u003etrunc_alloc);\n \tlws_free_set_NULL(wsi-\u003eudp);\n \n+\tif (wsi-\u003evhost \u0026\u0026 wsi-\u003evhost-\u003elserv_wsi \u003d\u003d wsi)\n+\t\twsi-\u003evhost-\u003elserv_wsi \u003d NULL;\n+\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n+\n \t/* we may not have an ah, but may be on the waiting list... */\n \tlwsl_info(\u0022ah det due to close\u005cn\u0022);\n \t__lws_header_table_detach(wsi, 0);\n \n-\tif (wsi-\u003evhost \u0026\u0026 wsi-\u003evhost-\u003elserv_wsi \u003d\u003d wsi)\n-\t\twsi-\u003evhost-\u003elserv_wsi \u003d NULL;\n-\n-\tah \u003d pt-\u003ehttp.ah_list;\n-\twhile (ah) {\n-\t\tif (ah-\u003ein_use \u0026\u0026 ah-\u003ewsi \u003d\u003d wsi) {\n-\t\t\tlwsl_err(\u0022%s: ah leak: wsi %p\u005cn\u0022, __func__, wsi);\n-\t\t\tah-\u003ein_use \u003d 0;\n-\t\t\tah-\u003ewsi \u003d NULL;\n-\t\t\tpt-\u003ehttp.ah_count_in_use--;\n-\t\t\tbreak;\n+\t{\n+\t\tstruct allocated_headers *ah \u003d pt-\u003ehttp.ah_list;\n+\t\twhile (ah) {\n+\t\t\tif (ah-\u003ein_use \u0026\u0026 ah-\u003ewsi \u003d\u003d wsi) {\n+\t\t\t\tlwsl_err(\u0022%s: ah leak: wsi %p\u005cn\u0022, __func__, wsi);\n+\t\t\t\tah-\u003ein_use \u003d 0;\n+\t\t\t\tah-\u003ewsi \u003d NULL;\n+\t\t\t\tpt-\u003ehttp.ah_count_in_use--;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t\tah \u003d ah-\u003enext;\n \t\t}\n-\t\tah \u003d ah-\u003enext;\n \t}\n+#endif\n \n #if defined(LWS_WITH_PEER_LIMITS)\n \tlws_peer_track_wsi_close(wsi-\u003econtext, wsi-\u003epeer);\n@@ -606,20 +627,20 @@ __lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason, const char *\n #ifdef LWS_WITH_CGI\n \tif (wsi-\u003erole_ops \u003d\u003d \u0026role_ops_cgi) {\n \t\t/* we are not a network connection, but a handler for CGI io */\n-\t\tif (wsi-\u003eparent \u0026\u0026 wsi-\u003eparent-\u003ecgi) {\n+\t\tif (wsi-\u003eparent \u0026\u0026 wsi-\u003eparent-\u003ehttp.cgi) {\n \n \t\t\tif (wsi-\u003ecgi_channel \u003d\u003d LWS_STDOUT)\n \t\t\t\tlws_cgi_remove_and_kill(wsi-\u003eparent);\n \n \t\t\t/* end the binding between us and master */\n-\t\t\twsi-\u003eparent-\u003ecgi-\u003estdwsi[(int)wsi-\u003ecgi_channel] \u003d NULL;\n+\t\t\twsi-\u003eparent-\u003ehttp.cgi-\u003estdwsi[(int)wsi-\u003ecgi_channel] \u003d NULL;\n \t\t}\n \t\twsi-\u003esocket_is_permanently_unusable \u003d 1;\n \n \t\tgoto just_kill_connection;\n \t}\n \n-\tif (wsi-\u003ecgi)\n+\tif (wsi-\u003ehttp.cgi)\n \t\tlws_cgi_remove_and_kill(wsi);\n #endif\n \n@@ -631,10 +652,11 @@ __lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason, const char *\n \t\twsi-\u003esocket_is_permanently_unusable \u003d 1;\n \t\tgoto just_kill_connection;\n \t}\n-\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \tif (lwsi_role_http(wsi) \u0026\u0026 lwsi_role_server(wsi) \u0026\u0026\n \t wsi-\u003ehttp.fop_fd !\u003d NULL)\n \t\tlws_vfs_file_close(\u0026wsi-\u003ehttp.fop_fd);\n+#endif\n \n \tif (lwsi_state(wsi) \u003d\u003d LRS_DEAD_SOCKET)\n \t\treturn;\n@@ -879,17 +901,17 @@ __lws_close_free_wsi_final(struct lws *wsi)\n \t\t\t\t\t\t wsi-\u003euser_space, NULL, 0);\n \n #ifdef LWS_WITH_CGI\n-\tif (wsi-\u003ecgi) {\n+\tif (wsi-\u003ehttp.cgi) {\n \n \t\tfor (n \u003d 0; n \u003c 3; n++) {\n-\t\t\tif (wsi-\u003ecgi-\u003epipe_fds[n][!!(n \u003d\u003d 0)] \u003d\u003d 0)\n+\t\t\tif (wsi-\u003ehttp.cgi-\u003epipe_fds[n][!!(n \u003d\u003d 0)] \u003d\u003d 0)\n \t\t\t\tlwsl_err(\u0022ZERO FD IN CGI CLOSE\u0022);\n \n-\t\t\tif (wsi-\u003ecgi-\u003epipe_fds[n][!!(n \u003d\u003d 0)] \u003e\u003d 0)\n-\t\t\t\tclose(wsi-\u003ecgi-\u003epipe_fds[n][!!(n \u003d\u003d 0)]);\n+\t\t\tif (wsi-\u003ehttp.cgi-\u003epipe_fds[n][!!(n \u003d\u003d 0)] \u003e\u003d 0)\n+\t\t\t\tclose(wsi-\u003ehttp.cgi-\u003epipe_fds[n][!!(n \u003d\u003d 0)]);\n \t\t}\n \n-\t\tlws_free(wsi-\u003ecgi);\n+\t\tlws_free(wsi-\u003ehttp.cgi);\n \t}\n #endif\n \n@@ -2882,7 +2904,7 @@ lws_strncpy(char *dest, const char *src, size_t size)\n LWS_VISIBLE LWS_EXTERN int\n lws_is_cgi(struct lws *wsi) {\n #ifdef LWS_WITH_CGI\n-\treturn !!wsi-\u003ecgi;\n+\treturn !!wsi-\u003ehttp.cgi;\n #else\n \treturn 0;\n #endif\n@@ -2944,6 +2966,7 @@ lws_cmdline_option(int argc, const char **argv, const char *val)\n LWS_EXTERN int\n lws_json_dump_vhost(const struct lws_vhost *vh, char *buf, int len)\n {\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \tstatic const char * const prots[] \u003d {\n \t\t\u0022http://\u0022,\n \t\t\u0022https://\u0022,\n@@ -2953,6 +2976,7 @@ lws_json_dump_vhost(const struct lws_vhost *vh, char *buf, int len)\n \t\t\u0022\u003ehttps://\u0022,\n \t\t\u0022callback://\u0022\n \t};\n+#endif\n \tchar *orig \u003d buf, *end \u003d buf + len - 1, first \u003d 1;\n \tint n \u003d 0;\n \ndiff --git a/lib/output.c b/lib/output.c\nindex b6149c4..7d1a748 100644\n--- a/lib/output.c\n+++ b/lib/output.c\n@@ -215,7 +215,7 @@ LWS_VISIBLE int lws_write(struct lws *wsi, unsigned char *buf, size_t len,\n \tlws_stats_atomic_bump(wsi-\u003econtext, pt, LWSSTATS_B_WRITE, len);\n \n #ifdef LWS_WITH_ACCESS_LOG\n-\twsi-\u003eaccess_log.sent +\u003d len;\n+\twsi-\u003ehttp.access_log.sent +\u003d len;\n #endif\n \tif (wsi-\u003evhost)\n \t\twsi-\u003evhost-\u003econn_stats.tx +\u003d len;\ndiff --git a/lib/private-libwebsockets.h b/lib/private-libwebsockets.h\nindex f514d1f..a3fe842 100644\n--- a/lib/private-libwebsockets.h\n+++ b/lib/private-libwebsockets.h\n@@ -1397,9 +1397,6 @@ struct lws {\n #if defined(LWS_WITH_LIBEV) || defined(LWS_WITH_LIBEVENT)\n \tstruct lws_io_watcher w_write;\n #endif\n-#ifdef LWS_WITH_ACCESS_LOG\n-\tstruct lws_access_log access_log;\n-#endif\n \n \t/* pointers */\n \n@@ -1409,9 +1406,6 @@ struct lws {\n \tstruct lws *child_list; /* points to first child */\n \tstruct lws *sibling_list; /* subsequent children at same level */\n \n-#ifdef LWS_WITH_CGI\n-\tstruct lws_cgi *cgi; /* wsi being cgi master have one of these */\n-#endif\n \tconst struct lws_protocols *protocol;\n \tstruct lws **same_vh_protocol_prev, *same_vh_protocol_next;\n \n@@ -1678,8 +1672,7 @@ lws_handle_POLLOUT_event(struct lws *wsi, struct lws_pollfd *pollfd);\n LWS_EXTERN struct lws *\n lws_client_connect_via_info2(struct lws *wsi);\n \n-LWS_EXTERN int\n-_lws_destroy_ah(struct lws_context_per_thread *pt, struct allocated_headers *ah);\n+\n \n LWS_EXTERN void\n lws_client_stash_destroy(struct lws *wsi);\n@@ -1733,8 +1726,7 @@ __lws_header_table_detach(struct lws *wsi, int autoservice);\n \n LWS_EXTERN void\n lws_header_table_reset(struct lws *wsi, int autoservice);\n-void\n-_lws_header_table_reset(struct allocated_headers *ah);\n+\n void\n __lws_header_table_reset(struct lws *wsi, int autoservice);\n \n@@ -2095,8 +2087,7 @@ __lws_set_timeout(struct lws *wsi, enum pending_timeout reason, int secs);\n int\n __lws_change_pollfd(struct lws *wsi, int _and, int _or);\n \n-int\n-lws_read_h1(struct lws *wsi, unsigned char *buf, lws_filepos_t len);\n+\n int\n lws_callback_as_writeable(struct lws *wsi);\n int\n@@ -2105,12 +2096,8 @@ lws_buflist_aware_read(struct lws_context_per_thread *pt, struct lws *wsi,\n int\n lws_buflist_aware_consume(struct lws *wsi, struct lws_tokens *ebuf, int used,\n \t\t\t int buffered);\n-int\n-lws_process_ws_upgrade(struct lws *wsi);\n-int\n-lws_server_init_wsi_for_ws(struct lws *wsi);\n-int\n-handshake_0405(struct lws_context *context, struct lws *wsi);\n+\n+\n char *\n lws_generate_client_ws_handshake(struct lws *wsi, char *p);\n int\ndiff --git a/lib/roles/cgi/cgi-server.c b/lib/roles/cgi/cgi-server.c\nindex b5c1d19..2de5a87 100644\n--- a/lib/roles/cgi/cgi-server.c\n+++ b/lib/roles/cgi/cgi-server.c\n@@ -121,15 +121,15 @@ lws_cgi(struct lws *wsi, const char * const *exec_array, int script_uri_path_len\n \t * give the master wsi a cgi struct\n \t */\n \n-\twsi-\u003ecgi \u003d lws_zalloc(sizeof(*wsi-\u003ecgi), \u0022new cgi\u0022);\n-\tif (!wsi-\u003ecgi) {\n+\twsi-\u003ehttp.cgi \u003d lws_zalloc(sizeof(*wsi-\u003ehttp.cgi), \u0022new cgi\u0022);\n+\tif (!wsi-\u003ehttp.cgi) {\n \t\tlwsl_err(\u0022%s: OOM\u005cn\u0022, __func__);\n \t\treturn -1;\n \t}\n \n-\twsi-\u003ecgi-\u003eresponse_code \u003d HTTP_STATUS_OK;\n+\twsi-\u003ehttp.cgi-\u003eresponse_code \u003d HTTP_STATUS_OK;\n \n-\tcgi \u003d wsi-\u003ecgi;\n+\tcgi \u003d wsi-\u003ehttp.cgi;\n \tcgi-\u003ewsi \u003d wsi; /* set cgi's owning wsi */\n \tsum \u003d cgi-\u003esummary;\n \tsumend \u003d sum + strlen(cgi-\u003esummary) - 1;\n@@ -187,7 +187,7 @@ lws_cgi(struct lws *wsi, const char * const *exec_array, int script_uri_path_len\n \twsi-\u003ehdr_state \u003d LCHS_HEADER;\n \n \t/* add us to the pt list of active cgis */\n-\tlwsl_debug(\u0022%s: adding cgi %p to list\u005cn\u0022, __func__, wsi-\u003ecgi);\n+\tlwsl_debug(\u0022%s: adding cgi %p to list\u005cn\u0022, __func__, wsi-\u003ehttp.cgi);\n \tcgi-\u003ecgi_list \u003d pt-\u003ehttp.cgi_list;\n \tpt-\u003ehttp.cgi_list \u003d cgi;\n \n@@ -445,10 +445,10 @@ bail3:\n \tpt-\u003ehttp.cgi_list \u003d cgi-\u003ecgi_list;\n \n \twhile (--n \u003e\u003d 0)\n-\t\t__remove_wsi_socket_from_fds(wsi-\u003ecgi-\u003estdwsi[n]);\n+\t\t__remove_wsi_socket_from_fds(wsi-\u003ehttp.cgi-\u003estdwsi[n]);\n bail2:\n \tfor (n \u003d 0; n \u003c 3; n++)\n-\t\tif (wsi-\u003ecgi-\u003estdwsi[n])\n+\t\tif (wsi-\u003ehttp.cgi-\u003estdwsi[n])\n \t\t\t__lws_free_wsi(cgi-\u003estdwsi[n]);\n \n bail1:\n@@ -459,7 +459,7 @@ bail1:\n \t\t\tclose(cgi-\u003epipe_fds[n][1]);\n \t}\n \n-\tlws_free_set_NULL(wsi-\u003ecgi);\n+\tlws_free_set_NULL(wsi-\u003ehttp.cgi);\n \n \tlwsl_err(\u0022%s: failed\u005cn\u0022, __func__);\n \n@@ -491,7 +491,7 @@ lws_cgi_write_split_stdout_headers(struct lws *wsi)\n \t\t\t*value \u003d NULL;\n \tchar c, hrs;\n \n-\tif (!wsi-\u003ecgi)\n+\tif (!wsi-\u003ehttp.cgi)\n \t\treturn -1;\n \n \twhile (wsi-\u003ehdr_state !\u003d LHCS_PAYLOAD) {\n@@ -502,13 +502,13 @@ lws_cgi_write_split_stdout_headers(struct lws *wsi)\n \t\tswitch (wsi-\u003ehdr_state) {\n \t\tcase LHCS_RESPONSE:\n \t\t\tlwsl_debug(\u0022LHCS_RESPONSE: issuing response %d\u005cn\u0022,\n-\t\t\t\t wsi-\u003ecgi-\u003eresponse_code);\n+\t\t\t\t wsi-\u003ehttp.cgi-\u003eresponse_code);\n \t\t\tif (lws_add_http_header_status(wsi,\n-\t\t\t\t\t\t wsi-\u003ecgi-\u003eresponse_code,\n+\t\t\t\t\t\t wsi-\u003ehttp.cgi-\u003eresponse_code,\n \t\t\t\t\t\t \u0026p, end))\n \t\t\t\treturn 1;\n-\t\t\tif (!wsi-\u003ecgi-\u003eexplicitly_chunked \u0026\u0026\n-\t\t\t !wsi-\u003ecgi-\u003econtent_length \u0026\u0026\n+\t\t\tif (!wsi-\u003ehttp.cgi-\u003eexplicitly_chunked \u0026\u0026\n+\t\t\t !wsi-\u003ehttp.cgi-\u003econtent_length \u0026\u0026\n \t\t\t\tlws_add_http_header_by_token(wsi,\n \t\t\t\t\tWSI_TOKEN_HTTP_TRANSFER_ENCODING,\n \t\t\t\t\t(unsigned char *)\u0022chunked\u0022, 7, \u0026p, end))\n@@ -524,8 +524,8 @@ lws_cgi_write_split_stdout_headers(struct lws *wsi)\n \n \t\t\t/*\n \t\t\t * so we have a bunch of http/1 style ascii headers\n-\t\t\t * starting from wsi-\u003ecgi-\u003eheaders_buf through\n-\t\t\t * wsi-\u003ecgi-\u003eheaders_pos. These are OK for http/1\n+\t\t\t * starting from wsi-\u003ehttp.cgi-\u003eheaders_buf through\n+\t\t\t * wsi-\u003ehttp.cgi-\u003eheaders_pos. These are OK for http/1\n \t\t\t * connections, but they're no good for http/2 conns.\n \t\t\t *\n \t\t\t * Let's redo them at headers_pos forward using the\n@@ -534,13 +534,13 @@ lws_cgi_write_split_stdout_headers(struct lws *wsi)\n \t\t\tif (!wsi-\u003ehttp2_substream)\n \t\t\t\tgoto post_hpack_recode;\n \n-\t\t\tp \u003d wsi-\u003ecgi-\u003eheaders_start;\n-\t\t\twsi-\u003ecgi-\u003eheaders_start \u003d wsi-\u003ecgi-\u003eheaders_pos;\n-\t\t\twsi-\u003ecgi-\u003eheaders_dumped \u003d wsi-\u003ecgi-\u003eheaders_start;\n+\t\t\tp \u003d wsi-\u003ehttp.cgi-\u003eheaders_start;\n+\t\t\twsi-\u003ehttp.cgi-\u003eheaders_start \u003d wsi-\u003ehttp.cgi-\u003eheaders_pos;\n+\t\t\twsi-\u003ehttp.cgi-\u003eheaders_dumped \u003d wsi-\u003ehttp.cgi-\u003eheaders_start;\n \t\t\thrs \u003d HR_NAME;\n \t\t\tname \u003d buf;\n \n-\t\t\twhile (p \u003c wsi-\u003ecgi-\u003eheaders_start) {\n+\t\t\twhile (p \u003c wsi-\u003ehttp.cgi-\u003eheaders_start) {\n \t\t\t\tswitch (hrs) {\n \t\t\t\tcase HR_NAME:\n \t\t\t\t\t/*\n@@ -582,7 +582,7 @@ lws_cgi_write_split_stdout_headers(struct lws *wsi)\n \t\t\t\t\t/* fallthru */\n \t\t\t\tcase HR_CRLF:\n \t\t\t\t\tif ((*p !\u003d '\u005cx0a' \u0026\u0026 *p !\u003d '\u005cx0d') ||\n-\t\t\t\t\t p + 1 \u003d\u003d wsi-\u003ecgi-\u003eheaders_start) {\n+\t\t\t\t\t p + 1 \u003d\u003d wsi-\u003ehttp.cgi-\u003eheaders_start) {\n \t\t\t\t\t\t*name \u003d '\u005c0';\n \t\t\t\t\t\tif ((strcmp((const char *)buf,\n \t\t\t\t\t\t\t \u0022transfer-encoding\u0022)\n@@ -592,8 +592,8 @@ lws_cgi_write_split_stdout_headers(struct lws *wsi)\n \t\t\t\t\t\t\tif (\n \t\t\t\t\tlws_add_http_header_by_name(wsi, buf,\n \t\t\t\t\t(unsigned char *)value, name - value,\n-\t\t\t\t\t(unsigned char **)\u0026wsi-\u003ecgi-\u003eheaders_pos,\n-\t\t\t\t\t(unsigned char *)wsi-\u003ecgi-\u003eheaders_end))\n+\t\t\t\t\t(unsigned char **)\u0026wsi-\u003ehttp.cgi-\u003eheaders_pos,\n+\t\t\t\t\t(unsigned char *)wsi-\u003ehttp.cgi-\u003eheaders_end))\n \t\t\t\t\t\t\t\treturn 1;\n \t\t\t\t\t\t\thrs \u003d HR_NAME;\n \t\t\t\t\t\t\tname \u003d buf;\n@@ -607,8 +607,8 @@ lws_cgi_write_split_stdout_headers(struct lws *wsi)\n post_hpack_recode:\n \t\t\t/* finalize cached headers before dumping them */\n \t\t\tif (lws_finalize_http_header(wsi,\n-\t\t\t\t (unsigned char **)\u0026wsi-\u003ecgi-\u003eheaders_pos,\n-\t\t\t\t (unsigned char *)wsi-\u003ecgi-\u003eheaders_end)) {\n+\t\t\t\t (unsigned char **)\u0026wsi-\u003ehttp.cgi-\u003eheaders_pos,\n+\t\t\t\t (unsigned char *)wsi-\u003ehttp.cgi-\u003eheaders_end)) {\n \n \t\t\t\tlwsl_notice(\u0022finalize failed\u005cn\u0022);\n \t\t\t\treturn -1;\n@@ -622,30 +622,30 @@ post_hpack_recode:\n \n \t\tcase LHCS_DUMP_HEADERS:\n \n-\t\t\tn \u003d wsi-\u003ecgi-\u003eheaders_pos - wsi-\u003ecgi-\u003eheaders_dumped;\n+\t\t\tn \u003d wsi-\u003ehttp.cgi-\u003eheaders_pos - wsi-\u003ehttp.cgi-\u003eheaders_dumped;\n \t\t\tif (n \u003e 512)\n \t\t\t\tn \u003d 512;\n \n \t\t\tlwsl_debug(\u0022LHCS_DUMP_HEADERS: %d\u005cn\u0022, n);\n \n \t\t\tcmd \u003d LWS_WRITE_HTTP_HEADERS_CONTINUATION;\n-\t\t\tif (wsi-\u003ecgi-\u003eheaders_dumped + n !\u003d\n-\t\t\t wsi-\u003ecgi-\u003eheaders_pos) {\n+\t\t\tif (wsi-\u003ehttp.cgi-\u003eheaders_dumped + n !\u003d\n+\t\t\t wsi-\u003ehttp.cgi-\u003eheaders_pos) {\n \t\t\t\tlwsl_notice(\u0022adding no fin flag\u005cn\u0022);\n \t\t\t\tcmd |\u003d LWS_WRITE_NO_FIN;\n \t\t\t}\n \n \t\t\tm \u003d lws_write(wsi,\n-\t\t\t\t (unsigned char *)wsi-\u003ecgi-\u003eheaders_dumped,\n+\t\t\t\t (unsigned char *)wsi-\u003ehttp.cgi-\u003eheaders_dumped,\n \t\t\t\t n, cmd);\n \t\t\tif (m \u003c 0) {\n \t\t\t\tlwsl_debug(\u0022%s: write says %d\u005cn\u0022, __func__, m);\n \t\t\t\treturn -1;\n \t\t\t}\n-\t\t\twsi-\u003ecgi-\u003eheaders_dumped +\u003d n;\n-\t\t\tif (wsi-\u003ecgi-\u003eheaders_dumped \u003d\u003d wsi-\u003ecgi-\u003eheaders_pos) {\n+\t\t\twsi-\u003ehttp.cgi-\u003eheaders_dumped +\u003d n;\n+\t\t\tif (wsi-\u003ehttp.cgi-\u003eheaders_dumped \u003d\u003d wsi-\u003ehttp.cgi-\u003eheaders_pos) {\n \t\t\t\twsi-\u003ehdr_state \u003d LHCS_PAYLOAD;\n-\t\t\t\tlws_free_set_NULL(wsi-\u003ecgi-\u003eheaders_buf);\n+\t\t\t\tlws_free_set_NULL(wsi-\u003ehttp.cgi-\u003eheaders_buf);\n \t\t\t\tlwsl_debug(\u0022freed cgi headers\u005cn\u0022);\n \t\t\t} else {\n \t\t\t\twsi-\u003ereason_bf |\u003d LWS_CB_REASON_AUX_BF__CGI_HEADERS;\n@@ -658,31 +658,31 @@ post_hpack_recode:\n \t\t\treturn 0;\n \t\t}\n \n-\t\tif (!wsi-\u003ecgi-\u003eheaders_buf) {\n+\t\tif (!wsi-\u003ehttp.cgi-\u003eheaders_buf) {\n \t\t\t/* if we don't already have a headers buf, cook one up */\n \t\t\tn \u003d 2048;\n \t\t\tif (wsi-\u003ehttp2_substream)\n \t\t\t\tn \u003d 4096;\n-\t\t\twsi-\u003ecgi-\u003eheaders_buf \u003d lws_malloc(n + LWS_PRE,\n+\t\t\twsi-\u003ehttp.cgi-\u003eheaders_buf \u003d lws_malloc(n + LWS_PRE,\n \t\t\t\t\t\t\t \u0022cgi hdr buf\u0022);\n-\t\t\tif (!wsi-\u003ecgi-\u003eheaders_buf) {\n+\t\t\tif (!wsi-\u003ehttp.cgi-\u003eheaders_buf) {\n \t\t\t\tlwsl_err(\u0022OOM\u005cn\u0022);\n \t\t\t\treturn -1;\n \t\t\t}\n \n \t\t\tlwsl_debug(\u0022allocated cgi hdrs\u005cn\u0022);\n-\t\t\twsi-\u003ecgi-\u003eheaders_start \u003d wsi-\u003ecgi-\u003eheaders_buf + LWS_PRE;\n-\t\t\twsi-\u003ecgi-\u003eheaders_pos \u003d wsi-\u003ecgi-\u003eheaders_start;\n-\t\t\twsi-\u003ecgi-\u003eheaders_dumped \u003d wsi-\u003ecgi-\u003eheaders_pos;\n-\t\t\twsi-\u003ecgi-\u003eheaders_end \u003d wsi-\u003ecgi-\u003eheaders_buf + n - 1;\n+\t\t\twsi-\u003ehttp.cgi-\u003eheaders_start \u003d wsi-\u003ehttp.cgi-\u003eheaders_buf + LWS_PRE;\n+\t\t\twsi-\u003ehttp.cgi-\u003eheaders_pos \u003d wsi-\u003ehttp.cgi-\u003eheaders_start;\n+\t\t\twsi-\u003ehttp.cgi-\u003eheaders_dumped \u003d wsi-\u003ehttp.cgi-\u003eheaders_pos;\n+\t\t\twsi-\u003ehttp.cgi-\u003eheaders_end \u003d wsi-\u003ehttp.cgi-\u003eheaders_buf + n - 1;\n \n \t\t\tfor (n \u003d 0; n \u003c SIGNIFICANT_HDR_COUNT; n++) {\n-\t\t\t\twsi-\u003ecgi-\u003ematch[n] \u003d 0;\n-\t\t\t\twsi-\u003ecgi-\u003elp \u003d 0;\n+\t\t\t\twsi-\u003ehttp.cgi-\u003ematch[n] \u003d 0;\n+\t\t\t\twsi-\u003ehttp.cgi-\u003elp \u003d 0;\n \t\t\t}\n \t\t}\n \n-\t\tn \u003d lws_get_socket_fd(wsi-\u003ecgi-\u003estdwsi[LWS_STDOUT]);\n+\t\tn \u003d lws_get_socket_fd(wsi-\u003ehttp.cgi-\u003estdwsi[LWS_STDOUT]);\n \t\tif (n \u003c 0)\n \t\t\treturn -1;\n \t\tn \u003d read(n, \u0026c, 1);\n@@ -694,7 +694,7 @@ post_hpack_recode:\n \t\t\telse\n \t\t\t\tn \u003d 0;\n \n-\t\t\tif (wsi-\u003ecgi-\u003eheaders_pos \u003e\u003d wsi-\u003ecgi-\u003eheaders_end - 4) {\n+\t\t\tif (wsi-\u003ehttp.cgi-\u003eheaders_pos \u003e\u003d wsi-\u003ehttp.cgi-\u003eheaders_end - 4) {\n \t\t\t\tlwsl_notice(\u0022CGI hdrs \u003e buf size\u005cn\u0022);\n \n \t\t\t\treturn -1;\n@@ -704,7 +704,7 @@ post_hpack_recode:\n \t\t\tgoto agin;\n \n \t\tlwsl_debug(\u0022-- 0x%02X %c %d %d\u005cn\u0022, (unsigned char)c, c,\n-\t\t\t wsi-\u003ecgi-\u003ematch[1], wsi-\u003ehdr_state);\n+\t\t\t wsi-\u003ehttp.cgi-\u003ematch[1], wsi-\u003ehdr_state);\n \t\tif (!c)\n \t\t\treturn -1;\n \t\tswitch (wsi-\u003ehdr_state) {\n@@ -715,64 +715,64 @@ post_hpack_recode:\n \t\t\t\t * significant headers with\n \t\t\t\t * numeric decimal payloads\n \t\t\t\t */\n-\t\t\t\tif (!significant_hdr[n][wsi-\u003ecgi-\u003ematch[n]] \u0026\u0026\n+\t\t\t\tif (!significant_hdr[n][wsi-\u003ehttp.cgi-\u003ematch[n]] \u0026\u0026\n \t\t\t\t (c \u003e\u003d '0' \u0026\u0026 c \u003c\u003d '9') \u0026\u0026\n-\t\t\t\t wsi-\u003ecgi-\u003elp \u003c (int)sizeof(wsi-\u003ecgi-\u003el) - 1) {\n-\t\t\t\t\twsi-\u003ecgi-\u003el[wsi-\u003ecgi-\u003elp++] \u003d c;\n-\t\t\t\t\twsi-\u003ecgi-\u003el[wsi-\u003ecgi-\u003elp] \u003d '\u005c0';\n+\t\t\t\t wsi-\u003ehttp.cgi-\u003elp \u003c (int)sizeof(wsi-\u003ehttp.cgi-\u003el) - 1) {\n+\t\t\t\t\twsi-\u003ehttp.cgi-\u003el[wsi-\u003ehttp.cgi-\u003elp++] \u003d c;\n+\t\t\t\t\twsi-\u003ehttp.cgi-\u003el[wsi-\u003ehttp.cgi-\u003elp] \u003d '\u005c0';\n \t\t\t\t\tswitch (n) {\n \t\t\t\t\tcase SIGNIFICANT_HDR_CONTENT_LENGTH:\n-\t\t\t\t\t\twsi-\u003ecgi-\u003econtent_length \u003d\n-\t\t\t\t\t\t\tatoll(wsi-\u003ecgi-\u003el);\n+\t\t\t\t\t\twsi-\u003ehttp.cgi-\u003econtent_length \u003d\n+\t\t\t\t\t\t\tatoll(wsi-\u003ehttp.cgi-\u003el);\n \t\t\t\t\t\tbreak;\n \t\t\t\t\tcase SIGNIFICANT_HDR_STATUS:\n-\t\t\t\t\t\twsi-\u003ecgi-\u003eresponse_code \u003d\n-\t\t\t\t\t\t\tatol(wsi-\u003ecgi-\u003el);\n+\t\t\t\t\t\twsi-\u003ehttp.cgi-\u003eresponse_code \u003d\n+\t\t\t\t\t\t\tatol(wsi-\u003ehttp.cgi-\u003el);\n \t\t\t\t\t\tlwsl_debug(\u0022Status set to %d\u005cn\u0022,\n-\t\t\t\t\t\t wsi-\u003ecgi-\u003eresponse_code);\n+\t\t\t\t\t\t wsi-\u003ehttp.cgi-\u003eresponse_code);\n \t\t\t\t\t\tbreak;\n \t\t\t\t\tdefault:\n \t\t\t\t\t\tbreak;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t/* hits up to the NUL are sticky until next hdr */\n-\t\t\t\tif (significant_hdr[n][wsi-\u003ecgi-\u003ematch[n]]) {\n+\t\t\t\tif (significant_hdr[n][wsi-\u003ehttp.cgi-\u003ematch[n]]) {\n \t\t\t\t\tif (tolower(c) \u003d\u003d\n-\t\t\t\t\t significant_hdr[n][wsi-\u003ecgi-\u003ematch[n]])\n-\t\t\t\t\t\twsi-\u003ecgi-\u003ematch[n]++;\n+\t\t\t\t\t significant_hdr[n][wsi-\u003ehttp.cgi-\u003ematch[n]])\n+\t\t\t\t\t\twsi-\u003ehttp.cgi-\u003ematch[n]++;\n \t\t\t\t\telse\n-\t\t\t\t\t\twsi-\u003ecgi-\u003ematch[n] \u003d 0;\n+\t\t\t\t\t\twsi-\u003ehttp.cgi-\u003ematch[n] \u003d 0;\n \t\t\t\t}\n \t\t\t}\n \n \t\t\t/* some cgi only send us \u005cx0a for EOL */\n \t\t\tif (c \u003d\u003d '\u005cx0a') {\n \t\t\t\twsi-\u003ehdr_state \u003d LCHS_SINGLE_0A;\n-\t\t\t\t*wsi-\u003ecgi-\u003eheaders_pos++ \u003d '\u005cx0d';\n+\t\t\t\t*wsi-\u003ehttp.cgi-\u003eheaders_pos++ \u003d '\u005cx0d';\n \t\t\t}\n-\t\t\t*wsi-\u003ecgi-\u003eheaders_pos++ \u003d c;\n+\t\t\t*wsi-\u003ehttp.cgi-\u003eheaders_pos++ \u003d c;\n \t\t\tif (c \u003d\u003d '\u005cx0d')\n \t\t\t\twsi-\u003ehdr_state \u003d LCHS_LF1;\n \n \t\t\tif (wsi-\u003ehdr_state !\u003d LCHS_HEADER \u0026\u0026\n \t\t\t !significant_hdr[SIGNIFICANT_HDR_TRANSFER_ENCODING]\n-\t\t\t\t [wsi-\u003ecgi-\u003ematch[\n+\t\t\t\t [wsi-\u003ehttp.cgi-\u003ematch[\n \t\t\t\t\t SIGNIFICANT_HDR_TRANSFER_ENCODING]]) {\n \t\t\t\tlwsl_debug(\u0022cgi produced chunked\u005cn\u0022);\n-\t\t\t\twsi-\u003ecgi-\u003eexplicitly_chunked \u003d 1;\n+\t\t\t\twsi-\u003ehttp.cgi-\u003eexplicitly_chunked \u003d 1;\n \t\t\t}\n \n \t\t\t/* presence of Location: mandates 302 retcode */\n \t\t\tif (wsi-\u003ehdr_state !\u003d LCHS_HEADER \u0026\u0026\n \t\t\t !significant_hdr[SIGNIFICANT_HDR_LOCATION][\n-\t\t\t\t wsi-\u003ecgi-\u003ematch[SIGNIFICANT_HDR_LOCATION]]) {\n+\t\t\t\t wsi-\u003ehttp.cgi-\u003ematch[SIGNIFICANT_HDR_LOCATION]]) {\n \t\t\t\tlwsl_debug(\u0022CGI: Location hdr seen\u005cn\u0022);\n-\t\t\t\twsi-\u003ecgi-\u003eresponse_code \u003d 302;\n+\t\t\t\twsi-\u003ehttp.cgi-\u003eresponse_code \u003d 302;\n \t\t\t}\n \n \t\t\tbreak;\n \t\tcase LCHS_LF1:\n-\t\t\t*wsi-\u003ecgi-\u003eheaders_pos++ \u003d c;\n+\t\t\t*wsi-\u003ehttp.cgi-\u003eheaders_pos++ \u003d c;\n \t\t\tif (c \u003d\u003d '\u005cx0a') {\n \t\t\t\twsi-\u003ehdr_state \u003d LCHS_CR2;\n \t\t\t\tbreak;\n@@ -790,8 +790,8 @@ post_hpack_recode:\n \t\t\t}\n \t\t\twsi-\u003ehdr_state \u003d LCHS_HEADER;\n \t\t\tfor (n \u003d 0; n \u003c SIGNIFICANT_HDR_COUNT; n++)\n-\t\t\t\twsi-\u003ecgi-\u003ematch[n] \u003d 0;\n-\t\t\twsi-\u003ecgi-\u003elp \u003d 0;\n+\t\t\t\twsi-\u003ehttp.cgi-\u003ematch[n] \u003d 0;\n+\t\t\twsi-\u003ehttp.cgi-\u003elp \u003d 0;\n \t\t\tgoto hdr;\n \n \t\tcase LCHS_LF2:\n@@ -800,7 +800,7 @@ post_hpack_recode:\n \t\t\tif (c \u003d\u003d '\u005cx0a') {\n \t\t\t\tlwsl_debug(\u0022Content-Length: %lld\u005cn\u0022,\n \t\t\t\t\t(unsigned long long)\n-\t\t\t\t\twsi-\u003ecgi-\u003econtent_length);\n+\t\t\t\t\twsi-\u003ehttp.cgi-\u003econtent_length);\n \t\t\t\twsi-\u003ehdr_state \u003d LHCS_RESPONSE;\n \t\t\t\t/*\n \t\t\t\t * drop the \u005c0xa ... finalize\n@@ -812,11 +812,11 @@ post_hpack_recode:\n \t\t\t\t/* we got \u005cr\u005cn\u005cr[^\u005cn]... unreasonable */\n \t\t\t\treturn -1;\n \t\t\t/* we got \u005cx0anext header, it's reasonable */\n-\t\t\t*wsi-\u003ecgi-\u003eheaders_pos++ \u003d c;\n+\t\t\t*wsi-\u003ehttp.cgi-\u003eheaders_pos++ \u003d c;\n \t\t\twsi-\u003ehdr_state \u003d LCHS_HEADER;\n \t\t\tfor (n \u003d 0; n \u003c SIGNIFICANT_HDR_COUNT; n++)\n-\t\t\t\twsi-\u003ecgi-\u003ematch[n] \u003d 0;\n-\t\t\twsi-\u003ecgi-\u003elp \u003d 0;\n+\t\t\t\twsi-\u003ehttp.cgi-\u003ematch[n] \u003d 0;\n+\t\t\twsi-\u003ehttp.cgi-\u003elp \u003d 0;\n \t\t\tbreak;\n \t\tcase LHCS_PAYLOAD:\n \t\t\tbreak;\n@@ -830,8 +830,8 @@ agin:\n \n \t/* payload processing */\n \n-\tm \u003d !wsi-\u003ecgi-\u003eexplicitly_chunked \u0026\u0026 !wsi-\u003ecgi-\u003econtent_length;\n-\tn \u003d lws_get_socket_fd(wsi-\u003ecgi-\u003estdwsi[LWS_STDOUT]);\n+\tm \u003d !wsi-\u003ehttp.cgi-\u003eexplicitly_chunked \u0026\u0026 !wsi-\u003ehttp.cgi-\u003econtent_length;\n+\tn \u003d lws_get_socket_fd(wsi-\u003ehttp.cgi-\u003estdwsi[LWS_STDOUT]);\n \tif (n \u003c 0)\n \t\treturn -1;\n \tn \u003d read(n, start, sizeof(buf) - LWS_PRE -\n@@ -852,7 +852,7 @@ agin:\n \t\t\tn +\u003d m + 2;\n \t\t}\n \t\tcmd \u003d LWS_WRITE_HTTP;\n-\t\tif (wsi-\u003ecgi-\u003econtent_length_seen + n \u003d\u003d wsi-\u003ecgi-\u003econtent_length)\n+\t\tif (wsi-\u003ehttp.cgi-\u003econtent_length_seen + n \u003d\u003d wsi-\u003ehttp.cgi-\u003econtent_length)\n \t\t\tcmd \u003d LWS_WRITE_HTTP_FINAL;\n \t\tm \u003d lws_write(wsi, (unsigned char *)start, n, cmd);\n \t\t//lwsl_notice(\u0022write %d\u005cn\u0022, m);\n@@ -860,7 +860,7 @@ agin:\n \t\t\tlwsl_debug(\u0022%s: stdout write says %d\u005cn\u0022, __func__, m);\n \t\t\treturn -1;\n \t\t}\n-\t\twsi-\u003ecgi-\u003econtent_length_seen +\u003d n;\n+\t\twsi-\u003ehttp.cgi-\u003econtent_length_seen +\u003d n;\n \t} else {\n \t\tif (wsi-\u003ecgi_stdout_zero_length) {\n \t\t\tlwsl_debug(\u0022%s: stdout is POLLHUP'd\u005cn\u0022, __func__);\n@@ -882,20 +882,20 @@ lws_cgi_kill(struct lws *wsi)\n \n \tlwsl_debug(\u0022%s: %p\u005cn\u0022, __func__, wsi);\n \n-\tif (!wsi-\u003ecgi)\n+\tif (!wsi-\u003ehttp.cgi)\n \t\treturn 0;\n \n-\tif (wsi-\u003ecgi-\u003epid \u003e 0) {\n-\t\tn \u003d waitpid(wsi-\u003ecgi-\u003epid, \u0026status, WNOHANG);\n+\tif (wsi-\u003ehttp.cgi-\u003epid \u003e 0) {\n+\t\tn \u003d waitpid(wsi-\u003ehttp.cgi-\u003epid, \u0026status, WNOHANG);\n \t\tif (n \u003e 0) {\n \t\t\tlwsl_debug(\u0022%s: PID %d reaped\u005cn\u0022, __func__,\n-\t\t\t\t wsi-\u003ecgi-\u003epid);\n+\t\t\t\t wsi-\u003ehttp.cgi-\u003epid);\n \t\t\tgoto handled;\n \t\t}\n \t\t/* kill the process group */\n-\t\tn \u003d kill(-wsi-\u003ecgi-\u003epid, SIGTERM);\n+\t\tn \u003d kill(-wsi-\u003ehttp.cgi-\u003epid, SIGTERM);\n \t\tlwsl_debug(\u0022%s: SIGTERM child PID %d says %d (errno %d)\u005cn\u0022,\n-\t\t\t __func__, wsi-\u003ecgi-\u003epid, n, errno);\n+\t\t\t __func__, wsi-\u003ehttp.cgi-\u003epid, n, errno);\n \t\tif (n \u003c 0) {\n \t\t\t/*\n \t\t\t * hum seen errno\u003d3 when process is listed in ps,\n@@ -903,28 +903,28 @@ lws_cgi_kill(struct lws *wsi)\n \t\t\t *\n \t\t\t * Direct these fallback attempt to the exact child\n \t\t\t */\n-\t\t\tn \u003d kill(wsi-\u003ecgi-\u003epid, SIGTERM);\n+\t\t\tn \u003d kill(wsi-\u003ehttp.cgi-\u003epid, SIGTERM);\n \t\t\tif (n \u003c 0) {\n-\t\t\t\tn \u003d kill(wsi-\u003ecgi-\u003epid, SIGPIPE);\n+\t\t\t\tn \u003d kill(wsi-\u003ehttp.cgi-\u003epid, SIGPIPE);\n \t\t\t\tif (n \u003c 0) {\n-\t\t\t\t\tn \u003d kill(wsi-\u003ecgi-\u003epid, SIGKILL);\n+\t\t\t\t\tn \u003d kill(wsi-\u003ehttp.cgi-\u003epid, SIGKILL);\n \t\t\t\t\tif (n \u003c 0)\n \t\t\t\t\t\tlwsl_err(\u0022%s: SIGKILL PID %d \u0022\n \t\t\t\t\t\t\t \u0022failed errno %d \u0022\n \t\t\t\t\t\t\t \u0022(maybe zombie)\u005cn\u0022,\n \t\t\t\t\t\t\t __func__,\n-\t\t\t\t\t\t\t wsi-\u003ecgi-\u003epid, errno);\n+\t\t\t\t\t\t\t wsi-\u003ehttp.cgi-\u003epid, errno);\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\t/* He could be unkillable because he's a zombie */\n \t\tn \u003d 1;\n \t\twhile (n \u003e 0) {\n-\t\t\tn \u003d waitpid(-wsi-\u003ecgi-\u003epid, \u0026status, WNOHANG);\n+\t\t\tn \u003d waitpid(-wsi-\u003ehttp.cgi-\u003epid, \u0026status, WNOHANG);\n \t\t\tif (n \u003e 0)\n \t\t\t\tlwsl_debug(\u0022%s: reaped PID %d\u005cn\u0022, __func__, n);\n \t\t\tif (n \u003c\u003d 0) {\n-\t\t\t\tn \u003d waitpid(wsi-\u003ecgi-\u003epid, \u0026status, WNOHANG);\n+\t\t\t\tn \u003d waitpid(wsi-\u003ehttp.cgi-\u003epid, \u0026status, WNOHANG);\n \t\t\t\tif (n \u003e 0)\n \t\t\t\t\tlwsl_debug(\u0022%s: reaped PID %d\u005cn\u0022,\n \t\t\t\t\t\t __func__, n);\n@@ -933,15 +933,15 @@ lws_cgi_kill(struct lws *wsi)\n \t}\n \n handled:\n-\targs.stdwsi \u003d \u0026wsi-\u003ecgi-\u003estdwsi[0];\n+\targs.stdwsi \u003d \u0026wsi-\u003ehttp.cgi-\u003estdwsi[0];\n \n-\tif (wsi-\u003ecgi-\u003epid !\u003d -1) {\n+\tif (wsi-\u003ehttp.cgi-\u003epid !\u003d -1) {\n \t\tn \u003d user_callback_handle_rxflow(wsi-\u003eprotocol-\u003ecallback, wsi,\n \t\t\t\t\t\tLWS_CALLBACK_CGI_TERMINATED,\n \t\t\t\t\t\twsi-\u003euser_space,\n-\t\t\t\t\t\t(void *)\u0026args, wsi-\u003ecgi-\u003epid);\n-\t\twsi-\u003ecgi-\u003epid \u003d -1;\n-\t\tif (n \u0026\u0026 !wsi-\u003ecgi-\u003ebeing_closed)\n+\t\t\t\t\t\t(void *)\u0026args, wsi-\u003ehttp.cgi-\u003epid);\n+\t\twsi-\u003ehttp.cgi-\u003epid \u003d -1;\n+\t\tif (n \u0026\u0026 !wsi-\u003ehttp.cgi-\u003ebeing_closed)\n \t\t\tlws_close_free_wsi(wsi, 0, \u0022lws_cgi_kill\u0022);\n \t}\n \n@@ -1085,10 +1085,10 @@ finish_him:\n LWS_VISIBLE LWS_EXTERN struct lws *\n lws_cgi_get_stdwsi(struct lws *wsi, enum lws_enum_stdinouterr ch)\n {\n-\tif (!wsi-\u003ecgi)\n+\tif (!wsi-\u003ehttp.cgi)\n \t\treturn NULL;\n \n-\treturn wsi-\u003ecgi-\u003estdwsi[ch];\n+\treturn wsi-\u003ehttp.cgi-\u003estdwsi[ch];\n }\n \n void\n@@ -1098,20 +1098,20 @@ lws_cgi_remove_and_kill(struct lws *wsi)\n \tstruct lws_cgi **pcgi \u003d \u0026pt-\u003ehttp.cgi_list;\n \n \t/* remove us from the cgi list */\n-\tlwsl_debug(\u0022%s: remove cgi %p from list\u005cn\u0022, __func__, wsi-\u003ecgi);\n+\tlwsl_debug(\u0022%s: remove cgi %p from list\u005cn\u0022, __func__, wsi-\u003ehttp.cgi);\n \twhile (*pcgi) {\n-\t\tif (*pcgi \u003d\u003d wsi-\u003ecgi) {\n+\t\tif (*pcgi \u003d\u003d wsi-\u003ehttp.cgi) {\n \t\t\t/* drop us from the pt cgi list */\n \t\t\t*pcgi \u003d (*pcgi)-\u003ecgi_list;\n \t\t\tbreak;\n \t\t}\n \t\tpcgi \u003d \u0026(*pcgi)-\u003ecgi_list;\n \t}\n-\tif (wsi-\u003ecgi-\u003eheaders_buf) {\n+\tif (wsi-\u003ehttp.cgi-\u003eheaders_buf) {\n \t\tlwsl_debug(\u0022close: freed cgi headers\u005cn\u0022);\n-\t\tlws_free_set_NULL(wsi-\u003ecgi-\u003eheaders_buf);\n+\t\tlws_free_set_NULL(wsi-\u003ehttp.cgi-\u003eheaders_buf);\n \t}\n \t/* we have a cgi going, we must kill it */\n-\twsi-\u003ecgi-\u003ebeing_closed \u003d 1;\n+\twsi-\u003ehttp.cgi-\u003ebeing_closed \u003d 1;\n \tlws_cgi_kill(wsi);\n }\ndiff --git a/lib/roles/cgi/ops-cgi.c b/lib/roles/cgi/ops-cgi.c\nindex d113fbf..546d294 100644\n--- a/lib/roles/cgi/ops-cgi.c\n+++ b/lib/roles/cgi/ops-cgi.c\n@@ -44,7 +44,7 @@ rops_handle_POLLIN_cgi(struct lws_context_per_thread *pt, struct lws *wsi,\n \t}\n \n \targs.ch \u003d wsi-\u003ecgi_channel;\n-\targs.stdwsi \u003d \u0026wsi-\u003eparent-\u003ecgi-\u003estdwsi[0];\n+\targs.stdwsi \u003d \u0026wsi-\u003eparent-\u003ehttp.cgi-\u003estdwsi[0];\n \targs.hdr_state \u003d wsi-\u003ehdr_state;\n \n \tlwsl_debug(\u0022CGI LWS_STDOUT %p wsistate 0x%x\u005cn\u0022,\ndiff --git a/lib/roles/h1/ops-h1.c b/lib/roles/h1/ops-h1.c\nindex 5fa929a..a5611f8 100644\n--- a/lib/roles/h1/ops-h1.c\n+++ b/lib/roles/h1/ops-h1.c\n@@ -128,11 +128,11 @@ http_postbody:\n \t\t\twsi-\u003ehttp.rx_content_remain -\u003d body_chunk_len;\n \t\t\tlen -\u003d body_chunk_len;\n #ifdef LWS_WITH_CGI\n-\t\t\tif (wsi-\u003ecgi) {\n+\t\t\tif (wsi-\u003ehttp.cgi) {\n \t\t\t\tstruct lws_cgi_args args;\n \n \t\t\t\targs.ch \u003d LWS_STDIN;\n-\t\t\t\targs.stdwsi \u003d \u0026wsi-\u003ecgi-\u003estdwsi[0];\n+\t\t\t\targs.stdwsi \u003d \u0026wsi-\u003ehttp.cgi-\u003estdwsi[0];\n \t\t\t\targs.data \u003d buf;\n \t\t\t\targs.len \u003d body_chunk_len;\n \n@@ -169,14 +169,14 @@ postbody_completion:\n \t\t\t * If we're running a cgi, we can't let him off the\n \t\t\t * hook just because he sent his POST data\n \t\t\t */\n-\t\t\tif (wsi-\u003ecgi)\n+\t\t\tif (wsi-\u003ehttp.cgi)\n \t\t\t\tlws_set_timeout(wsi, PENDING_TIMEOUT_CGI,\n \t\t\t\t\t\twsi-\u003econtext-\u003etimeout_secs);\n \t\t\telse\n #endif\n \t\t\tlws_set_timeout(wsi, NO_PENDING_TIMEOUT, 0);\n #ifdef LWS_WITH_CGI\n-\t\t\tif (!wsi-\u003ecgi)\n+\t\t\tif (!wsi-\u003ehttp.cgi)\n #endif\n \t\t\t{\n \t\t\t\tlwsl_info(\u0022HTTP_BODY_COMPLETION: %p (%s)\u005cn\u0022,\n@@ -478,7 +478,7 @@ rops_handle_POLLIN_h1(struct lws_context_per_thread *pt, struct lws *wsi,\n //\t\t\twsi-\u003ewsistate, wsi-\u003erole_ops-\u003ename, pollfd-\u003erevents);\n \n #ifdef LWS_WITH_CGI\n-\tif (wsi-\u003ecgi \u0026\u0026 (pollfd-\u003erevents \u0026 LWS_POLLOUT)) {\n+\tif (wsi-\u003ehttp.cgi \u0026\u0026 (pollfd-\u003erevents \u0026 LWS_POLLOUT)) {\n \t\tif (lws_handle_POLLOUT_event(wsi, pollfd))\n \t\t\treturn LWS_HPI_RET_PLEASE_CLOSE_ME;\n \ndiff --git a/lib/roles/h2/ops-h2.c b/lib/roles/h2/ops-h2.c\nindex 8aeb167..93c5b7f 100644\n--- a/lib/roles/h2/ops-h2.c\n+++ b/lib/roles/h2/ops-h2.c\n@@ -98,7 +98,7 @@ rops_handle_POLLIN_h2(struct lws_context_per_thread *pt, struct lws *wsi,\n \tint n, m;\n \n #ifdef LWS_WITH_CGI\n-\tif (wsi-\u003ecgi \u0026\u0026 (pollfd-\u003erevents \u0026 LWS_POLLOUT)) {\n+\tif (wsi-\u003ehttp.cgi \u0026\u0026 (pollfd-\u003erevents \u0026 LWS_POLLOUT)) {\n \t\tif (lws_handle_POLLOUT_event(wsi, pollfd))\n \t\t\treturn LWS_HPI_RET_PLEASE_CLOSE_ME;\n \ndiff --git a/lib/roles/http/client/client-handshake.c b/lib/roles/http/client/client-handshake.c\nindex b2137df..7edf3cc 100644\n--- a/lib/roles/http/client/client-handshake.c\n+++ b/lib/roles/http/client/client-handshake.c\n@@ -28,16 +28,20 @@ lws_getaddrinfo46(struct lws *wsi, const char *ads, struct addrinfo **result)\n struct lws *\n lws_client_connect_2(struct lws *wsi)\n {\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \tstruct lws_context *context \u003d wsi-\u003econtext;\n \tstruct lws_context_per_thread *pt \u003d \u0026context-\u003ept[(int)wsi-\u003etsi];\n-\tconst char *cce \u003d \u0022\u0022, *iface, *adsin, *meth;\n+\tconst char *adsin;\n \tstruct lws *wsi_piggyback \u003d NULL;\n-\tstruct addrinfo *result;\n \tstruct lws_pollfd pfd;\n \tssize_t plen \u003d 0;\n+#endif\n+\tstruct addrinfo *result;\n \tconst char *ads;\n \tsockaddr46 sa46;\n \tint n, port;\n+\tconst char *cce \u003d \u0022\u0022, *iface;\n+\tconst char *meth \u003d NULL;\n #ifdef LWS_WITH_IPV6\n \tchar ipv6only \u003d lws_check_opt(wsi-\u003evhost-\u003eoptions,\n \t\t\tLWS_SERVER_OPTION_IPV6_V6ONLY_MODIFY |\n@@ -50,13 +54,14 @@ lws_client_connect_2(struct lws *wsi)\n \n \tlwsl_client(\u0022%s: %p\u005cn\u0022, __func__, wsi);\n \n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \tif (!wsi-\u003ehttp.ah) {\n \t\tcce \u003d \u0022ah was NULL at cc2\u0022;\n \t\tlwsl_err(\u0022%s\u005cn\u0022, cce);\n \t\tgoto oom4;\n \t}\n \n-\t/* we can only piggyback GET */\n+\t/* we can only piggyback GET or POST */\n \n \tmeth \u003d lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_METHOD);\n \tif (meth \u0026\u0026 strcmp(meth, \u0022GET\u0022) \u0026\u0026 strcmp(meth, \u0022POST\u0022))\n@@ -142,6 +147,7 @@ lws_client_connect_2(struct lws *wsi)\n \tlws_vhost_unlock(wsi-\u003evhost);\n \n create_new_conn:\n+#endif\n \n \t/*\n \t * clients who will create their own fresh connection keep a copy of\n@@ -176,6 +182,8 @@ create_new_conn:\n \t */\n \twsi-\u003eipv6 \u003d LWS_IPV6_ENABLED(wsi-\u003evhost);\n \n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n+\n \t/* Decide what it is we need to connect to:\n \t *\n \t * Priority 1: connect to http proxy */\n@@ -195,6 +203,9 @@ create_new_conn:\n \t\tplen +\u003d sprintf((char *)pt-\u003eserv_buf + plen, \u0022\u005cx0d\u005cx0a\u0022);\n \t\tads \u003d wsi-\u003evhost-\u003ehttp.http_proxy_address;\n \t\tport \u003d wsi-\u003evhost-\u003ehttp.http_proxy_port;\n+#else\n+\t\tif (0) {\n+#endif\n \n #if defined(LWS_WITH_SOCKS5)\n \n@@ -328,7 +339,7 @@ create_new_conn:\n \tif (!lws_socket_is_valid(wsi-\u003edesc.sockfd)) {\n \n #if defined(LWS_WITH_LIBUV)\n-\t\tif (LWS_LIBUV_ENABLED(context))\n+\t\tif (LWS_LIBUV_ENABLED(wsi-\u003econtext))\n \t\t\tif (lws_libuv_check_watcher_active(wsi)) {\n \t\t\t\tlwsl_warn(\u0022Waiting for libuv watcher to close\u005cn\u0022);\n \t\t\t\tcce \u003d \u0022waiting for libuv watcher to close\u0022;\n@@ -362,7 +373,7 @@ create_new_conn:\n \t\tlws_libuv_accept(wsi, wsi-\u003edesc);\n \t\tlws_libevent_accept(wsi, wsi-\u003edesc);\n \n-\t\tif (__insert_wsi_socket_into_fds(context, wsi)) {\n+\t\tif (__insert_wsi_socket_into_fds(wsi-\u003econtext, wsi)) {\n \t\t\tcompatible_close(wsi-\u003edesc.sockfd);\n \t\t\tcce \u003d \u0022insert wsi failed\u0022;\n \t\t\tgoto oom4;\n@@ -444,6 +455,7 @@ create_new_conn:\n \n \tlwsl_client(\u0022connected\u005cn\u0022);\n \n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \t/* we are connected to server, or proxy */\n \n \t/* http proxy */\n@@ -475,6 +487,7 @@ create_new_conn:\n \n \t\treturn wsi;\n \t}\n+#endif\n #if defined(LWS_WITH_SOCKS5)\n \t/* socks proxy */\n \telse if (wsi-\u003evhost-\u003esocks_proxy_port) {\n@@ -494,8 +507,9 @@ create_new_conn:\n \t\treturn wsi;\n \t}\n #endif\n-\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n send_hs:\n+\n \tif (wsi_piggyback \u0026\u0026\n \t !lws_dll_is_null(\u0026wsi-\u003edll_client_transaction_queue)) {\n \t\t/*\n@@ -548,7 +562,7 @@ send_hs:\n \t\tif (n) /* returns 1 on failure after closing wsi */\n \t\t\treturn NULL;\n \t}\n-\n+#endif\n \treturn wsi;\n \n oom4:\n@@ -562,7 +576,9 @@ oom4:\n \tif (wsi-\u003eposition_in_fds_table !\u003d -1)\n \t\tgoto failed1;\n \tlws_remove_from_timeout_list(wsi);\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \tlws_header_table_detach(wsi, 0);\n+#endif\n \tlws_client_stash_destroy(wsi);\n \tlws_free_set_NULL(wsi-\u003eclient_hostname_copy);\n \tlws_free(wsi);\n@@ -580,6 +596,8 @@ failed1:\n \treturn NULL;\n }\n \n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n+\n /**\n * lws_client_reset() - retarget a connected wsi to start over with a new connection (ie, redirect)\n *\t\t\tthis only works if still in HTTP, ie, not upgraded yet\n@@ -833,6 +851,8 @@ html_parser_cb(const hubbub_token *token, void *pw)\n }\n #endif\n \n+#endif\n+\n static char *\n lws_strdup(const char *s)\n {\n@@ -891,7 +911,7 @@ lws_client_connect_via_info(struct lws_client_connect_info *i)\n \t/* assert the mode and union status (hdr) clearly */\n \tlws_role_transition(wsi, LWSIFR_CLIENT, LRS_UNCONNECTED, \u0026role_ops_h1);\n #else\n-\tlws_role_transition(wsi, LWSIFR_CLIENT, LRS_UNCONNECTED, \u0026role_ops_raw);\n+\tlws_role_transition(wsi, LWSIFR_CLIENT, LRS_UNCONNECTED, \u0026role_ops_raw_skt);\n #endif\n \twsi-\u003edesc.sockfd \u003d LWS_SOCK_INVALID;\n \n@@ -926,7 +946,12 @@ lws_client_connect_via_info(struct lws_client_connect_info *i)\n \twsi-\u003eclient_pipeline \u003d !!(i-\u003essl_connection \u0026 LCCSCF_PIPELINE);\n \n \t/* reasonable place to start */\n-\tlws_role_transition(wsi, LWSIFR_CLIENT, LRS_UNCONNECTED, \u0026role_ops_h1);\n+\tlws_role_transition(wsi, LWSIFR_CLIENT, LRS_UNCONNECTED,\n+#if defined(LWS_ROLE_H1)\n+\t\t\t\u0026role_ops_h1);\n+#else\n+\t\u0026role_ops_raw_skt);\n+#endif\n \n \t/*\n \t * 1) for http[s] connection, allow protocol selection by name\n@@ -1027,6 +1052,7 @@ lws_client_connect_via_info(struct lws_client_connect_info *i)\n \tif (i-\u003epwsi)\n \t\t*i-\u003epwsi \u003d wsi;\n \n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \t/* if we went on the waiting list, no probs just return the wsi\n \t * when we get the ah, now or later, he will call\n \t * lws_client_connect_via_info2() below.\n@@ -1039,6 +1065,8 @@ lws_client_connect_via_info(struct lws_client_connect_info *i)\n \t\tgoto bail2;\n \t}\n \n+#endif\n+\n \tif (i-\u003eparent_wsi) {\n \t\tlwsl_info(\u0022%s: created child %p of parent %p\u005cn\u0022, __func__,\n \t\t\t\twsi, i-\u003eparent_wsi);\n@@ -1060,8 +1088,9 @@ bail1:\n \n bail:\n \tlws_free(wsi);\n-\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n bail2:\n+#endif\n \tif (i-\u003epwsi)\n \t\t*i-\u003epwsi \u003d NULL;\n \ndiff --git a/lib/roles/http/client/client.c b/lib/roles/http/client/client.c\nindex 130766a..1a1a27c 100644\n--- a/lib/roles/http/client/client.c\n+++ b/lib/roles/http/client/client.c\n@@ -84,10 +84,12 @@ lws_client_socket_service(struct lws *wsi, struct lws_pollfd *pollfd,\n \tchar ebuf[128];\n #endif\n \tconst char *cce \u003d NULL;\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n+\tssize_t len \u003d 0;\n \tunsigned char c;\n+#endif\n \tchar *sb \u003d p;\n \tint n \u003d 0;\n-\tssize_t len \u003d 0;\n #if defined(LWS_WITH_SOCKS5)\n \tchar conn_mode \u003d 0, pending_timeout \u003d 0;\n #endif\n@@ -404,11 +406,12 @@ start_ws_handshake:\n \t\tif (lwsi_state(w) \u003d\u003d LRS_IDLING) {\n \t\t\tlwsi_set_state(w, LRS_WAITING_SERVER_REPLY);\n \t\t\tw-\u003ehdr_parsing_completed \u003d 0;\n-\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \t\t\tw-\u003ehttp.ah-\u003eparser_state \u003d WSI_TOKEN_NAME_PART;\n \t\t\tw-\u003ehttp.ah-\u003elextable_pos \u003d 0;\n \t\t\t/* If we're (re)starting on headers, need other implied init */\n \t\t\twsi-\u003ehttp.ah-\u003eues \u003d URIES_IDLE;\n+#endif\n \t\t}\n \n \t\tlws_set_timeout(wsi, PENDING_TIMEOUT_AWAITING_SERVER_RESPONSE,\n@@ -427,9 +430,11 @@ start_ws_handshake:\n \t\t\tbreak;\n \t\t}\n client_http_body_sent:\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \t\t/* prepare ourselves to do the parsing */\n \t\twsi-\u003ehttp.ah-\u003eparser_state \u003d WSI_TOKEN_NAME_PART;\n \t\twsi-\u003ehttp.ah-\u003elextable_pos \u003d 0;\n+#endif\n \t\tlwsi_set_state(wsi, LRS_WAITING_SERVER_REPLY);\n \t\tlws_set_timeout(wsi, PENDING_TIMEOUT_AWAITING_SERVER_RESPONSE,\n \t\t\t\tcontext-\u003etimeout_secs);\n@@ -452,6 +457,7 @@ client_http_body_sent:\n \t\tif (!(pollfd-\u003erevents \u0026 LWS_POLLIN))\n \t\t\tbreak;\n \n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \t\t/* interpret the server response\n \t\t *\n \t\t * HTTP/1.1 101 Switching Protocols\n@@ -499,7 +505,7 @@ client_http_body_sent:\n \t\tif (wsi-\u003ehttp.ah-\u003eparser_state !\u003d WSI_PARSING_COMPLETE)\n \t\t\tbreak;\n \n-\n+#endif\n \n \t\t/*\n \t\t * otherwise deal with the handshake. If there's any\n@@ -526,7 +532,7 @@ bail3:\n \treturn 0;\n }\n \n-\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \n int LWS_WARN_UNUSED_RESULT\n lws_http_transaction_completed_client(struct lws *wsi)\n@@ -622,6 +628,7 @@ lws_http_client_http_response(struct lws *wsi)\n \n \treturn wsi-\u003ehttp.ah-\u003ehttp_response;\n }\n+#endif\n #if defined(LWS_PLAT_OPTEE)\n char *\n strrchr(const char *s, int c)\n@@ -638,6 +645,7 @@ strrchr(const char *s, int c)\n #define atoll atoi\n #endif\n \n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n int\n lws_client_interpret_server_handshake(struct lws *wsi)\n {\n@@ -663,9 +671,15 @@ lws_client_interpret_server_handshake(struct lws *wsi)\n \t\t} else\n #endif\n \t\t{\n+#if defined(LWS_ROLE_H1)\n+\t\t\t{\n \t\t\tlwsl_debug(\u0022%s: %p: transitioning to h1 client\u005cn\u0022, __func__, wsi);\n \t\t\tlws_role_transition(wsi, LWSIFR_CLIENT,\n \t\t\t\t\t LRS_ESTABLISHED, \u0026role_ops_h1);\n+\t\t\t}\n+#else\n+\t\t\treturn -1;\n+#endif\n \t\t}\n \n \t\twsi-\u003ehttp.ah \u003d ah;\n@@ -826,7 +840,15 @@ lws_client_interpret_server_handshake(struct lws *wsi)\n \t\t\t\t\t/* go back to \u0022trying to connect\u0022 state */\n \t\t\t\t\tlws_role_transition(ww, LWSIFR_CLIENT,\n \t\t\t\t\t\t\t LRS_UNCONNECTED,\n+#if defined(LWS_ROLE_H1)\n \t\t\t\t\t\t\t \u0026role_ops_h1);\n+#else\n+#if defined (LWS_ROLE_H2)\n+\t\t\t\t\t\t\t \u0026role_ops_h2);\n+#else\n+\t\t\t\t\t\t\t \u0026role_ops_raw);\n+#endif\n+#endif\n \t\t\t\t\tww-\u003euser_space \u003d NULL;\n \t\t\t\t} lws_end_foreach_dll_safe(d, d1);\n \t\t\t\tlws_vhost_unlock(wsi-\u003evhost);\n@@ -948,7 +970,7 @@ bail2:\n \n \treturn 1;\n }\n-\n+#endif\n \n char *\n lws_generate_client_handshake(struct lws *wsi, char *pkt)\n@@ -1045,6 +1067,8 @@ lws_generate_client_handshake(struct lws *wsi, char *pkt)\n \treturn p;\n }\n \n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n+\n LWS_VISIBLE int\n lws_http_client_read(struct lws *wsi, char **buf, int *len)\n {\n@@ -1195,3 +1219,5 @@ completed:\n \n \treturn 0;\n }\n+\n+#endif\n\u005c No newline at end of file\ndiff --git a/lib/roles/http/header.c b/lib/roles/http/header.c\nindex a201c97..eef5fde 100644\n--- a/lib/roles/http/header.c\n+++ b/lib/roles/http/header.c\n@@ -200,7 +200,7 @@ lws_add_http_header_status(struct lws *wsi, unsigned int _code,\n \tint n;\n \n #ifdef LWS_WITH_ACCESS_LOG\n-\twsi-\u003eaccess_log.response \u003d code;\n+\twsi-\u003ehttp.access_log.response \u003d code;\n #endif\n \n #ifdef LWS_WITH_HTTP2\ndiff --git a/lib/roles/http/private.h b/lib/roles/http/private.h\nindex e8519bd..2411ec8 100644\n--- a/lib/roles/http/private.h\n+++ b/lib/roles/http/private.h\n@@ -182,6 +182,16 @@ struct lws_vhost_role_http {\n \tunsigned int http_proxy_port;\n };\n \n+#ifdef LWS_WITH_ACCESS_LOG\n+struct lws_access_log {\n+\tchar *header_log;\n+\tchar *user_agent;\n+\tchar *referrer;\n+\tunsigned long sent;\n+\tint response;\n+};\n+#endif\n+\n struct _lws_http_mode_related {\n \tstruct lws *new_wsi_list;\n \n@@ -200,6 +210,13 @@ struct _lws_http_mode_related {\n \tchar multipart_content_type[64];\n #endif\n \n+#ifdef LWS_WITH_ACCESS_LOG\n+\tstruct lws_access_log access_log;\n+#endif\n+#ifdef LWS_WITH_CGI\n+\tstruct lws_cgi *cgi; /* wsi being cgi master have one of these */\n+#endif\n+\n \tenum http_version request_version;\n \tenum http_connection_type connection_type;\n \tlws_filepos_t tx_content_length;\n@@ -230,15 +247,11 @@ enum lws_parse_urldecode_results {\n \tLPUR_EXCESSIVE,\n };\n \n-struct lws_rewrite;\n+int\n+lws_read_h1(struct lws *wsi, unsigned char *buf, lws_filepos_t len);\n \n-#ifdef LWS_WITH_ACCESS_LOG\n-struct lws_access_log {\n-\tchar *header_log;\n-\tchar *user_agent;\n-\tchar *referrer;\n-\tunsigned long sent;\n-\tint response;\n-};\n-#endif\n+void\n+_lws_header_table_reset(struct allocated_headers *ah);\n \n+LWS_EXTERN int\n+_lws_destroy_ah(struct lws_context_per_thread *pt, struct allocated_headers *ah);\ndiff --git a/lib/roles/http/server/access-log.c b/lib/roles/http/server/access-log.c\nindex a4e30fe..c07e557 100644\n--- a/lib/roles/http/server/access-log.c\n+++ b/lib/roles/http/server/access-log.c\n@@ -61,8 +61,8 @@ lws_prepare_access_log_info(struct lws *wsi, char *uri_ptr, int meth)\n \tif (wsi-\u003eaccess_log_pending)\n \t\tlws_access_log(wsi);\n \n-\twsi-\u003eaccess_log.header_log \u003d lws_malloc(l, \u0022access log\u0022);\n-\tif (wsi-\u003eaccess_log.header_log) {\n+\twsi-\u003ehttp.access_log.header_log \u003d lws_malloc(l, \u0022access log\u0022);\n+\tif (wsi-\u003ehttp.access_log.header_log) {\n \n \t\ttmp \u003d localtime(\u0026t);\n \t\tif (tmp)\n@@ -81,42 +81,42 @@ lws_prepare_access_log_info(struct lws *wsi, char *uri_ptr, int meth)\n \t\tif (!me)\n \t\t\tme \u003d \u0022(null)\u0022;\n \n-\t\tlws_snprintf(wsi-\u003eaccess_log.header_log, l,\n+\t\tlws_snprintf(wsi-\u003ehttp.access_log.header_log, l,\n \t\t\t \u0022%s - - [%s] \u005c\u0022%s %s %s\u005c\u0022\u0022,\n \t\t\t pa, da, me, uri_ptr,\n \t\t\t hver[wsi-\u003ehttp.request_version]);\n \n \t\tl \u003d lws_hdr_total_length(wsi, WSI_TOKEN_HTTP_USER_AGENT);\n \t\tif (l) {\n-\t\t\twsi-\u003eaccess_log.user_agent \u003d lws_malloc(l + 2, \u0022access log\u0022);\n-\t\t\tif (!wsi-\u003eaccess_log.user_agent) {\n+\t\t\twsi-\u003ehttp.access_log.user_agent \u003d lws_malloc(l + 2, \u0022access log\u0022);\n+\t\t\tif (!wsi-\u003ehttp.access_log.user_agent) {\n \t\t\t\tlwsl_err(\u0022OOM getting user agent\u005cn\u0022);\n-\t\t\t\tlws_free_set_NULL(wsi-\u003eaccess_log.header_log);\n+\t\t\t\tlws_free_set_NULL(wsi-\u003ehttp.access_log.header_log);\n \t\t\t\treturn;\n \t\t\t}\n \n-\t\t\tlws_hdr_copy(wsi, wsi-\u003eaccess_log.user_agent,\n+\t\t\tlws_hdr_copy(wsi, wsi-\u003ehttp.access_log.user_agent,\n \t\t\t\t\tl + 1, WSI_TOKEN_HTTP_USER_AGENT);\n \n \t\t\tfor (m \u003d 0; m \u003c l; m++)\n-\t\t\t\tif (wsi-\u003eaccess_log.user_agent[m] \u003d\u003d '\u005c\u0022')\n-\t\t\t\t\twsi-\u003eaccess_log.user_agent[m] \u003d '\u005c'';\n+\t\t\t\tif (wsi-\u003ehttp.access_log.user_agent[m] \u003d\u003d '\u005c\u0022')\n+\t\t\t\t\twsi-\u003ehttp.access_log.user_agent[m] \u003d '\u005c'';\n \t\t}\n \t\tl \u003d lws_hdr_total_length(wsi, WSI_TOKEN_HTTP_REFERER);\n \t\tif (l) {\n-\t\t\twsi-\u003eaccess_log.referrer \u003d lws_malloc(l + 2, \u0022referrer\u0022);\n-\t\t\tif (!wsi-\u003eaccess_log.referrer) {\n+\t\t\twsi-\u003ehttp.access_log.referrer \u003d lws_malloc(l + 2, \u0022referrer\u0022);\n+\t\t\tif (!wsi-\u003ehttp.access_log.referrer) {\n \t\t\t\tlwsl_err(\u0022OOM getting user agent\u005cn\u0022);\n-\t\t\t\tlws_free_set_NULL(wsi-\u003eaccess_log.user_agent);\n-\t\t\t\tlws_free_set_NULL(wsi-\u003eaccess_log.header_log);\n+\t\t\t\tlws_free_set_NULL(wsi-\u003ehttp.access_log.user_agent);\n+\t\t\t\tlws_free_set_NULL(wsi-\u003ehttp.access_log.header_log);\n \t\t\t\treturn;\n \t\t\t}\n-\t\t\tlws_hdr_copy(wsi, wsi-\u003eaccess_log.referrer,\n+\t\t\tlws_hdr_copy(wsi, wsi-\u003ehttp.access_log.referrer,\n \t\t\t\t\tl + 1, WSI_TOKEN_HTTP_REFERER);\n \n \t\t\tfor (m \u003d 0; m \u003c l; m++)\n-\t\t\t\tif (wsi-\u003eaccess_log.referrer[m] \u003d\u003d '\u005c\u0022')\n-\t\t\t\t\twsi-\u003eaccess_log.referrer[m] \u003d '\u005c'';\n+\t\t\t\tif (wsi-\u003ehttp.access_log.referrer[m] \u003d\u003d '\u005c\u0022')\n+\t\t\t\t\twsi-\u003ehttp.access_log.referrer[m] \u003d '\u005c'';\n \t\t}\n \t\twsi-\u003eaccess_log_pending \u003d 1;\n \t}\n@@ -126,8 +126,8 @@ lws_prepare_access_log_info(struct lws *wsi, char *uri_ptr, int meth)\n int\n lws_access_log(struct lws *wsi)\n {\n-\tchar *p \u003d wsi-\u003eaccess_log.user_agent, ass[512],\n-\t *p1 \u003d wsi-\u003eaccess_log.referrer;\n+\tchar *p \u003d wsi-\u003ehttp.access_log.user_agent, ass[512],\n+\t *p1 \u003d wsi-\u003ehttp.access_log.referrer;\n \tint l;\n \n \tif (!wsi-\u003evhost)\n@@ -139,7 +139,7 @@ lws_access_log(struct lws *wsi)\n \tif (!wsi-\u003eaccess_log_pending)\n \t\treturn 0;\n \n-\tif (!wsi-\u003eaccess_log.header_log)\n+\tif (!wsi-\u003ehttp.access_log.header_log)\n \t\treturn 0;\n \n \tif (!p)\n@@ -154,8 +154,8 @@ lws_access_log(struct lws *wsi)\n \t * maintaining the structure of the log text\n \t */\n \tl \u003d lws_snprintf(ass, sizeof(ass) - 7, \u0022%s %d %lu \u005c\u0022%s\u0022,\n-\t\t wsi-\u003eaccess_log.header_log,\n-\t\t wsi-\u003eaccess_log.response, wsi-\u003eaccess_log.sent, p1);\n+\t\t wsi-\u003ehttp.access_log.header_log,\n+\t\t wsi-\u003ehttp.access_log.response, wsi-\u003ehttp.access_log.sent, p1);\n \tif (strlen(p) \u003e sizeof(ass) - 6 - l)\n \t\tp[sizeof(ass) - 6 - l] \u003d '\u005c0';\n \tl +\u003d lws_snprintf(ass + l, sizeof(ass) - 1 - l, \u0022\u005c\u0022 \u005c\u0022%s\u005c\u0022\u005cn\u0022, p);\n@@ -163,17 +163,17 @@ lws_access_log(struct lws *wsi)\n \tif (write(wsi-\u003evhost-\u003elog_fd, ass, l) !\u003d l)\n \t\tlwsl_err(\u0022Failed to write log\u005cn\u0022);\n \n-\tif (wsi-\u003eaccess_log.header_log) {\n-\t\tlws_free(wsi-\u003eaccess_log.header_log);\n-\t\twsi-\u003eaccess_log.header_log \u003d NULL;\n+\tif (wsi-\u003ehttp.access_log.header_log) {\n+\t\tlws_free(wsi-\u003ehttp.access_log.header_log);\n+\t\twsi-\u003ehttp.access_log.header_log \u003d NULL;\n \t}\n-\tif (wsi-\u003eaccess_log.user_agent) {\n-\t\tlws_free(wsi-\u003eaccess_log.user_agent);\n-\t\twsi-\u003eaccess_log.user_agent \u003d NULL;\n+\tif (wsi-\u003ehttp.access_log.user_agent) {\n+\t\tlws_free(wsi-\u003ehttp.access_log.user_agent);\n+\t\twsi-\u003ehttp.access_log.user_agent \u003d NULL;\n \t}\n-\tif (wsi-\u003eaccess_log.referrer) {\n-\t\tlws_free(wsi-\u003eaccess_log.referrer);\n-\t\twsi-\u003eaccess_log.referrer \u003d NULL;\n+\tif (wsi-\u003ehttp.access_log.referrer) {\n+\t\tlws_free(wsi-\u003ehttp.access_log.referrer);\n+\t\twsi-\u003ehttp.access_log.referrer \u003d NULL;\n \t}\n \twsi-\u003eaccess_log_pending \u003d 0;\n \ndiff --git a/lib/roles/http/server/parsers.c b/lib/roles/http/server/parsers.c\nindex c9ee323..21d44db 100644\n--- a/lib/roles/http/server/parsers.c\n+++ b/lib/roles/http/server/parsers.c\n@@ -586,20 +586,6 @@ lws_hdr_simple_create(struct lws *wsi, enum lws_token_indexes h, const char *s)\n \treturn 0;\n }\n \n-signed char char_to_hex(const char c)\n-{\n-\tif (c \u003e\u003d '0' \u0026\u0026 c \u003c\u003d '9')\n-\t\treturn c - '0';\n-\n-\tif (c \u003e\u003d 'a' \u0026\u0026 c \u003c\u003d 'f')\n-\t\treturn c - 'a' + 10;\n-\n-\tif (c \u003e\u003d 'A' \u0026\u0026 c \u003c\u003d 'F')\n-\t\treturn c - 'A' + 10;\n-\n-\treturn -1;\n-}\n-\n static int LWS_WARN_UNUSED_RESULT\n issue_char(struct lws *wsi, unsigned char c)\n {\ndiff --git a/lib/roles/http/server/server.c b/lib/roles/http/server/server.c\nindex 5c819cd..689ae29 100644\n--- a/lib/roles/http/server/server.c\n+++ b/lib/roles/http/server/server.c\n@@ -1749,7 +1749,7 @@ lws_http_transaction_completed(struct lws *wsi)\n \twsi-\u003ehttp.tx_content_remain \u003d 0;\n \twsi-\u003ehdr_parsing_completed \u003d 0;\n #ifdef LWS_WITH_ACCESS_LOG\n-\twsi-\u003eaccess_log.sent \u003d 0;\n+\twsi-\u003ehttp.access_log.sent \u003d 0;\n #endif\n \n \tif (wsi-\u003evhost-\u003ekeepalive_timeout)\n@@ -1905,12 +1905,15 @@ lws_adopt_descriptor_vhost(struct lws_vhost *vh, lws_adoption_type type,\n }\n #endif\n \t} else\n+#if defined(LWS_ROLE_H1)\n \t\tif (type \u0026 LWS_ADOPT_HTTP) {/* he will transition later */\n \t\t\tnew_wsi-\u003eprotocol \u003d\n \t\t\t\t\u0026vh-\u003eprotocols[vh-\u003edefault_protocol_index];\n \t\t\tnew_wsi-\u003erole_ops \u003d \u0026role_ops_h1;\n \t\t}\n-\t\telse { /* this is the only time he will transition */\n+\t\telse\n+#endif\n+\t\t{ /* this is the only time he will transition */\n \t\t\tlws_bind_protocol(new_wsi,\n \t\t\t\t\u0026vh-\u003eprotocols[vh-\u003eraw_protocol_index]);\n \t\t\tlws_role_transition(new_wsi, 0, LRS_ESTABLISHED,\n@@ -1964,18 +1967,22 @@ lws_adopt_descriptor_vhost(struct lws_vhost *vh, lws_adoption_type type,\n \t\t\telse\n \t\t\t\tlws_role_transition(new_wsi, 0, LRS_UNCONNECTED,\n \t\t\t\t\t\t \u0026role_ops_raw_skt);\n-\t\t} else\n+\t\t}\n+#if defined(LWS_ROLE_H1)\n+\t\telse\n \t\t\tlws_role_transition(new_wsi, LWSIFR_SERVER,\n \t\t\t\t\t LRS_HEADERS, \u0026role_ops_h1);\n+#endif\n \t} else {\n \t\t/* SSL */\n \t\tif (!(type \u0026 LWS_ADOPT_HTTP))\n \t\t\tlws_role_transition(new_wsi, 0, LRS_SSL_INIT,\n \t\t\t\t\t \u0026role_ops_raw_skt);\n+#if defined(LWS_ROLE_H1)\n \t\telse\n \t\t\tlws_role_transition(new_wsi, LWSIFR_SERVER,\n \t\t\t\t\t LRS_SSL_INIT, \u0026role_ops_h1);\n-\n+#endif\n \t\tssl \u003d 1;\n \t}\n \ndiff --git a/lib/roles/ws/private.h b/lib/roles/ws/private.h\nindex 1662ec4..82eb84b 100644\n--- a/lib/roles/ws/private.h\n+++ b/lib/roles/ws/private.h\n@@ -155,3 +155,10 @@ LWS_EXTERN int\n lws_ext_cb_all_exts(struct lws_context *context, struct lws *wsi, int reason,\n \t\t void *arg, int len);\n #endif\n+\n+int\n+handshake_0405(struct lws_context *context, struct lws *wsi);\n+int\n+lws_process_ws_upgrade(struct lws *wsi);\n+int\n+lws_server_init_wsi_for_ws(struct lws *wsi);\ndiff --git a/lib/service.c b/lib/service.c\nindex cf2f2b4..13ce9d1 100644\n--- a/lib/service.c\n+++ b/lib/service.c\n@@ -96,7 +96,7 @@ lws_handle_POLLOUT_event(struct lws *wsi, struct lws_pollfd *pollfd)\n \t * A cgi master's wire protocol remains h1 or h2. He is just getting\n \t * his data from his child cgis.\n \t */\n-\tif (wsi-\u003ecgi) {\n+\tif (wsi-\u003ehttp.cgi) {\n \t\t/* also one shot */\n \t\tif (pollfd)\n \t\t\tif (lws_change_pollfd(wsi, LWS_POLLOUT, 0)) {\n@@ -236,6 +236,7 @@ __lws_service_timeout_check(struct lws *wsi, time_t sec)\n \n \t\t/* no need to log normal idle keepalive timeout */\n \t\tif (wsi-\u003epending_timeout !\u003d PENDING_TIMEOUT_HTTP_KEEPALIVE_IDLE)\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \t\t\tlwsl_info(\u0022wsi %p: TIMEDOUT WAITING on %d \u0022\n \t\t\t\t \u0022(did hdr %d, ah %p, wl %d, pfd \u0022\n \t\t\t\t \u0022events %d) %llu vs %llu\u005cn\u0022,\n@@ -245,8 +246,12 @@ __lws_service_timeout_check(struct lws *wsi, time_t sec)\n \t\t\t\t (unsigned long long)sec,\n \t\t\t\t (unsigned long long)wsi-\u003epending_timeout_limit);\n #if defined(LWS_WITH_CGI)\n-\t\tif (wsi-\u003ecgi)\n-\t\t\tlwsl_notice(\u0022CGI timeout: %s\u005cn\u0022, wsi-\u003ecgi-\u003esummary);\n+\t\tif (wsi-\u003ehttp.cgi)\n+\t\t\tlwsl_notice(\u0022CGI timeout: %s\u005cn\u0022, wsi-\u003ehttp.cgi-\u003esummary);\n+#endif\n+#else\n+\t\tlwsl_info(\u0022wsi %p: TIMEDOUT WAITING on %d \u0022, (void *)wsi,\n+\t\t\t wsi-\u003epending_timeout);\n #endif\n \n \t\t/*\n@@ -509,14 +514,16 @@ lws_service_periodic_checks(struct lws_context *context,\n {\n \tstruct lws_context_per_thread *pt \u003d \u0026context-\u003ept[tsi];\n \tlws_sockfd_type our_fd \u003d 0, tmp_fd;\n-\tstruct allocated_headers *ah;\n \tstruct lws *wsi;\n \tint timed_out \u003d 0;\n \ttime_t now;\n #if defined(LWS_WITH_TLS)\n \tint n \u003d 0;\n #endif\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n+\tstruct allocated_headers *ah;\n \tint m;\n+#endif\n \n \tif (!context-\u003eprotocol_init_done)\n \t\tif (lws_protocol_init(context))\n@@ -608,6 +615,7 @@ lws_service_periodic_checks(struct lws_context *context,\n \t\t}\n \t} lws_end_foreach_dll_safe(d, d1);\n \n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \t/*\n \t * Phase 2: double-check active ah timeouts independent of wsi\n \t *\t timeout status\n@@ -688,7 +696,7 @@ lws_service_periodic_checks(struct lws_context *context,\n \n \t\tah \u003d pt-\u003ehttp.ah_list;\n \t}\n-\n+#endif\n \tlws_pt_unlock(pt);\n \n #if 0\ndiff --git a/lib/tls/openssl/openssl-client.c b/lib/tls/openssl/openssl-client.c\nindex 3e42276..63ceb32 100644\n--- a/lib/tls/openssl/openssl-client.c\n+++ b/lib/tls/openssl/openssl-client.c\n@@ -101,8 +101,11 @@ lws_ssl_client_bio_create(struct lws *wsi)\n \tint n;\n #endif\n \n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \tif (lws_hdr_copy(wsi, hostname, sizeof(hostname),\n-\t\t\t _WSI_TOKEN_CLIENT_HOST) \u003c\u003d 0) {\n+\t\t\t _WSI_TOKEN_CLIENT_HOST) \u003c\u003d 0)\n+#endif\n+\t{\n \t\tlwsl_err(\u0022%s: Unable to get hostname\u005cn\u0022, __func__);\n \n \t\treturn -1;\n@@ -208,10 +211,11 @@ lws_ssl_client_bio_create(struct lws *wsi)\n defined(LWS_HAVE_SSL_get0_alpn_selected)\n \tif (wsi-\u003evhost-\u003ealpn)\n \t\talpn_comma \u003d wsi-\u003evhost-\u003ealpn;\n-\n+#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)\n \tif (lws_hdr_copy(wsi, hostname, sizeof(hostname),\n \t\t\t _WSI_TOKEN_CLIENT_ALPN) \u003e 0)\n \t\talpn_comma \u003d hostname;\n+#endif\n \n \tlwsl_info(\u0022client conn using alpn list '%s'\u005cn\u0022, alpn_comma);\n \ndiff --git a/minimal-examples/client-server/minimal-ws-proxy/CMakeLists.txt b/minimal-examples/client-server/minimal-ws-proxy/CMakeLists.txt\nindex c3f7521..a265496 100644\n--- a/minimal-examples/client-server/minimal-ws-proxy/CMakeLists.txt\n+++ b/minimal-examples/client-server/minimal-ws-proxy/CMakeLists.txt\n@@ -63,6 +63,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_WS 1 requirements)\n require_lws_config(LWS_WITHOUT_CLIENT 0 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \ndiff --git a/minimal-examples/http-client/minimal-http-client-certinfo/CMakeLists.txt b/minimal-examples/http-client/minimal-http-client-certinfo/CMakeLists.txt\nindex 72392f5..1bc44df 100644\n--- a/minimal-examples/http-client/minimal-http-client-certinfo/CMakeLists.txt\n+++ b/minimal-examples/http-client/minimal-http-client-certinfo/CMakeLists.txt\n@@ -64,6 +64,7 @@ ENDMACRO()\n \n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITHOUT_CLIENT 0 requirements)\n require_lws_config(LWS_OPENSSL_SUPPORT 1 requirements)\n \ndiff --git a/minimal-examples/http-client/minimal-http-client-hugeurl/CMakeLists.txt b/minimal-examples/http-client/minimal-http-client-hugeurl/CMakeLists.txt\nindex 306ba8d..22a3011 100644\n--- a/minimal-examples/http-client/minimal-http-client-hugeurl/CMakeLists.txt\n+++ b/minimal-examples/http-client/minimal-http-client-hugeurl/CMakeLists.txt\n@@ -63,6 +63,7 @@ ENDMACRO()\n \n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITHOUT_CLIENT 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/http-client/minimal-http-client-multi/CMakeLists.txt b/minimal-examples/http-client/minimal-http-client-multi/CMakeLists.txt\nindex 9f4f3b6..be0314e 100644\n--- a/minimal-examples/http-client/minimal-http-client-multi/CMakeLists.txt\n+++ b/minimal-examples/http-client/minimal-http-client-multi/CMakeLists.txt\n@@ -64,6 +64,7 @@ ENDMACRO()\n \n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITHOUT_CLIENT 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/http-client/minimal-http-client-post/CMakeLists.txt b/minimal-examples/http-client/minimal-http-client-post/CMakeLists.txt\nindex 889f5f7..9fe8d51 100644\n--- a/minimal-examples/http-client/minimal-http-client-post/CMakeLists.txt\n+++ b/minimal-examples/http-client/minimal-http-client-post/CMakeLists.txt\n@@ -63,6 +63,7 @@ ENDMACRO()\n \n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITHOUT_CLIENT 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/http-client/minimal-http-client/CMakeLists.txt b/minimal-examples/http-client/minimal-http-client/CMakeLists.txt\nindex f8b222c..6181371 100644\n--- a/minimal-examples/http-client/minimal-http-client/CMakeLists.txt\n+++ b/minimal-examples/http-client/minimal-http-client/CMakeLists.txt\n@@ -64,6 +64,7 @@ ENDMACRO()\n \n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITHOUT_CLIENT 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/http-server/minimal-http-server-basicauth/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-basicauth/CMakeLists.txt\nindex edf29d0..c1bb2ce 100644\n--- a/minimal-examples/http-server/minimal-http-server-basicauth/CMakeLists.txt\n+++ b/minimal-examples/http-server/minimal-http-server-basicauth/CMakeLists.txt\n@@ -62,6 +62,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/http-server/minimal-http-server-dynamic/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-dynamic/CMakeLists.txt\nindex 3286a41..5b5794c 100644\n--- a/minimal-examples/http-server/minimal-http-server-dynamic/CMakeLists.txt\n+++ b/minimal-examples/http-server/minimal-http-server-dynamic/CMakeLists.txt\n@@ -63,6 +63,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/http-server/minimal-http-server-form-get/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-form-get/CMakeLists.txt\nindex 582809f..1b43056 100644\n--- a/minimal-examples/http-server/minimal-http-server-form-get/CMakeLists.txt\n+++ b/minimal-examples/http-server/minimal-http-server-form-get/CMakeLists.txt\n@@ -62,6 +62,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/http-server/minimal-http-server-form-post-file/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-form-post-file/CMakeLists.txt\nindex ae83283..1cffb98 100644\n--- a/minimal-examples/http-server/minimal-http-server-form-post-file/CMakeLists.txt\n+++ b/minimal-examples/http-server/minimal-http-server-form-post-file/CMakeLists.txt\n@@ -62,6 +62,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/http-server/minimal-http-server-form-post/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-form-post/CMakeLists.txt\nindex 01d3c56..32a9f76 100644\n--- a/minimal-examples/http-server/minimal-http-server-form-post/CMakeLists.txt\n+++ b/minimal-examples/http-server/minimal-http-server-form-post/CMakeLists.txt\n@@ -62,6 +62,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/http-server/minimal-http-server-libuv-foreign/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-libuv-foreign/CMakeLists.txt\nindex 87f1ac3..6ad9493 100644\n--- a/minimal-examples/http-server/minimal-http-server-libuv-foreign/CMakeLists.txt\n+++ b/minimal-examples/http-server/minimal-http-server-libuv-foreign/CMakeLists.txt\n@@ -62,6 +62,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITH_LIBUV 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \ndiff --git a/minimal-examples/http-server/minimal-http-server-libuv/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-libuv/CMakeLists.txt\nindex dc56dcd..1ced495 100644\n--- a/minimal-examples/http-server/minimal-http-server-libuv/CMakeLists.txt\n+++ b/minimal-examples/http-server/minimal-http-server-libuv/CMakeLists.txt\n@@ -63,6 +63,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITH_LIBUV 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \ndiff --git a/minimal-examples/http-server/minimal-http-server-multivhost/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-multivhost/CMakeLists.txt\nindex ae0400d..ace0d7c 100644\n--- a/minimal-examples/http-server/minimal-http-server-multivhost/CMakeLists.txt\n+++ b/minimal-examples/http-server/minimal-http-server-multivhost/CMakeLists.txt\n@@ -62,6 +62,7 @@ MACRO(require_lws_config reqconfig _val result)\n \tendif()\n ENDMACRO()\n set(requirements 1)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/http-server/minimal-http-server-smp/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-smp/CMakeLists.txt\nindex fedd155..ab2718e 100644\n--- a/minimal-examples/http-server/minimal-http-server-smp/CMakeLists.txt\n+++ b/minimal-examples/http-server/minimal-http-server-smp/CMakeLists.txt\n@@ -76,6 +76,7 @@ ENDMACRO()\n \n set(requirements 1)\n require_pthreads(requirements)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/http-server/minimal-http-server-sse-ring/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-sse-ring/CMakeLists.txt\nindex a972391..464cfbe 100644\n--- a/minimal-examples/http-server/minimal-http-server-sse-ring/CMakeLists.txt\n+++ b/minimal-examples/http-server/minimal-http-server-sse-ring/CMakeLists.txt\n@@ -76,6 +76,7 @@ ENDMACRO()\n \n set(requirements 1)\n require_pthreads(requirements)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/http-server/minimal-http-server-sse/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-sse/CMakeLists.txt\nindex b96d6d8..c22a71f 100644\n--- a/minimal-examples/http-server/minimal-http-server-sse/CMakeLists.txt\n+++ b/minimal-examples/http-server/minimal-http-server-sse/CMakeLists.txt\n@@ -63,6 +63,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/http-server/minimal-http-server-tls/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server-tls/CMakeLists.txt\nindex 7c8e7d6..758d973 100644\n--- a/minimal-examples/http-server/minimal-http-server-tls/CMakeLists.txt\n+++ b/minimal-examples/http-server/minimal-http-server-tls/CMakeLists.txt\n@@ -63,6 +63,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n require_lws_config(LWS_OPENSSL_SUPPORT 1 requirements)\n \ndiff --git a/minimal-examples/http-server/minimal-http-server/CMakeLists.txt b/minimal-examples/http-server/minimal-http-server/CMakeLists.txt\nindex a17d4e9..a0fa4ec 100644\n--- a/minimal-examples/http-server/minimal-http-server/CMakeLists.txt\n+++ b/minimal-examples/http-server/minimal-http-server/CMakeLists.txt\n@@ -64,6 +64,7 @@ ENDMACRO()\n \n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_H1 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/ws-client/minimal-ws-client-echo/CMakeLists.txt b/minimal-examples/ws-client/minimal-ws-client-echo/CMakeLists.txt\nindex 8a8cc74..d5162b0 100644\n--- a/minimal-examples/ws-client/minimal-ws-client-echo/CMakeLists.txt\n+++ b/minimal-examples/ws-client/minimal-ws-client-echo/CMakeLists.txt\n@@ -63,6 +63,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_WS 1 requirements)\n require_lws_config(LWS_WITHOUT_CLIENT 0 requirements)\n require_lws_config(LWS_WITHOUT_EXTENSIONS 0 requirements)\n \ndiff --git a/minimal-examples/ws-client/minimal-ws-client-pmd-bulk/CMakeLists.txt b/minimal-examples/ws-client/minimal-ws-client-pmd-bulk/CMakeLists.txt\nindex c76f91e..ace89a5 100644\n--- a/minimal-examples/ws-client/minimal-ws-client-pmd-bulk/CMakeLists.txt\n+++ b/minimal-examples/ws-client/minimal-ws-client-pmd-bulk/CMakeLists.txt\n@@ -63,6 +63,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_WS 1 requirements)\n require_lws_config(LWS_WITHOUT_CLIENT 0 requirements)\n #require_lws_config(LWS_WITHOUT_EXTENSIONS 0 requirements)\n \ndiff --git a/minimal-examples/ws-client/minimal-ws-client-rx/CMakeLists.txt b/minimal-examples/ws-client/minimal-ws-client-rx/CMakeLists.txt\nindex 9548db3..fb8c938 100644\n--- a/minimal-examples/ws-client/minimal-ws-client-rx/CMakeLists.txt\n+++ b/minimal-examples/ws-client/minimal-ws-client-rx/CMakeLists.txt\n@@ -63,6 +63,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_WS 1 requirements)\n require_lws_config(LWS_WITHOUT_CLIENT 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/ws-client/minimal-ws-client-tx/CMakeLists.txt b/minimal-examples/ws-client/minimal-ws-client-tx/CMakeLists.txt\nindex a43e3dc..47f2dc6 100644\n--- a/minimal-examples/ws-client/minimal-ws-client-tx/CMakeLists.txt\n+++ b/minimal-examples/ws-client/minimal-ws-client-tx/CMakeLists.txt\n@@ -75,6 +75,7 @@ ENDMACRO()\n \n set(requirements 1)\n require_pthreads(requirements)\n+require_lws_config(LWS_ROLE_WS 1 requirements)\n require_lws_config(LWS_WITHOUT_CLIENT 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/ws-server/minimal-ws-broker/CMakeLists.txt b/minimal-examples/ws-server/minimal-ws-broker/CMakeLists.txt\nindex 73fb25a..719147d 100644\n--- a/minimal-examples/ws-server/minimal-ws-broker/CMakeLists.txt\n+++ b/minimal-examples/ws-server/minimal-ws-broker/CMakeLists.txt\n@@ -62,6 +62,7 @@ MACRO(require_lws_config reqconfig _val result)\n \tendif()\n ENDMACRO()\n set(requirements 1)\n+require_lws_config(LWS_ROLE_WS 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/ws-server/minimal-ws-server-echo/CMakeLists.txt b/minimal-examples/ws-server/minimal-ws-server-echo/CMakeLists.txt\nindex 0ea8692..78823ea 100644\n--- a/minimal-examples/ws-server/minimal-ws-server-echo/CMakeLists.txt\n+++ b/minimal-examples/ws-server/minimal-ws-server-echo/CMakeLists.txt\n@@ -63,6 +63,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_WS 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n require_lws_config(LWS_WITHOUT_EXTENSIONS 0 requirements)\n \ndiff --git a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/CMakeLists.txt b/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/CMakeLists.txt\nindex 962c988..d27769f 100644\n--- a/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/CMakeLists.txt\n+++ b/minimal-examples/ws-server/minimal-ws-server-pmd-bulk/CMakeLists.txt\n@@ -63,6 +63,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_WS 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n #require_lws_config(LWS_WITHOUT_EXTENSIONS 0 requirements)\n \ndiff --git a/minimal-examples/ws-server/minimal-ws-server-pmd/CMakeLists.txt b/minimal-examples/ws-server/minimal-ws-server-pmd/CMakeLists.txt\nindex fb607ab..db9f03e 100644\n--- a/minimal-examples/ws-server/minimal-ws-server-pmd/CMakeLists.txt\n+++ b/minimal-examples/ws-server/minimal-ws-server-pmd/CMakeLists.txt\n@@ -63,6 +63,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_WS 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n require_lws_config(LWS_WITHOUT_EXTENSIONS 0 requirements)\n \ndiff --git a/minimal-examples/ws-server/minimal-ws-server-ring/CMakeLists.txt b/minimal-examples/ws-server/minimal-ws-server-ring/CMakeLists.txt\nindex 01445cf..28018e4 100644\n--- a/minimal-examples/ws-server/minimal-ws-server-ring/CMakeLists.txt\n+++ b/minimal-examples/ws-server/minimal-ws-server-ring/CMakeLists.txt\n@@ -63,6 +63,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_WS 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/ws-server/minimal-ws-server-threads/CMakeLists.txt b/minimal-examples/ws-server/minimal-ws-server-threads/CMakeLists.txt\nindex cbfee93..bf67791 100644\n--- a/minimal-examples/ws-server/minimal-ws-server-threads/CMakeLists.txt\n+++ b/minimal-examples/ws-server/minimal-ws-server-threads/CMakeLists.txt\n@@ -76,6 +76,7 @@ ENDMACRO()\n \n set(requirements 1)\n require_pthreads(requirements)\n+require_lws_config(LWS_ROLE_WS 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \n if (requirements)\ndiff --git a/minimal-examples/ws-server/minimal-ws-server/CMakeLists.txt b/minimal-examples/ws-server/minimal-ws-server/CMakeLists.txt\nindex c0cb7cb..6b938b1 100644\n--- a/minimal-examples/ws-server/minimal-ws-server/CMakeLists.txt\n+++ b/minimal-examples/ws-server/minimal-ws-server/CMakeLists.txt\n@@ -63,6 +63,7 @@ MACRO(require_lws_config reqconfig _val result)\n ENDMACRO()\n \n set(requirements 1)\n+require_lws_config(LWS_ROLE_WS 1 requirements)\n require_lws_config(LWS_WITHOUT_SERVER 0 requirements)\n \n if (requirements)\n","s":{"c":1713561831,"u": 19126}} ],"g": 22999,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}