[FFmpeg-devel] [PATCH] gethostbyname_r

Ronald S. Bultje rsbultje
Thu Aug 2 18:36:31 CEST 2007


Hi,

On 8/2/07, Nicolas George <nicolas.george at normalesup.org> wrote:
>
> Le quintidi 15 thermidor, an CCXV, Ronald S. Bultje a ?crit:
> > attached patch changes the meaning of the av_resolve_host function
> signature
> > to not just be -1, but actually contain herrno code information. For
> this,
> > we use gethostbyname() or gethostbyname_r(), which is also added in this
> > patch.
>
> gethostbyname_r is not standard, and gethostbyname is obsolete. New
> applications are supposed to use getaddrinfo, which is thread-safe and
> protocol independent. And standard.
>
> getaddrinfo is already used in libavformat/udp.c, in
> udp_ipv6_resolve_host,
> but it is not IPv6-specific.
>
> I believe that, although it would probably mean a little more work, using
> getaddrinfo by default everywhere would be a cleaner solution.


Maybe someone ( =you? :-) ) should submit a patch for this, since I keep
providing patches for stuff I barely care or know anything about to get
other patches (e.g. the errno one to provide relatively useful error
messages in applications) in that I'm interested in...

Also, if we do this, ffserver and tcp.c need to be made ipv6-compatible, and
I'm definitely not the right person to do that...

Ronald




More information about the ffmpeg-devel mailing list