diff --git a/lib/core/context.c b/lib/core/context.c index 67aabe4c5..96eab80cf 100644 --- a/lib/core/context.c +++ b/lib/core/context.c @@ -192,6 +192,13 @@ lwsl_info("context created\n"); #endif #endif + if (context->max_fds < 0) { + lwsl_err("%s: problem getting process max files\n", + __func__); + + return NULL; + } + if (info->count_threads) context->count_threads = info->count_threads; else diff --git a/lib/roles/ws/client-parser-ws.c b/lib/roles/ws/client-parser-ws.c index 6b43e23fe..427510903 100644 --- a/lib/roles/ws/client-parser-ws.c +++ b/lib/roles/ws/client-parser-ws.c @@ -646,7 +646,11 @@ utf8_fail: /* if pmd not enabled, in == out */ - if (n == PMDR_DID_NOTHING || n == PMDR_UNKNOWN) + if (n == PMDR_DID_NOTHING +#if !defined(LWS_WITHOUT_EXTENSIONS) + || n == PMDR_UNKNOWN +#endif + ) pmdrx.eb_in.len -= pmdrx.eb_out.len; m = wsi->protocol->callback(wsi, diff --git a/lib/roles/ws/ops-ws.c b/lib/roles/ws/ops-ws.c index 465963d7e..f5c4c567d 100644 --- a/lib/roles/ws/ops-ws.c +++ b/lib/roles/ws/ops-ws.c @@ -692,11 +692,15 @@ utf8_fail: /* if pmd not enabled, in == out */ - if (n == PMDR_DID_NOTHING || - n == PMDR_UNKNOWN) + if (n == PMDR_DID_NOTHING +#if !defined(LWS_WITHOUT_EXTENSIONS) + || + n == PMDR_UNKNOWN +#endif + ) pmdrx.eb_in.len -= pmdrx.eb_out.len; - if (!wsi->wsistate_pre_close && + if (!wsi->wsistate_pre_close && (pmdrx.eb_out.len >= 0 || callback_action == LWS_CALLBACK_RECEIVE_PONG || n == PMDR_EMPTY_FINAL)) {