mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
raw-proxy: don't defer to raw-skt if we wanted raw-proxy
At some point raw-skt became the default that overrode the raw-proxy binding request. Don't do that if we can see we specifically wanted raw-proxy.
This commit is contained in:
parent
3452980391
commit
7528491505
4 changed files with 12 additions and 5 deletions
|
@ -584,7 +584,7 @@ lws_callback_http_dummy(struct lws *wsi, enum lws_callback_reasons reason,
|
|||
case LWS_CALLBACK_CLOSED_CLIENT_HTTP:
|
||||
if (!lws_get_parent(wsi))
|
||||
break;
|
||||
lwsl_err("%s: LWS_CALLBACK_CLOSED_CLIENT_HTTP\n", __func__);
|
||||
// lwsl_err("%s: LWS_CALLBACK_CLOSED_CLIENT_HTTP\n", __func__);
|
||||
lws_set_timeout(lws_get_parent(wsi), LWS_TO_KILL_ASYNC,
|
||||
PENDING_TIMEOUT_KILLED_BY_PROXY_CLIENT_CLOSE);
|
||||
break;
|
||||
|
|
|
@ -164,8 +164,9 @@ rops_client_bind_raw_proxy(struct lws *wsi,
|
|||
|
||||
/* we are a fallback if nothing else matched */
|
||||
|
||||
// lws_role_transition(wsi, LWSIFR_CLIENT, LRS_UNCONNECTED,
|
||||
// &role_ops_raw_proxy);
|
||||
if (i->local_protocol_name && !strcmp(i->local_protocol_name, "raw-proxy"))
|
||||
lws_role_transition(wsi, LWSIFR_CLIENT, LRS_UNCONNECTED,
|
||||
&role_ops_raw_proxy);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -206,7 +206,8 @@ rops_client_bind_raw_skt(struct lws *wsi,
|
|||
|
||||
/* we are a fallback if nothing else matched */
|
||||
|
||||
lws_role_transition(wsi, LWSIFR_CLIENT, LRS_UNCONNECTED,
|
||||
if (!i->local_protocol_name || strcmp(i->local_protocol_name, "raw-proxy"))
|
||||
lws_role_transition(wsi, LWSIFR_CLIENT, LRS_UNCONNECTED,
|
||||
&role_ops_raw_skt);
|
||||
|
||||
return 1; /* matched */
|
||||
|
|
|
@ -252,10 +252,12 @@ bad_onward:
|
|||
break;
|
||||
|
||||
case LWS_CALLBACK_RAW_PROXY_CLI_ADOPT:
|
||||
lwsl_debug("LWS_CALLBACK_RAW_CLI_ADOPT: pss %p\n", pss);
|
||||
lwsl_debug("%s: %p: LWS_CALLBACK_RAW_CLI_ADOPT: pss %p\n", __func__, wsi, pss);
|
||||
if (conn || !pss)
|
||||
break;
|
||||
conn = pss->conn = lws_get_opaque_user_data(wsi);
|
||||
if (!conn)
|
||||
break;
|
||||
conn->established[ONW] = 1;
|
||||
/* they start enabled */
|
||||
conn->rx_enabled[ACC] = 1;
|
||||
|
@ -445,6 +447,9 @@ bad_onward:
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (!len)
|
||||
return 0;
|
||||
|
||||
pkt.payload = malloc(len);
|
||||
if (!pkt.payload) {
|
||||
lwsl_notice("OOM: dropping\n");
|
||||
|
|
Loading…
Add table
Reference in a new issue