tag:github.com,2008:https://github.com/githubChenchi/libwebsockets/releasesTags from libwebsockets2017-07-18T17:05:49Ztag:github.com,2008:Repository/97807190/v2.2.22017-07-18T17:05:49Zv2.2.2lws-teamtag:github.com,2008:Repository/97807190/v2.2.12017-03-29T00:22:54Zv2.2.1: ev: stop event listeners during context destroy<p>ev: stop event listeners during context destroy</p>
<p>I think I've found a bug in libev backend, in function lws_libev_io(). I'm using latest version from master branch.</p>
<p>When deleting a context with active connections via lws_context_destroy(), context->being_destroyed is set to 1 early in the function, before the loop calling lws_close_free_wsi() on each active connection.
<br />lws_close_free_wsi() calls remove_wsi_socket_from_fds(), which calls lws_libev_io(), and here is my problem :</p>
<p>lws_libev_io() returns without doing anything if context->being_destroyed is set, so libev callbacks for deleted connections file descriptors stay registered after context is destroyed, which may lead to segfault/undefined behaviour if these file descriptors get reused later (which would trigger the callbacks).</p>
<p>I think the "if (!pt->io_loop_ev || context->being_destroyed) return;" statement should be replaced with " if (!pt->io_loop_ev) return;"</p>
<p>This fixes the problem for me and I have not seen any side effect yet. Moreover, libuv backend does not have such a test.</p>obacamtracetag:github.com,2008:Repository/97807190/v2.2.02017-03-08T06:15:01Zv2.2.0lws-teamtag:github.com,2008:Repository/97807190/v2.1.12017-02-15T10:03:12Zv2.1.1lws-teamtag:github.com,2008:Repository/97807190/v2.1.02016-10-06T19:19:50Zv2.1.0<p>v2.1.0</p>
<p>Bump soname to 9</p>lws-teamtag:github.com,2008:Repository/97807190/v2.0.32016-09-14T19:07:47Zv2.0.3lws-teamtag:github.com,2008:Repository/97807190/v1.7.92016-09-14T18:43:37Zv1.7.9<p>v1.7.9</p>
<p>SONAME to 7.1 because of lws_snprintf()</p>lws-teamtag:github.com,2008:Repository/97807190/v2.1-pre32016-09-05T07:03:37Zv2.1-pre3: windows: WCHAR in lws_plat_inet_ntop needs double the final allocation<p>windows: WCHAR in lws_plat_inet_ntop needs double the final allocation</p>
<p><a class="issue-link js-issue-link" href="https://github.com/warmcat/libwebsockets/issues/619">warmcat#619</a></p>lws-teamtag:github.com,2008:Repository/97807190/v2.0.22016-06-06T11:59:55Zv2.0.2lws-teamtag:github.com,2008:Repository/97807190/v2.0.12016-05-12T14:29:25Zv2.0.1lws-team