8000 lws fails to queue connection when mixing IP and Hostname by yassineBT · Pull Request #3338 · warmcat/libwebsockets · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

lws fails to queue connection when mixing IP and Hostname #3338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions lib/core-net/vhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -1781,6 +1781,7 @@ lws_vhost_active_conns(struct lws *wsi, struct lws **nwsi, const char *adsin)
#endif
#if defined(LWS_WITH_TLS)
char newconn_cannot_use_h1 = 0;
const char *w_adsin;

if ((wsi->tls.use_ssl & LCCSCF_USE_SSL) &&
my_alpn && !strstr(my_alpn, "http/1.1"))
Expand Down Expand Up @@ -1820,10 +1821,11 @@ lws_vhost_active_conns(struct lws *wsi, struct lws **nwsi, const char *adsin)
struct lws *w = lws_container_of(d, struct lws,
dll_cli_active_conns);

w_adsin = lws_wsi_client_stash_item(w, CIS_ADDRESS,
_WSI_TOKEN_CLIENT_PEER_ADDRESS);
lwsl_wsi_debug(wsi, "check %s %s %s %d %d",
lws_wsi_tag(w), adsin,
w->cli_hostname_copy ? w->cli_hostname_copy :
"null",
w_adsin ? w_adsin : "null",
wsi->c_port, w->c_port);

if (w != wsi &&
Expand All @@ -1837,7 +1839,7 @@ lws_vhost_active_conns(struct lws *wsi, struct lws **nwsi, const char *adsin)
(w->role_ops == wsi->role_ops ||
(lwsi_role_http(w) && lwsi_role_http(wsi))) &&
/* ... same role, or at least both some kind of http */
w->cli_hostname_copy && !strcmp(adsin, w->cli_hostname_copy) &&
w_adsin && !strcmp(adsin, w_adsin) &&
/* same endpoint hostname */
#if defined(LWS_WITH_TLS)
!(newconn_cannot_use_h1 && w->role_ops == &role_ops_h1) &&
Expand Down
10CA
0