Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Worker crash when closing WebRtcServer with active WebRtcTransports #1390

Merged

Conversation

ibc
Copy link
Member

@ibc ibc commented May 3, 2024

Fixes #1388

Details

  • WebRtcServer destructor must first close its WebRtcTransports and then the UDP sockets and TCP servers (so also its TCP connections). Otherwise those WebRtcTransports will try to send DTLS Close Alert on an already closed/freed UdpSocketHandle or TcpConnectionHandle.

Steps to verify

  1. Have WebRtcServer running and a client connected.
  2. In server side call webRtcServer.close().
  3. It should not crash anymore.

Fixes #1388

### Details

- `WebRtcServer` destructor must first close its `WebRtcTransports` and then the UDP sockets and TCP servers (so also its TCP connections). Otherwise those `WebRtcTransports` will try to send DTLS Close Alert on an already closed/freed `UdpSocketHandle` or `TcpConnectionHandle`.

### Steps to verify

1. Have `WebRtcServer` running and a client connected.
2. In server side call `webRtcServer.close()`.
3. It should not crash anymore.
@ibc ibc requested a review from jmillan May 3, 2024 10:30
@jmillan jmillan merged commit d33cb88 into v3 May 3, 2024
35 checks passed
@jmillan jmillan deleted the fix-worker-crash-when-closing-webrtcserver-with-active-connections branch May 3, 2024 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Worker crash when closing WebRtcServer if there are TCP connections active
2 participants