[Libwebsockets] [PATCH] properly skip protocols with NULL name

Andy Green andy at warmcat.com
Thu Jan 7 00:10:50 CET 2016



On 01/07/2016 01:00 AM, Denis Osvald wrote:
> Hi,
>
> The patch in my original message has mangled whitespace.
>
> Here's another attempt at posting it to the list inline.
> If it still doesn't work I'l put an attachment.

Thanks... the mangling is gone but it didn't cleanly apply to HEAD... at 
least that was easy to work around.

I noticed we don't need to check wsi->protocol for NULL any more in the 
loop then, that led to a few more cleanings I squashed in this same patch

http://git.libwebsockets.org/cgi-bin/cgit/libwebsockets/commit/?id=27174e64de7fdbbc76fad3ce73ef67bdf87b365a

-Andy

> Regards,
> Denis
>
>
>  From 22eb9de7d7f222da08ad3f2f28d1adacdcff5216 Mon Sep 17 00:00:00 2001
> From: Denis Osvald <denis.osvald at sartura.hr>
> Date: Mon, 21 Dec 2015 16:39:59 +0100
> Subject: [PATCH] properly skip protocols with NULL name
>
> Signed-off-by: Denis Osvald <denis.osvald at sartura.hr>
> ---
>   lib/server.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/server.c b/lib/server.c
> index c60405e..d63fe08 100644
> --- a/lib/server.c
> +++ b/lib/server.c
> @@ -458,7 +458,7 @@ upgrade_ws:
>
>   			n = 0;
>   			while (wsi->protocol && context->protocols[n].callback) {
> -				if (!wsi->protocol->name) {
> +				if (!context->protocols[n].name) {
>   					n++;
>   					continue;
>   				}
>



More information about the Libwebsockets mailing list