title: Segmentation fault when getting host information
body: <p>It happens when called at high concurrency,it seems the result of <code>gethostbyname</code> is not cached ?</p>
  
  <pre><code>static int proxy_getaddr(char *HostName)
  {
      struct hostent*     Host;
      Host=gethostbyname(HostName);
  
      if(!Host)
      {
          unsigned long int addr=inet_addr(HostName);
          if(addr!=-1)
              Host=gethostbyaddr((char*)addr,sizeof(addr),AF_INET);
      }
      ...
  </code></pre>
  
  <p>Here's the core dump:</p>
  
  <pre><code>0x00000034f40e98b1 in gethostbyaddr () from /lib64/libc.so.6
  0x000000000040182c in proxy_getaddr (HostName=0x48d75be0 "stackoverflow.com")
  </code></pre>
  
  <p>How can I fix this issue?</p>