]> sjero.net Git - wget/blobdiff - src/connect.c
[svn] Remove host canonicalization code.
[wget] / src / connect.c
index 3e676b42a5ac39605f0275d7ad671f3421482953..aa3153ede2fba79c37da561c64b4d66aa6d0430e 100644 (file)
@@ -65,21 +65,9 @@ uerr_t
 make_connection (int *sock, char *hostname, unsigned short port)
 {
   struct sockaddr_in sock_name;
-  /* struct hostent *hptr; */
-
-  /* Get internet address of the host.  We can do it either by calling
-     ngethostbyname, or by calling store_hostaddress, from host.c.
-     storehostaddress is better since it caches calls to
-     gethostbyname.  */
-#if 1
-  if (!store_hostaddress ((unsigned char *)&sock_name.sin_addr, hostname))
-    return HOSTERR;
-#else  /* never */
-  if (!(hptr = ngethostbyname (hostname)))
+
+  if (!lookup_host (hostname, (unsigned char *)&sock_name.sin_addr))
     return HOSTERR;
-  /* Copy the address of the host to socket description.  */
-  memcpy (&sock_name.sin_addr, hptr->h_addr, hptr->h_length);
-#endif /* never */
 
   /* Set port and protocol */
   sock_name.sin_family = AF_INET;