windows: defeat service if no vhosts

This commit is contained in:
Andy Green 2017-10-10 14:46:54 +08:00
parent 46b04f4ba4
commit f66b84778c
2 changed files with 4 additions and 1 deletions

View file

@ -2448,6 +2448,9 @@ lws_create_basic_wsi(struct lws_context *context, int tsi)
{
struct lws *new_wsi;
if (!context->vhost_list)
return NULL;
if ((unsigned int)context->pt[tsi].fds_count ==
context->fd_limit_per_thread - 1) {
lwsl_err("no space for new conn\n");

View file

@ -164,7 +164,7 @@ _lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi)
int n, m;
/* stay dead once we are dead */
if (context == NULL)
if (context == NULL || !context->vhost_list)
return 1;
pt = &context->pt[tsi];