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

Luca Abeni lucabe72
Mon Jan 4 13:04:00 CET 2010


On 04/01/10 12:52, Martin Storsj? wrote:
[...]
>> Maybe, the "non CONFIG_IPV6" functions can be disabled/removed one by one,
>> instead of removing the whole "non CONFIG_IPV6" at one time?
>> I mean, you can start by removing the functions that do not use getnameinfo
>> and multicast macros... Just an idea.
>
> I'm not sure if the functions can be upgraded one at a time or that
> requires more refactoring - I'll look into it later if you don't get there
> first.

Well, the "incremental upgrade" obviously requires some work and 
modifications on the existing code. If this makes the transition more 
complex instead of simpler, let's just drop the "incremental upgrade" idea.

[...]
>> But let's keep in mind that 90% of the times (or maybe even 99%) when we use
>> UDP we use numeric addresses, so there are no symbolic names to be resolved,
>> and it should be immediately clear if an address is IPv4 or IPv6.
>
> Well, the udp protocol is used internally within the rtp protocol,
> launched e.g. from the rtsp demuxer, where it probably would happen to use
> hostnames.

But in this case (receiving RTP packets over UDP) you do not really need 
to resolve a remote host address (I don't know, maybe the current code 
does it, but it is not really needed...).


>>> But given this, I guess a better approach would be to simply drop this
>>> patch (it actually feels a bit redundant, since it does the same as the
>>> resolve_host fix in patch 2). Later (after the initial getaddrinfo support
>>> is commited?) we could work on adding more compatibility wrappers for
>>> making the "ipv6 codepath" in udp.c the only one.
>>
>> AFAIR, this was the original plan. But I do not want to stop or slow down
>> things, so if people feel that a different plan is better, let's go for a new
>> plan. My only suggestion is that the disabling/removal of the "non
>> CONFIG_IPV6" codepath can probably be done incrementally (I hope :).
>
> Ok, so lets drop the current patch for the udp protocol, and instead aim
> at cleaning it up and merging the codepaths later, after the first patches
> have been commited.

If you are fine with this, good.
My impression is that at the end the codepaths merge will just consist 
in removing the "#else" part of "CONFIG_IPV6".


			Thanks,
				Luca



More information about the ffmpeg-devel mailing list