If you set a close reason with lws_close_reason() and trigger a clean close, e.g., by returning a nonzero value from an lws callback, lws will end up doing a "force close" without sending the WS close frame.
This only happens if you are using libuv, and _DEBUG is enabled. It looks like some code to help test libuv close behavior was left in during early development? The attached patch resolves the issue. If the test behavior is still desired, perhaps it can be guarded with a different macro?
0001-service-don-t-double-close-wsi-with-libuv-and-_DEBUG.patch
If you set a close reason with
lws_close_reason()and trigger a clean close, e.g., by returning a nonzero value from an lws callback, lws will end up doing a "force close" without sending the WS close frame.This only happens if you are using libuv, and _DEBUG is enabled. It looks like some code to help test libuv close behavior was left in during early development? The attached patch resolves the issue. If the test behavior is still desired, perhaps it can be guarded with a different macro?
0001-service-don-t-double-close-wsi-with-libuv-and-_DEBUG.patch