-
Notifications
You must be signed in to change notification settings - Fork 463
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
STUN Server null reference exception fix #1337
base: master
Are you sure you want to change the base?
Conversation
RTC updates
use wyze camera name from url
Add timeout to ice gathering Add prefer H264 flag for compatible formats
Add sanity check for ICE Gathering timeout
Add sanity check for ICE Gathering timeout Fix bug in g722 codec
Fix bug where duplicate durations were being added to local track timestamp in SendAudioFrame Ignore H264 formats that use unsupported packetization modes Clean up logic in AreMatch
What's actually changing in this PR? Which line has the change and is not just a refactor? |
It's not returning null..when it returned null you got a null reference exception. |
Is this the non-refactor change?
Is there any reason to throw an exception? With protocols like STUN & RTCP there are regularly unsupported message types. In 99% of cases it's safe to ignore them and allow the connection to proceed. Throwing an exception will potentially mean WebRTC connections will be blocked by an unknown STUN message type. |
I only found two references to it in the code base and there was no null check on the result hence the null reference exception. You make a good point though it should probably be fixed upstream. |
Actually.. The method i changed is private and it's only called in 2 locations in SipSorcery code, both of which will throw a null reference exception immediately afterwards if GetResponse returns null. I think it's better design to throw a meaningful exception message rather than let it fail with a null reference exception which is basically meaningless to consumers.
|
If you add a TURN option to ice it sends allocate requests to the STUN server which results in null reference exceptions as the STUN server only accepts binding requests. This adds a more helpful error message to debug output.