[rtmpdump] Patch to work around lack of SO_RCVTIMEO on Solaris 10 and prior

Alasdair Lumsden alasdairrr at gmail.com
Wed Nov 30 02:01:22 CET 2011


Hi All,

We have a requirement to run rtmpdump on Solaris 10, which unfortunately is missing SO_RCVTIMEO (although it is present in OpenSolaris snv_106 and newer). This results in the timeout not working properly.

To rectify this, I have modified rtmpdump to utilise a non-blocking recv with select. I have transplanted the readt and setnonblock functions from netatalk/libatalk/util/socket.c into librtmp/rtmp.c, since it had quite a portable implementation, and the code is licensed as LGPLv2 which is upwards compatible with LGPLv2.1. I've added the guy's copyright header (I don't need a copyright header myself since my changes are trivial).

The patch is here:

http://linux01.everycity.co.uk/~alasdair/solaris_10_timeout.patch

The patch is quite dirty so before being attacked, I'd just like to say I'm not a full time C coder, I haven't done much C since University beyond producing patches. I think it's probably worth refactoring readt/setnonblock out into its own source file. I'm also not sure if my approach with TLS_read is a good one.

I wouldn't mind tidying up the code if anyone has any constructive comments but before doing so I'd like to know if it's likely to be accepted, as obviously there's no point in me polishing this if it's not going to get integrated.

Cheers,

Alasdair


More information about the rtmpdump mailing list