handle same vh protocol reinsert
authorAndy Green <andy@warmcat.com>
Sat, 12 Aug 2017 12:53:49 +0000 (20:53 +0800)
committerAndy Green <andy@warmcat.com>
Sat, 12 Aug 2017 12:53:49 +0000 (20:53 +0800)
lib/pollfd.c

index f3f2fbb..25167dd 100644 (file)
@@ -449,8 +449,8 @@ lws_same_vh_protocol_insert(struct lws *wsi, int n)
        //              wsi->same_vh_protocol_prev);
 
        if (wsi->same_vh_protocol_prev || wsi->same_vh_protocol_next) {
-               lwsl_err("Attempted to attach wsi twice to same vh prot\n");
-               assert(0);
+               lws_same_vh_protocol_remove(wsi);
+               lwsl_notice("Attempted to attach wsi twice to same vh prot\n");
        }
 
        wsi->same_vh_protocol_prev = /* guy who points to us */