[FFmpeg-devel] [PATCH/RFC] Prefer getaddrinfo over gethostbyname

Ronald S. Bultje rsbultje
Tue Jan 12 18:37:07 CET 2010


On Tue, Jan 12, 2010 at 12:34 PM, Martin Storsj? <martin at martin.st> wrote:
> On Tue, 12 Jan 2010, Ronald S. Bultje wrote:
>> Mac uses ss_len, which confused me for a second. len + family should
>> be 16 bits, and len may be zero (unset), as is the case for FFmpeg on
>> Mac. That still works fine. So the above should (and does) work.
> No, that'd only work on big-endian, right? And if the ss_len/sa_len field
> for some reason happens to be set, things would fail in ways that are
> quite hard to debug/notice.
>> I agree that it'd be nicer to include the ss_len conditionally
>> depending on whether it is present in sockaddr_in, but as Mans said,
>> ;-).
> Hah. :-)
> Regardless, I don't really have too much an opinion on this matter
> (initially, I just wanted thread-safe host resolving, and here we are
> now...). My vote is on casting to sockaddr and using sa_family instead
> since that has much less risk of getting screwed up on other platforms,
> but choose any one you like.

On what systems is sockaddr_storage not defined?


More information about the ffmpeg-devel mailing list