NULL protocol: make sure vhost same protocol linklist gets correct protocol index
authorAndy Green <andy@warmcat.com>
Wed, 31 May 2017 01:45:28 +0000 (09:45 +0800)
committerAndy Green <andy@warmcat.com>
Wed, 31 May 2017 01:45:28 +0000 (09:45 +0800)
lib/server.c

index ae01d05..ee61c60 100644 (file)
@@ -1447,7 +1447,7 @@ upgrade_ws:
                         */
                        lwsl_info("defaulting to prot handler %d\n",
                                wsi->vhost->default_protocol_index);
-                       n = 0;
+                       n = wsi->vhost->default_protocol_index;
                        wsi->protocol = &wsi->vhost->protocols[
                                      (int)wsi->vhost->default_protocol_index];
                }