mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
minilex: fix ROLE_WS=0 case
This commit is contained in:
parent
1289b0a0ef
commit
28f04b5ebd
5 changed files with 5940 additions and 5925 deletions
|
@ -754,40 +754,39 @@ lws_hpack_use_idx_hdr(struct lws *wsi, int idx, int known_token)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#if !defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) && !defined(LWS_ROLE_WS) && !defined(LWS_ROLE_H2)
|
||||
static uint8_t lws_header_implies_psuedoheader_map[] = {
|
||||
0x03,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x03,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
#endif
|
||||
#if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) && !defined(LWS_ROLE_WS) && !defined(LWS_ROLE_H2)
|
||||
static uint8_t lws_header_implies_psuedoheader_map[] = {
|
||||
0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
#endif
|
||||
#if !defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) && defined(LWS_ROLE_WS) && !defined(LWS_ROLE_H2)
|
||||
static uint8_t lws_header_implies_psuedoheader_map[] = {
|
||||
0x03,0x00,0x00,0x80,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
#endif
|
||||
#if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) && defined(LWS_ROLE_WS) && !defined(LWS_ROLE_H2)
|
||||
static uint8_t lws_header_implies_psuedoheader_map[] = {
|
||||
0x07,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x38,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x10,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
#endif
|
||||
#if !defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) && !defined(LWS_ROLE_WS) && defined(LWS_ROLE_H2)
|
||||
static uint8_t lws_header_implies_psuedoheader_map[] = {
|
||||
0x03,0x00,0x80,0x07,0x00,0x00,0x00,0x10,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x03,0x00,0x80,0x0f,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
#endif
|
||||
#if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) && !defined(LWS_ROLE_WS) && defined(LWS_ROLE_H2)
|
||||
static uint8_t lws_header_implies_psuedoheader_map[] = {
|
||||
0x07,0x00,0x00,0x1e,0x00,0x00,0x00,0xc0,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x07,0x00,0x00,0x3e,0x00,0x00,0x00,0x80,0x03,0x01,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
#endif
|
||||
#if !defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) && defined(LWS_ROLE_WS) && defined(LWS_ROLE_H2)
|
||||
static uint8_t lws_header_implies_psuedoheader_map[] = {
|
||||
0x03,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x80,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
0x03,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,
|
||||
};
|
||||
#endif
|
||||
#if defined(LWS_WITH_HTTP_UNCOMMON_HEADERS) && defined(LWS_ROLE_WS) && defined(LWS_ROLE_H2)
|
||||
|
@ -796,7 +795,6 @@ static uint8_t lws_header_implies_psuedoheader_map[] = {
|
|||
};
|
||||
#endif
|
||||
|
||||
|
||||
static int
|
||||
lws_hpack_handle_pseudo_rules(struct lws *nwsi, struct lws *wsi, int m)
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -46,15 +46,94 @@
|
|||
*/
|
||||
|
||||
unsigned char filter_array[] = {
|
||||
0xff, 0xff, 0xaa, 0xff, 0xff, 0xff, 0xff, 0xcc, 0xff, 0xcc,
|
||||
0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xff, 0xf0, 0xff, 0xaa,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xfa, 0xcc, 0xcc, 0xcc, 0xf0, 0xf0, 0xf0, 0xf0,
|
||||
0xf0, 0xfa, 0xff, 0xfa, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
|
||||
0xff, 0xfa, 0xfa, 0xfa, 0xff, 0xff, 0xff, 0xff, 0xfa, 0xff,
|
||||
0xfa, 0xfa, 0xfa, 0xfa, 0xaa, 0xaa, 0xaa, 0xff, 0xaa, 0xaa,
|
||||
0xff, 0xff, 0xff, 0xff, 0xfa, 0xfa, 0xf0, 0xff, 0xff
|
||||
0xff, /* get */
|
||||
0xff, /* post */
|
||||
0xaa, /* options */
|
||||
0xff, /* host */
|
||||
0xff, /* connection */
|
||||
0xff, /* upgrade */
|
||||
0xff, /* origin */
|
||||
0xcc, /* sec-ws-draft */
|
||||
0xff, /* crlf */
|
||||
0xcc, /* sec-ws-ext */
|
||||
0xcc, /* sec-ws-key1 */
|
||||
0xcc, /* sec-ws-key2 */
|
||||
0xcc, /* sec-ws-protocol */
|
||||
0xcc, /* sec-ws-accept */
|
||||
0xcc, /* sec-ws-nonce */
|
||||
0xff, /* http/1.1 */
|
||||
0xf0, /* http2-settings */
|
||||
0xff, /* accept */
|
||||
0xaa, /* access-control-req-hdrs */
|
||||
0xff, /* if-modified-since */
|
||||
0xff, /* if-none-match */
|
||||
0xff, /* accept-encoding */
|
||||
0xff, /* accept-language */
|
||||
0xff, /* pragma */
|
||||
0xff, /* cache-control */
|
||||
0xff, /* authorization */
|
||||
0xff, /* cookie */
|
||||
0xff, /* content-length */
|
||||
0xff, /* content-type */
|
||||
0xff, /* date */
|
||||
0xff, /* range */
|
||||
0xfa, /* referer */
|
||||
0xcc, /* sec-ws-key */
|
||||
0xcc, /* sec-ws-version */
|
||||
0xcc, /* sec-sc-origin */
|
||||
0xf0, /* authority */
|
||||
0xf0, /* method */
|
||||
0xf0, /* path */
|
||||
0xf0, /* scheme */
|
||||
0xf0, /* status */
|
||||
0xfa, /* accept-charset */
|
||||
0xff, /* accept-ranges */
|
||||
0xfa, /* access-control-allow-origin */
|
||||
0xff, /* age */
|
||||
0xff, /* allow */
|
||||
0xff, /* content-disposition */
|
||||
0xff, /* content-encoding */
|
||||
0xff, /* content-language */
|
||||
0xff, /* content-location */
|
||||
0xff, /* content-range */
|
||||
0xff, /* etag */
|
||||
0xff, /* expect */
|
||||
0xff, /* expires */
|
||||
0xff, /* from */
|
||||
0xff, /* if-match */
|
||||
0xff, /* if-range */
|
||||
0xff, /* if-unmodified-since */
|
||||
0xff, /* last-modified */
|
||||
0xff, /* link */
|
||||
0xff, /* location */
|
||||
0xfa, /* max-forwards */
|
||||
0xfa, /* proxy-authenticate */
|
||||
0xfa, /* proxy-authorization */
|
||||
0xff, /* refresh */
|
||||
0xff, /* retry-after */
|
||||
0xff, /* server */
|
||||
0xff, /* set-cookie */
|
||||
0xfa, /* strict-transport-security */
|
||||
0xff, /* transfer-encoding */
|
||||
0xfa, /* user-agent */
|
||||
0xfa, /* vary */
|
||||
0xfa, /* via */
|
||||
0xfa, /* www-authenticate */
|
||||
0xaa, /* patch */
|
||||
0xaa, /* put */
|
||||
0xaa, /* delete */
|
||||
0xff, /* uri-args */
|
||||
0xaa, /* proxy */
|
||||
0xaa, /* x-real-ip */
|
||||
0xff, /* http/1.0 */
|
||||
0xff, /* x-forwarded-for */
|
||||
0xff, /* connect */
|
||||
0xff, /* head */
|
||||
0xfa, /* te */
|
||||
0xfa, /* replay-nonce */
|
||||
0xf0, /* protocol */
|
||||
0xff, /* x-auth-token */
|
||||
0xff /* not matchable */
|
||||
};
|
||||
|
||||
static unsigned char lws_header_implies_psuedoheader_map[] = {
|
||||
|
|
|
@ -1078,6 +1078,7 @@ lws_http_proxy_start(struct lws *wsi, const struct lws_http_mount *hit,
|
|||
struct lws *cwsi;
|
||||
int n, na;
|
||||
|
||||
#if defined(LWS_ROLE_WS)
|
||||
if (ws)
|
||||
/*
|
||||
* Neither our inbound ws upgrade request side, nor our onward
|
||||
|
@ -1094,7 +1095,7 @@ lws_http_proxy_start(struct lws *wsi, const struct lws_http_mount *hit,
|
|||
* the .local_protocol_name.
|
||||
*/
|
||||
lws_bind_protocol(wsi, &lws_ws_proxy, __func__);
|
||||
|
||||
#endif
|
||||
memset(&i, 0, sizeof(i));
|
||||
i.context = lws_get_context(wsi);
|
||||
|
||||
|
@ -1228,9 +1229,11 @@ lws_http_proxy_start(struct lws *wsi, const struct lws_http_mount *hit,
|
|||
i.alpn = "http/1.1";
|
||||
i.parent_wsi = wsi;
|
||||
i.pwsi = &cwsi;
|
||||
#if defined(LWS_ROLE_WS)
|
||||
i.protocol = lws_hdr_simple_ptr(wsi, WSI_TOKEN_PROTOCOL);
|
||||
if (ws)
|
||||
i.local_protocol_name = "lws-ws-proxy";
|
||||
#endif
|
||||
|
||||
// i.uri_replace_from = hit->origin;
|
||||
// i.uri_replace_to = hit->mountpoint;
|
||||
|
|
|
@ -82,8 +82,8 @@ char crl_path[1024] = "";
|
|||
#include "../plugins/protocol_lws_mirror.c"
|
||||
#include "../plugins/protocol_lws_status.c"
|
||||
#include "../plugins/protocol_dumb_increment.c"
|
||||
#include "../plugins/protocol_post_demo.c"
|
||||
#endif
|
||||
#include "../plugins/protocol_post_demo.c"
|
||||
|
||||
static int
|
||||
lws_callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user,
|
||||
|
@ -155,8 +155,8 @@ static struct lws_protocols protocols[] = {
|
|||
LWS_PLUGIN_PROTOCOL_DUMB_INCREMENT,
|
||||
LWS_PLUGIN_PROTOCOL_MIRROR,
|
||||
LWS_PLUGIN_PROTOCOL_LWS_STATUS,
|
||||
LWS_PLUGIN_PROTOCOL_POST_DEMO,
|
||||
#endif
|
||||
LWS_PLUGIN_PROTOCOL_POST_DEMO,
|
||||
{ NULL, NULL, 0, 0 } /* terminator */
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue