[rtmpdump] librtmp infinite loop

Howard Chu hyc at highlandsun.com
Fri Dec 24 23:32:01 CET 2010


Steve McFarlin wrote:
>
> On Dec 24, 2010, at 2:11 PM, Steve McFarlin wrote:
>
>> Hello,
>>
>> platform: darwin - iphone
>> librtmp ver: latest package download and integrated into FFmpeg
>> Setup: RTMP publish to server
>>
>> Problem:
>>
>> If the connection to the remote server is closed a SIGPIPE is raised. It is at this point librtmp will enter into an infinite loop. The loop trace is as follows (some error logs were added by me).
>>
>> ERROR: WriteN, RTMP send error 32 (43 bytes)
>> RTMP_Close
>> RTMP_Close - Still connected
>> SendFCUnpublish
>> RTMP_SendPacket
>> ERROR: WriteN, RTMP send error 32 (43 bytes)
>> RTMP_Close
>> RTMP_Close - Still connected
>> SendFCUnpublish
>> RTMP_SendPacket
>> ERROR: WriteN, RTMP send error 32 (43 bytes)
>> RTMP_Close
>> RTMP_Close - Still connected
>> ....
>>
>>
>> This will go on forever. I am currently investigating why this occurs. I will update if I find why.

> Simply adding the following code to rtmp.c::WriteN fixes the issue.
>
> if (sockerr == EPIPE) {
>      r->m_sb.sb_socket = -1;
> }
>
That will leak the descriptor. I'll commit a fix shortly.


More information about the rtmpdump mailing list