fix: discard incoming binary or text frame if we are shutting down to avoid deadlock (#84)

This commit is contained in:
Dave Horton
2024-06-28 07:28:35 -04:00
committed by GitHub
parent de676ddc81
commit d6e246d84c

View File

@@ -141,6 +141,11 @@ int AudioPipe::lws_callback(struct lws *wsi,
return 0;
}
if (ap->m_state == LWS_CLIENT_DISCONNECTING) {
lwsl_notice("AudioPipe::lws_service_thread race condition: got incoming message while closing the connection.\n");
return 0;
}
if (lws_frame_is_binary(wsi)) {
if (ap->is_bidirectional_audio_stream()) {
ap->m_callback(ap->m_uuid.c_str(), ap->m_bugname.c_str(), AudioPipe::BINARY, NULL, (char *) in, len);