]> sjero.net Git - wget/blobdiff - src/ftp-basic.c
[svn] No longer include INET headers in ftp-basic.c.
[wget] / src / ftp-basic.c
index 5c60ccfb116741faee82cfe341a0e240ef0b7cc0..6a1c045390dcfb4c0105b1fe40a7d6c079df6ae9 100644 (file)
@@ -44,17 +44,6 @@ so, delete this exception statement from your version.  */
 #endif
 #include <sys/types.h>
 
-/* For inet_ntop. */
-#ifndef WINDOWS
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#endif
-
-#ifdef WINDOWS
-# include <winsock.h>
-#endif
-
 #include "wget.h"
 #include "utils.h"
 #include "rbuf.h"
@@ -286,7 +275,7 @@ ftp_port (struct rbuf *rbuf, int *local_sock)
 
   /* Get the address of this side of the connection. */
   if (!socket_ip_address (RBUF_FD (rbuf), &addr, ENDPOINT_LOCAL))
-    return BINDERR;
+    return FTPSYSERR;
 
   assert (addr.type == IPV4_ADDRESS);
 
@@ -294,9 +283,9 @@ ftp_port (struct rbuf *rbuf, int *local_sock)
   port = 0;
 
   /* Bind the port.  */
-  err = bindport (&addr, &port, local_sock);
-  if (err != BINDOK)
-    return err;
+  *local_sock = bind_local (&addr, &port);
+  if (*local_sock < 0)
+    return FTPSYSERR;
 
   /* Construct the argument of PORT (of the form a,b,c,d,e,f). */
   ip_address_to_port_repr (&addr, port, bytes, sizeof (bytes));
@@ -383,7 +372,7 @@ ftp_lprt (struct rbuf *rbuf, int *local_sock)
 
   /* Get the address of this side of the connection. */
   if (!socket_ip_address (RBUF_FD (rbuf), &addr, ENDPOINT_LOCAL))
-    return BINDERR;
+    return FTPSYSERR;
 
   assert (addr.type == IPV4_ADDRESS || addr.type == IPV6_ADDRESS);
 
@@ -391,9 +380,9 @@ ftp_lprt (struct rbuf *rbuf, int *local_sock)
   port = 0;
 
   /* Bind the port.  */
-  err = bindport (&addr, &port, local_sock);
-  if (err != BINDOK)
-    return err;
+  *local_sock = bind_local (&addr, &port);
+  if (*local_sock < 0)
+    return FTPSYSERR;
 
   /* Construct the argument of LPRT (of the form af,n,h1,h2,...,hn,p1,p2). */
   ip_address_to_lprt_repr (&addr, port, bytes, sizeof (bytes));
@@ -467,7 +456,7 @@ ftp_eprt (struct rbuf *rbuf, int *local_sock)
 
   /* Get the address of this side of the connection. */
   if (!socket_ip_address (RBUF_FD (rbuf), &addr, ENDPOINT_LOCAL))
-    return BINDERR;
+    return FTPSYSERR;
 
   assert (addr.type == IPV4_ADDRESS || addr.type == IPV6_ADDRESS);
 
@@ -475,9 +464,9 @@ ftp_eprt (struct rbuf *rbuf, int *local_sock)
   port = 0;
 
   /* Bind the port.  */
-  err = bindport (&addr, &port, local_sock);
-  if (err != BINDOK)
-    return err;
+  *local_sock = bind_local (&addr, &port);
+  if (*local_sock < 0)
+    return FTPSYSERR;
 
   /* Construct the argument of LPRT (of the form af,n,h1,h2,...,hn,p1,p2). */
   ip_address_to_eprt_repr (&addr, port, bytes, sizeof (bytes));
@@ -1090,7 +1079,8 @@ ftp_syst (struct rbuf *rbuf, enum stype *server_type)
     *server_type = ST_VMS;
   else if (!strcasecmp (request, "UNIX"))
     *server_type = ST_UNIX;
-  else if (!strcasecmp (request, "WINDOWS_NT"))
+  else if (!strcasecmp (request, "WINDOWS_NT")
+          || !strcasecmp (request, "WINDOWS2000"))
     *server_type = ST_WINNT;
   else if (!strcasecmp (request, "MACOS"))
     *server_type = ST_MACOS;