From: Andy Green Date: Tue, 18 Jul 2017 03:15:43 +0000 (+0800) Subject: explicit vhosts: only check context for flag X-Git-Tag: accepted/tizen/4.0/unified/20171012.191640~46 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fupstream%2Flibwebsockets.git;a=commitdiff_plain;h=5106e9141ff94b33e23e47fdab834e4cd1606a24 explicit vhosts: only check context for flag Although the test apps reuse the context info directly and so inherit the flag state there when creating vhosts, users might generate a fresh info without the flag for vhost creation. So just go by what was given at context creation time. --- diff --git a/lib/context.c b/lib/context.c index f3b56ce..9b89564 100644 --- a/lib/context.c +++ b/lib/context.c @@ -490,7 +490,7 @@ lws_create_vhost(struct lws_context *context, * for a protocol get it enabled. */ - if (info->options & LWS_SERVER_OPTION_EXPLICIT_VHOSTS) + if (context->options & LWS_SERVER_OPTION_EXPLICIT_VHOSTS) f = 0; (void)f; #ifdef LWS_WITH_PLUGINS @@ -520,7 +520,7 @@ lws_create_vhost(struct lws_context *context, #ifdef LWS_WITH_PLUGINS (context->plugin_list) || #endif - info->options & LWS_SERVER_OPTION_EXPLICIT_VHOSTS) + context->options & LWS_SERVER_OPTION_EXPLICIT_VHOSTS) vh->protocols = lwsp; else { vh->protocols = info->protocols;