-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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/make dtls fragment stay within mtu size range #1143
Conversation
Amazing. Thanks a lot. However, probably it will take several days before we can review and merge this PR (super busy days after summer and lot of pending work). |
Yes of course, I'm in no hurry. I will try to find something else mediasoup-related to help out with. As for this PR: I'm just beginning to learn the code base and I'm not sure if I got it right in terms of encapsulation and data hiding. Might want to refactor that. |
I'm testing this PR right now, but I'll do in the |
I see a potential problem: void DtlsTransport::Reset()
{
MS_TRACE();
int ret;
if (!IsRunning())
return;
MS_WARN_TAG(dtls, "resetting DTLS transport");
// Stop the DTLS timer.
this->timer->Stop();
// We need to reset the SSL instance so we need to "shutdown" it, but we
// don't want to send a Close Alert to the peer, so just don't call
// SendPendingOutgoingDTLSData().
SSL_shutdown(this->ssl);
this->localRole.reset();
this->state = DtlsState::NEW;
this->handshakeDone = false;
this->handshakeDoneNow = false;
// Reset SSL status.
// NOTE: For this to properly work, SSL_shutdown() must be called before.
// NOTE: This may fail if not enough DTLS handshake data has been received,
// but we don't care so just clear the error queue.
ret = SSL_clear(this->ssl);
if (ret == 0)
ERR_clear_error();
} Note the: // We need to reset the SSL instance so we need to "shutdown" it, but we// don't want to send a Close Alert to the peer, so just don't call
// SendPendingOutgoingDTLSData().
SSL_shutdown(this->ssl); However in your PR we no longer call |
Let's ignore this use case since AFAIR it never worked fine. This is, if
|
closes #1100
This PR will make DTLS fragment stay within MTU size range. Currently that's not always the case, e.g. on large certificate size.
The solution is to stop calling
BIO_get_mem_data()
manually for pending out going data, and instead rely on a callback function, set withBIO_set_callback_ex()
.Packet capture during usage when running a worker build from this branch: