// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: ftp.cc,v 1.26 2001/03/24 22:34:55 jgg Exp $
+// $Id: ftp.cc,v 1.29 2002/04/24 05:35:13 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 /*{{{*/
putenv("no_proxy=");
// Run the http method
- string Path = flNotFile(argv[0]) + "/http";
+ string Path = flNotFile(argv[0]) + "http";
execl(Path.c_str(),Path.c_str(),0);
cerr << "Unable to invoke " << Path << endl;
exit(100);