mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
ss: server: check more carefully if built but not used on a wsi
This commit is contained in:
parent
77062d1c27
commit
1f0cd18dd6
2 changed files with 4 additions and 2 deletions
|
@ -2531,7 +2531,8 @@ lws_h2_ws_handshake(struct lws *wsi)
|
|||
* the generic ss-ws.c protocol name
|
||||
*/
|
||||
|
||||
if (wsi->a.vhost->ss_handle->policy->u.http.u.ws.subprotocol) {
|
||||
if (wsi->a.vhost && wsi->a.vhost->ss_handle &&
|
||||
wsi->a.vhost->ss_handle->policy->u.http.u.ws.subprotocol) {
|
||||
lws_ss_handle_t *h =
|
||||
(lws_ss_handle_t *)wsi->a.opaque_user_data;
|
||||
|
||||
|
|
|
@ -720,7 +720,8 @@ handshake_0405(struct lws_context *context, struct lws *wsi)
|
|||
* though...
|
||||
*/
|
||||
|
||||
if (sssh->policy->u.http.u.ws.subprotocol)
|
||||
if (sssh && sssh->policy &&
|
||||
sssh->policy->u.http.u.ws.subprotocol)
|
||||
prot = sssh->policy->u.http.u.ws.subprotocol;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue