]> granicus.if.org Git - libevent/commit
Do the proper hack for the (Open)BSD getaddrinfo quirk.
authorNick Mathewson <nickm@torproject.org>
Wed, 18 Nov 2009 23:18:55 +0000 (23:18 +0000)
committerNick Mathewson <nickm@torproject.org>
Wed, 18 Nov 2009 23:18:55 +0000 (23:18 +0000)
commitf070a4aed2129a722f10d23e6defc4f901143fea
tree0bcf94b67514daec041eebfaeace195e90905086
parent07ce7f9991551c571759deabebb7a72527b40840
Do the proper hack for the (Open)BSD getaddrinfo quirk.

From evutil.c:

   Some older BSDs (like OpenBSD up to 4.6) used to believe that
   giving a numeric port without giving an ai_socktype was verboten.
   We test for this so we can apply an appropriate workaround.  If it
   turns out that the bug is present, then:

    - If nodename==NULL and servname is numeric, we build an answer
      ourselves using evutil_getaddrinfo_common().

    - If nodename!=NULL and servname is numeric, then we set
      servname=NULL when calling getaddrinfo, and post-process the
      result to set the ports on it.

   We test for this bug at runtime, since otherwise we can't have the
   same binary run on multiple BSD versions.

svn:r1550
evutil.c