Browse Source

Removing unused code

(methods that are were not even linked into the final image)

Source commit: 748dd3256e84fc5cf010be3bbc7c432db18428cc
Martin Prikryl 9 years ago
parent
commit
038dcc251a

+ 0 - 21
source/filezilla/ApiLog.cpp

@@ -61,27 +61,6 @@ void CApiLog::LogMessageRaw(int nMessageType, LPCTSTR pMsg) const
   SendLogMessage(nMessageType, pMsg);
 }
 
-void CApiLog::LogMessage(int nMessageType, UINT nFormatID, ...) const
-{
-  DebugAssert(nMessageType>=FZ_LOG_STATUS && nMessageType<=FZ_LOG_DEBUG);
-  if (!LoggingMessageType(nMessageType))
-    return;
-
-  CString str;
-  str.LoadString(nFormatID);
-
-  va_list ap;
-
-  va_start(ap, nFormatID);
-  CString text;
-  text.FormatV(str, ap);
-  va_end(ap);
-
-  if (nMessageType>=FZ_LOG_DEBUG)
-    return;
-  SendLogMessage(nMessageType, text);
-}
-
 void CApiLog::SendLogMessage(int nMessageType, LPCTSTR pMsg) const
 {
   if (!LoggingMessageType(nMessageType))

+ 0 - 1
source/filezilla/ApiLog.h

@@ -17,7 +17,6 @@ public:
 
   void LogMessage(int nMessageType, LPCTSTR pMsgFormat, ...) const;
   void LogMessageRaw(int nMessageType, LPCTSTR pMsg) const;
-  void LogMessage(int nMessageType, UINT nFormatID, ...) const;
 
   CString GetOption(int OptionID) const;
   int GetOptionVal(int OptionID) const;

+ 1 - 21
source/filezilla/AsyncProxySocketLayer.cpp

@@ -45,13 +45,6 @@ CAsyncProxySocketLayer::~CAsyncProxySocketLayer()
 /////////////////////////////////////////////////////////////////////////////
 // Member-Funktion CAsyncProxySocketLayer
 
-void CAsyncProxySocketLayer::SetProxy(int nProxyType)
-{
-  //Validate the parameters
-  DebugAssert(nProxyType==PROXYTYPE_NOPROXY);
-  m_ProxyData.nProxyType=nProxyType;
-}
-
 void CAsyncProxySocketLayer::SetProxy(int nProxyType, const char * pProxyHost, int ProxyPort)
 {
   USES_CONVERSION;
@@ -966,7 +959,7 @@ void CAsyncProxySocketLayer::ClearBuffer()
 
 BOOL CAsyncProxySocketLayer::Listen( int nConnectionBacklog)
 {
-  if (GetProxyType()==PROXYTYPE_NOPROXY)
+  if (m_ProxyData.nProxyType==PROXYTYPE_NOPROXY)
     return ListenNext(nConnectionBacklog);
 
   USES_CONVERSION;
@@ -1055,11 +1048,6 @@ BOOL CAsyncProxySocketLayer::GetPeerName( SOCKADDR* lpSockAddr, int* lpSockAddrL
   return res;
 }
 
-int CAsyncProxySocketLayer::GetProxyType() const
-{
-  return m_ProxyData.nProxyType;
-}
-
 void CAsyncProxySocketLayer::Close()
 {
   delete [] m_ProxyData.pProxyHost;
@@ -1103,14 +1091,6 @@ int CAsyncProxySocketLayer::Receive(void* lpBuf, int nBufLen, int nFlags)
   return ReceiveNext(lpBuf, nBufLen, nFlags);
 }
 
-BOOL CAsyncProxySocketLayer::PrepareListen(unsigned long ip)
-{
-  if (GetLayerState()!=notsock && GetLayerState()!=unconnected)
-    return FALSE;
-  m_nProxyPeerIp=ip;
-  return TRUE;
-}
-
 BOOL CAsyncProxySocketLayer::Accept( CAsyncSocketEx& rConnectedSocket, SOCKADDR* lpSockAddr /*=NULL*/, int* lpSockAddrLen /*=NULL*/ )
 {
   if (!m_ProxyData.nProxyType)

+ 0 - 23
source/filezilla/AsyncProxySocketLayer.h

@@ -42,25 +42,9 @@ PROXYSTATUS_LISTENSOCKETCREATED 8 //Called when a listen socket was created succ
                 //on which the listen socket will be created
                 //The two parameters will contain the ip and port of the listen socket on the server.
 
-If you want to use CAsyncProxySocketLayer to create a listen socket, you
-have to use this overloaded function:
-BOOL PrepareListen(unsigned long serverIp);
-serverIP is the IP of the server you are already connected
-through the SOCKS proxy. You can't use listen sockets over a
-SOCKS proxy without a primary connection. Listen sockets are only
-supported by SOCKS proxies, this won't work with HTTP proxies.
-When the listen socket is created successfully, the PROXYSTATUS_LISTENSOCKETCREATED
-notification is sent. The parameters  will tell you the ip and the port of the listen socket.
-After it you have to handle the OnAccept message and accept the
-connection.
-Be carful when calling Accept: rConnected socket will NOT be filled! Instead use the instance which created the
-listen socket, it will handle the data connection.
-If you want to accept more than one connection, you have to create a listing socket for each of them!
-
 Description of important functions and their parameters:
 --------------------------------------------------------
 
-void SetProxy(int nProxyType);
 void SetProxy(int nProxyType, const char * ProxyHost, int nProxyPort);
 void SetProxy(int nProxyType, const char *, int nProxyPort, const char * ProxyUser, const char * ProxyPass);
 
@@ -118,7 +102,6 @@ public:
   virtual BOOL Connect(const SOCKADDR * lpSockAddr, int nSockAddrLen);
   virtual BOOL Listen(int nConnectionBacklog);
 
-  void SetProxy(int nProxyType); // Only PROXYTYPE_NOPROXY
   void SetProxy(int nProxyType, const char * pProxyHost, int ProxyPort); // May not be PROXYTYPE_NOPROXY
 
   // Sets the proxy details.
@@ -129,12 +112,6 @@ public:
   // ProxyPass - the password for SOCKS5 proxies
   void SetProxy(int nProxyType, const char * pProxyHost, int ProxyPort, const char * pProxyUser, const char * pProxyPass); // Only SOCKS5 and HTTP1.1 proxies
 
-  // Prepare listen
-  BOOL PrepareListen(unsigned long ip);
-
-  int GetProxyType() const;
-  // Returns the type of the proxy
-
   // Returns the address of the server behind the SOCKS proxy you are connected to
   virtual BOOL GetPeerName(CString & rPeerAddress, UINT & rPeerPort);
   virtual BOOL GetPeerName(SOCKADDR * lpSockAddr, int * lpSockAddrLen);

+ 0 - 22
source/filezilla/FileZillaApi.cpp

@@ -112,28 +112,6 @@ int CFileZillaApi::Connect(const t_server &server)
   return m_pMainThread->LastOperationSuccessful()?FZ_REPLY_OK:FZ_REPLY_ERROR;
 }
 
-int CFileZillaApi::List()
-{
-  //Check if call allowed
-  if (!m_bInitialized)
-    return FZ_REPLY_NOTINITIALIZED;
-  if (IsConnected()==FZ_REPLY_NOTCONNECTED)
-    return FZ_REPLY_NOTCONNECTED;
-  CServerPath path;
-// seems to be incorrectly skipped when cache is not required
-  if (!m_pMainThread->GetWorkingDirPath(path) || path.IsEmpty())
-    m_pMainThread->GetCurrentPath(path);
-
-  if (m_pMainThread->IsBusy())
-    return FZ_REPLY_BUSY;
-
-  t_command command;
-  command.id=FZ_COMMAND_LIST;
-  command.path = path;
-  m_pMainThread->Command(command);
-  return m_pMainThread->LastOperationSuccessful()?FZ_REPLY_OK:FZ_REPLY_ERROR;
-}
-
 int CFileZillaApi::Cancel()
 {
   //Check if call allowed

+ 0 - 1
source/filezilla/FileZillaApi.h

@@ -240,7 +240,6 @@ public:
   // Operations
   int Connect(const t_server & server);
 
-  int List();
   int List(const CServerPath & path);
 
   int ListFile(CString FileName, const CServerPath & path); //Get info about specified file

+ 0 - 6
source/filezilla/FileZillaIntf.cpp

@@ -211,12 +211,6 @@ bool __fastcall TFileZillaIntf::Rename(const wchar_t* OldName,
   return Check(FFileZillaApi->Rename(OldName, NewName, Path, NewPath), L"rename");
 }
 //---------------------------------------------------------------------------
-bool __fastcall TFileZillaIntf::List()
-{
-  DebugAssert(FFileZillaApi != NULL);
-  return Check(FFileZillaApi->List(), L"list");
-}
-//---------------------------------------------------------------------------
 bool __fastcall TFileZillaIntf::List(const wchar_t * APath)
 {
   DebugAssert(FFileZillaApi != NULL);

+ 0 - 1
source/filezilla/FileZillaIntf.h

@@ -179,7 +179,6 @@ public:
     X509 * Certificate, EVP_PKEY * PrivateKey);
   bool __fastcall Close(bool AllowBusy);
 
-  bool __fastcall List();
   bool __fastcall List(const wchar_t * Path);
   bool __fastcall ListFile(const wchar_t * FileName, const wchar_t * APath);
 

+ 0 - 57
source/filezilla/MainThread.cpp

@@ -82,38 +82,6 @@ void CMainThread::OnTimer(WPARAM wParam, LPARAM lParam)
   return;
 }
 
-void CMainThread::ShowStatus(CString status, int type)
-{
-  ECS;
-  if (m_bQuit)
-  {
-    LCS;
-    return;
-  }
-  LCS;
-  //Displays a message in the message log
-  t_ffam_statusmessage *pStatus = new t_ffam_statusmessage;
-  pStatus->post = TRUE;
-  pStatus->status = status;
-  pStatus->type = type;
-  if (!GetIntern()->PostMessage(FZ_MSG_MAKEMSG(FZ_MSG_STATUS, 0), (LPARAM)pStatus))
-    delete pStatus;
-}
-
-void CMainThread::ShowStatus(UINT nID, int type)
-{
-  ECS;
-  if (m_bQuit)
-  {
-    LCS;
-    return;
-  }
-  LCS;
-  CString str;
-  str.LoadString(nID);
-  ShowStatus(str,type);
-}
-
 BOOL CMainThread::OnThreadMessage(UINT Msg, WPARAM wParam, LPARAM lParam)
 {
   if (Msg==m_nInternalMessageID)
@@ -387,20 +355,6 @@ void CMainThread::SendDirectoryListing(t_directory * pDirectoryToSend)
   }
 }
 
-bool CMainThread::GetWorkingDirPath(CServerPath &path)
-{
-  ECS;
-  if (m_pWorkingDir)
-  {
-    path = m_pWorkingDir->path;
-    LCS;
-    return true;
-  }
-  LCS;
-
-  return false;
-}
-
 __int64 CMainThread::GetAsyncRequestID() const
 {
   return m_nAsyncRequestID;
@@ -465,14 +419,3 @@ DWORD CMainThread::Run()
   delete this;
   return res;
 }
-
-BOOL CMainThread::IsValid() const
-{
-  if (!this)
-    return FALSE;
-
-  if (IsBadWritePtr((VOID *)this, sizeof(CMainThread)) )
-    return FALSE;
-
-  return TRUE;
-}

+ 0 - 5
source/filezilla/MainThread.h

@@ -25,7 +25,6 @@ public:
   DWORD m_dwThreadId;
   HANDLE m_hThread;
   static CMainThread * Create(int nPriority = THREAD_PRIORITY_NORMAL, DWORD dwCreateFlags = 0);
-  bool GetWorkingDirPath(CServerPath & path);
   void SetWorkingDir(t_directory * pWorkingDir);
   BOOL GetWorkingDir(t_directory * pWorkingDir);
   void SendDirectoryListing(t_directory * pDirectoryToSend);
@@ -56,8 +55,6 @@ public:
   DWORD ResumeThread();
   BOOL PostThreadMessage( UINT message , WPARAM wParam, LPARAM lParam);
 
-  BOOL IsValid() const;
-
 protected:
   BOOL InitInstance();
   DWORD ExitInstance();
@@ -65,8 +62,6 @@ protected:
   static DWORD WINAPI ThreadProc(LPVOID lpParameter);
 
   CCriticalSection m_CriticalSection;
-  void ShowStatus(CString status,int type);
-  void ShowStatus(UINT nID, int type);
 
   CFtpControlSocket * m_pControlSocket;
   __int64 m_nAsyncRequestID;

+ 0 - 195
source/filezilla/ServerPath.cpp

@@ -15,12 +15,6 @@ CServerPath::CServerPath()
   m_bEmpty = TRUE;
 }
 
-CServerPath::CServerPath(int nServerType)
-{
-  m_nServerType = nServerType;
-  m_bEmpty = TRUE;
-}
-
 CServerPath::CServerPath(CString path, bool trim)
 {
   m_nServerType = FZ_SERVERTYPE_FTP;
@@ -575,195 +569,6 @@ BOOL CServerPath::AddSubdir(CString subdir)
   return TRUE;
 }
 
-CServerPath::CServerPath(CString subdir, const CServerPath &parent)
-{
-  *this=parent;
-  subdir.TrimLeft( L" " );
-  subdir.TrimRight( L" " );
-
-  if ( subdir==L"" )
-  {
-    if (IsEmpty())
-      DebugFail();
-    else
-      return;
-  }
-
-  if (!(m_nServerType&FZ_SERVERTYPE_HIGHMASK))
-    m_nServerType=FZ_SERVERTYPE_FTP;
-
-  m_bEmpty = FALSE;
-
-  switch (m_nServerType&FZ_SERVERTYPE_HIGHMASK)
-  {
-  case FZ_SERVERTYPE_FTP:
-    switch(m_nServerType&FZ_SERVERTYPE_SUBMASK)
-    {
-    case FZ_SERVERTYPE_SUB_FTP_MVS:
-    case FZ_SERVERTYPE_SUB_FTP_BS2000:
-      {
-        subdir.TrimLeft(FTP_MVS_DOUBLE_QUOTA);
-        subdir.TrimRight(FTP_MVS_DOUBLE_QUOTA);
-
-        if (subdir.Left(1) == L"'")
-        {
-          if (subdir.Right(1) == L"'")
-          {
-               if (!SetPath(subdir))
-              m_bEmpty = true;
-          }
-          else
-            m_bEmpty = true;
-        }
-        else if (subdir.Right(1) == L"'")
-          m_bEmpty = true;
-        else if (!m_bEmpty)
-        {
-          if (m_Prefix != L".")
-            m_bEmpty  = true;
-          else
-          {
-            subdir.TrimLeft(L'.');
-            while (subdir.Replace(L"..", L"."));
-
-            int pos = subdir.Find(L'.');
-            while (pos != -1)
-            {
-              m_Segments.push_back(subdir.Left(pos));
-              subdir = subdir.Mid(pos + 1);
-              pos = subdir.Find(L'.');
-            }
-            if (subdir != L"")
-            {
-              m_Prefix = L"";
-              m_Segments.push_back(subdir);
-            }
-          }
-        }
-        else if (!SetPath(subdir))
-          m_bEmpty = true;
-      }
-      break;
-    case FZ_SERVERTYPE_SUB_FTP_VMS:
-      {
-        int pos1=subdir.Find( L"[" );
-        if (pos1==-1)
-        {
-          DebugAssert( subdir.Right(1)!=L"]" );
-          while ( subdir.Replace( L"..", L"." ) );
-        }
-        else
-        {
-          if (subdir.Right(1)!=L"]")
-            DebugFail();
-          subdir=subdir.Left(subdir.GetLength()-1);
-          if (pos1)
-            m_Prefix=subdir.Left(pos1);
-          else
-            m_Prefix=L"";
-          m_Segments.clear();
-          subdir=subdir.Mid(pos1+1);
-
-          DebugAssert(subdir.Find( L"[" )==-1 && subdir.Find( L"]" )==-1);
-        }
-        int pos=subdir.Find( L"." );
-        while(pos!=-1)
-        {
-          m_Segments.push_back(subdir.Left(pos));
-          subdir=subdir.Mid(pos+1);
-          pos=subdir.Find( L"." );
-        }
-        if (subdir!=L"")
-          m_Segments.push_back(subdir);
-      }
-      break;
-    case FZ_SERVERTYPE_SUB_FTP_WINDOWS:
-      {
-        subdir.Replace( L"\\", L"/" );
-        while(subdir.Replace( L"//", L"/" ));
-        if (subdir.GetLength() >= 2 && subdir[1] == L':')
-          m_Segments.clear();
-        else if (subdir[0]==L'/')
-        {
-          CString firstSegment;
-          if (m_Segments.empty())
-            firstSegment = L"C:";
-          else
-            firstSegment = m_Segments.front();
-          m_Segments.clear();
-          m_Segments.push_back(firstSegment);
-          subdir.TrimLeft( L"/" );
-        }
-        subdir.TrimRight( L"/" );
-        int pos = subdir.Find( L"/" );
-        while(pos!=-1)
-        {
-          m_Segments.push_back(subdir.Left(pos));
-          subdir=subdir.Mid(pos+1);
-          pos=subdir.Find( L"/" );
-        }
-        if (subdir!=L"")
-          m_Segments.push_back(subdir);
-        break;
-      }
-    default:
-      subdir.Replace( L"\\", L"/" );
-      while(subdir.Replace( L"//", L"/" ));
-      if (subdir[0]==L'/')
-      {
-        m_Segments.clear();
-        subdir.TrimLeft( L"/" );
-      }
-      subdir.TrimRight( L"/" );
-      int pos=subdir.Find( L"/" );
-      while(pos!=-1)
-      {
-        m_Segments.push_back(subdir.Left(pos));
-        subdir=subdir.Mid(pos+1);
-        pos=subdir.Find( L"/" );
-      }
-      if (subdir!=L"")
-        m_Segments.push_back(subdir);
-      break;
-    }
-    break;
-  case FZ_SERVERTYPE_LOCAL:
-    {
-      subdir.TrimRight( L"\\" );
-      while (subdir.Replace( L"\\\\", L"\\" ));
-      subdir.TrimLeft( L"\\" );
-      int pos=subdir.Find( L":" );
-
-      if (pos==1) //subdir is absolute path
-      {
-        m_Segments.clear();
-        m_Prefix=subdir.Left(pos+1);
-        subdir=subdir.Mid(pos+1);
-        subdir.TrimLeft( L"\\" );
-        if (subdir.Find( L":" )!=-1)
-          DebugFail();
-      }
-      if (pos==-1 || pos==1)
-      {
-        pos=subdir.Find( L"\\" );
-        while (pos!=-1)
-        {
-          m_Segments.push_back(subdir.Left(pos));
-          subdir=subdir.Mid(pos+1);
-          pos=subdir.Find( L"\\" );
-        }
-        if ( subdir!=L"" )
-          m_Segments.push_back(subdir);
-      }
-      else
-        DebugFail();
-    }
-    break;
-  default:
-    DebugFail();
-  }
-}
-
 BOOL CServerPath::SetPath(CString newpath)
 {
   return SetPath(newpath, FALSE);

+ 0 - 2
source/filezilla/ServerPath.h

@@ -12,10 +12,8 @@ public:
   BOOL HasParent() const;
   CString GetLastSegment() const;
   CServerPath();
-  CServerPath(int nServerType);
   CServerPath(CString path, bool trim = true);
   CServerPath(CString path, int nServerType, bool trim = true);
-  CServerPath(CString subdir, const CServerPath & parent); // If subdir is absolute, parent is ignored
   CServerPath(const CServerPath & path);
 
   virtual ~CServerPath();