[vlc-devel] [PATCH 08/18] Add missing getaddrinfo(), freeaddrinfo(), getnameinfo() and gai_strerror() for OS/2
KO Myung-Hun
komh78 at gmail.com
Sun Oct 23 04:59:51 CEST 2011
Rémi Denis-Courmont wrote:
> Hello,
>
> On Friday 21 October 2011, KO Myung-Hun wrote:
>> Rémi Denis-Courmont wrote:
>>> Le jeudi 20 octobre 2011 15:30:15 KO Myung-Hun, vous avez écrit :
>>>> ---
>>>>
>>>> include/vlc_network.h | 33 +++++
>>>> src/network/getaddrinfo.c | 334
>>>>
>>>> +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 367
>>>> insertions(+), 0 deletions(-)
>>>
>>> This code seems to be ripped from some old crap that I wrote years ago.
>>> Unfortunately, that implementation of getaddrinfo() assumes that
>>> gethostbyname() and gethostbyaddr() are thread-safe. I believe this is
>>> the case on Winsock 2 / Windows 9x which this code was aimed at.
>>
>> I've confirmed that gethostbyname() and gethostbyaddr() uses static dat,
>> so they are not thread-safe.
>
> getaddrinfo() and getnameinfo() are supposed to be thread-safe (as they are
> specified by IETF and POSIX), and VLC assumes they are.
>
> On Windows, I think gethostbyname() returns data from thread-local storage, so
> it is thread-safe. But this is an exception.
>
Ah, what I said is about OS/2 implementation of gethostbyname() and
gethostbyaddr() not about IETF and POSIX implementation.
>>> I do not know if this really works correctly on OS/2. It might be a bit
>>> more complicated than that...
>>
>> Fortunately, this works correctly on OS/2. So I'll submit a new patch to
>> fix this after this patch is merged.
>>
>> Possible ?
>
> I am not sure what you mean. But I don't really like to clutter the generic
> network code with this. If you have an OS/2-specific solution, it belongs in
> src/os2/ IMHO.
>
What I meant is that I'll send another patch to fix this problem after
this patch is pushed.
Anyway, as you said, I'll move this codes to src/os2.
--
KO Myung-Hun
Using Mozilla SeaMonkey 2.0.14
Under OS/2 Warp 4 for Korean with FixPak #15
On AMD ThunderBird 1GHz with 512 MB RAM
Korean OS/2 User Community : http://www.ecomstation.co.kr
More information about the vlc-devel
mailing list