-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
librtmp: Fix reset socket descriptor to -1 after closing RTMP connect… #12207
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
base: master
Are you sure you want to change the base?
Conversation
Please remove the punctuation ( |
44fd087
to
7ec6d2f
Compare
done. |
Wouldn't doing this in |
7ec6d2f
to
cf22325
Compare
You are right. |
Out of curiosity, where exactly is that stack from? I'm unable to find any references to a liblive-push anywhere. Is this something based on librtmp? |
|
Is this something that you are distributing? Is the source available? I'm reluctant to accept a fix based on a project that might be violating the librtmp license without understanding the context a bit more. Thanks in advance. |
Since it’s my own demo project and it’s not fully developed yet, it will be available on GitHub later with a public repository. |
That should be fine then, no need to delay for your release if it is just internal for the moment. Thanks for the context, we were just curious about the crash stack and couldn't find the library anywhere. |
So can it be merged normally now? |
Description
The socket descriptor (
sb_socket
) is explicitly set to -1 after closing in theWriteN
function.The client ID cleanup logic in
RTMP_Close
is moved after the socket closure to maintain proper resource cleanup order.Motivation and Context
I was using RTMP for live streaming on Android, and when I shut down the server, the above stack trace appeared. After investigation, the cause was as follows:
close()
on a socket that has already been closed.RTMP_Close()
, if the current sb_socket is still valid, the flow re-entersWriteN()
viaSendFCUnpublish()
->RTMP_SendPacket()
. This causesRTMPSockBuf_Send()
to fail again, leading back toRTMP_Close()
and creating an infinite loop.How Has This Been Tested?
Types of changes
Checklist: