agent/wpthook/hook_winsock.cc
/*-----------------------------------------------------------------------------
  Firefox falls back to gethostbyname if ipv6 isn't detected on the machine
-----------------------------------------------------------------------------*/
Firefox falls back to gethostbyname if ipv6 isn't detected on the machine
Firefox falls back to gethostbyname if ipv6 isn ' t detected on the machine
struct hostent * CWsHook::gethostbyname(const char * pNodeName) {
  struct hostent * ret = NULL;
  _sockets.ResetSslFd();
  void * context = NULL;
  CString name = CA2T(pNodeName);
  if (!_test_state._exit)
      context = _dns.LookupStart(name);
  if (_gethostbyname)
    ret = _gethostbyname((LPCSTR)CT2A(name));
  if (ret && !_test_state._exit) {
    if (ret->h_name)
      _dns.LookupAlias(name, (LPCTSTR)CA2T(ret->h_name));
    char ** alias = ret->h_aliases;
    int count = 0;
    while (*alias && count < 100) {
      count++;
      _dns.LookupAlias(name, (LPCTSTR)CA2T(*alias));
      alias++;
    }    
    for (int i = 0; ret->h_addr_list[i] != 0; i++)
      _dns.LookupAddress(context, *(u_long *)ret->h_addr_list[i]);
  }
  int err = WSAHOST_NOT_FOUND;
  if (ret)
    err = 0;
  if (context)
    _dns.LookupDone(context, err);
  return ret;
}
struct hostent * CWsHook :: gethostbyname ( const char * pNodeName ) { struct hostent * ret = NULL ; _sockets . ResetSslFd ( ) ; void * context = NULL ; CString name = CA2T ( pNodeName ) ; if ( ! _test_state . _exit ) context = _dns . LookupStart ( name ) ; if ( _gethostbyname ) ret = _gethostbyname ( ( LPCSTR ) CT2A ( name ) ) ; if ( ret && ! _test_state . _exit ) { if ( ret -> h_name ) _dns . LookupAlias ( name , ( LPCTSTR ) CA2T ( ret -> h_name ) ) ; char * * alias = ret -> h_aliases ; int count = 0 ; while ( * alias && count < 100 ) { count ++ ; _dns . LookupAlias ( name , ( LPCTSTR ) CA2T ( * alias ) ) ; alias ++ ; } for ( int i = 0 ; ret -> h_addr_list [ i ] != 0 ; i ++ ) _dns . LookupAddress ( context , * ( u_long * ) ret -> h_addr_list [ i ] ) ; } int err = WSAHOST_NOT_FOUND ; if ( ret ) err = 0 ; if ( context ) _dns . LookupDone ( context , err ) ; return ret ; }
Firefox falls back to gethostbyname if ipv6 isn't detected on the machine
Firefox falls back to gethostbyname if ipv6 isn ' t detected on the machine