// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: ftp.cc,v 1.26 2001/03/24 22:34:55 jgg Exp $
+// $Id: ftp.cc,v 1.28 2001/05/22 04:02:00 jgg Exp $
/* ######################################################################
FTP Aquire Method - This is the FTP aquire method for APT.
#include <stdio.h>
#include <errno.h>
#include <stdarg.h>
+#include <iostream>
// Internet stuff
#include <netinet/in.h>
#include "ftp.h"
/*}}}*/
+using namespace std;
+
/* This table is for the EPRT and EPSV commands, it maps the OS address
family to the IETF address families */
struct AFMap
RotateDNS();
if (Connect(Host,Port,"ftp",21,ServerFd,TimeOut,Owner) == false)
return false;
+
+ // Login must be before getpeername otherwise dante won't work.
+ Owner->Status("Logging in");
+ bool Res = Login();
// Get the remote server's address
PeerAddrLen = sizeof(PeerAddr);
if (getsockname(ServerFd,(sockaddr *)&ServerAddr,&ServerAddrLen) != 0)
return _error->Errno("getsockname","Unable to determine the local name");
- Owner->Status("Logging in");
- return Login();
+ return Res;
}
/*}}}*/
// FTPConn::Login - Login to the remote server /*{{{*/