myserver-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myserver-commit] [SCM] GNU MyServer branch, master, updated. ef37279196


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. ef37279196c467a7c8dfb669fc8bc22e6ce7fd38
Date: Wed, 15 Jul 2009 21:12:35 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU MyServer".

The branch, master has been updated
       via  ef37279196c467a7c8dfb669fc8bc22e6ce7fd38 (commit)
       via  d0e7b4fab291566dd9f2e2dbf141e70ca96714c1 (commit)
      from  592e52de4a224e39a737e6b564954855a658db58 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------


commit ef37279196c467a7c8dfb669fc8bc22e6ce7fd38
Author: Giuseppe Scrivano <address@hidden>
Date:   Wed Jul 15 23:11:53 2009 +0200

    FTP class refactoring, some methods were renamed.

diff --git a/myserver/include/protocol/ftp/ftp.h 
b/myserver/include/protocol/ftp/ftp.h
index 0958d78..88b21aa 100755
--- a/myserver/include/protocol/ftp/ftp.h
+++ b/myserver/include/protocol/ftp/ftp.h
@@ -32,215 +32,220 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, 
Boston, MA  02110-1301  USA
 #include <include/conf/security/security_token.h>
 class Ftp;
 
-class FtpUserData : public ProtocolBuffer
+class FtpuserData:public ProtocolBuffer
 {
 public:
-       FtpUserData();
-       ~FtpUserData();
-       void reset();
-       int CloseDataConnection();
-  virtual bool allowDelete(bool);
-
-       enum FtpState
-       {
-               NO_CONTROL_CONNECTION,
-               BUISY,
-               UNAVAILABLE,
-               CONTROL_CONNECTION_UP,
-               USER_LOGGED_IN,
-               DATA_CONNECTION_UP
-       } m_nFtpState;
-
-       std::string m_sUserName, m_sPass;
-       enum FtpRepresentation
-       {
-               REPR_ASCII,
-               REPR_IMAGE
-       } m_nFtpRepresentation;
-       enum FtpFormatControl
-       {
-               NON_PRINT
-       } m_nFtpFormatControl;
-       enum FtpFileStructure
-       {
-               STRU_FILE
-       } m_nFtpFileStructure;
-       enum FtpTransferMode
-       {
-               MODE_STREAM
-       } m_nTransferMode;
-       ConnectionPtr m_pDataConnection;
-       Mutex m_DataConnBusy;
-       FtpHost m_cdh;
-       std::string m_cwd;
-       int m_nLocalDataPort;
-       bool m_bBreakDataConnection;
-       ThreadID m_dataThreadId;
-       bool m_bPassiveSrv;
-       u_long m_nRestartOffset;
-       std::string m_sRenameFrom;
-
-       // STAT data
-       std::string m_sCurrentFileName;
-       u_long m_nFileSize, m_nBytesSent;
+  FtpuserData ();
+  ~FtpuserData ();
+  void reset ();
+  int closeDataConnection ();
+  virtual bool allowdelete (bool);
+
+  enum Ftpstate
+  {
+    NO_CONTROL_CONNECTION,
+    BUISY,
+    UNAVAILABLE,
+    CONTROL_CONNECTION_UP,
+    USER_LOGGED_IN,
+    DATA_CONNECTION_UP
+  } m_nFtpstate;
+
+    std::string m_suserName, m_sPass;
+  enum FtpRepresentation
+  {
+    REPR_ASCII,
+    REPR_IMAGE
+  } m_nFtpRepresentation;
+  enum FtpFormatControl
+  {
+    NON_PRINT
+  } m_nFtpFormatControl;
+  enum FtpFilestructure
+  {
+    STRU_FILE
+  } m_nFtpFilestructure;
+  enum FtpTransfermode
+  {
+    MODE_STREAM
+  } m_nTransfermode;
+  ConnectionPtr m_pDataConnection;
+  Mutex m_DataConnBusy;
+  FtpHost m_cdh;
+    std::string m_cwd;
+  int m_nLocalDataport;
+  bool m_bBreakDataConnection;
+  ThreadID m_dataThreadId;
+  bool m_bPassiveSrv;
+  u_long m_nrestartOffset;
+    std::string m_sRenameFrom;
+
+  // STAT data
+    std::string m_sCurrentFileName;
+  u_long m_nFileSize, m_nBytesSent;
 };
 
 struct FtpThreadContext
 {
-       FtpThreadContext();
-       ConnectionPtr pConnection;
-       MemBuf *buffer;
-       MemBuf *secondaryBuffer;
-       u_long buffersize;
-       u_long secondaryBufferSize;
-       u_long m_nParseLength;
-       u_long nBytesToRead;
-       Ftp *pProtocolInterpreter;
+  FtpThreadContext ();
+  ConnectionPtr pConnection;
+  MemBuf *buffer;
+  MemBuf *secondaryBuffer;
+  u_long buffersize;
+  u_long secondaryBufferSize;
+  u_long m_nParseLength;
+  u_long nBytesToRead;
+  Ftp *pProtocolInterpreter;
   SecurityToken st;
 };
 
-class Ftp : public Protocol
+class Ftp:public Protocol
 {
 public:
-       Ftp();
-       virtual ~Ftp();
-       virtual int controlConnection(ConnectionPtr pConnection, char *b1, char 
*b2,
-                       int bs1, int bs2, u_long nbtr, u_long id);
-       static int loadProtocolStatic(XmlParser*);
-       static int unLoadProtocolStatic(XmlParser*);
-// Ftp helpers
-       int ParseControlConnection();
-       yyscan_t GetScanner() { return m_scanner; }
-       u_long ComputeParseLength(const YYLTYPE &location);
-
-  void logAccess (int nReplyCode, const std::string &sCustomText);
-       void ftp_reply(int nReplyCode, const std::string &sCustomText = "");
-       //int get_ftp_reply(int nReplyCode, std::string &sReply);
-       int PrintError(const char *msg);//TODO: change this fnc !!!
-       FtpThreadContext td;
-       int CloseDataConnection();
-
-       static int FIRST_PASV_PORT;
-       static int LAST_PASV_PORT;
-
-       int CheckRights(const std::string &sUser, const std::string &sPass,  
const std::string &sPath, int mask);
-       void WaitDataConnection();
-       
-       int OpenDataConnection();
-       int OpenDataPassive();
-       int OpenDataActive();
-
-  virtual char* registerName(char* out, int len);
-  static char* registerNameImpl(char* out, int len);
-
-protected:
-       yyscan_t        m_scanner;
-       bool UserLoggedIn();
-       bool BuildLocalPath(const std::string &sPath, std::string &sOutPath);
-       bool GetLocalPath(const std::string &sPath, std::string &sOutPath);
-       void RetrStor(bool bRetr, bool bAppend, const std::string &sPath);
-       void RemovePipelinedCmds(MemBuf &In, MemBuf &Out);
+  Ftp ();
+  virtual ~ Ftp ();
+  virtual int controlConnection (ConnectionPtr pConnection, char *b1,
+                                char *b2, int bs1, int bs2, u_long nbtr,
+                                u_long id);
+  static int loadProtocolstatic (XmlParser *);
+  static int unLoadProtocolstatic (XmlParser *);
+
+  int parseControlConnection ();
+  yyscan_t getScanner ()
+  {
+    return m_scanner;
+  }
+  u_long computeParseLength (const YYLTYPE & location);
+
+  void logAccess (int nReplyCode, const std::string & sCustomText);
+  void ftpReply (int nReplyCode, const std::string & sCustomText = "");
+
+  int printError (const char *msg);
+  FtpThreadContext td;
+  int closeDataConnection ();
+
+  static int FIRST_PASV_PORT;
+  static int LAST_PASV_PORT;
+
+  int checkRights (const std::string & suser, const std::string & sPass,
+                  const std::string & sPath, int mask);
+  void waitDataConnection ();
+
+  int OpenDataConnection ();
+  int openDataPassive ();
+  int openDataActive ();
+
+  virtual char *registerName (char *out, int len);
+  static char *registerNameImpl (char *out, int len);
+
+  void escapeTelnet (MemBuf & In, MemBuf & Out);
+  void user (const std::string & sParam);
+  void password (const std::string & sParam);
+  void port (const FtpHost & host);
+  void pasv ();
+  int type (int ntypeCode, int nFormatControlCode = -1);
+  void retr (const std::string & sPath);
+  void quit ();
+  void help (const std::string & sCmd = "");
+  void noop ();
+  void stru (int nstructure);
+  void mode (int nmode);
+  void list (const std::string & sParam = "");
+  void nlst (const std::string & sParam = "");
+  void abor ();
+  void cwd (const std::string & sPath);
+  void pwd ();
+  void rest (const std::string & srestPoint);
+  void syst ();
+  void stat (const std::string & sParam = "");
+  void allo (int nSize, int nRecordSize = -1);
+
+  void stor (const std::string & sPath);
+  void stou (const std::string & sPath);
+  void dele (const std::string & sPath);
+  void appe (const std::string & sPath);
+  void mkd (const std::string & sPath);
+  void rmd (const std::string & sPath);
+  void rnfr (const std::string & sPath);
+  void Rnto (const std::string & sPath);
+
+  /* RFC 3659 commands */
+  void size (const std::string & sPath);
 
-public:
-       void EscapeTelnet(MemBuf &In, MemBuf &Out);
 
-// Ftp commands Handlers
-public:
-       void User(const std::string &sParam);
-       void Password(const std::string &sParam);
-       void Port(const FtpHost &host);
-       void Pasv();
-       int Type(int nTypeCode, int nFormatControlCode = -1);
-       void Retr(const std::string &sPath);
-       void Quit();
-       void Help(const std::string &sCmd = "");
-       void Noop();
-       void Stru(int nStructure);
-       void Mode(int nMode);
-       void List(const std::string &sParam = "");
-       void Nlst(const std::string &sParam = "");
-       void Abor();
-       void Cwd(const std::string &sPath);
-       void Pwd();
-       void Rest(const std::string &sRestPoint);
-       void Syst();
-       void Stat(const std::string &sParam = "");
-       void Allo(int nSize, int nRecordSize = -1);
-
-       void Stor(const std::string &sPath);
-       void Stou(const std::string &sPath);
-       void Dele(const std::string &sPath);
-       void Appe(const std::string &sPath);
-       void Mkd(const std::string &sPath);
-       void Rmd(const std::string &sPath);
-       void Rnfr(const std::string &sPath);
-       void Rnto(const std::string &sPath);
-
-       /* RFC 3659 commands*/
-       void Size(const std::string &sPath);
-
-       static bool m_bAllowAnonymous, m_bAnonymousNeedPass, 
m_bAllowAsynchronousCmds, m_bEnablePipelining, m_bEnableStoreCmds;
-       int m_nLocalControlPort;
-       int m_nPassivePort;
+protected:
+  yyscan_t m_scanner;
+  bool userLoggedIn ();
+  bool buildLocalPath (const std::string & sPath, std::string & sOutPath);
+  bool getLocalPath (const std::string & sPath, std::string & sOutPath);
+  void retrstor (bool bretr, bool bappend, const std::string & sPath);
+  void removePipelinedCmds (MemBuf & In, MemBuf & Out);
+
+  static bool m_ballowAnonymous, m_bAnonymousNeedPass,
+    m_ballowAsynchronousCmds, m_bEnablePipelining, m_bEnablestoreCmds;
+
+  int m_nLocalControlport;
+  int m_nPassiveport;
 };
 
 class DataConnectionWorkerThreadData
 {
 public:
-       DataConnectionWorkerThreadData();
-       ~DataConnectionWorkerThreadData();
-       ConnectionPtr m_pConnection;
-       std::string m_sFilePath;
-       bool m_bAppend;
-       Ftp *m_pFtp;
+  DataConnectionWorkerThreadData ();
+  ~DataConnectionWorkerThreadData ();
+  ConnectionPtr m_pConnection;
+    std::string m_sFilePath;
+  bool m_bappend;
+  Ftp *m_pFtp;
 };
 
-int get_ftp_reply(int nReplyCode, std::string &sReply);
-void ftp_reply(ConnectionPtr pConnection, int nReplyCode, const std::string 
&sCustomText = "");
-void yyerror(YYLTYPE *pLoc, Ftp *pContext, const char *msg);
+int getFtpReply (int nReplyCode, std::string & sReply);
+void ftpReply (ConnectionPtr pConnection, int nReplyCode,
+               const std::string & sCustomText = "");
+void yyerror (YYLTYPE * pLoc, Ftp * pContext, const char *msg);
 
 
 
 /*!
  *Adapter class to make Ftp reentrant.
  */
-class FtpProtocol : public Protocol
+class FtpProtocol:public Protocol
 {
 public:
-       FtpProtocol()
+  FtpProtocol ()
   {
     protocolOptions = PROTOCOL_FAST_CHECK;
   }
 
-  virtual ~FtpProtocol()
+  virtual ~ FtpProtocol ()
   {
 
   }
 
-  virtual char* registerName(char* out, int len)
+  virtual char *registerName (char *out, int len)
   {
-    return Ftp::registerNameImpl(out, len);
+    return Ftp::registerNameImpl (out, len);
   }
 
-       virtual int controlConnection(ConnectionPtr a, char *b1, char *b2,
-                                int bs1, int bs2, u_long nbtr, u_long id)
+  virtual int controlConnection (ConnectionPtr a, char *b1, char *b2,
+                                int bs1, int bs2, u_long nbtr, u_long id)
   {
     Ftp ftp;
-    return ftp.controlConnection(a, b1, b2, bs1, bs2, nbtr, id);
+    return ftp.controlConnection (a, b1, b2, bs1, bs2, nbtr, id);
   }
 
-  virtual int loadProtocol(XmlParser* parser)
+  virtual int loadProtocol (XmlParser * parser)
   {
-    return Ftp::loadProtocolStatic(parser);
+    return Ftp::loadProtocolstatic (parser);
   }
-  
-       virtual int unLoadProtocol(XmlParser* parser)
+
+  virtual int unLoadProtocol (XmlParser * parser)
   {
-    return Ftp::unLoadProtocolStatic(parser);
+    return Ftp::unLoadProtocolstatic (parser);
 
   }
 
-  int getProtocolOptions()
+  int getProtocolOptions ()
   {
     return protocolOptions;
   }
diff --git a/myserver/include/protocol/ftp/ftp_common.h 
b/myserver/include/protocol/ftp/ftp_common.h
index 0e0c228..de5a49d 100644
--- a/myserver/include/protocol/ftp/ftp_common.h
+++ b/myserver/include/protocol/ftp/ftp_common.h
@@ -1,7 +1,7 @@
 /* -*- mode: c++ -*- */
 /*
 MyServer
-Copyright (C) 2008 Free Software Foundation, Inc.
+Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
@@ -30,11 +30,11 @@ struct FtpHost
        int p1, p2;
 };
 
-void SetFtpHost(FtpHost &out, const FtpHost &in);
-void SetFtpHost(FtpHost &out, const char *szIn);
-void GetIpAddr(const FtpHost &host, char *pOut, const int &nBuffSize);
-int GetPortNo(const FtpHost &host);
-std::string GetPortNo(unsigned int nPort);
-std::string GetHost(const FtpHost &host);
-void RemovePathsDots(std::string &sPath);
+void setFtpHost(FtpHost &out, const FtpHost &in);
+void setFtpHost(FtpHost &out, const char *szIn);
+void getIpAddr(const FtpHost &host, char *pOut, const int &nBuffSize);
+int getPortNo(const FtpHost &host);
+std::string getPortNo(unsigned int nport);
+std::string getHost(const FtpHost &host);
+
 #endif //__FTP_COMMON_H__ 
diff --git a/myserver/src/protocol/ftp/ftp.cpp 
b/myserver/src/protocol/ftp/ftp.cpp
index 20b32e2..34f7d25 100755
--- a/myserver/src/protocol/ftp/ftp.cpp
+++ b/myserver/src/protocol/ftp/ftp.cpp
@@ -40,15 +40,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
MA  02110-1301  USA
 #include <arpa/inet.h>
 #endif
 
-static DEFINE_THREAD(SendAsciiFile,pParam);
-static DEFINE_THREAD(SendImageFile,pParam);
+static DEFINE_THREAD (SendAsciiFile, pParam);
+static DEFINE_THREAD (SendImageFile, pParam);
 
-static DEFINE_THREAD(ReceiveAsciiFile,pParam);
-static DEFINE_THREAD(ReceiveImageFile,pParam);
+static DEFINE_THREAD (ReceiveAsciiFile, pParam);
+static DEFINE_THREAD (ReceiveImageFile, pParam);
 
 //////////////////////////////////////////////////////////////////////////////
 // FtpHost class
-void SetFtpHost(FtpHost &out, const FtpHost &in)
+void setFtpHost (FtpHost & out, const FtpHost & in)
 {
   out.h1 = in.h1;
   out.h2 = in.h2;
@@ -58,97 +58,98 @@ void SetFtpHost(FtpHost &out, const FtpHost &in)
   out.p2 = in.p2;
 }
 
-void SetFtpHost(FtpHost &out, const char *szIn)
+void setFtpHost (FtpHost & out, const char *szIn)
 {
   std::stringstream ss;
-  char *szLocalIn = strdup(szIn);
-  char *tok = strtok(szLocalIn, ",.");
-  while ( tok != NULL )
-  {
-    ss << tok << " ";
-    tok = strtok(NULL, ",.");
-  }
+  char *szLocalIn = strdup (szIn);
+  char *tok = strtok (szLocalIn, ",.");
+  while (tok != NULL)
+    {
+      ss << tok << " ";
+      tok = strtok (NULL, ",.");
+    }
   ss >> out.h1 >> out.h2 >> out.h3 >> out.h4 >> out.p1 >> out.p2;
-  free(szLocalIn);
+  free (szLocalIn);
 }
 
-void GetIpAddr(const FtpHost &host, char *pOut, const int &nBuffSize)
+void getIpAddr (const FtpHost & host, char *pOut, const int &nBuffSize)
 {
-  if ( pOut == NULL )
+  if (pOut == NULL)
     return;
   std::ostringstream sRet;
   sRet << host.h1 << '.' << host.h2 << '.' << host.h3 << '.' << host.h4;
-  memset(pOut, 0, nBuffSize);
-  strncpy(pOut, sRet.str().c_str(), nBuffSize-1);
+  memset (pOut, 0, nBuffSize);
+  strncpy (pOut, sRet.str ().c_str (), nBuffSize - 1);
 }
 
-int GetPortNo(const FtpHost &host)
+int getPortNo (const FtpHost & host)
 {
   return ((host.p1 << 8) + host.p2);
 }
 
-std::string GetPortNo(unsigned int nPort)
+std::string getPortNo (unsigned int nport)
 {
-  unsigned int hiByte = (nPort & 0x0000ff00) >> 8;
-  unsigned int loByte = nPort & 0x000000ff;
+  unsigned int hiByte = (nport & 0x0000ff00) >> 8;
+  unsigned int loByte = nport & 0x000000ff;
   std::ostringstream out;
   out << hiByte << "," << loByte;
-  return out.str();
+  return out.str ();
 }
 
-std::string GetHost(const FtpHost &host)
+std::string getHost (const FtpHost & host)
 {
   std::ostringstream s;
-  s << host.h1 << ',' << host.h2 << ',' << host.h3 << ',' << host.h4 << ',' << 
host.p1 << ',' << host.p2;
-  return s.str().c_str();
+  s << host.h1 << ',' << host.h2 << ',' << host.h3 << ',' << host.
+    h4 << ',' << host.p1 << ',' << host.p2;
+  return s.str ().c_str ();
 }
 
 //////////////////////////////////////////////////////////////////////////////
-// FtpUserData class
-FtpUserData::FtpUserData()
+// FtpuserData class
+FtpuserData::FtpuserData ()
 {
-  reset();
-  m_DataConnBusy.init();
+  reset ();
+  m_DataConnBusy.init ();
 }
 
-bool FtpUserData::allowDelete(bool wait)
+bool FtpuserData::allowdelete (bool wait)
 {
-  if ( wait )
-  {
-    //wait for data connection to finish
-    m_DataConnBusy.lock();
-    m_DataConnBusy.unlock();
+  if (wait)
+    {
+      //wait for data connection to finish
+      m_DataConnBusy.lock ();
+      m_DataConnBusy.unlock ();
 
-  }
-  if ( m_pDataConnection != NULL )
-    return !m_pDataConnection->isScheduled();
+    }
+  if (m_pDataConnection != NULL)
+    return !m_pDataConnection->isScheduled ();
   else
-      return true;
+    return true;
 }
 
 
-FtpUserData::~FtpUserData()
+FtpuserData::~FtpuserData ()
 {
   delete m_pDataConnection;
   m_pDataConnection = NULL;
-  m_DataConnBusy.destroy();
+  m_DataConnBusy.destroy ();
 }
 
-void FtpUserData::reset()
+void FtpuserData::reset ()
 {
-  m_nFtpState = NO_CONTROL_CONNECTION;
-  m_pDataConnection = new Connection();
-  m_sUserName = m_sPass = "";
+  m_nFtpstate = NO_CONTROL_CONNECTION;
+  m_pDataConnection = new Connection ();
+  m_suserName = m_sPass = "";
   m_nFtpRepresentation = REPR_ASCII;
   m_nFtpFormatControl = NON_PRINT;
-  m_nFtpFileStructure = STRU_FILE;
-  m_nTransferMode = MODE_STREAM;
+  m_nFtpFilestructure = STRU_FILE;
+  m_nTransfermode = MODE_STREAM;
   m_cwd = "";
-  m_nLocalDataPort = 0;
+  m_nLocalDataport = 0;
   m_bBreakDataConnection = false;
   m_dataThreadId = 0;
   m_bPassiveSrv = false;
-  m_nRestartOffset = 0;
+  m_nrestartOffset = 0;
   m_sCurrentFileName = "";
   m_nFileSize = 0;
   m_nBytesSent = 0;
@@ -160,40 +161,40 @@ void FtpUserData::reset()
   m_cdh.p2 = 0;
 }
 
-int FtpUserData::CloseDataConnection()
+int FtpuserData::closeDataConnection ()
 {
-  if ( m_nFtpState < DATA_CONNECTION_UP )
+  if (m_nFtpstate < DATA_CONNECTION_UP)
     return 1;
 
-  if ( m_pDataConnection != NULL && m_pDataConnection->socket != NULL )
-  {
-    m_pDataConnection->socket->shutdown(SD_BOTH);
-    m_pDataConnection->socket->close();
-    delete m_pDataConnection->socket;
-    m_pDataConnection->socket = NULL;
-    m_pDataConnection->setScheduled(0);
-  }
-  
+  if (m_pDataConnection != NULL && m_pDataConnection->socket != NULL)
+    {
+      m_pDataConnection->socket->shutdown (SD_BOTH);
+      m_pDataConnection->socket->close ();
+      delete m_pDataConnection->socket;
+      m_pDataConnection->socket = NULL;
+      m_pDataConnection->setScheduled (0);
+    }
+
   //m_DataConnBusy.unlock();
-  m_nFtpState = USER_LOGGED_IN;
+  m_nFtpstate = USER_LOGGED_IN;
   return 1;
 }
 
 //////////////////////////////////////////////////////////////////////////////
-// FtpUserData class
-DataConnectionWorkerThreadData::DataConnectionWorkerThreadData()
+// FtpuserData class
+DataConnectionWorkerThreadData::DataConnectionWorkerThreadData ()
 {
   m_pConnection = NULL;
-  m_bAppend = false;
+  m_bappend = false;
 }
 
-DataConnectionWorkerThreadData::~DataConnectionWorkerThreadData()
+DataConnectionWorkerThreadData::~DataConnectionWorkerThreadData ()
 {
 }
 
 //////////////////////////////////////////////////////////////////////////////
 // FtpThreadContext helper structure
-FtpThreadContext::FtpThreadContext()
+FtpThreadContext::FtpThreadContext ()
 {
   pConnection = NULL;
   buffer = NULL;
@@ -209,243 +210,240 @@ FtpThreadContext::FtpThreadContext()
 struct reply
 {
   int nCode;
-  std::string sText;
+    std::string sText;
 };
 
-struct reply reply_table[] = 
-{
-  { 120, "Service ready in %s minutes." },
-  { 125, "Data connection already open; transfer starting." },
-  { 150, "File status okay; about to open data connection." },
-  { 200, "Command okay." },
-  { 213, "File status." },
-  { 214, "The following commands are recognized:\r\n\
+struct reply reply_table[] = {
+  {120, "Service ready in %s minutes."},
+  {125, "Data connection already open; transfer starting."},
+  {150, "File status okay; about to open data connection."},
+  {200, "Command okay."},
+  {213, "File status."},
+  {214, "The following commands are recognized:\r\n\
 USER, PASS, PORT, PASV, TYPE, REST, RETR, LIST, NLST, ABOR, \r\n\
 CWD, CDUP, PWD, ALLO, STOR, STOU, DELE, APPE, MKD, RMD, \r\n\
 RNFR, RNTO, SYST, STAT, QUIT\r\n\
-214 Detailed help on commands will soon be available." },
-  { 215, "%s system type." },
-  { 220, "Service ready for new user." },
-  { 221, "Goodbye." },
-  { 226, "Closing data connection." },
-  { 227, "Entering passive mode. %s" },
-  { 230, "User logged in, proceed."},
-  { 250, "Requested file action okay, completed."},
-  { 257, "PATHNAME created" },
-  { 331, "User name okay, need password." },
-  { 350, "Requested file action pending further information." },
-  { 421, "Service not available, closing control connection." },
-  { 425, "Can't open data connection." },
-  { 426, "Connection closed; Transfer aborted." },
-  { 450, "Requested file action not taken. File unavailable." },
-  { 451, "Requested action aborted: local error in processing." },
-  { 500, "Syntax error, command unrecognized." },
-  { 501, "Syntax error in parameters or arguments." },
-  { 502, "Command not implemented." },
-  { 503, "Bad sequence of commands." },
-  { 504, "Command not implemented for that parameter."},
-  { 530, "Not logged in." },
-  { 532, "Need account for storing files." },
-  { 550, "Requested action not taken. File unavailable." },
-  { 0, "" }
+214 Detailed help on commands will soon be available."},
+  {215, "%s system type."},
+  {220, "Service ready for new user."},
+  {221, "Goodbye."},
+  {226, "Closing data connection."},
+  {227, "Entering passive mode. %s"},
+  {230, "user logged in, proceed."},
+  {250, "Requested file action okay, completed."},
+  {257, "PATHNAME created"},
+  {331, "user name okay, need password."},
+  {350, "Requested file action pending further information."},
+  {421, "Service not available, closing control connection."},
+  {425, "Can't open data connection."},
+  {426, "Connection closed; Transfer aborted."},
+  {450, "Requested file action not taken. File unavailable."},
+  {451, "Requested action aborted: local error in processing."},
+  {500, "Syntax error, command unrecognized."},
+  {501, "Syntax error in parameters or arguments."},
+  {502, "Command not implemented."},
+  {503, "Bad sequence of commands."},
+  {504, "Command not implemented for that parameter."},
+  {530, "Not logged in."},
+  {532, "Need account for storing files."},
+  {550, "Requested action not taken. File unavailable."},
+  {0, ""}
 };
 
-int get_ftp_reply(int nReplyCode, std::string &sReply)
+int getFtpReply (int nReplyCode, std::string & sReply)
 {
-  for ( int i = 0; reply_table[i].nCode != 0; i++ )
-  {
-    if ( reply_table[i].nCode != nReplyCode )
-      continue;
-    sReply = reply_table[i].sText;
-    return 1;
-  }
+  for (int i = 0; reply_table[i].nCode != 0; i++)
+    {
+      if (reply_table[i].nCode != nReplyCode)
+       continue;
+      sReply = reply_table[i].sText;
+      return 1;
+    }
   return 0;
 }
 
-void ftp_reply(ConnectionPtr pConnection, int nReplyCode,
-               const std::string &sCustomText/* = ""*/)
+void ftpReply (ConnectionPtr pConnection, int nReplyCode,
+          const std::string & sCustomText /* = "" */ )
 {
-  if ( pConnection == NULL || pConnection->socket == NULL )
+  if (pConnection == NULL || pConnection->socket == NULL)
     return;
 
-  std::string sLocalCustomText(sCustomText);
-  Server *pInstance = Server::getInstance();
-  if ( pInstance != NULL && pInstance->stopServer() == 1 )
-  {
-    nReplyCode = 421;
-    sLocalCustomText = "";
-  }
+  std::string sLocalCustomText (sCustomText);
+  Server *pInstance = Server::getInstance ();
+  if (pInstance != NULL && pInstance->stopServer () == 1)
+    {
+      nReplyCode = 421;
+      sLocalCustomText = "";
+    }
 
   std::ostringstream buffer;
-  if ( !sLocalCustomText.empty() )
+  if (!sLocalCustomText.empty ())
     {
-        if ( nReplyCode >= 0 )
+      if (nReplyCode >= 0)
         buffer << nReplyCode << " " << sLocalCustomText << "\r\n";
-        else
-            buffer << sLocalCustomText << "\r\n";
-        }
+      else
+        buffer << sLocalCustomText << "\r\n";
+    }
   else
-  {
-    std::string sReplyText;
-    get_ftp_reply(nReplyCode, sReplyText);
-    if ( sReplyText.find('\n') == std::string::npos )
-      buffer << nReplyCode << " " << sReplyText << "\r\n";
-    else
-      buffer << nReplyCode << "-" << sReplyText << "\r\n";
-  }
+    {
+      std::string sReplyText;
+      getFtpReply (nReplyCode, sReplyText);
+      if (sReplyText.find ('\n') == std::string::npos)
+        buffer << nReplyCode << " " << sReplyText << "\r\n";
+      else
+        buffer << nReplyCode << "-" << sReplyText << "\r\n";
+    }
   pConnection->socket->send (buffer.str ().c_str (),
-                             strlen (buffer.str ().c_str ()), 0);
+                            strlen (buffer.str ().c_str ()), 0);
 }
 
 //////////////////////////////////////////////////////////////////////////////
 // Ftp class
 
-bool Ftp::m_bAllowAnonymous = false;
+bool Ftp::m_ballowAnonymous = false;
 bool Ftp::m_bAnonymousNeedPass = true;
-bool Ftp::m_bAllowAsynchronousCmds = true;
+bool Ftp::m_ballowAsynchronousCmds = true;
 bool Ftp::m_bEnablePipelining = true;
-bool Ftp::m_bEnableStoreCmds = true;
+bool Ftp::m_bEnablestoreCmds = true;
 
 int Ftp::FIRST_PASV_PORT = 60000;
 int Ftp::LAST_PASV_PORT = 65000;
 
-Ftp::Ftp()
+Ftp::Ftp ()
 {
-  m_nPassivePort = Ftp::FIRST_PASV_PORT;
+  m_nPassiveport = Ftp::FIRST_PASV_PORT;
   protocolOptions = PROTOCOL_FAST_CHECK | PROTOCOL_DENY_DELETE;
-  protocolPrefix.assign("ftp://";);
+  protocolPrefix.assign ("ftp://";);
 }
 
-Ftp::~Ftp()
+Ftp::~Ftp ()
 {
 }
 
-int Ftp::controlConnection(ConnectionPtr pConnection, char *b1, char *b2,
-                           int bs1, int bs2, u_long nbtr, u_long id)
+int Ftp::controlConnection (ConnectionPtr pConnection, char *b1, char *b2,
+                       int bs1, int bs2, u_long nbtr, u_long id)
 {
-  if ( pConnection == NULL )
+  if (pConnection == NULL)
     return ClientsThread::DELETE_CONNECTION;
-  Server* server = Server::getInstance();
-  if ( server == NULL )
+  Server *server = Server::getInstance ();
+  if (server == NULL)
     return ClientsThread::DELETE_CONNECTION;
 
-  FtpUserData *pFtpUserData = NULL;
-  if ( pConnection->protocolBuffer == NULL )
-    pConnection->protocolBuffer = new FtpUserData();
-  pFtpUserData = static_cast<FtpUserData *>(pConnection->protocolBuffer);
-  if ( pFtpUserData == NULL )
+  FtpuserData *pFtpuserData = NULL;
+  if (pConnection->protocolBuffer == NULL)
+    pConnection->protocolBuffer = new FtpuserData ();
+  pFtpuserData = static_cast < FtpuserData * >(pConnection->protocolBuffer);
+  if (pFtpuserData == NULL)
     return ClientsThread::DELETE_CONNECTION;
 
   // check if ftp is busy(return 120) or unavailable(return 421)
-  if ( pConnection->getToRemove() == CONNECTION_REMOVE_OVERLOAD )
-  {
-    pFtpUserData->m_nFtpState = FtpUserData::BUISY;
-    // TODO: really compute busy time interval
-    std::string sTempText;
-    get_ftp_reply(120, sTempText);
-    std::string::size_type n = sTempText.find("%s");
-    if ( n != std::string::npos )
-      sTempText.replace(n, 2, "10");
-    ftp_reply(120, sTempText);
-  }
+  if (pConnection->getToRemove () == CONNECTION_REMOVE_OVERLOAD)
+    {
+      pFtpuserData->m_nFtpstate = FtpuserData::BUISY;
+      // TODO: really compute busy time interval
+      std::string sTempText;
+      getFtpReply (120, sTempText);
+      std::string::size_type n = sTempText.find ("%s");
+      if (n != std::string::npos)
+        sTempText.replace (n, 2, "10");
+      ftpReply (120, sTempText);
+    }
 
-  if ( server->isRebooting() != 0 )
-  {
-    pFtpUserData->m_nFtpState = FtpUserData::UNAVAILABLE;
-    ftp_reply(421);
-    return 0;
-  }
+  if (server->isRebooting () != 0)
+    {
+      pFtpuserData->m_nFtpstate = FtpuserData::UNAVAILABLE;
+      ftpReply (421);
+      return 0;
+    }
 
   // init default local ports
-  m_nLocalControlPort = pConnection->getLocalPort();
-  pFtpUserData->m_nLocalDataPort = m_nLocalControlPort - 1;
+  m_nLocalControlport = pConnection->getLocalPort ();
+  pFtpuserData->m_nLocalDataport = m_nLocalControlport - 1;
 
-  if ( pFtpUserData->m_cwd.empty() && pConnection->host != NULL )//current dir 
not initialized
-  {
-    pFtpUserData->m_cwd = "";
-  }
+  if (pFtpuserData->m_cwd.empty () && pConnection->host != NULL)
+    pFtpuserData->m_cwd = "";
 
   //switch context
   td.pConnection = pConnection;
-  td.buffer = pConnection->getActiveThread()->getBuffer();
-  td.secondaryBuffer = pConnection->getActiveThread()->getSecondaryBuffer();
+  td.buffer = pConnection->getActiveThread ()->getBuffer ();
+  td.secondaryBuffer = pConnection->getActiveThread ()->getSecondaryBuffer ();
   td.buffersize = bs1;
   td.secondaryBufferSize = bs2;
   td.nBytesToRead = nbtr;
   td.pProtocolInterpreter = this;
   td.m_nParseLength = 0;
 
-  return ParseControlConnection();
+  return parseControlConnection ();
 }
 
 
-char* Ftp::registerName(char* out, int len)
+char * Ftp::registerName (char *out, int len)
 {
-  return registerNameImpl(out, len);
+  return registerNameImpl (out, len);
 }
 
-char* Ftp::registerNameImpl(char* out, int len)
+char * Ftp::registerNameImpl (char *out, int len)
 {
-  if(out)
-  {
-    myserver_strlcpy(out, "FTP", len);
-  }
-  return (char*) "FTP";
+  if (out)
+    {
+      myserver_strlcpy (out, "FTP", len);
+    }
+  return (char *) "FTP";
 }
 
 
-int Ftp::loadProtocolStatic(XmlParser*)
+int Ftp::loadProtocolstatic (XmlParser *)
 {
   // load custom messages from cfg here
   Server *server = Server::getInstance ();
 
   // allow anonymous access
   const char *pData = server->getHashedData ("ftp.allow_anonymous");
-  if ( pData != NULL )
-    m_bAllowAnonymous = strcmpi("Yes", pData) == 0 ? true : false;
+  if (pData != NULL)
+    m_ballowAnonymous = strcmpi ("Yes", pData) == 0 ? true : false;
 
   // request password for anonymous
   pData = server->getHashedData ("ftp.anonymous_need_pass");
-  if ( pData != NULL )
-    m_bAnonymousNeedPass = strcmpi("Yes", pData) == 0 ? true : false;
+  if (pData != NULL)
+    m_bAnonymousNeedPass = strcmpi ("Yes", pData) == 0 ? true : false;
 
   // enable asyncronous cmds
   pData = server->getHashedData ("ftp.allow_asynchronous_cmds");
-  if ( pData != NULL )
-    m_bAllowAsynchronousCmds = strcmpi("Yes", pData) == 0 ? true : false;
+  if (pData != NULL)
+    m_ballowAsynchronousCmds = strcmpi ("Yes", pData) == 0 ? true : false;
 
   // enable pipelining
   pData = server->getHashedData ("ftp.allow_pipelining");
-  if ( pData != NULL )
-    m_bEnablePipelining = strcmpi("Yes", pData) == 0 ? true : false;
+  if (pData != NULL)
+    m_bEnablePipelining = strcmpi ("Yes", pData) == 0 ? true : false;
 
   // enable write commands
   pData = server->getHashedData ("ftp.allow_store");
-  if ( pData != NULL )
-    m_bEnableStoreCmds = strcmpi("Yes", pData) == 0 ? true : false;
+  if (pData != NULL)
+    m_bEnablestoreCmds = strcmpi ("Yes", pData) == 0 ? true : false;
 
   return 1;
 }
 
-int Ftp::unLoadProtocolStatic(XmlParser*)
+int Ftp::unLoadProtocolstatic (XmlParser *)
 {
-  if ( true/*everything is ok*/ )
+  if (true /*everything is ok */ )
     return 1;
   else
     return 0;
 }
 
-void Ftp::ftp_reply(int nReplyCode, const std::string &sCustomText /*= ""*/)
+void Ftp::ftpReply (int nReplyCode, const std::string & sCustomText /*= ""*/ )
 {
-  if ( td.pConnection == NULL || td.pConnection->socket == NULL )
+  if (td.pConnection == NULL || td.pConnection->socket == NULL)
     return;
 
-  ::ftp_reply(td.pConnection, nReplyCode, sCustomText);
+  ::ftpReply (td.pConnection, nReplyCode, sCustomText);
 
   logAccess (nReplyCode, sCustomText);
 }
 
-void Ftp::logAccess (int nReplyCode, const std::string &sCustomText)
+void Ftp::logAccess (int nReplyCode, const std::string & sCustomText)
 {
   /* Log the reply.  */
   string time;
@@ -455,28 +453,28 @@ void Ftp::logAccess (int nReplyCode, const std::string 
&sCustomText)
 
   td.secondaryBuffer->setLength (0);
   *td.secondaryBuffer << time
-                      << " " << td.pConnection->getIpAddr ()
-                      << " " << msgCode
-                      << " " << sCustomText;
+    << " " << td.pConnection->getIpAddr ()
+    << " " << msgCode << " " << sCustomText;
 
 #ifdef WIN32
-  *td.secondaryBuffer  << "\r\n" << end_str;
+  *td.secondaryBuffer << "\r\n" << end_str;
 #else
-  *td.secondaryBuffer  << "\n" << end_str;
+  *td.secondaryBuffer << "\n" << end_str;
 #endif
 
   if (td.pConnection->host)
-  td.pConnection->host->accessesLogWrite (td.secondaryBuffer->getBuffer ());
+    td.pConnection->host->accessesLogWrite (td.secondaryBuffer->getBuffer ());
 }
 
-int Ftp::CloseDataConnection()
+int Ftp::closeDataConnection ()
 {
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
-  int nRet = pFtpUserData->CloseDataConnection();
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
+  int nRet = pFtpuserData->closeDataConnection ();
   return nRet;
 }
 
-int Ftp::PrintError(const char *msg)
+int Ftp::printError (const char *msg)
 {
   /* Log the reply.  */
   string time;
@@ -484,8 +482,7 @@ int Ftp::PrintError(const char *msg)
 
   td.secondaryBuffer->setLength (0);
   *td.secondaryBuffer << td.pConnection->getIpAddr ();
-  *td.secondaryBuffer << " " << time
-                      << " " << msg;
+  *td.secondaryBuffer << " " << time << " " << msg;
 
   if (td.pConnection->host)
     td.pConnection->host->warningsLogWrite (td.secondaryBuffer->getBuffer ());
@@ -493,82 +490,89 @@ int Ftp::PrintError(const char *msg)
   return 1;
 }
 
-void Ftp::User(const std::string &sParam)
+void
+Ftp::user (const std::string & sParam)
 {
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
-  if (!m_bAllowAnonymous && strcmpi (pFtpUserData->m_sUserName.c_str (), 
"anonymous") == 0)
-  {
-    ftp_reply (530);
-    return;
-  }
+  if (!m_ballowAnonymous
+      && strcmpi (pFtpuserData->m_suserName.c_str (), "anonymous") == 0)
+    {
+      ftpReply (530);
+      return;
+    }
 
-  pFtpUserData->m_sUserName = sParam;
-  ftp_reply(331);
+  pFtpuserData->m_suserName = sParam;
+  ftpReply (331);
 }
 
-void Ftp::Password(const std::string &sParam)
+void Ftp::password (const std::string & sParam)
 {
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
-  if ( !m_bAllowAnonymous && strcmpi(pFtpUserData->m_sUserName.c_str(), 
"anonymous") == 0 )
-  {
-    ftp_reply(530);
-    return;
-  }
+  if (!m_ballowAnonymous
+      && strcmpi (pFtpuserData->m_suserName.c_str (), "anonymous") == 0)
+    {
+      ftpReply (530);
+      return;
+    }
 
-  pFtpUserData->m_sPass = sParam;
-  pFtpUserData->m_nFtpState = FtpUserData::USER_LOGGED_IN;
-  ftp_reply(230);
+  pFtpuserData->m_sPass = sParam;
+  pFtpuserData->m_nFtpstate = FtpuserData::USER_LOGGED_IN;
+  ftpReply (230);
 }
 
-void Ftp::Port(const FtpHost &host)
+void Ftp::port (const FtpHost & host)
 {
-  WaitDataConnection();
+  waitDataConnection ();
 
-  if ( !UserLoggedIn() )
+  if (!userLoggedIn ())
     return;
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
-  SetFtpHost(pFtpUserData->m_cdh, host);
-  ftp_reply(200);
+  setFtpHost (pFtpuserData->m_cdh, host);
+  ftpReply (200);
 }
 
-void Ftp::Pasv()
+void Ftp::pasv ()
 {
-  WaitDataConnection();
-  if ( !UserLoggedIn() )
+  waitDataConnection ();
+  if (!userLoggedIn ())
     return;
 
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
-  std::string sHost = td.pConnection->getLocalIpAddr();
-  if ( m_nPassivePort < Ftp::LAST_PASV_PORT )
-    sHost += "," + GetPortNo(m_nPassivePort++);
+  std::string sHost = td.pConnection->getLocalIpAddr ();
+  if (m_nPassiveport < Ftp::LAST_PASV_PORT)
+    sHost += "," + getPortNo (m_nPassiveport++);
   else
-  {
-    m_nPassivePort = Ftp::FIRST_PASV_PORT;
-    sHost += "," + GetPortNo(m_nPassivePort++);
-  }
-  SetFtpHost(pFtpUserData->m_cdh, sHost.c_str());
+    {
+      m_nPassiveport = Ftp::FIRST_PASV_PORT;
+      sHost += "," + getPortNo (m_nPassiveport++);
+    }
+  setFtpHost (pFtpuserData->m_cdh, sHost.c_str ());
 
-  pFtpUserData->m_bPassiveSrv = true;
-    if ( OpenDataConnection() == 0 )
-      {
-       ftp_reply(425);//RFC959 command replay exception
-       return;
-      }
+  pFtpuserData->m_bPassiveSrv = true;
+  if (OpenDataConnection () == 0)
+    {
+      ftpReply (425);          //RFC959 command replay exception
+      return;
+    }
 
   std::string sTempText;
-  get_ftp_reply(227, sTempText);
-  std::string::size_type n = sTempText.find("%s");
-  if ( n != std::string::npos )
+  getFtpReply (227, sTempText);
+  std::string::size_type n = sTempText.find ("%s");
+  if (n != std::string::npos)
 #ifdef WIN32
-    sTempText.replace(n, 2, GetHost(pFtpUserData->m_cdh));
+    sTempText.replace (n, 2, getHost (pFtpuserData->m_cdh));
 #else
-    sTempText.replace(n, 2, GetHost(pFtpUserData->m_cdh));
+    sTempText.replace (n, 2, getHost (pFtpuserData->m_cdh));
 #endif //WIN32
-  ftp_reply(227, sTempText);
+  ftpReply (227, sTempText);
 
   //wait for incoming connection
   int timeoutvalue = 3;
@@ -581,849 +585,895 @@ void Ftp::Pasv()
   MYSERVER_SOCKADDRIN asockIn;
   int asockInLen = 0;
   Socket asock;
-  if ( pFtpUserData->m_pDataConnection->socket->dataOnRead(timeoutvalue, 0) == 
1 )
+  if (pFtpuserData->m_pDataConnection->socket->dataOnRead (timeoutvalue, 0) ==
+      1)
     {
-    asockInLen = sizeof(sockaddr_in);
-    asock = pFtpUserData->m_pDataConnection->socket->accept(&asockIn, 
&asockInLen);
-    if ( asock.getHandle() == (Handle)INVALID_SOCKET )
-      return;
+      asockInLen = sizeof (sockaddr_in);
+      asock =
+       pFtpuserData->m_pDataConnection->socket->accept (&asockIn,
+                                                        &asockInLen);
+      if (asock.getHandle () == (Handle) INVALID_SOCKET)
+       return;
 
-    pFtpUserData->m_pDataConnection->socket->shutdown(SD_BOTH);
-    pFtpUserData->m_pDataConnection->socket->close();
-    delete pFtpUserData->m_pDataConnection->socket;
-    pFtpUserData->m_pDataConnection->socket = new Socket(asock);
-  }
-  pFtpUserData->m_bPassiveSrv = false;
+      pFtpuserData->m_pDataConnection->socket->shutdown (SD_BOTH);
+      pFtpuserData->m_pDataConnection->socket->close ();
+      delete pFtpuserData->m_pDataConnection->socket;
+      pFtpuserData->m_pDataConnection->socket = new Socket (asock);
+    }
+  pFtpuserData->m_bPassiveSrv = false;
 }
 
-void Ftp::RetrStor(bool bRetr, bool bAppend, const std::string &sPath)
-{    
+void Ftp::retrstor (bool bretr, bool bappend, const std::string & sPath)
+{
   std::string sLocalPath;
-  if ( !UserLoggedIn() )
-  {
-    //CloseDataConnection();
-    return;
-  }
-  if ( (bRetr && !GetLocalPath(sPath, sLocalPath)) || 
-    (!bRetr && !BuildLocalPath(sPath, sLocalPath)) )
-  {
-    //CloseDataConnection();
-    return;
-  }
+  if (!userLoggedIn ())
+    {
+      //closeDataConnection();
+      return;
+    }
+  if ((bretr && !getLocalPath (sPath, sLocalPath)) ||
+      (!bretr && !buildLocalPath (sPath, sLocalPath)))
+    {
+      //closeDataConnection();
+      return;
+    }
 
   std::string sLocalDir, sLocalFileName;
-  FilesUtility::splitPath(sLocalPath, sLocalDir, sLocalFileName);
+  FilesUtility::splitPath (sLocalPath, sLocalDir, sLocalFileName);
 
   /* The security file doesn't exist in any case.  */
   const char *secName = td.st.getHashedData ("security.filename",
-                                             MYSERVER_VHOST_CONF | 
MYSERVER_SERVER_CONF,
-                                             ".security.xml");
-  if( !strcmpi(sLocalFileName.c_str(), secName))
-  {
-    ftp_reply(550);
-    //CloseDataConnection();
-    return;
-  }
+                                            MYSERVER_VHOST_CONF |
+                                            MYSERVER_SERVER_CONF,
+                                            ".security.xml");
+  if (!strcmpi (sLocalFileName.c_str (), secName))
+    {
+      ftpReply (550);
+      //closeDataConnection();
+      return;
+    }
 
   int nMask = 0;
-  if ( bRetr )
+  if (bretr)
     nMask = MYSERVER_PERMISSION_READ | MYSERVER_PERMISSION_BROWSE;
   else
     nMask = MYSERVER_PERMISSION_WRITE;
 
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
-  if (CheckRights (pFtpUserData->m_sUserName, pFtpUserData->m_sPass, 
sLocalPath, nMask) == 0)
-  {
-    ftp_reply(530);
-    //CloseDataConnection();
-    return;
-  }
+  if (checkRights
+      (pFtpuserData->m_suserName, pFtpuserData->m_sPass, sLocalPath,
+       nMask) == 0)
+    {
+      ftpReply (530);
+      //closeDataConnection();
+      return;
+    }
 
   if (FilesUtility::isDirectory (sLocalPath.c_str ()))
     {
-      ftp_reply (550);
+      ftpReply (550);
       return;
     }
 
   /* FIXME: Log after the file is sent, not before.  */
   logAccess (0, sLocalPath);
 
-  DataConnectionWorkerThreadData *pData = new DataConnectionWorkerThreadData();
+  DataConnectionWorkerThreadData *pData =
+    new DataConnectionWorkerThreadData ();
   pData->m_pConnection = td.pConnection;
-  pData->m_bAppend = bAppend || pFtpUserData->m_nRestartOffset > 0;
+  pData->m_bappend = bappend || pFtpuserData->m_nrestartOffset > 0;
   pData->m_sFilePath = sLocalPath;
   pData->m_pFtp = this;
 
-  pFtpUserData->m_sCurrentFileName = "";
-  pFtpUserData->m_nFileSize = 0;
-  pFtpUserData->m_nBytesSent = 0;
-  
-  switch ( pFtpUserData->m_nFtpRepresentation )
-  {
-    case FtpUserData::REPR_ASCII:
-            Thread::create(&pFtpUserData->m_dataThreadId, 
bRetr?SendAsciiFile:ReceiveAsciiFile, pData);
+  pFtpuserData->m_sCurrentFileName = "";
+  pFtpuserData->m_nFileSize = 0;
+  pFtpuserData->m_nBytesSent = 0;
+
+  switch (pFtpuserData->m_nFtpRepresentation)
+    {
+    case FtpuserData::REPR_ASCII:
+      Thread::create (&pFtpuserData->m_dataThreadId,
+                     bretr ? SendAsciiFile : ReceiveAsciiFile, pData);
       break;
-    case FtpUserData::REPR_IMAGE:
-            Thread::create(&pFtpUserData->m_dataThreadId, 
bRetr?SendImageFile:ReceiveImageFile, pData);
+    case FtpuserData::REPR_IMAGE:
+      Thread::create (&pFtpuserData->m_dataThreadId,
+                     bretr ? SendImageFile : ReceiveImageFile, pData);
       break;
-  }
+    }
 }
 
-static DEFINE_THREAD(SendAsciiFile, pParam)
+static
+DEFINE_THREAD (SendAsciiFile, pParam)
 {
-  DataConnectionWorkerThreadData *pWt = 
reinterpret_cast<DataConnectionWorkerThreadData *>(pParam);
-  if ( pWt == NULL )
-  {
+  DataConnectionWorkerThreadData *pWt =
+    reinterpret_cast < DataConnectionWorkerThreadData * >(pParam);
+  if (pWt == NULL)
+    {
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
   ConnectionPtr pConnection = pWt->m_pConnection;
-  if ( pConnection == NULL )
-  {
-    ftp_reply(pConnection, 451);
-    delete pWt;
+  if (pConnection == NULL)
+    {
+      ftpReply (pConnection, 451);
+      delete pWt;
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(pConnection->protocolBuffer);
-  if ( pFtpUserData == NULL )
-  {
-    ftp_reply(pConnection, 451);
-    delete pWt;
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(pConnection->protocolBuffer);
+  if (pFtpuserData == NULL)
+    {
+      ftpReply (pConnection, 451);
+      delete pWt;
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
-  pFtpUserData->m_DataConnBusy.lock();
-  
-  if ( pWt->m_pFtp == NULL )
-  {
-    pFtpUserData->CloseDataConnection();
-    pFtpUserData->m_DataConnBusy.unlock();
-    delete pWt;
+  pFtpuserData->m_DataConnBusy.lock ();
+
+  if (pWt->m_pFtp == NULL)
+    {
+      pFtpuserData->closeDataConnection ();
+      pFtpuserData->m_DataConnBusy.unlock ();
+      delete pWt;
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
-  if ( pFtpUserData->m_nFtpState == FtpUserData::DATA_CONNECTION_UP )
-    ftp_reply(pConnection, 125);
-    else 
+  if (pFtpuserData->m_nFtpstate == FtpuserData::DATA_CONNECTION_UP)
+    ftpReply (pConnection, 125);
+  else
     {
-      ftp_reply(pConnection, 150);
-        if ( pWt->m_pFtp->OpenDataConnection() == 0 )
-      {
-        ftp_reply(pConnection, 425);
-        pFtpUserData->CloseDataConnection();
-        pFtpUserData->m_DataConnBusy.unlock();
-        delete pWt;
+      ftpReply (pConnection, 150);
+      if (pWt->m_pFtp->OpenDataConnection () == 0)
+       {
+         ftpReply (pConnection, 425);
+         pFtpuserData->closeDataConnection ();
+         pFtpuserData->m_DataConnBusy.unlock ();
+         delete pWt;
 #ifdef WIN32
-  return 0;
+         return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+         return (void *) 0;
 #endif
-      }
+       }
     }
 
-     if( pFtpUserData->m_pDataConnection == NULL || 
-    pFtpUserData->m_pDataConnection->socket == NULL)
-  {
-    ftp_reply(pConnection, 451);
-    pFtpUserData->CloseDataConnection();
-    pFtpUserData->m_DataConnBusy.unlock();
-    delete pWt;
+  if (pFtpuserData->m_pDataConnection == NULL ||
+      pFtpuserData->m_pDataConnection->socket == NULL)
+    {
+      ftpReply (pConnection, 451);
+      pFtpuserData->closeDataConnection ();
+      pFtpuserData->m_DataConnBusy.unlock ();
+      delete pWt;
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
-  File *file = NULL;//new File();
+  File *file = NULL;           //new File();
   try
   {
-    file = 
Server::getInstance()->getCachedFiles()->open(pWt->m_sFilePath.c_str());
-    if ( file == NULL )
-    {
-      ftp_reply(pConnection, 451);
-      pFtpUserData->CloseDataConnection();
-      pFtpUserData->m_DataConnBusy.unlock();
-      delete pWt;
+    file =
+      Server::getInstance ()->getCachedFiles ()->open (pWt->m_sFilePath.
+                                                      c_str ());
+    if (file == NULL)
+      {
+       ftpReply (pConnection, 451);
+       pFtpuserData->closeDataConnection ();
+       pFtpuserData->m_DataConnBusy.unlock ();
+       delete pWt;
 #ifdef WIN32
-  return 0;
+       return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+       return (void *) 0;
 #endif
-    }
-        u_long filesize = file->getFileSize();
-    if ( pFtpUserData->m_nRestartOffset > 0 )
-      pFtpUserData->m_nRestartOffset = 0;// don't implement restart for ASCII
+      }
+    u_long filesize = file->getFileSize ();
+    if (pFtpuserData->m_nrestartOffset > 0)
+      pFtpuserData->m_nrestartOffset = 0;      // don't implement restart for 
ASCII
 
-    pFtpUserData->m_sCurrentFileName = pWt->m_sFilePath;
-    pFtpUserData->m_nFileSize = filesize;
+    pFtpuserData->m_sCurrentFileName = pWt->m_sFilePath;
+    pFtpuserData->m_nFileSize = filesize;
 
     u_long nbr, nBufferSize = 0;
     char *pLine = NULL;
     int nLineLength = 0;
     std::string sLine;
     MemBuf buffer, secondaryBuffer;
-    buffer.setLength(1024);
-    while ( filesize != 0 )
-    {
-      memset(buffer.getBuffer(), 0, buffer.getRealLength());
-      nBufferSize = std::min(static_cast<u_long>(filesize), 
static_cast<u_long>(buffer.getRealLength()/2));
-      if ( file->read(buffer.getBuffer(), nBufferSize, &nbr) )
+    buffer.setLength (1024);
+    while (filesize != 0)
       {
-        ftp_reply(pConnection, 451);
-        file->close();
-        delete file;
-        pFtpUserData->CloseDataConnection();
-        pFtpUserData->m_DataConnBusy.unlock();
-        delete pWt;
+       memset (buffer.getBuffer (), 0, buffer.getRealLength ());
+       nBufferSize =
+         std::min (static_cast < u_long > (filesize),
+                   static_cast < u_long > (buffer.getRealLength () / 2));
+       if (file->read (buffer.getBuffer (), nBufferSize, &nbr))
+         {
+           ftpReply (pConnection, 451);
+           file->close ();
+           delete file;
+           pFtpuserData->closeDataConnection ();
+           pFtpuserData->m_DataConnBusy.unlock ();
+           delete pWt;
 #ifdef WIN32
-  return 0;
+           return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+           return (void *) 0;
 #endif
-      }
-      filesize -= nbr;
-      pFtpUserData->m_nBytesSent += nbr;
+         }
+       filesize -= nbr;
+       pFtpuserData->m_nBytesSent += nbr;
 
-      secondaryBuffer.setLength(0);
-      pLine = buffer.getBuffer();
-      if ( pLine == NULL )
-      {
-        ftp_reply(pConnection, 451);
-        file->close();
-        delete file;
-        pFtpUserData->CloseDataConnection();
-        pFtpUserData->m_DataConnBusy.unlock();
-        delete pWt;
+       secondaryBuffer.setLength (0);
+       pLine = buffer.getBuffer ();
+       if (pLine == NULL)
+         {
+           ftpReply (pConnection, 451);
+           file->close ();
+           delete file;
+           pFtpuserData->closeDataConnection ();
+           pFtpuserData->m_DataConnBusy.unlock ();
+           delete pWt;
 #ifdef WIN32
-  return 0;
+           return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+           return (void *) 0;
 #endif
-      }
-      while ( *pLine != 0 )
-      {
-        nLineLength = getEndLine(pLine, 0);
-        if ( nLineLength < 0 )//last line
-        {
-          sLine.assign(pLine, strlen(pLine));
-          if ( !sLine.empty() )
-            secondaryBuffer << sLine;
-          pLine += strlen(pLine);
-        }
-        else
-        {
-          sLine.assign(pLine, nLineLength);
-          secondaryBuffer << sLine << "\r\n";
-          if ( *(pLine + nLineLength) == '\r' )
-            nLineLength++;
-          if ( *(pLine + nLineLength) == '\n' )
-            nLineLength++;
-          pLine += nLineLength;
-        }
-      }
-            if ( 
pFtpUserData->m_pDataConnection->socket->send(secondaryBuffer.getBuffer(), 
-          (u_long)secondaryBuffer.getLength(), 0) == SOCKET_ERROR )
-            {
-        ftp_reply(pConnection, 451);
-               file->close();
-        file->close();
-        delete file;
-        pFtpUserData->CloseDataConnection();
-        pFtpUserData->m_DataConnBusy.unlock();
-        delete pWt;
+         }
+       while (*pLine != 0)
+         {
+           nLineLength = getEndLine (pLine, 0);
+           if (nLineLength < 0)        //last line
+             {
+               sLine.assign (pLine, strlen (pLine));
+               if (!sLine.empty ())
+                 secondaryBuffer << sLine;
+               pLine += strlen (pLine);
+             }
+           else
+             {
+               sLine.assign (pLine, nLineLength);
+               secondaryBuffer << sLine << "\r\n";
+               if (*(pLine + nLineLength) == '\r')
+                 nLineLength++;
+               if (*(pLine + nLineLength) == '\n')
+                 nLineLength++;
+               pLine += nLineLength;
+             }
+         }
+       if (pFtpuserData->m_pDataConnection->socket->
+           send (secondaryBuffer.getBuffer (),
+                 (u_long) secondaryBuffer.getLength (), 0) == SOCKET_ERROR)
+         {
+           ftpReply (pConnection, 451);
+           file->close ();
+           file->close ();
+           delete file;
+           pFtpuserData->closeDataConnection ();
+           pFtpuserData->m_DataConnBusy.unlock ();
+           delete pWt;
 #ifdef WIN32
-  return 0;
+           return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+           return (void *) 0;
 #endif
-            }
-      if ( pFtpUserData->m_bBreakDataConnection )
-      {
-        pFtpUserData->m_bBreakDataConnection = false;
-               file->close();
-        delete file;
-        pFtpUserData->CloseDataConnection();
-        pFtpUserData->m_DataConnBusy.unlock();
-        delete pWt;
+         }
+       if (pFtpuserData->m_bBreakDataConnection)
+         {
+           pFtpuserData->m_bBreakDataConnection = false;
+           file->close ();
+           delete file;
+           pFtpuserData->closeDataConnection ();
+           pFtpuserData->m_DataConnBusy.unlock ();
+           delete pWt;
 #ifdef WIN32
-  return 1;
+           return 1;
 #elif HAVE_PTHREAD
-  return (void*)1;
+           return (void *) 1;
 #endif
+         }
       }
-    }
-    file->close();
+    file->close ();
     delete file;
   }
-  catch (bad_alloc &ba)
+  catch (bad_alloc & ba)
   {
-    if ( file != NULL )
-      file->close();
+    if (file != NULL)
+      file->close ();
     delete file;
     //report error
   }
 
-  pFtpUserData->m_sCurrentFileName = "";
-  pFtpUserData->m_nFileSize = 0;
-  pFtpUserData->m_nBytesSent = 0;
-  pFtpUserData->m_nRestartOffset = 0;
-  ftp_reply(pConnection, 226);
-  pFtpUserData->CloseDataConnection();
-  pFtpUserData->m_DataConnBusy.unlock();
+  pFtpuserData->m_sCurrentFileName = "";
+  pFtpuserData->m_nFileSize = 0;
+  pFtpuserData->m_nBytesSent = 0;
+  pFtpuserData->m_nrestartOffset = 0;
+  ftpReply (pConnection, 226);
+  pFtpuserData->closeDataConnection ();
+  pFtpuserData->m_DataConnBusy.unlock ();
   delete pWt;
 #ifdef WIN32
   return 1;
 #elif HAVE_PTHREAD
-  return (void*)1;
+  return (void *) 1;
 #endif
 
 }
 
-static DEFINE_THREAD(SendImageFile, pParam)
+static
+DEFINE_THREAD (SendImageFile, pParam)
 {
-  DataConnectionWorkerThreadData *pWt = 
reinterpret_cast<DataConnectionWorkerThreadData *>(pParam);
-  if ( pWt == NULL )
-  {
+  DataConnectionWorkerThreadData *pWt =
+    reinterpret_cast < DataConnectionWorkerThreadData * >(pParam);
+  if (pWt == NULL)
+    {
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
   ConnectionPtr pConnection = pWt->m_pConnection;
-  if ( pConnection == NULL )
-  {
-    ftp_reply(pConnection, 451);
-    delete pWt;
+  if (pConnection == NULL)
+    {
+      ftpReply (pConnection, 451);
+      delete pWt;
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(pConnection->protocolBuffer);
-  if ( pFtpUserData == NULL )
-  {
-    ftp_reply(pConnection, 451);
-    pFtpUserData->CloseDataConnection();
-    delete pWt;
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(pConnection->protocolBuffer);
+  if (pFtpuserData == NULL)
+    {
+      ftpReply (pConnection, 451);
+      pFtpuserData->closeDataConnection ();
+      delete pWt;
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
-  pFtpUserData->m_DataConnBusy.lock();
-  
-  if ( pWt->m_pFtp == NULL )
-  {
-    pFtpUserData->CloseDataConnection();
-    pFtpUserData->m_DataConnBusy.unlock();
-    delete pWt;
+  pFtpuserData->m_DataConnBusy.lock ();
+
+  if (pWt->m_pFtp == NULL)
+    {
+      pFtpuserData->closeDataConnection ();
+      pFtpuserData->m_DataConnBusy.unlock ();
+      delete pWt;
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
-  
-  if ( pFtpUserData->m_nFtpState == FtpUserData::DATA_CONNECTION_UP )
-    ftp_reply(pConnection, 125);
-    else 
+    }
+
+  if (pFtpuserData->m_nFtpstate == FtpuserData::DATA_CONNECTION_UP)
+    ftpReply (pConnection, 125);
+  else
     {
-      ftp_reply(pConnection, 150);
-        if ( pWt->m_pFtp->OpenDataConnection() == 0 )
-      {
-        ftp_reply(pConnection, 425);
-        pFtpUserData->CloseDataConnection();
-        pFtpUserData->m_DataConnBusy.unlock();
-        delete pWt;
+      ftpReply (pConnection, 150);
+      if (pWt->m_pFtp->OpenDataConnection () == 0)
+       {
+         ftpReply (pConnection, 425);
+         pFtpuserData->closeDataConnection ();
+         pFtpuserData->m_DataConnBusy.unlock ();
+         delete pWt;
 #ifdef WIN32
-  return 0;
+         return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+         return (void *) 0;
 #endif
-        }
-  }
+       }
+    }
 
-        if( pFtpUserData->m_pDataConnection == NULL || 
-      pFtpUserData->m_pDataConnection->socket == NULL)
-  {
-    ftp_reply(pConnection, 451);
-    pFtpUserData->CloseDataConnection();
-    pFtpUserData->m_DataConnBusy.unlock();
-    delete pWt;
+  if (pFtpuserData->m_pDataConnection == NULL ||
+      pFtpuserData->m_pDataConnection->socket == NULL)
+    {
+      ftpReply (pConnection, 451);
+      pFtpuserData->closeDataConnection ();
+      pFtpuserData->m_DataConnBusy.unlock ();
+      delete pWt;
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
   File *file = NULL;
   try
   {
-    file = 
Server::getInstance()->getCachedFiles()->open(pWt->m_sFilePath.c_str());
-    if( file == NULL )
-    {
-      ftp_reply(pConnection, 451);
-      pFtpUserData->CloseDataConnection();
-      pFtpUserData->m_DataConnBusy.unlock();
-      delete pWt;
+    file =
+      Server::getInstance ()->getCachedFiles ()->open (pWt->m_sFilePath.
+                                                      c_str ());
+    if (file == NULL)
+      {
+       ftpReply (pConnection, 451);
+       pFtpuserData->closeDataConnection ();
+       pFtpuserData->m_DataConnBusy.unlock ();
+       delete pWt;
 #ifdef WIN32
-  return 0;
+       return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+       return (void *) 0;
 #endif
-    }
-    u_long filesize = file->getFileSize();
+      }
+    u_long filesize = file->getFileSize ();
     u_long nbr, nBufferSize = 0;
-    if ( pWt->m_bAppend && pFtpUserData->m_nRestartOffset < filesize )
-    {
-      file->seek (pFtpUserData->m_nRestartOffset);
-      filesize -= pFtpUserData->m_nRestartOffset;
-    }
+    if (pWt->m_bappend && pFtpuserData->m_nrestartOffset < filesize)
+      {
+       file->seek (pFtpuserData->m_nrestartOffset);
+       filesize -= pFtpuserData->m_nrestartOffset;
+      }
 
-    pFtpUserData->m_sCurrentFileName = pWt->m_sFilePath;
-    pFtpUserData->m_nFileSize = filesize;
+    pFtpuserData->m_sCurrentFileName = pWt->m_sFilePath;
+    pFtpuserData->m_nFileSize = filesize;
 
     MemBuf secondaryBuffer;
-    secondaryBuffer.setLength(1024);
-    while ( filesize != 0 )
-    {
-      nBufferSize = std::min(static_cast<u_long>(filesize), 
static_cast<u_long>(secondaryBuffer.getRealLength()/2));
-      if ( file->read(secondaryBuffer.getBuffer(), nBufferSize, &nbr) ||
-        
pFtpUserData->m_pDataConnection->socket->send(secondaryBuffer.getBuffer(), 
-          (u_long)nBufferSize, 0) == SOCKET_ERROR )
+    secondaryBuffer.setLength (1024);
+    while (filesize != 0)
       {
-        ftp_reply(pConnection, 451);
-        file->close();
-        delete file;
-        pFtpUserData->CloseDataConnection();
-        pFtpUserData->m_DataConnBusy.unlock();
-        delete pWt;
+       nBufferSize =
+         std::min (static_cast < u_long > (filesize),
+                   static_cast < u_long >
+                   (secondaryBuffer.getRealLength () / 2));
+       if (file->read (secondaryBuffer.getBuffer (), nBufferSize, &nbr)
+           || pFtpuserData->m_pDataConnection->socket->send (secondaryBuffer.
+                                                             getBuffer (),
+                                                             (u_long)
+                                                             nBufferSize,
+                                                             0) ==
+           SOCKET_ERROR)
+         {
+           ftpReply (pConnection, 451);
+           file->close ();
+           delete file;
+           pFtpuserData->closeDataConnection ();
+           pFtpuserData->m_DataConnBusy.unlock ();
+           delete pWt;
 #ifdef WIN32
-  return 0;
+           return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+           return (void *) 0;
 #endif
-      }
-      filesize -= nbr;
-      pFtpUserData->m_nBytesSent += nbr;
-      pFtpUserData->m_nRestartOffset += nbr;
-      if ( pFtpUserData->m_bBreakDataConnection )
-      {
-        pFtpUserData->m_bBreakDataConnection = false;
-               file->close();
-        delete file;
-        pFtpUserData->CloseDataConnection();
-        pFtpUserData->m_DataConnBusy.unlock();
-        delete pWt;
+         }
+       filesize -= nbr;
+       pFtpuserData->m_nBytesSent += nbr;
+       pFtpuserData->m_nrestartOffset += nbr;
+       if (pFtpuserData->m_bBreakDataConnection)
+         {
+           pFtpuserData->m_bBreakDataConnection = false;
+           file->close ();
+           delete file;
+           pFtpuserData->closeDataConnection ();
+           pFtpuserData->m_DataConnBusy.unlock ();
+           delete pWt;
 #ifdef WIN32
-  return 1;
+           return 1;
 #elif HAVE_PTHREAD
-  return (void*)1;
+           return (void *) 1;
 #endif
+         }
       }
-    }
-    file->close();
+    file->close ();
     delete file;
   }
-  catch (bad_alloc &ba)
+  catch (bad_alloc & ba)
   {
-    if ( file != NULL )
-      file->close();
+    if (file != NULL)
+      file->close ();
     delete file;
     //report error
   }
 
-  pFtpUserData->m_sCurrentFileName = "";
-  pFtpUserData->m_nFileSize = 0;
-  pFtpUserData->m_nBytesSent = 0;
-  pFtpUserData->m_nRestartOffset = 0;
-  ftp_reply(pConnection, 226);
-  pFtpUserData->CloseDataConnection();
-  pFtpUserData->m_DataConnBusy.unlock();
+  pFtpuserData->m_sCurrentFileName = "";
+  pFtpuserData->m_nFileSize = 0;
+  pFtpuserData->m_nBytesSent = 0;
+  pFtpuserData->m_nrestartOffset = 0;
+  ftpReply (pConnection, 226);
+  pFtpuserData->closeDataConnection ();
+  pFtpuserData->m_DataConnBusy.unlock ();
   delete pWt;
 #ifdef WIN32
   return 1;
 #elif HAVE_PTHREAD
-  return (void*)1;
+  return (void *) 1;
 #endif
 }
 
-static DEFINE_THREAD(ReceiveAsciiFile, pParam)
+static
+DEFINE_THREAD (ReceiveAsciiFile, pParam)
 {
   DataConnectionWorkerThreadData *pWt =
-    reinterpret_cast<DataConnectionWorkerThreadData *>(pParam);
+    reinterpret_cast < DataConnectionWorkerThreadData * >(pParam);
 
-  if ( pWt == NULL )
-  {
+  if (pWt == NULL)
+    {
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
   ConnectionPtr pConnection = pWt->m_pConnection;
-  if ( pConnection == NULL )
-  {
-    ftp_reply(pConnection, 451);
-    delete pWt;
+  if (pConnection == NULL)
+    {
+      ftpReply (pConnection, 451);
+      delete pWt;
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(pConnection->protocolBuffer);
-  if ( pFtpUserData == NULL )
-  {
-    ftp_reply(pConnection, 451);
-    pFtpUserData->CloseDataConnection();
-    delete pWt;
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(pConnection->protocolBuffer);
+  if (pFtpuserData == NULL)
+    {
+      ftpReply (pConnection, 451);
+      pFtpuserData->closeDataConnection ();
+      delete pWt;
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
-  pFtpUserData->m_DataConnBusy.lock();
-  
-  if ( pWt->m_pFtp == NULL )
-  {
-    pFtpUserData->CloseDataConnection();
-    pFtpUserData->m_DataConnBusy.unlock();
-    delete pWt;
+  pFtpuserData->m_DataConnBusy.lock ();
+
+  if (pWt->m_pFtp == NULL)
+    {
+      pFtpuserData->closeDataConnection ();
+      pFtpuserData->m_DataConnBusy.unlock ();
+      delete pWt;
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
-  if ( pFtpUserData->m_nFtpState == FtpUserData::DATA_CONNECTION_UP )
-    ftp_reply(pConnection, 125);
-    else 
+  if (pFtpuserData->m_nFtpstate == FtpuserData::DATA_CONNECTION_UP)
+    ftpReply (pConnection, 125);
+  else
     {
-      ftp_reply(pConnection, 150);
-        if ( pWt->m_pFtp->OpenDataConnection() == 0 )
-      {
-        ftp_reply(pConnection, 425);
-        pFtpUserData->CloseDataConnection();
-        pFtpUserData->m_DataConnBusy.unlock();
-        delete pWt;
+      ftpReply (pConnection, 150);
+      if (pWt->m_pFtp->OpenDataConnection () == 0)
+       {
+         ftpReply (pConnection, 425);
+         pFtpuserData->closeDataConnection ();
+         pFtpuserData->m_DataConnBusy.unlock ();
+         delete pWt;
 #ifdef WIN32
-  return 0;
+         return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+         return (void *) 0;
 #endif
-        }
-  }
-  
-        if( pFtpUserData->m_pDataConnection == NULL || 
-      pFtpUserData->m_pDataConnection->socket == NULL)
-  {
-    ftp_reply(pConnection, 451);
-    pFtpUserData->CloseDataConnection();
-    pFtpUserData->m_DataConnBusy.unlock();
-    delete pWt;
+       }
+    }
+
+  if (pFtpuserData->m_pDataConnection == NULL ||
+      pFtpuserData->m_pDataConnection->socket == NULL)
+    {
+      ftpReply (pConnection, 451);
+      pFtpuserData->closeDataConnection ();
+      pFtpuserData->m_DataConnBusy.unlock ();
+      delete pWt;
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
   File file;
   try
   {
     u_long flags = 0;
-    if ( pWt->m_bAppend )
+    if (pWt->m_bappend)
       flags = File::APPEND | File::WRITE;
     else
       flags = File::FILE_CREATE_ALWAYS | File::WRITE;
-    if ( file.openFile(pWt->m_sFilePath.c_str(), flags) )
-    {
-      ftp_reply(pConnection, 451);
-      pFtpUserData->CloseDataConnection();
-      pFtpUserData->m_DataConnBusy.unlock();
-      delete pWt;
+    if (file.openFile (pWt->m_sFilePath.c_str (), flags))
+      {
+       ftpReply (pConnection, 451);
+       pFtpuserData->closeDataConnection ();
+       pFtpuserData->m_DataConnBusy.unlock ();
+       delete pWt;
 #ifdef WIN32
-  return 0;
+       return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+       return (void *) 0;
 #endif
-    }
+      }
 
     MemBuf buffer, secondaryBuffer;
-    buffer.setLength(1024);
-    memset(buffer.getBuffer(), 0, buffer.getRealLength());
+    buffer.setLength (1024);
+    memset (buffer.getBuffer (), 0, buffer.getRealLength ());
     char *pLine = NULL;
     int nLineLength = 0;
     std::string sLine;
     u_long nbr;
-    while ( pFtpUserData->m_pDataConnection->socket->read(buffer.getBuffer(), 
-          (u_long)buffer.getRealLength()-1, &nbr) != SOCKET_ERROR && nbr != 0 )
-    {
-      memset(secondaryBuffer.getBuffer(), 0, secondaryBuffer.getRealLength());
-      secondaryBuffer.setLength(0);
-      pLine = buffer.getBuffer();
-      if ( pLine == NULL )
+    while (pFtpuserData->m_pDataConnection->socket->read (buffer.getBuffer (),
+                                                         (u_long) buffer.
+                                                         getRealLength () -
+                                                         1,
+                                                         &nbr) !=
+          SOCKET_ERROR && nbr != 0)
       {
-        ftp_reply(pConnection, 451);
-        file.close();
-        pFtpUserData->CloseDataConnection();
-        pFtpUserData->m_DataConnBusy.unlock();
-        delete pWt;
+       memset (secondaryBuffer.getBuffer (), 0,
+               secondaryBuffer.getRealLength ());
+       secondaryBuffer.setLength (0);
+       pLine = buffer.getBuffer ();
+       if (pLine == NULL)
+         {
+           ftpReply (pConnection, 451);
+           file.close ();
+           pFtpuserData->closeDataConnection ();
+           pFtpuserData->m_DataConnBusy.unlock ();
+           delete pWt;
 #ifdef WIN32
-  return 0;
+           return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+           return (void *) 0;
 #endif
-      }
-      while ( *pLine != 0 )
-      {
-        nLineLength = getEndLine(pLine, 0);
-        if ( nLineLength < 0 )//last line
-        {
-          sLine.assign(pLine, strlen(pLine));
-          if ( !sLine.empty() )
-            secondaryBuffer << sLine;
-          pLine += strlen(pLine);
-        }
-        else
-        {
-          sLine.assign(pLine, nLineLength);
+         }
+       while (*pLine != 0)
+         {
+           nLineLength = getEndLine (pLine, 0);
+           if (nLineLength < 0)        //last line
+             {
+               sLine.assign (pLine, strlen (pLine));
+               if (!sLine.empty ())
+                 secondaryBuffer << sLine;
+               pLine += strlen (pLine);
+             }
+           else
+             {
+               sLine.assign (pLine, nLineLength);
 #ifdef WIN32
-          secondaryBuffer << sLine << "\r\n";
+               secondaryBuffer << sLine << "\r\n";
 #else
-          secondaryBuffer << sLine << "\n";
+               secondaryBuffer << sLine << "\n";
 #endif
-          if ( *(pLine + nLineLength) == '\r' )
-            nLineLength++;
-          if ( *(pLine + nLineLength) == '\n' )
-            nLineLength++;
-          pLine += nLineLength;
-        }
-      }
-      file.write(secondaryBuffer.getBuffer(), 
(u_long)secondaryBuffer.getLength(), &nbr);
+               if (*(pLine + nLineLength) == '\r')
+                 nLineLength++;
+               if (*(pLine + nLineLength) == '\n')
+                 nLineLength++;
+               pLine += nLineLength;
+             }
+         }
+       file.write (secondaryBuffer.getBuffer (),
+                   (u_long) secondaryBuffer.getLength (), &nbr);
 
-      if ( pFtpUserData->m_bBreakDataConnection )
-      {
-        pFtpUserData->m_bBreakDataConnection = false;
-               file.close();
-        pFtpUserData->CloseDataConnection();
-        pFtpUserData->m_DataConnBusy.unlock();
-        delete pWt;
+       if (pFtpuserData->m_bBreakDataConnection)
+         {
+           pFtpuserData->m_bBreakDataConnection = false;
+           file.close ();
+           pFtpuserData->closeDataConnection ();
+           pFtpuserData->m_DataConnBusy.unlock ();
+           delete pWt;
 #ifdef WIN32
-  return 1;
+           return 1;
 #elif HAVE_PTHREAD
-  return (void*)1;
+           return (void *) 1;
 #endif
+         }
+       memset (buffer.getBuffer (), 0, buffer.getRealLength ());
       }
-      memset(buffer.getBuffer(), 0, buffer.getRealLength());
-    }
-    file.close();
+    file.close ();
   }
-  catch (bad_alloc &ba)
+  catch (bad_alloc & ba)
   {
-    file.close();
+    file.close ();
     //report error
   }
 
-  ftp_reply(pConnection, 226);
-  pFtpUserData->CloseDataConnection();
-  pFtpUserData->m_DataConnBusy.unlock();
+  ftpReply (pConnection, 226);
+  pFtpuserData->closeDataConnection ();
+  pFtpuserData->m_DataConnBusy.unlock ();
   delete pWt;
 #ifdef WIN32
   return 1;
 #elif HAVE_PTHREAD
-  return (void*)1;
+  return (void *) 1;
 #endif
 }
 
-static DEFINE_THREAD(ReceiveImageFile, pParam)
+static
+DEFINE_THREAD (ReceiveImageFile, pParam)
 {
-  DataConnectionWorkerThreadData *pWt = 
reinterpret_cast<DataConnectionWorkerThreadData *>(pParam);
-  if ( pWt == NULL )
-  {
+  DataConnectionWorkerThreadData *pWt =
+    reinterpret_cast < DataConnectionWorkerThreadData * >(pParam);
+  if (pWt == NULL)
+    {
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)-1;
+      return (void *) -1;
 #endif
-  }
+    }
 
   ConnectionPtr pConnection = pWt->m_pConnection;
-  if ( pConnection == NULL )
-  {
-    ftp_reply(pConnection, 451);
-    delete pWt;
+  if (pConnection == NULL)
+    {
+      ftpReply (pConnection, 451);
+      delete pWt;
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(pConnection->protocolBuffer);
-  if ( pFtpUserData == NULL )
-  {
-    ftp_reply(pConnection, 451);
-    pFtpUserData->CloseDataConnection();
-    delete pWt;
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(pConnection->protocolBuffer);
+  if (pFtpuserData == NULL)
+    {
+      ftpReply (pConnection, 451);
+      pFtpuserData->closeDataConnection ();
+      delete pWt;
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
-  pFtpUserData->m_DataConnBusy.lock();
-  
-  if ( pWt->m_pFtp == NULL )
-  {
-    pFtpUserData->CloseDataConnection();
-    pFtpUserData->m_DataConnBusy.unlock();
-    delete pWt;
+  pFtpuserData->m_DataConnBusy.lock ();
+
+  if (pWt->m_pFtp == NULL)
+    {
+      pFtpuserData->closeDataConnection ();
+      pFtpuserData->m_DataConnBusy.unlock ();
+      delete pWt;
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
-  if ( pFtpUserData->m_nFtpState == FtpUserData::DATA_CONNECTION_UP )
-    ftp_reply(pConnection, 125);
-    else 
+  if (pFtpuserData->m_nFtpstate == FtpuserData::DATA_CONNECTION_UP)
+    ftpReply (pConnection, 125);
+  else
     {
-      ftp_reply(pConnection, 150);
-        if ( pWt->m_pFtp->OpenDataConnection() == 0 )
-      {
-        ftp_reply(pConnection, 425);
-        pFtpUserData->CloseDataConnection();
-        pFtpUserData->m_DataConnBusy.unlock();
-        delete pWt;
+      ftpReply (pConnection, 150);
+      if (pWt->m_pFtp->OpenDataConnection () == 0)
+       {
+         ftpReply (pConnection, 425);
+         pFtpuserData->closeDataConnection ();
+         pFtpuserData->m_DataConnBusy.unlock ();
+         delete pWt;
 #ifdef WIN32
-  return 0;
+         return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+         return (void *) 0;
 #endif
-        }
-  }
-  
-        if( pFtpUserData->m_pDataConnection == NULL || 
-      pFtpUserData->m_pDataConnection->socket == NULL)
-  {
-    ftp_reply(pConnection, 451);
-    pFtpUserData->CloseDataConnection();
-    pFtpUserData->m_DataConnBusy.unlock();
-    delete pWt;
+       }
+    }
+
+  if (pFtpuserData->m_pDataConnection == NULL ||
+      pFtpuserData->m_pDataConnection->socket == NULL)
+    {
+      ftpReply (pConnection, 451);
+      pFtpuserData->closeDataConnection ();
+      pFtpuserData->m_DataConnBusy.unlock ();
+      delete pWt;
 #ifdef WIN32
-  return 0;
+      return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+      return (void *) 0;
 #endif
-  }
+    }
 
   File file;
   try
   {
     u_long flags = 0;
-    if ( pWt->m_bAppend )
+    if (pWt->m_bappend)
       flags = File::APPEND | File::WRITE;
     else
       flags = File::FILE_CREATE_ALWAYS | File::WRITE;
-    if ( file.openFile(pWt->m_sFilePath.c_str(), flags) )
-    {
-      ftp_reply(pConnection, 451);
-      pFtpUserData->CloseDataConnection();
-      pFtpUserData->m_DataConnBusy.unlock();
-      delete pWt;
+    if (file.openFile (pWt->m_sFilePath.c_str (), flags))
+      {
+       ftpReply (pConnection, 451);
+       pFtpuserData->closeDataConnection ();
+       pFtpuserData->m_DataConnBusy.unlock ();
+       delete pWt;
 #ifdef WIN32
-  return 0;
+       return 0;
 #elif HAVE_PTHREAD
-  return (void*)0;
+       return (void *) 0;
 #endif
-    }
+      }
     u_long nbr;
     MemBuf buffer;
-    buffer.setLength(1024);
-    memset(buffer.getBuffer(), 0, buffer.getRealLength());
-    while ( pFtpUserData->m_pDataConnection->socket->read(buffer.getBuffer(), 
-          (u_long)buffer.getRealLength()-1, &nbr) != SOCKET_ERROR && nbr != 0 )
-    {
-      file.write(buffer.getBuffer(), nbr, &nbr);
-      if ( pFtpUserData->m_bBreakDataConnection )
+    buffer.setLength (1024);
+    memset (buffer.getBuffer (), 0, buffer.getRealLength ());
+    while (pFtpuserData->m_pDataConnection->socket->read (buffer.getBuffer (),
+                                                         (u_long) buffer.
+                                                         getRealLength () -
+                                                         1,
+                                                         &nbr) !=
+          SOCKET_ERROR && nbr != 0)
       {
-        pFtpUserData->m_bBreakDataConnection = false;
-               file.close();
-        pFtpUserData->CloseDataConnection();
-        pFtpUserData->m_DataConnBusy.unlock();
-        delete pWt;
+       file.write (buffer.getBuffer (), nbr, &nbr);
+       if (pFtpuserData->m_bBreakDataConnection)
+         {
+           pFtpuserData->m_bBreakDataConnection = false;
+           file.close ();
+           pFtpuserData->closeDataConnection ();
+           pFtpuserData->m_DataConnBusy.unlock ();
+           delete pWt;
 #ifdef WIN32
-  return 1;
+           return 1;
 #elif HAVE_PTHREAD
-  return (void*)1;
+           return (void *) 1;
 #endif
+         }
       }
-    }
-    file.close();
+    file.close ();
   }
-  catch (bad_alloc &ba)
+  catch (bad_alloc & ba)
   {
     //report error
-    file.close();
+    file.close ();
   }
 
-  ftp_reply(pConnection, 226);
-  pFtpUserData->CloseDataConnection();
-  pFtpUserData->m_DataConnBusy.unlock();
+  ftpReply (pConnection, 226);
+  pFtpuserData->closeDataConnection ();
+  pFtpuserData->m_DataConnBusy.unlock ();
   delete pWt;
 #ifdef WIN32
   return 1;
 #elif HAVE_PTHREAD
-  return (void*)1;
+  return (void *) 1;
 #endif
 }
 
-bool Ftp::UserLoggedIn()
+bool Ftp::userLoggedIn ()
 {
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
-  if ( pFtpUserData == NULL )
-  {
-    return false;
-  }
-  if ( pFtpUserData->m_nFtpState < FtpUserData::USER_LOGGED_IN )
-  {
-    ftp_reply(530);
-    return false;
-  }
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
+  if (pFtpuserData == NULL)
+    {
+      return false;
+    }
+  if (pFtpuserData->m_nFtpstate < FtpuserData::USER_LOGGED_IN)
+    {
+      ftpReply (530);
+      return false;
+    }
   return true;
 }
 
@@ -1433,9 +1483,11 @@ bool Ftp::UserLoggedIn()
  *\param sOutPath local path
  *\return Return true if path exist, file is a normal one and is into the 
ftp's root folder
  */
-bool Ftp::BuildLocalPath(const std::string &sPathIn, std::string &sOutPath)
+bool
+Ftp::buildLocalPath (const std::string & sPathIn, std::string & sOutPath)
 {
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
   sOutPath = td.pConnection->host->getDocumentRoot ();
 
@@ -1443,24 +1495,26 @@ bool Ftp::BuildLocalPath(const std::string &sPathIn, 
std::string &sOutPath)
     sOutPath.append ("/");
 
   if (sPathIn[0] != '/')
-    sOutPath.append (pFtpUserData->m_cwd);
+    sOutPath.append (pFtpuserData->m_cwd);
 
-  if ( sPathIn[0] != '-' ) // ls params not handled
+  if (sPathIn[0] != '-')       // ls params not handled
     sOutPath.append (sPathIn);
 
   FilesUtility::completePath (sOutPath);
 
-  std::string sDocRoot(td.pConnection->host->getDocumentRoot());
-  FilesUtility::completePath(sDocRoot);
-  if ( FilesUtility::getPathRecursionLevel(sDocRoot) > 
FilesUtility::getPathRecursionLevel(sOutPath) )
-  {
-    ftp_reply(550);
-    return false;
-  }
+  std::string sDocRoot (td.pConnection->host->getDocumentRoot ());
+  FilesUtility::completePath (sDocRoot);
+  if (FilesUtility::getPathRecursionLevel (sDocRoot) >
+      FilesUtility::getPathRecursionLevel (sOutPath))
+    {
+      ftpReply (550);
+      return false;
+    }
   ///////////////////////////////////////
-  if ( FilesUtility::isDirectory(sOutPath) &&
-       (sOutPath[sOutPath.length() - 1] != '/' && sOutPath[sOutPath.length() - 
1] != '\\') )
-    sOutPath.append("/");
+  if (FilesUtility::isDirectory (sOutPath) &&
+      (sOutPath[sOutPath.length () - 1] != '/'
+       && sOutPath[sOutPath.length () - 1] != '\\'))
+    sOutPath.append ("/");
   return true;
 }
 
@@ -1470,489 +1524,521 @@ bool Ftp::BuildLocalPath(const std::string &sPathIn, 
std::string &sOutPath)
  *\param sOutPath local path
  *\return Return true if path exist, file is a normal one and is into the 
ftp's root folder
  */
-bool Ftp::GetLocalPath(const std::string &sPath, std::string &sOutPath)
+bool Ftp::getLocalPath (const std::string & sPath, std::string & sOutPath)
 {
-  if ( !BuildLocalPath(sPath, sOutPath) )
+  if (!buildLocalPath (sPath, sOutPath))
     return false;
 
-  if ( sOutPath.empty() || 
-     !FilesUtility::fileExists(sOutPath) || 
-     FilesUtility::isLink(sOutPath.c_str()) )
-  {
-    ftp_reply(550);
-    return false;
-  }
+  if (sOutPath.empty () ||
+      !FilesUtility::fileExists (sOutPath) ||
+      FilesUtility::isLink (sOutPath.c_str ()))
+    {
+      ftpReply (550);
+      return false;
+    }
 
   return true;
 }
 
-void Ftp::Quit()
+void
+Ftp::quit ()
 {
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
   //wait to finish data transfer
-  if ( !m_bAllowAsynchronousCmds )
-    WaitDataConnection();
+  if (!m_ballowAsynchronousCmds)
+    waitDataConnection ();
 
-  pFtpUserData->m_nFtpState = FtpUserData::NO_CONTROL_CONNECTION;
-  ftp_reply(221);
+  pFtpuserData->m_nFtpstate = FtpuserData::NO_CONTROL_CONNECTION;
+  ftpReply (221);
 }
 
-void Ftp::Help(const std::string &sCmd/* = ""*/)
+void
+Ftp::help (const std::string & sCmd /* = "" */ )
 {
-  WaitDataConnection();
+  waitDataConnection ();
   // treat SITE the same as HELP
-  if ( sCmd.empty() || stringcmpi(sCmd, "SITE") == 0 )
-    ftp_reply(214);
+  if (sCmd.empty () || stringcmpi (sCmd, "SITE") == 0)
+    ftpReply (214);
   else
-    ftp_reply(502);
+    ftpReply (502);
 }
 
-void Ftp::Noop()
+void
+Ftp::noop ()
 {
-  WaitDataConnection();
-  ftp_reply(200);
+  waitDataConnection ();
+  ftpReply (200);
 }
 
-int Ftp::OpenDataConnection()
+int
+Ftp::OpenDataConnection ()
 {
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
-  if ( pFtpUserData->m_nFtpState == FtpUserData::DATA_CONNECTION_UP )
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
+  if (pFtpuserData->m_nFtpstate == FtpuserData::DATA_CONNECTION_UP)
     return 1;
 
-  //pFtpUserData->m_DataConnBusy.lock();
-  int nRet = pFtpUserData->m_bPassiveSrv ? OpenDataPassive() : 
OpenDataActive();
-  if ( nRet != 0 )
-    pFtpUserData->m_nFtpState = FtpUserData::DATA_CONNECTION_UP;
+  //pFtpuserData->m_DataConnBusy.lock();
+  int nRet =
+    pFtpuserData->m_bPassiveSrv ? openDataPassive () : openDataActive ();
+  if (nRet != 0)
+    pFtpuserData->m_nFtpstate = FtpuserData::DATA_CONNECTION_UP;
   return nRet;
 }
 
-int Ftp::OpenDataPassive()
+int
+Ftp::openDataPassive ()
 {
-  Server* server = Server::getInstance();
-  if ( server == NULL )
+  Server *server = Server::getInstance ();
+  if (server == NULL)
     return 0;
 
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
-  Socket *pSocket = new Socket();
-  pSocket->socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
-  if ( pSocket->getHandle() == (Handle)INVALID_SOCKET )
+  Socket *pSocket = new Socket ();
+  pSocket->socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
+  if (pSocket->getHandle () == (Handle) INVALID_SOCKET)
     return 0;
   int nReuseAddr = 1;
   MYSERVER_SOCKADDR_STORAGE storage = { 0 };
-  ((sockaddr_in*)(&storage))->sin_family = AF_INET;
+  ((sockaddr_in *) (&storage))->sin_family = AF_INET;
   char szIpAddr[16];
-  memset(szIpAddr, 0, 16);
-  GetIpAddr(pFtpUserData->m_cdh, szIpAddr, 16);
+  memset (szIpAddr, 0, 16);
+  getIpAddr (pFtpuserData->m_cdh, szIpAddr, 16);
 #ifdef WIN32
-  ((sockaddr_in*)(&storage))->sin_addr.s_addr = inet_addr(szIpAddr);
+  ((sockaddr_in *) (&storage))->sin_addr.s_addr = inet_addr (szIpAddr);
 #else
-  inet_aton(szIpAddr, &((sockaddr_in*)(&storage))->sin_addr);
+  inet_aton (szIpAddr, &((sockaddr_in *) (&storage))->sin_addr);
 #endif // WIN32
-  ((sockaddr_in*)(&storage))->sin_port = htons(GetPortNo(pFtpUserData->m_cdh));
-  if ( pSocket->setsockopt(SOL_SOCKET, SO_REUSEADDR, (const char*)&nReuseAddr, 
sizeof(nReuseAddr)) < 0 )
+  ((sockaddr_in *) (&storage))->sin_port =
+    htons (getPortNo (pFtpuserData->m_cdh));
+  if (pSocket->
+      setsockopt (SOL_SOCKET, SO_REUSEADDR, (const char *) &nReuseAddr,
+                 sizeof (nReuseAddr)) < 0)
     return 0;
-  if ( pSocket->bind(&storage, sizeof(sockaddr_in)) != 0 || 
pSocket->listen(SOMAXCONN) != 0 )
+  if (pSocket->bind (&storage, sizeof (sockaddr_in)) != 0
+      || pSocket->listen (SOMAXCONN) != 0)
     return 0;
 
-  pFtpUserData->m_pDataConnection->setPort(GetPortNo(pFtpUserData->m_cdh));
-  
pFtpUserData->m_pDataConnection->setLocalPort(pFtpUserData->m_nLocalDataPort);
-  pFtpUserData->m_pDataConnection->setIpAddr(td.pConnection->getIpAddr());
-  
pFtpUserData->m_pDataConnection->setLocalIpAddr(td.pConnection->getLocalIpAddr());
-  pFtpUserData->m_pDataConnection->host = td.pConnection->host;
-  pFtpUserData->m_pDataConnection->socket = pSocket;
-  pFtpUserData->m_pDataConnection->setScheduled(1);
+  pFtpuserData->m_pDataConnection->setPort (getPortNo (pFtpuserData->m_cdh));
+  pFtpuserData->m_pDataConnection->setLocalPort 
(pFtpuserData->m_nLocalDataport);
+  pFtpuserData->m_pDataConnection->setIpAddr (td.pConnection->getIpAddr ());
+  pFtpuserData->m_pDataConnection->setLocalIpAddr 
(td.pConnection->getLocalIpAddr ());
+  pFtpuserData->m_pDataConnection->host = td.pConnection->host;
+  pFtpuserData->m_pDataConnection->socket = pSocket;
+  pFtpuserData->m_pDataConnection->setScheduled (1);
   return 1;
 }
 
-int Ftp::OpenDataActive()
+int
+Ftp::openDataActive ()
 {
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
   Socket dataSocket;
-  dataSocket.socket(PF_INET, SOCK_STREAM, IPPROTO_TCP);
+  dataSocket.socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
   char szIpAddr[16];
-  memset(szIpAddr, 0, 16);
-  GetIpAddr(pFtpUserData->m_cdh, szIpAddr, 16);
-  if ( dataSocket.connect(szIpAddr, GetPortNo(pFtpUserData->m_cdh)) < 0 )
+  memset (szIpAddr, 0, 16);
+  getIpAddr (pFtpuserData->m_cdh, szIpAddr, 16);
+  if (dataSocket.connect (szIpAddr, getPortNo (pFtpuserData->m_cdh)) < 0)
     return 0;
 
-  pFtpUserData->m_pDataConnection->setPort(GetPortNo(pFtpUserData->m_cdh));
-  
pFtpUserData->m_pDataConnection->setLocalPort(pFtpUserData->m_nLocalDataPort);
-  pFtpUserData->m_pDataConnection->setIpAddr(td.pConnection->getIpAddr());
-  
pFtpUserData->m_pDataConnection->setLocalIpAddr(td.pConnection->getLocalIpAddr());
-  pFtpUserData->m_pDataConnection->host = td.pConnection->host;
-  pFtpUserData->m_pDataConnection->socket = new Socket(dataSocket);
-  pFtpUserData->m_pDataConnection->setScheduled(1);
+  pFtpuserData->m_pDataConnection->setPort (getPortNo (pFtpuserData->m_cdh));
+  pFtpuserData->m_pDataConnection->setLocalPort 
(pFtpuserData->m_nLocalDataport);
+  pFtpuserData->m_pDataConnection->setIpAddr (td.pConnection->getIpAddr ());
+  pFtpuserData->m_pDataConnection->setLocalIpAddr (td.pConnection->
+                                                   getLocalIpAddr ());
+  pFtpuserData->m_pDataConnection->host = td.pConnection->host;
+  pFtpuserData->m_pDataConnection->socket = new Socket (dataSocket);
+  pFtpuserData->m_pDataConnection->setScheduled (1);
 
   return 1;
 }
 
-int Ftp::Type(int nTypeCode, int nFormatControlCode/* = -1*/)
+int
+Ftp::type (int ntypeCode, int nFormatControlCode /* = -1 */ )
 {
-  WaitDataConnection();
-  if ( !UserLoggedIn() )
+  waitDataConnection ();
+  if (!userLoggedIn ())
     return 0;
 
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
-  pFtpUserData->m_nFtpRepresentation = 
(FtpUserData::FtpRepresentation)nTypeCode;
-  switch ( nFormatControlCode )
-  {
-    case FtpUserData::NON_PRINT:
-      if ( nTypeCode == FtpUserData::REPR_ASCII )
-        pFtpUserData->m_nFtpFormatControl = 
(FtpUserData::FtpFormatControl)nFormatControlCode;
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
+  pFtpuserData->m_nFtpRepresentation =
+    (FtpuserData::FtpRepresentation) ntypeCode;
+  switch (nFormatControlCode)
+    {
+    case FtpuserData::NON_PRINT:
+      if (ntypeCode == FtpuserData::REPR_ASCII)
+       pFtpuserData->m_nFtpFormatControl =
+         (FtpuserData::FtpFormatControl) nFormatControlCode;
       else
-      {
-        ftp_reply(501);
-        return 0;
-      }
+       {
+         ftpReply (501);
+         return 0;
+       }
       break;
-    case FtpUserData::REPR_IMAGE:
-      pFtpUserData->m_nFtpFormatControl = 
(FtpUserData::FtpFormatControl)nFormatControlCode;
+    case FtpuserData::REPR_IMAGE:
+      pFtpuserData->m_nFtpFormatControl =
+       (FtpuserData::FtpFormatControl) nFormatControlCode;
       break;
-  }
+    }
 
-  ftp_reply(200);
+  ftpReply (200);
   return 1;
 }
 
-void Ftp::Stru(int nStructure)
+void
+Ftp::stru (int nstructure)
 {
-  WaitDataConnection();
-  if ( !UserLoggedIn() )
+  waitDataConnection ();
+  if (!userLoggedIn ())
     return;
-  if ( nStructure < 0 )
-    ftp_reply(504);
+  if (nstructure < 0)
+    ftpReply (504);
 
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
-  pFtpUserData->m_nFtpFileStructure = 
(FtpUserData::FtpFileStructure)nStructure;
-  ftp_reply(200);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
+  pFtpuserData->m_nFtpFilestructure =
+    (FtpuserData::FtpFilestructure) nstructure;
+  ftpReply (200);
 }
 
-void Ftp::Mode(int nMode)
+void
+Ftp::mode (int nmode)
 {
-  WaitDataConnection();
-  if ( !UserLoggedIn() )
+  waitDataConnection ();
+  if (!userLoggedIn ())
     return;
-  if ( nMode < 0 )
-    ftp_reply(504);
+  if (nmode < 0)
+    ftpReply (504);
 
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
-  pFtpUserData->m_nTransferMode = (FtpUserData::FtpTransferMode)nMode;
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
+  pFtpuserData->m_nTransfermode = (FtpuserData::FtpTransfermode) nmode;
 }
 
-void Ftp::List(const std::string &sParam/*= ""*/)
+void
+Ftp::list (const std::string & sParam /*= ""*/ )
 {
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
-  WaitDataConnection();
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
+  waitDataConnection ();
 
   std::string sLocalPath;
-  if ( !UserLoggedIn() || !GetLocalPath(sParam, sLocalPath) /*|| */ )
+  if (!userLoggedIn () || !getLocalPath (sParam, sLocalPath))
     return;
 
-  if ( pFtpUserData->m_nFtpState == FtpUserData::DATA_CONNECTION_UP )
-    ftp_reply(125);
-    else
+  if (pFtpuserData->m_nFtpstate == FtpuserData::DATA_CONNECTION_UP)
+    ftpReply (125);
+  else
     {
-      ftp_reply(150);
-        if ( OpenDataConnection() == 0 )
-         {
-           ftp_reply(425);
-           return;
-         }
+      ftpReply (150);
+      if (OpenDataConnection () == 0)
+        {
+          ftpReply (425);
+          return;
+        }
     }
 
-  std::string sPath(sLocalPath);
-  if ( sPath.empty() )
-    sPath = pFtpUserData->m_cwd;
+  std::string sPath (sLocalPath);
+  if (sPath.empty ())
+    sPath = pFtpuserData->m_cwd;
 
-  const char *username = pFtpUserData->m_sUserName.c_str();
-  const char *password = pFtpUserData->m_sPass.c_str();
+  const char *username = pFtpuserData->m_suserName.c_str ();
+  const char *password = pFtpuserData->m_sPass.c_str ();
 
-  if (CheckRights (username, password, sLocalPath,
-                  MYSERVER_PERMISSION_BROWSE) == 0)
+  if (checkRights (username, password, sLocalPath,
+                   MYSERVER_PERMISSION_BROWSE) == 0)
     {
-      ftp_reply (530);
+      ftpReply (530);
       return;
     }
 
   time_t now;
-  time(&now);
+  time (&now);
 
-  MemBuf &secondaryBuffer = *td.secondaryBuffer;
-  secondaryBuffer.setLength(0);
+  MemBuf & secondaryBuffer = *td.secondaryBuffer;
+  secondaryBuffer.setLength (0);
 
   char perm[11];
-  if ( FilesUtility::isDirectory(sPath) )
-  {
-    FindData fd;
-    //dir MUST ends with '/'
-    if ( fd.findfirst(sPath) )
-    {
-      ftp_reply(450);
-      CloseDataConnection();
-      return;
-    }
-
-    const char *secName = td.st.getHashedData ("security.filename",
-                                               MYSERVER_VHOST_CONF | 
MYSERVER_SERVER_CONF,
-                                               ".security.xml");
-    do
+  if (FilesUtility::isDirectory (sPath))
     {
-      if(fd.name[0] == '.' || !strcmpi(fd.name, secName) )
-        continue;
-
-      perm[10] = '\0';
-      perm[0] = fd.attrib == FILE_ATTRIBUTE_DIRECTORY ? 'd' : '-';
-      string completeFileName(sPath);
-      completeFileName.append(fd.name);
-      int guestMask = CheckRights("Guest", "", completeFileName, -1);
-      int pMask = CheckRights(username, password, completeFileName, -1);
-
-      //Owner and group permissions are the same.
-      perm[1] = perm[4] = pMask & MYSERVER_PERMISSION_READ ? 'r' : '-';
-      perm[2] = perm[5] = pMask & MYSERVER_PERMISSION_WRITE ? 'w' : '-';
-      perm[3] = perm[6] = pMask & MYSERVER_PERMISSION_EXECUTE ? 'x' : '-';
-
-      //Permission for All are the permission for Guest
-      perm[7] = guestMask & MYSERVER_PERMISSION_READ ? 'r' : '-';
-      perm[8] = guestMask & MYSERVER_PERMISSION_WRITE ? 'w' : '-';
-      perm[9] = guestMask & MYSERVER_PERMISSION_EXECUTE ? 'x' : '-';
-
-      string date;
-      const char* datePtr =  getRFC822LocalTime(fd.time_write, date, 32);
-
-      char dateFtpFormat[13];
-
-      dateFtpFormat[3] = ' ';
-      dateFtpFormat[6] = ' ';
-      dateFtpFormat[7] = ' ';
-      dateFtpFormat[12] = '\0';
-
-      int offset = datePtr[6] == ' ' ? 0 : 1;
-
-          //Day
-      dateFtpFormat[4] = datePtr[5];
-      dateFtpFormat[5] = datePtr[6];
-
-      //Month
-      dateFtpFormat[0] = datePtr[7 + offset];
-      dateFtpFormat[1] = datePtr[8 + offset];
-      dateFtpFormat[2] = datePtr[9 + offset];
-
-      //If the file was modified in the last 6 months
-      //show the hour instead of the year
-      if(now - fd.time_write < 60 * 60 * 183 && 
-         now > fd.time_write)
-      {
-        //Hour
-        dateFtpFormat[7] = datePtr[16 + offset];
-        dateFtpFormat[8] = datePtr[17 + offset];
-        dateFtpFormat[9] = ':';
-        dateFtpFormat[10] = datePtr[19 + offset];
-        dateFtpFormat[11] = datePtr[20 + offset];
-      }
-      else
-      {
-        //Year
-        dateFtpFormat[8] = datePtr[11 + offset];
-        dateFtpFormat[9] = datePtr[12 + offset];
-        dateFtpFormat[10] = datePtr[13 + offset];
-        dateFtpFormat[11] = datePtr[14 + offset];
-      }
-
-      char nlinkStr[12];
-      memset(nlinkStr, 0, sizeof(char)*12);
+      FindData fd;
+      //dir MUST ends with '/'
+      if (fd.findfirst (sPath))
+       {
+         ftpReply (450);
+         closeDataConnection ();
+         return;
+       }
+
+      const char *secName = td.st.getHashedData ("security.filename",
+                                                MYSERVER_VHOST_CONF |
+                                                MYSERVER_SERVER_CONF,
+                                                ".security.xml");
+      do
+       {
+         if (fd.name[0] == '.' || !strcmpi (fd.name, secName))
+           continue;
+
+         perm[10] = '\0';
+         perm[0] = fd.attrib == FILE_ATTRIBUTE_DIRECTORY ? 'd' : '-';
+         string completeFileName (sPath);
+         completeFileName.append (fd.name);
+         int guestMask = checkRights ("Guest", "", completeFileName, -1);
+         int pMask = checkRights (username, password, completeFileName, -1);
+
+         //Owner and group permissions are the same.
+         perm[1] = perm[4] = pMask & MYSERVER_PERMISSION_READ ? 'r' : '-';
+         perm[2] = perm[5] = pMask & MYSERVER_PERMISSION_WRITE ? 'w' : '-';
+         perm[3] = perm[6] = pMask & MYSERVER_PERMISSION_EXECUTE ? 'x' : '-';
+
+         //Permission for All are the permission for Guest
+         perm[7] = guestMask & MYSERVER_PERMISSION_READ ? 'r' : '-';
+         perm[8] = guestMask & MYSERVER_PERMISSION_WRITE ? 'w' : '-';
+         perm[9] = guestMask & MYSERVER_PERMISSION_EXECUTE ? 'x' : '-';
+
+         string date;
+         const char *datePtr = getRFC822LocalTime (fd.time_write, date, 32);
+
+         char dateFtpFormat[13];
+
+         dateFtpFormat[3] = ' ';
+         dateFtpFormat[6] = ' ';
+         dateFtpFormat[7] = ' ';
+         dateFtpFormat[12] = '\0';
+
+         int offset = datePtr[6] == ' ' ? 0 : 1;
+
+         //Day
+         dateFtpFormat[4] = datePtr[5];
+         dateFtpFormat[5] = datePtr[6];
+
+         //Month
+         dateFtpFormat[0] = datePtr[7 + offset];
+         dateFtpFormat[1] = datePtr[8 + offset];
+         dateFtpFormat[2] = datePtr[9 + offset];
+
+         //If the file was modified in the last 6 months
+         //show the hour instead of the year
+         if (now - fd.time_write < 60 * 60 * 183 && now > fd.time_write)
+           {
+             //Hour
+             dateFtpFormat[7] = datePtr[16 + offset];
+             dateFtpFormat[8] = datePtr[17 + offset];
+             dateFtpFormat[9] = ':';
+             dateFtpFormat[10] = datePtr[19 + offset];
+             dateFtpFormat[11] = datePtr[20 + offset];
+           }
+         else
+           {
+             //Year
+             dateFtpFormat[8] = datePtr[11 + offset];
+             dateFtpFormat[9] = datePtr[12 + offset];
+             dateFtpFormat[10] = datePtr[13 + offset];
+             dateFtpFormat[11] = datePtr[14 + offset];
+           }
+
+         char nlinkStr[12];
+         memset (nlinkStr, 0, sizeof (char) * 12);
 #ifndef WIN32
-      nlink_t nlink = 1;
-      nlink = fd.getStatStruct()->st_nlink;
-      sprintf(nlinkStr, "%lu", (u_long) nlink);
+         nlink_t nlink = 1;
+         nlink = fd.getStatStruct ()->st_nlink;
+         sprintf (nlinkStr, "%lu", (u_long) nlink);
 #endif
 
-      char fdSizeStr[12];
-      sprintf(fdSizeStr, "%li", fd.size);
+         char fdSizeStr[12];
+         sprintf (fdSizeStr, "%li", fd.size);
 
-      secondaryBuffer << (const char *)perm << " " << nlinkStr << " " 
-              << username << " " << username << " " << fdSizeStr 
-              << " " << (const char *)dateFtpFormat << " " 
-              << fd.name << "\r\n";
+         secondaryBuffer << (const char *) perm << " " << nlinkStr << " "
+           << username << " " << username << " " << fdSizeStr
+           << " " << (const char *) dateFtpFormat << " "
+           << fd.name << "\r\n";
 
-        }
-      while (!fd.findnext());
-    fd.findclose();
-  }
-  else if ( !FilesUtility::isLink(sPath) )
-  {
-    // TODO: implement * selection
-    std::string sDir, sFileName;
-    FilesUtility::splitPath(sLocalPath, sDir, sFileName);
-    FindData fd;
-    if ( fd.findfirst(sDir) )
-    {
-      ftp_reply(450);
-      CloseDataConnection();
-      return;
+       }
+      while (!fd.findnext ());
+      fd.findclose ();
     }
-    do
+  else if (!FilesUtility::isLink (sPath))
     {
-      if ( strcmp(fd.name, sFileName.c_str()) != 0 )
-        continue;
-
-      perm[10] = '\0';
-      perm[0] = fd.attrib == FILE_ATTRIBUTE_DIRECTORY ? 'd' : '-';
-
-      string completeFileName(sDir);
-      completeFileName.append(fd.name);
-
-      int guestMask = CheckRights("guest", "", completeFileName, -1);
-      int pMask = CheckRights(username, password, completeFileName, -1);
-      //Owner and group permissions are the same.
-      perm[1] = perm[4] = pMask & MYSERVER_PERMISSION_READ ? 'r' : '-';
-      perm[2] = perm[5] = pMask & MYSERVER_PERMISSION_WRITE ? 'w' : '-';
-      perm[3] = perm[6] = pMask & MYSERVER_PERMISSION_EXECUTE ? 'x' : '-';
-
-      //Permission for All are the permission for Guest
-      perm[7] = guestMask & MYSERVER_PERMISSION_READ ? 'r' : '-';
-      perm[8] = guestMask & MYSERVER_PERMISSION_WRITE ? 'w' : '-';
-      perm[9] = guestMask & MYSERVER_PERMISSION_EXECUTE ? 'x' : '-';
-
-      string date;
-      const char* datePtr =  getRFC822LocalTime(fd.time_write, date, 32);
-
-      char dateFtpFormat[13];
-
-      dateFtpFormat[3] = ' ';
-      dateFtpFormat[6] = ' ';
-      dateFtpFormat[7] = ' ';
-      dateFtpFormat[12] = '\0';
-
-      int offset = datePtr[6] == ' ' ? 0 : 1;
-
-          //Day
-      dateFtpFormat[4] = datePtr[5];
-      dateFtpFormat[5] = datePtr[6];
-
-      //Month
-      dateFtpFormat[0] = datePtr[7 + offset];
-      dateFtpFormat[1] = datePtr[8 + offset];
-      dateFtpFormat[2] = datePtr[9 + offset];
-
-      //If the file was modified in the last 6 months
-      //show the hour instead of the year
-      if(now - fd.time_write < 60 * 60 * 183 && 
-         now > fd.time_write)
-      {
-        //Hour
-        dateFtpFormat[7] = datePtr[16 + offset];
-        dateFtpFormat[8] = datePtr[17 + offset];
-        dateFtpFormat[9] = ':';
-        dateFtpFormat[10] = datePtr[19 + offset];
-        dateFtpFormat[11] = datePtr[20 + offset];
-      }
-      else
-      {
-        //Year
-        dateFtpFormat[8] = datePtr[11 + offset];
-        dateFtpFormat[9] = datePtr[12 + offset];
-        dateFtpFormat[10] = datePtr[13 + offset];
-        dateFtpFormat[11] = datePtr[14 + offset];
-      }
-
-      char nlinkStr[12];
-      memset(nlinkStr, 0, sizeof(char)*12);
+      // TODO: implement * selection
+      std::string sDir, sFileName;
+      FilesUtility::splitPath (sLocalPath, sDir, sFileName);
+      FindData fd;
+      if (fd.findfirst (sDir))
+       {
+         ftpReply (450);
+         closeDataConnection ();
+         return;
+       }
+      do
+       {
+         if (strcmp (fd.name, sFileName.c_str ()) != 0)
+           continue;
+
+         perm[10] = '\0';
+         perm[0] = fd.attrib == FILE_ATTRIBUTE_DIRECTORY ? 'd' : '-';
+
+         string completeFileName (sDir);
+         completeFileName.append (fd.name);
+
+         int guestMask = checkRights ("guest", "", completeFileName, -1);
+         int pMask = checkRights (username, password, completeFileName, -1);
+         //Owner and group permissions are the same.
+         perm[1] = perm[4] = pMask & MYSERVER_PERMISSION_READ ? 'r' : '-';
+         perm[2] = perm[5] = pMask & MYSERVER_PERMISSION_WRITE ? 'w' : '-';
+         perm[3] = perm[6] = pMask & MYSERVER_PERMISSION_EXECUTE ? 'x' : '-';
+
+         //Permission for All are the permission for Guest
+         perm[7] = guestMask & MYSERVER_PERMISSION_READ ? 'r' : '-';
+         perm[8] = guestMask & MYSERVER_PERMISSION_WRITE ? 'w' : '-';
+         perm[9] = guestMask & MYSERVER_PERMISSION_EXECUTE ? 'x' : '-';
+
+         string date;
+         const char *datePtr = getRFC822LocalTime (fd.time_write, date, 32);
+
+         char dateFtpFormat[13];
+
+         dateFtpFormat[3] = ' ';
+         dateFtpFormat[6] = ' ';
+         dateFtpFormat[7] = ' ';
+         dateFtpFormat[12] = '\0';
+
+         int offset = datePtr[6] == ' ' ? 0 : 1;
+
+         //Day
+         dateFtpFormat[4] = datePtr[5];
+         dateFtpFormat[5] = datePtr[6];
+
+         //Month
+         dateFtpFormat[0] = datePtr[7 + offset];
+         dateFtpFormat[1] = datePtr[8 + offset];
+         dateFtpFormat[2] = datePtr[9 + offset];
+
+         //If the file was modified in the last 6 months
+         //show the hour instead of the year
+         if (now - fd.time_write < 60 * 60 * 183 && now > fd.time_write)
+           {
+             //Hour
+             dateFtpFormat[7] = datePtr[16 + offset];
+             dateFtpFormat[8] = datePtr[17 + offset];
+             dateFtpFormat[9] = ':';
+             dateFtpFormat[10] = datePtr[19 + offset];
+             dateFtpFormat[11] = datePtr[20 + offset];
+           }
+         else
+           {
+             //Year
+             dateFtpFormat[8] = datePtr[11 + offset];
+             dateFtpFormat[9] = datePtr[12 + offset];
+             dateFtpFormat[10] = datePtr[13 + offset];
+             dateFtpFormat[11] = datePtr[14 + offset];
+           }
+
+         char nlinkStr[12];
+         memset (nlinkStr, 0, sizeof (char) * 12);
 #ifndef WIN32
-      nlink_t nlink = 1;
-      nlink = fd.getStatStruct()->st_nlink;
-      sprintf(nlinkStr, "%lu", (u_long) nlink);
+         nlink_t nlink = 1;
+         nlink = fd.getStatStruct ()->st_nlink;
+         sprintf (nlinkStr, "%lu", (u_long) nlink);
 #endif
 
-      char fdSizeStr[12];
-      sprintf(fdSizeStr, "%li", fd.size);
+         char fdSizeStr[12];
+         sprintf (fdSizeStr, "%li", fd.size);
 
-      secondaryBuffer << (const char *)perm << " " << nlinkStr << " " 
-              << username << " " << username << " " << fdSizeStr 
-              << " " << (const char *)dateFtpFormat << " " 
-              << fd.name << "\r\n";
-        }
-      while (!fd.findnext());
-    fd.findclose();
-  }
-  if( 
pFtpUserData->m_pDataConnection->socket->send(td.secondaryBuffer->getBuffer(), 
-      (u_long)td.secondaryBuffer->getLength(), 0) == SOCKET_ERROR)
-  {
-    ftp_reply(451);
-  }
+         secondaryBuffer << (const char *) perm << " " << nlinkStr << " "
+           << username << " " << username << " " << fdSizeStr
+           << " " << (const char *) dateFtpFormat << " "
+           << fd.name << "\r\n";
+       }
+      while (!fd.findnext ());
+      fd.findclose ();
+    }
+  if (pFtpuserData->m_pDataConnection->socket->
+      send (td.secondaryBuffer->getBuffer (),
+           (u_long) td.secondaryBuffer->getLength (), 0) == SOCKET_ERROR)
+    {
+      ftpReply (451);
+    }
 
-  ftp_reply(226);
-  CloseDataConnection();
+  ftpReply (226);
+  closeDataConnection ();
 }
 
-void Ftp::Nlst(const std::string &sParam/* = ""*/)
+void
+Ftp::nlst (const std::string & sParam /* = "" */ )
 {
-  WaitDataConnection();
+  waitDataConnection ();
   std::string sLocalPath;
-  if ( !UserLoggedIn() || !GetLocalPath(sParam, sLocalPath) )
+  if (!userLoggedIn () || !getLocalPath (sParam, sLocalPath))
     return;
 
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
-  if ( pFtpUserData->m_nFtpState == FtpUserData::DATA_CONNECTION_UP )
-    ftp_reply(125);
-    else
+  if (pFtpuserData->m_nFtpstate == FtpuserData::DATA_CONNECTION_UP)
+    ftpReply (125);
+  else
     {
-      ftp_reply(150);
-        if ( OpenDataConnection() == 0 )
-         {
-           ftp_reply(425);
-           return;
-         }
+      ftpReply (150);
+      if (OpenDataConnection () == 0)
+       {
+         ftpReply (425);
+         return;
+       }
     }
 
-  std::string sPath(sLocalPath);
-  if ( sPath.empty() )
-    sPath = pFtpUserData->m_cwd;
+  std::string sPath (sLocalPath);
+  if (sPath.empty ())
+    sPath = pFtpuserData->m_cwd;
 
-  if ( !FilesUtility::isDirectory(sPath) )
-  {
-    ftp_reply(450);
-    CloseDataConnection();
-    return;
-  }
+  if (!FilesUtility::isDirectory (sPath))
+    {
+      ftpReply (450);
+      closeDataConnection ();
+      return;
+    }
   FindData fd;
-  if ( fd.findfirst(sPath) )
-  {
-    ftp_reply(450);
-    CloseDataConnection();
-    return;
-  }
+  if (fd.findfirst (sPath))
+    {
+      ftpReply (450);
+      closeDataConnection ();
+      return;
+    }
 
-  MemBuf &secondaryBuffer = *td.secondaryBuffer;
-  secondaryBuffer.setLength(0);
+  MemBuf & secondaryBuffer = *td.secondaryBuffer;
+  secondaryBuffer.setLength (0);
 
   const char *secName = td.st.getHashedData ("security.filename",
-                                             MYSERVER_VHOST_CONF | 
MYSERVER_SERVER_CONF,
-                                             ".security.xml");
+                                            MYSERVER_VHOST_CONF |
+                                            MYSERVER_SERVER_CONF,
+                                            ".security.xml");
   do
     {
-      if(fd.name[0] == '.' || !strcmpi(fd.name, secName) )
-        continue;
+      if (fd.name[0] == '.' || !strcmpi (fd.name, secName))
+       continue;
 
-      if ( !sParam.empty() )
-        secondaryBuffer << sParam << "/";
+      if (!sParam.empty ())
+       secondaryBuffer << sParam << "/";
       secondaryBuffer << fd.name << "\r\n";
     }
-  while (!fd.findnext());
+  while (!fd.findnext ());
 
-  fd.findclose();
+  fd.findclose ();
 
-  if( 
pFtpUserData->m_pDataConnection->socket->send(td.secondaryBuffer->getBuffer(), 
-      (u_long)td.secondaryBuffer->getLength(), 0) == SOCKET_ERROR)
-  {
-    ftp_reply(451);
-  }
-  ftp_reply(226);
-  CloseDataConnection();
+  if (pFtpuserData->m_pDataConnection->socket->
+      send (td.secondaryBuffer->getBuffer (),
+           (u_long) td.secondaryBuffer->getLength (), 0) == SOCKET_ERROR)
+    {
+      ftpReply (451);
+    }
+  ftpReply (226);
+  closeDataConnection ();
 }
 
 /*!
@@ -1966,49 +2052,50 @@ void Ftp::Nlst(const std::string &sParam/* = ""*/)
  *\param In client's requests
  *\param Out client's requests without telnet codes
  */
-void Ftp::EscapeTelnet(MemBuf &In, MemBuf &Out)
+void
+Ftp::escapeTelnet (MemBuf & In, MemBuf & Out)
 {
-  Out.setLength(0);
+  Out.setLength (0);
 
-  if ( In.getRealLength() == 0 )
+  if (In.getRealLength () == 0)
     return;
 
-  char *pIn = In.getBuffer();
+  char *pIn = In.getBuffer ();
   char szReply[3];
 
-  while ( (u_int) (pIn - In.getBuffer()) < In.getLength() )
+  while ((u_int) (pIn - In.getBuffer ()) < In.getLength ())
     {
-        if ( *pIn == '\377' )
-        {
-            szReply[0] = *pIn++;
-            if ( *pIn == '\0' )
-                break;
-            switch ( *pIn )
-            {
-                case '\375'://DO
-                case '\376'://DONT
-                    szReply[1] = '\374';
-                    pIn++;
-                    break;
-                case '\373'://WILL
-                case '\374'://WONT
-                    szReply[1] = '\376';
-                    pIn++;
-                    break;
-                case '\377':
-                    szReply[1] = '\0';
-                Out << *pIn;
-                    break;
-
-                default:
-                    pIn++;
-                    continue;
-            }
-            szReply[2] = *pIn++;
-            ftp_reply(-1, szReply);
-            continue;
-        }
-    Out << *pIn++;
+      if (*pIn == '\377')
+       {
+         szReply[0] = *pIn++;
+         if (*pIn == '\0')
+           break;
+         switch (*pIn)
+           {
+           case '\375':        //DO
+           case '\376':        //DONT
+             szReply[1] = '\374';
+             pIn++;
+             break;
+           case '\373':        //WILL
+           case '\374':        //WONT
+             szReply[1] = '\376';
+             pIn++;
+             break;
+           case '\377':
+             szReply[1] = '\0';
+             Out << *pIn;
+             break;
+
+           default:
+             pIn++;
+             continue;
+           }
+         szReply[2] = *pIn++;
+         ftpReply (-1, szReply);
+         continue;
+       }
+      Out << *pIn++;
     }
   Out << '\0';
 }
@@ -2018,479 +2105,505 @@ void Ftp::EscapeTelnet(MemBuf &In, MemBuf &Out)
  *\param In client's requests
  *\param Out client's requests without telnet codes
  */
-void Ftp::RemovePipelinedCmds(MemBuf &In, MemBuf &Out)
+void Ftp::removePipelinedCmds (MemBuf & In, MemBuf & Out)
 {
-  Out.setLength(0);
-  if ( In.getRealLength() == 0 )
+  Out.setLength (0);
+  if (In.getRealLength () == 0)
     return;
   int i = 0;
-  for ( char c = In[i]; c != '\0'; i++, c = In[i] )
-  {
-    Out << c;
-    if ( c == '\n' )
-      break;
-  }
+  for (char c = In[i]; c != '\0'; i++, c = In[i])
+    {
+      Out << c;
+      if (c == '\n')
+       break;
+    }
   Out << '\0';
 }
 
-void Ftp::Abor()
+void Ftp::abor ()
 {
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
   //wait to finish data transfer
-  if ( !m_bAllowAsynchronousCmds )
-    WaitDataConnection();
+  if (!m_ballowAsynchronousCmds)
+    waitDataConnection ();
 
-  if ( pFtpUserData->m_nFtpState == FtpUserData::DATA_CONNECTION_UP )
-  {
-    pFtpUserData->m_bBreakDataConnection = true;
-          Thread::join(pFtpUserData->m_dataThreadId);// wait for data 
connection to end
-    ftp_reply(426);
-  }
+  if (pFtpuserData->m_nFtpstate == FtpuserData::DATA_CONNECTION_UP)
+    {
+      pFtpuserData->m_bBreakDataConnection = true;
+      Thread::join (pFtpuserData->m_dataThreadId);     // wait for data 
connection to end
+      ftpReply (426);
+    }
   else
-    ftp_reply(226);
-  pFtpUserData->m_bBreakDataConnection = false;
+    ftpReply (226);
+  pFtpuserData->m_bBreakDataConnection = false;
 }
 
-void Ftp::Pwd()
+void Ftp::pwd ()
 {
-  WaitDataConnection();
-  if ( !UserLoggedIn() )
+  waitDataConnection ();
+  if (!userLoggedIn ())
     return;
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
   std::string sCurrentPath = "\"";
-  sCurrentPath += pFtpUserData->m_cwd + "\"";
-  ftp_reply(257, sCurrentPath);
+  sCurrentPath += pFtpuserData->m_cwd + "\"";
+  ftpReply (257, sCurrentPath);
 }
 
-void Ftp::Cwd(const std::string &sPath)
+void Ftp::cwd (const std::string & sPath)
 {
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
-  WaitDataConnection();
-  if ( !UserLoggedIn() )
+  waitDataConnection ();
+  if (!userLoggedIn ())
     return;
 
   std::string sLocalPath;
-  if ( !GetLocalPath(sPath, sLocalPath) )
+  if (!getLocalPath (sPath, sLocalPath))
     return;
-  if ( !FilesUtility::isDirectory(sLocalPath) )
+  if (!FilesUtility::isDirectory (sLocalPath))
     {
-      ftp_reply(550);
+      ftpReply (550);
       return;
     }
 
   if (sPath[0] == '/')
-    pFtpUserData->m_cwd.assign ("");
+    pFtpuserData->m_cwd.assign ("");
 
   if (sPath.size () == 2 && sPath[0] == '.' && sPath[1] == '.')
     {
-      size_t ind = pFtpUserData->m_cwd.find_last_of ('/');
+      size_t ind = pFtpuserData->m_cwd.find_last_of ('/');
       if (ind != string::npos)
-        pFtpUserData->m_cwd.erase (ind + 1);
+       pFtpuserData->m_cwd.erase (ind + 1);
     }
   else if (sPath.size () != 1 || sPath[0] != '.')
     {
-      if (pFtpUserData->m_cwd.size () &&
-          pFtpUserData->m_cwd[pFtpUserData->m_cwd.size () - 1] != '/')
-        pFtpUserData->m_cwd += "/";
-      pFtpUserData->m_cwd += sPath;
+      if (pFtpuserData->m_cwd.size () &&
+         pFtpuserData->m_cwd[pFtpuserData->m_cwd.size () - 1] != '/')
+       pFtpuserData->m_cwd += "/";
+      pFtpuserData->m_cwd += sPath;
     }
 
-  ftp_reply(250);
+  ftpReply (250);
 }
 
-void Ftp::Rest(const std::string &sRestPoint)
+void Ftp::rest (const std::string & srestPoint)
 {
-  WaitDataConnection();
-  if ( !UserLoggedIn() )
+  waitDataConnection ();
+  if (!userLoggedIn ())
     return;
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
-  pFtpUserData->m_nRestartOffset = strtoul(sRestPoint.c_str(), NULL, 10);
-  ftp_reply(350);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
+  pFtpuserData->m_nrestartOffset = strtoul (srestPoint.c_str (), NULL, 10);
+  ftpReply (350);
 }
 
-void Ftp::Syst()
+void Ftp::syst ()
 {
-  WaitDataConnection();
-  if ( !UserLoggedIn() )
+  waitDataConnection ();
+  if (!userLoggedIn ())
     return;
 
   std::string sTempText;
-  get_ftp_reply(215, sTempText);
-  std::string::size_type n = sTempText.find("%s");
-  if ( n != std::string::npos )
+  getFtpReply (215, sTempText);
+  std::string::size_type n = sTempText.find ("%s");
+  if (n != std::string::npos)
 #ifdef WIN32
-    sTempText.replace(n, 2, "WIN32");
+    sTempText.replace (n, 2, "WIN32");
 #else
-    sTempText.replace(n, 2, "UNIX Type: L8");
+    sTempText.replace (n, 2, "UNIX type: L8");
 #endif //WIN32
-  ftp_reply(215, sTempText);
+  ftpReply (215, sTempText);
 }
 
-void Ftp::Stat(const std::string &sParam/* = ""*/)
+void Ftp::stat (const std::string & sParam /* = "" */ )
 {
-  if ( !UserLoggedIn() )
+  if (!userLoggedIn ())
     return;
 
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
   //wait to finish data transfer
-  if ( !m_bAllowAsynchronousCmds )
-    WaitDataConnection();
+  if (!m_ballowAsynchronousCmds)
+    waitDataConnection ();
 
-  if ( pFtpUserData->m_nFtpState == FtpUserData::DATA_CONNECTION_UP )
-  {
-    std::ostringstream sStat;
-    sStat << "Transferring file: " << pFtpUserData->m_sCurrentFileName;
-    sStat << " " << pFtpUserData->m_nBytesSent << " bytes transferred from " 
<< pFtpUserData->m_nFileSize;
-    ftp_reply(213, sStat.str());
-  }
+  if (pFtpuserData->m_nFtpstate == FtpuserData::DATA_CONNECTION_UP)
+    {
+      std::ostringstream sstat;
+      sstat << "Transferring file: " << pFtpuserData->m_sCurrentFileName;
+      sstat << " " << pFtpuserData->
+       m_nBytesSent << " bytes transferred from " << pFtpuserData->
+       m_nFileSize;
+      ftpReply (213, sstat.str ());
+    }
   else
-  {
-    //TODO: will be implemented later
-    ftp_reply(502);
-  }
+    {
+      //TODO: will be implemented later
+      ftpReply (502);
+    }
 }
 
-void Ftp::Retr(const std::string &sPath)
+void Ftp::retr (const std::string & sPath)
 {
-  RetrStor(true, false, sPath);
+  retrstor (true, false, sPath);
 }
 
-void Ftp::Stor(const std::string &sPath)
+void Ftp::stor (const std::string & sPath)
 {
-  if ( !m_bEnableStoreCmds )
-  {
-    ftp_reply(532);
-    return;
-  }
-  RetrStor(false, false, sPath);
+  if (!m_bEnablestoreCmds)
+    {
+      ftpReply (532);
+      return;
+    }
+  retrstor (false, false, sPath);
 }
 
-void Ftp::Stou(const std::string &sPath)
+void Ftp::stou (const std::string & sPath)
 {
-  if ( !m_bEnableStoreCmds )
-  {
-    ftp_reply(532);
-    return;
-  }
-  std::string sOutPath, sTempPath(sPath);
+  if (!m_bEnablestoreCmds)
+    {
+      ftpReply (532);
+      return;
+    }
+  std::string sOutPath, sTempPath (sPath);
   int nCount = -1;
   do
-  {
-    if ( nCount >= 0 )
     {
-      std::ostringstream sRename;
-      sRename << nCount;
-      sTempPath = sPath + sRename.str();
+      if (nCount >= 0)
+       {
+         std::ostringstream sRename;
+         sRename << nCount;
+         sTempPath = sPath + sRename.str ();
+       }
+      if (!buildLocalPath (sTempPath, sOutPath))
+       return;
+      nCount++;
     }
-    if ( !BuildLocalPath(sTempPath, sOutPath) )
-      return;
-    nCount++;
-  } while ( FilesUtility::fileExists(sOutPath) );
-  RetrStor(false, false, sOutPath);
+  while (FilesUtility::fileExists (sOutPath));
+  retrstor (false, false, sOutPath);
 }
 
-void Ftp::Dele(const std::string &sPath)
+void Ftp::dele (const std::string & sPath)
 {
-  WaitDataConnection();
+  waitDataConnection ();
   std::string sLocalPath;
-  if ( !UserLoggedIn() || !GetLocalPath(sPath, sLocalPath) )
-    return;
-  if ( !m_bEnableStoreCmds )
-  {
-    ftp_reply(532);
+  if (!userLoggedIn () || !getLocalPath (sPath, sLocalPath))
     return;
-  }
+  if (!m_bEnablestoreCmds)
+    {
+      ftpReply (532);
+      return;
+    }
   std::string sLocalDir, sLocalFileName;
-  FilesUtility::splitPath(sLocalPath, sLocalDir, sLocalFileName);
+  FilesUtility::splitPath (sLocalPath, sLocalDir, sLocalFileName);
 
   /* The security file doesn't exist in any case.  */
   const char *secName = td.st.getHashedData ("security.filename",
-                                             MYSERVER_VHOST_CONF | 
MYSERVER_SERVER_CONF,
-                                             ".security.xml");
+                                            MYSERVER_VHOST_CONF |
+                                            MYSERVER_SERVER_CONF,
+                                            ".security.xml");
 
-  if( !strcmpi(sLocalFileName.c_str(), secName) )
-  {
-    ftp_reply(550);
-    CloseDataConnection();
-    return;
-  }
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
-
-  if ( strcmpi(pFtpUserData->m_sUserName.c_str(), "anonymous") == 0 )
-  {
-    if ( CheckRights("Guest", "", sLocalFileName, MYSERVER_PERMISSION_WRITE) 
== 0 )
+  if (!strcmpi (sLocalFileName.c_str (), secName))
     {
-      ftp_reply(550);
+      ftpReply (550);
+      closeDataConnection ();
       return;
     }
-  }
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
+
+  if (strcmpi (pFtpuserData->m_suserName.c_str (), "anonymous") == 0)
+    {
+      if (checkRights ("Guest", "", sLocalFileName, MYSERVER_PERMISSION_WRITE)
+         == 0)
+       {
+         ftpReply (550);
+         return;
+       }
+    }
   else
-  {
-    if ( CheckRights(pFtpUserData->m_sUserName, pFtpUserData->m_sPass, 
-      sLocalFileName, MYSERVER_PERMISSION_WRITE) == 0 )
     {
-      ftp_reply(550);
-      return;
+      if (checkRights (pFtpuserData->m_suserName, pFtpuserData->m_sPass,
+                      sLocalFileName, MYSERVER_PERMISSION_WRITE) == 0)
+       {
+         ftpReply (550);
+         return;
+       }
     }
-  }
-  if ( FilesUtility::deleteFile(sLocalPath) != 0 )
-    ftp_reply(450);
-  ftp_reply(250);
+  if (FilesUtility::deleteFile (sLocalPath) != 0)
+    ftpReply (450);
+  ftpReply (250);
 }
 
-void Ftp::Appe(const std::string &sPath)
+void Ftp::appe (const std::string & sPath)
 {
-  if ( !m_bEnableStoreCmds )
-  {
-    ftp_reply(532);
-    return;
-  }
-  RetrStor(false, true, sPath);
+  if (!m_bEnablestoreCmds)
+    {
+      ftpReply (532);
+      return;
+    }
+  retrstor (false, true, sPath);
 }
 
-void Ftp::Mkd(const std::string &sPath)
+void Ftp::mkd (const std::string & sPath)
 {
-  WaitDataConnection();
-  if ( !UserLoggedIn() )
+  waitDataConnection ();
+  if (!userLoggedIn ())
     return;
-  if ( !m_bEnableStoreCmds )
-  {
-    ftp_reply(532);
-    return;
-  }
+  if (!m_bEnablestoreCmds)
+    {
+      ftpReply (532);
+      return;
+    }
 
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
-  std::string sLocalPath;// = pFtpUserData->m_cwd + "/" + sPath;
-  if ( !BuildLocalPath(sPath, sLocalPath) )
+  std::string sLocalPath;      // = pFtpuserData->m_cwd + "/" + sPath;
+  if (!buildLocalPath (sPath, sLocalPath))
     return;
 
-  if ( CheckRights(pFtpUserData->m_sUserName, pFtpUserData->m_sPass, 
-    sLocalPath, MYSERVER_PERMISSION_WRITE) == 0 )
-  {
-    ftp_reply(550);
-    return;
-  }
-  if ( FilesUtility::mkdir (sLocalPath) == 0 )
-    ftp_reply(250);
+  if (checkRights (pFtpuserData->m_suserName, pFtpuserData->m_sPass,
+                  sLocalPath, MYSERVER_PERMISSION_WRITE) == 0)
+    {
+      ftpReply (550);
+      return;
+    }
+  if (FilesUtility::mkdir (sLocalPath) == 0)
+    ftpReply (250);
   else
-    ftp_reply(501);
+    ftpReply (501);
 }
 
-void Ftp::Rmd(const std::string &sPath)
+void
+Ftp::rmd (const std::string & sPath)
 {
-  WaitDataConnection();
-  if ( !UserLoggedIn() )
-    return;
-  if ( sPath.empty() )
-  {
-    ftp_reply(550);
+  waitDataConnection ();
+  if (!userLoggedIn ())
     return;
-  }
-  if ( !m_bEnableStoreCmds )
-  {
-    ftp_reply(532);
-    return;
-  }
+  if (sPath.empty ())
+    {
+      ftpReply (550);
+      return;
+    }
+  if (!m_bEnablestoreCmds)
+    {
+      ftpReply (532);
+      return;
+    }
 
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
   std::string sLocalPath;
-  if ( !GetLocalPath(sPath, sLocalPath) )
+  if (!getLocalPath (sPath, sLocalPath))
     return;
 
-  if ( CheckRights(pFtpUserData->m_sUserName, pFtpUserData->m_sPass, 
-    sLocalPath, MYSERVER_PERMISSION_WRITE) == 0 )
-  {
-    ftp_reply(550);
-    return;
-  }
-  if ( FilesUtility::rmdir (sLocalPath) == 0 )
-    ftp_reply(250);
+  if (checkRights (pFtpuserData->m_suserName, pFtpuserData->m_sPass,
+                  sLocalPath, MYSERVER_PERMISSION_WRITE) == 0)
+    {
+      ftpReply (550);
+      return;
+    }
+  if (FilesUtility::rmdir (sLocalPath) == 0)
+    ftpReply (250);
   else
-    ftp_reply(501);
+    ftpReply (501);
 }
 
-void Ftp::Rnfr(const std::string &sPath)
+void Ftp::rnfr (const std::string & sPath)
 {
-  WaitDataConnection();
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
-  pFtpUserData->m_sRenameFrom = "";
-  if ( !UserLoggedIn() )
+  waitDataConnection ();
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
+  pFtpuserData->m_sRenameFrom = "";
+  if (!userLoggedIn ())
     return;
   std::string sLocalPath;
-  if ( sPath.empty() || !GetLocalPath(sPath, sLocalPath) )
-  {
-    ftp_reply(550);
-    return;
-  }
+  if (sPath.empty () || !getLocalPath (sPath, sLocalPath))
+    {
+      ftpReply (550);
+      return;
+    }
   std::string sLocalDir, sLocalFileName;
-  FilesUtility::splitPath(sLocalPath, sLocalDir, sLocalFileName);
+  FilesUtility::splitPath (sLocalPath, sLocalDir, sLocalFileName);
 
   const char *secName = td.st.getHashedData ("security.filename",
-                                             MYSERVER_VHOST_CONF | 
MYSERVER_SERVER_CONF,
-                                             ".security.xml");
+                                            MYSERVER_VHOST_CONF |
+                                            MYSERVER_SERVER_CONF,
+                                            ".security.xml");
 
   /* The security file doesn't exist in any case.  */
-  if( !strcmpi(sLocalFileName.c_str(), secName) )
-  {
-    ftp_reply(550);
-    return;
-  }
-  pFtpUserData->m_sRenameFrom = sLocalPath;
-  ftp_reply(350);
+  if (!strcmpi (sLocalFileName.c_str (), secName))
+    {
+      ftpReply (550);
+      return;
+    }
+  pFtpuserData->m_sRenameFrom = sLocalPath;
+  ftpReply (350);
 }
 
-void Ftp::Rnto(const std::string &sPath)
+void Ftp::Rnto (const std::string & sPath)
 {
-  WaitDataConnection();
-  if ( !UserLoggedIn() )
+  waitDataConnection ();
+  if (!userLoggedIn ())
     return;
   std::string sLocalPath;
-  if ( sPath.empty() || !BuildLocalPath(sPath, sLocalPath) )
-  {
-    ftp_reply(550);
-    return;
-  }
-  if ( !m_bEnableStoreCmds )
-  {
-    ftp_reply(532);
-    return;
-  }
+  if (sPath.empty () || !buildLocalPath (sPath, sLocalPath))
+    {
+      ftpReply (550);
+      return;
+    }
+  if (!m_bEnablestoreCmds)
+    {
+      ftpReply (532);
+      return;
+    }
 
   std::string sLocalDir, sLocalFileName;
-  FilesUtility::splitPath(sLocalPath, sLocalDir, sLocalFileName);
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FilesUtility::splitPath (sLocalPath, sLocalDir, sLocalFileName);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
-  if ( CheckRights(pFtpUserData->m_sUserName, pFtpUserData->m_sPass, 
-    pFtpUserData->m_sRenameFrom, MYSERVER_PERMISSION_WRITE) == 0)
-  {
-    ftp_reply(550);
-    return;
-  }
+  if (checkRights (pFtpuserData->m_suserName, pFtpuserData->m_sPass,
+                  pFtpuserData->m_sRenameFrom,
+                  MYSERVER_PERMISSION_WRITE) == 0)
+    {
+      ftpReply (550);
+      return;
+    }
 
   const char *secName = td.st.getHashedData ("security.filename",
-                                             MYSERVER_VHOST_CONF | 
MYSERVER_SERVER_CONF,
-                                             ".security.xml");
+                                            MYSERVER_VHOST_CONF |
+                                            MYSERVER_SERVER_CONF,
+                                            ".security.xml");
 
   /* The security file doesn't exist in any case.  */
-  if( !strcmpi(sLocalFileName.c_str(), secName) )
-  {
-    ftp_reply(550);
-    return;
-  }
-  FilesUtility::isLink(pFtpUserData->m_sRenameFrom);
-  if ( FilesUtility::renameFile(pFtpUserData->m_sRenameFrom, sLocalPath) )
-    ftp_reply(550);
+  if (!strcmpi (sLocalFileName.c_str (), secName))
+    {
+      ftpReply (550);
+      return;
+    }
+  FilesUtility::isLink (pFtpuserData->m_sRenameFrom);
+  if (FilesUtility::renameFile (pFtpuserData->m_sRenameFrom, sLocalPath))
+    ftpReply (550);
   else
-    ftp_reply(250);
+    ftpReply (250);
 }
 
-int Ftp::CheckRights(const std::string &sUser, const std::string &sPass, const 
std::string &sPath, int mask)
+int Ftp::checkRights (const std::string & suser, const std::string & sPass,
+                      const std::string & sPath, int mask)
 {
-  if ( sPath.empty() )
+  if (sPath.empty ())
     return 0;
-  std::string sDir(""), sFileName("");
-  if ( !FilesUtility::isDirectory(sPath.c_str()) )
-    FilesUtility::splitPath(sPath, sDir, sFileName);
+  std::string sDir (""), sFileName ("");
+  if (!FilesUtility::isDirectory (sPath.c_str ()))
+    FilesUtility::splitPath (sPath, sDir, sFileName);
   else
     sDir = sPath;
 
   string user;
   string password;
-  if ( strcmpi(sUser.c_str(), "anonymous") == 0 )
-  {
-    user.assign ("Guest");
-    password.assign("");
-  }
+  if (strcmpi (suser.c_str (), "anonymous") == 0)
+    {
+      user.assign ("Guest");
+      password.assign ("");
+    }
   else
-  {
-    user.assign (sUser);
-    password.assign (sPass);
-  }
+    {
+      user.assign (suser);
+      password.assign (sPass);
+    }
 
   td.st.setUser (user);
   td.st.setPassword (password);
 
-
   td.st.setDirectory (&sDir);
-  td.st.setSysDirectory ((string *)&(td.pConnection->host->getSystemRoot ()));
+  td.st.setSysDirectory ((string *) & (td.pConnection->host->getSystemRoot 
()));
   td.st.setResource (&sFileName);
 
   AuthDomain auth (&td.st);
-  string validator (td.st.getHashedData ("sec.validator", MYSERVER_VHOST_CONF |
-                                      MYSERVER_SERVER_CONF, "xml"));
-  string authMethod (td.st.getHashedData ("sec.auth_method", 
MYSERVER_VHOST_CONF |
-                                       MYSERVER_SERVER_CONF, "xml"));
+  string validator (td.st.getHashedData ("sec.validator", MYSERVER_VHOST_CONF
+                                         | MYSERVER_SERVER_CONF, "xml"));
+  string authMethod (td.st.getHashedData ("sec.auth_method", 
MYSERVER_VHOST_CONF
+                                          | MYSERVER_SERVER_CONF, "xml"));
 
-  SecurityDomain* domains[] = {&auth, NULL};
+  SecurityDomain *domains[] = { &auth, NULL };
 
-  Server::getInstance()->getSecurityManager ()->getPermissionMask (&td.st, 
domains,
-                                                                   validator, 
authMethod);
+  Server::getInstance ()->getSecurityManager ()->getPermissionMask (&td.st,
+                                                                    domains,
+                                                                    validator,
+                                                                    
authMethod);
 
   return (td.st.getMask () & mask);
 }
 
-void Ftp::Size(const std::string &sPath)
+void Ftp::size (const std::string & sPath)
 {
-  WaitDataConnection();
+  waitDataConnection ();
   std::string sLocalPath;
-  if ( !UserLoggedIn() || !GetLocalPath(sPath, sLocalPath) )
+
+  if (!userLoggedIn () || !getLocalPath (sPath, sLocalPath))
     return;
+
   std::string sLocalDir, sLocalFileName;
-  FilesUtility::splitPath(sLocalPath, sLocalDir, sLocalFileName);
+  FilesUtility::splitPath (sLocalPath, sLocalDir, sLocalFileName);
 
   /* The security file doesn't exist in any case.  */
   const char *secName = td.st.getHashedData ("security.filename",
-                                             MYSERVER_VHOST_CONF | 
MYSERVER_SERVER_CONF,
+                                             MYSERVER_VHOST_CONF |
+                                             MYSERVER_SERVER_CONF,
                                              ".security.xml");
-  if( !strcmpi(sLocalFileName.c_str(), secName))
-  {
-    ftp_reply(550);
-    CloseDataConnection();
-    return;
-  }
 
-  if ( sPath.empty() || !GetLocalPath(sPath, sLocalPath) )
+  if (!strcmpi (sLocalFileName.c_str (), secName))
     {
-      ftp_reply(550);
+      ftpReply (550);
+      closeDataConnection ();
       return;
     }
 
-  if (FilesUtility::isDirectory(sLocalPath.c_str ()))
+  if (sPath.empty () || !getLocalPath (sPath, sLocalPath))
+    {
+      ftpReply (550);
+      return;
+    }
+
+  if (FilesUtility::isDirectory (sLocalPath.c_str ()))
     {
-      ftp_reply(550);
+      ftpReply (550);
       return;
     }
 
   File f;
   if (f.openFile (sLocalPath.c_str (), File::OPEN_IF_EXISTS | File::READ))
     {
-      ftp_reply (550);
+      ftpReply (550);
       return;
     }
 
-  char size [12];
+  char size[12];
   sprintf (size, "%l", f.getFileSize ());
   f.close ();
 
-  ftp_reply(213, size);
+  ftpReply (213, size);
 }
 
-void Ftp::Allo(int nSize, int nRecordSize/* = -1*/)
+void Ftp::allo (int nSize, int nRecordSize /* = -1 */ )
 {
   //TODO: implement
-  Noop();
+  noop ();
 }
 
-void Ftp::WaitDataConnection()
+void Ftp::waitDataConnection ()
 {
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
+  FtpuserData *pFtpuserData =
+    static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
-  pFtpUserData->m_DataConnBusy.lock();
-  pFtpUserData->m_DataConnBusy.unlock();
+  pFtpuserData->m_DataConnBusy.lock ();
+  pFtpuserData->m_DataConnBusy.unlock ();
 }
diff --git a/myserver/src/protocol/ftp/ftp_parser.cpp 
b/myserver/src/protocol/ftp/ftp_parser.cpp
index f5d25ed..deea0ab 100644
--- a/myserver/src/protocol/ftp/ftp_parser.cpp
+++ b/myserver/src/protocol/ftp/ftp_parser.cpp
@@ -231,7 +231,7 @@ typedef struct YYLTYPE
 /* Line 264 of yacc.c  */
 #line 22 "ftp_parser.ypp"
 
-#define yyscanner pContext->GetScanner()
+#define yyscanner pContext->getScanner()
 
 
 /* Line 264 of yacc.c  */
@@ -1617,7 +1617,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 94 "ftp_parser.ypp"
     {
-                       pContext->ComputeParseLength((yyloc));
+                       pContext->computeParseLength((yyloc));
                }
     break;
 
@@ -1626,7 +1626,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 100 "ftp_parser.ypp"
     {
-                       pContext->User((yyvsp[(3) - (4)].m_szStr));
+                       pContext->user((yyvsp[(3) - (4)].m_szStr));
                }
     break;
 
@@ -1635,7 +1635,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 104 "ftp_parser.ypp"
     {
-                       pContext->Password((yyvsp[(3) - (4)].m_szStr));
+                       pContext->password((yyvsp[(3) - (4)].m_szStr));
                }
     break;
 
@@ -1644,7 +1644,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 108 "ftp_parser.ypp"
     {
-                 pContext->Port((yyvsp[(3) - (4)].m_host));
+                 pContext->port((yyvsp[(3) - (4)].m_host));
                }
     break;
 
@@ -1653,7 +1653,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 112 "ftp_parser.ypp"
     {
-                 pContext->Pasv();
+                 pContext->pasv();
                }
     break;
 
@@ -1662,7 +1662,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 116 "ftp_parser.ypp"
     {
-                 pContext->Mode((yyvsp[(3) - (4)].m_nInt));
+                 pContext->mode((yyvsp[(3) - (4)].m_nInt));
                }
     break;
 
@@ -1672,9 +1672,9 @@ yyreduce:
 #line 120 "ftp_parser.ypp"
     {
       if ((yyvsp[(3) - (4)].m_nInt) == -1)
-        pContext->ftp_reply(504);
+        pContext->ftpReply(504);
       else
-        pContext->Type((yyvsp[(3) - (4)].m_nInt));
+        pContext->type((yyvsp[(3) - (4)].m_nInt));
                }
     break;
 
@@ -1684,9 +1684,9 @@ yyreduce:
 #line 127 "ftp_parser.ypp"
     {
       if ((yyvsp[(3) - (6)].m_nInt) == -1 || (yyvsp[(5) - (6)].m_nInt) == -1)
-        pContext->ftp_reply(504);
+        pContext->ftpReply(504);
       else
-        pContext->Type((yyvsp[(3) - (6)].m_nInt), (yyvsp[(5) - (6)].m_nInt));
+        pContext->type((yyvsp[(3) - (6)].m_nInt), (yyvsp[(5) - (6)].m_nInt));
                }
     break;
 
@@ -1695,7 +1695,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 134 "ftp_parser.ypp"
     {
-                 pContext->Stru((yyvsp[(3) - (4)].m_nInt));
+                 pContext->stru((yyvsp[(3) - (4)].m_nInt));
                }
     break;
 
@@ -1704,7 +1704,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 138 "ftp_parser.ypp"
     {
-                 pContext->Rest((yyvsp[(3) - (4)].m_szStr));
+                 pContext->rest((yyvsp[(3) - (4)].m_szStr));
                }
     break;
 
@@ -1713,7 +1713,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 142 "ftp_parser.ypp"
     {
-                 pContext->Allo((yyvsp[(3) - (4)].m_nInt));
+                 pContext->allo((yyvsp[(3) - (4)].m_nInt));
                }
     break;
 
@@ -1722,7 +1722,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 146 "ftp_parser.ypp"
     {
-                 pContext->Allo((yyvsp[(3) - (8)].m_nInt), (yyvsp[(7) - 
(8)].m_nInt));
+                 pContext->allo((yyvsp[(3) - (8)].m_nInt), (yyvsp[(7) - 
(8)].m_nInt));
                }
     break;
 
@@ -1731,7 +1731,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 150 "ftp_parser.ypp"
     {
-                 pContext->Retr((yyvsp[(3) - (4)].m_szStr));
+                 pContext->retr((yyvsp[(3) - (4)].m_szStr));
                }
     break;
 
@@ -1740,7 +1740,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 154 "ftp_parser.ypp"
     {
-                       pContext->Abor();
+                       pContext->abor();
                }
     break;
 
@@ -1749,7 +1749,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 158 "ftp_parser.ypp"
     {
-                 pContext->List();
+                 pContext->list();
                }
     break;
 
@@ -1758,7 +1758,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 162 "ftp_parser.ypp"
     {
-                 pContext->List((yyvsp[(3) - (4)].m_szStr));
+                 pContext->list((yyvsp[(3) - (4)].m_szStr));
                }
     break;
 
@@ -1767,7 +1767,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 166 "ftp_parser.ypp"
     {
-                 pContext->Nlst();
+                 pContext->nlst();
                }
     break;
 
@@ -1776,7 +1776,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 170 "ftp_parser.ypp"
     {
-                 pContext->Nlst((yyvsp[(3) - (4)].m_szStr));
+                 pContext->nlst((yyvsp[(3) - (4)].m_szStr));
                }
     break;
 
@@ -1785,7 +1785,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 174 "ftp_parser.ypp"
     {
-                       pContext->Cwd((yyvsp[(3) - (4)].m_szStr));
+                       pContext->cwd((yyvsp[(3) - (4)].m_szStr));
                }
     break;
 
@@ -1794,7 +1794,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 178 "ftp_parser.ypp"
     {
-                       pContext->Cwd("..");
+                       pContext->cwd("..");
                }
     break;
 
@@ -1803,7 +1803,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 182 "ftp_parser.ypp"
     {
-                       pContext->Pwd();
+                       pContext->pwd();
                }
     break;
 
@@ -1812,7 +1812,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 186 "ftp_parser.ypp"
     {
-                       pContext->Help((yyvsp[(3) - (4)].m_szStr));
+                       pContext->help((yyvsp[(3) - (4)].m_szStr));
                }
     break;
 
@@ -1821,7 +1821,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 190 "ftp_parser.ypp"
     {
-                       pContext->Help();
+                       pContext->help();
                }
     break;
 
@@ -1830,7 +1830,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 194 "ftp_parser.ypp"
     {
-                       pContext->Syst();
+                       pContext->syst();
                }
     break;
 
@@ -1839,7 +1839,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 198 "ftp_parser.ypp"
     {
-                       pContext->Stat();
+                       pContext->stat();
                }
     break;
 
@@ -1848,7 +1848,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 202 "ftp_parser.ypp"
     {
-                       pContext->Quit();
+                       pContext->quit();
                }
     break;
 
@@ -1857,7 +1857,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 206 "ftp_parser.ypp"
     {
-                       pContext->Noop();
+                       pContext->noop();
                }
     break;
 
@@ -1866,7 +1866,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 210 "ftp_parser.ypp"
     {
-                       pContext->ftp_reply(502);//any new commands
+                       pContext->ftpReply(502);//any new commands
                }
     break;
 
@@ -1875,7 +1875,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 214 "ftp_parser.ypp"
     {
-                       pContext->ftp_reply(502);//any new commands
+                       pContext->ftpReply(502);//any new commands
                }
     break;
 
@@ -1893,7 +1893,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 222 "ftp_parser.ypp"
     {
-                 pContext->Stor((yyvsp[(3) - (4)].m_szStr));
+                 pContext->stor((yyvsp[(3) - (4)].m_szStr));
                }
     break;
 
@@ -1902,7 +1902,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 226 "ftp_parser.ypp"
     {
-                 pContext->Stou((yyvsp[(3) - (4)].m_szStr));
+                 pContext->stou((yyvsp[(3) - (4)].m_szStr));
                }
     break;
 
@@ -1911,7 +1911,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 230 "ftp_parser.ypp"
     {
-                 pContext->Dele((yyvsp[(3) - (4)].m_szStr));
+                 pContext->dele((yyvsp[(3) - (4)].m_szStr));
                }
     break;
 
@@ -1920,7 +1920,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 234 "ftp_parser.ypp"
     {
-                 pContext->Appe((yyvsp[(3) - (4)].m_szStr));
+                 pContext->appe((yyvsp[(3) - (4)].m_szStr));
                }
     break;
 
@@ -1929,7 +1929,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 238 "ftp_parser.ypp"
     {
-                 pContext->Mkd((yyvsp[(3) - (4)].m_szStr));
+                 pContext->mkd((yyvsp[(3) - (4)].m_szStr));
                }
     break;
 
@@ -1938,7 +1938,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 242 "ftp_parser.ypp"
     {
-                 pContext->Rmd((yyvsp[(3) - (4)].m_szStr));
+                 pContext->rmd((yyvsp[(3) - (4)].m_szStr));
                }
     break;
 
@@ -1947,7 +1947,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 246 "ftp_parser.ypp"
     {
-                 pContext->Rnfr((yyvsp[(3) - (4)].m_szStr));
+                 pContext->rnfr((yyvsp[(3) - (4)].m_szStr));
                }
     break;
 
@@ -1974,7 +1974,7 @@ yyreduce:
 #line 257 "ftp_parser.ypp"
     {
                        //pContext->Chmod($3, $5);
-                       pContext->ftp_reply(502);
+                       pContext->ftpReply(502);
                }
     break;
 
@@ -1984,7 +1984,7 @@ yyreduce:
 #line 262 "ftp_parser.ypp"
     {
                        //pContext->Utime($3, $5);
-                       pContext->ftp_reply(502);
+                       pContext->ftpReply(502);
                }
     break;
 
@@ -1993,7 +1993,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 268 "ftp_parser.ypp"
     {
-                       pContext->Size((yyvsp[(3) - (4)].m_szStr));
+                       pContext->size((yyvsp[(3) - (4)].m_szStr));
                }
     break;
 
@@ -2038,7 +2038,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 302 "ftp_parser.ypp"
     {
-                 (yyval.m_nInt) = FtpUserData::MODE_STREAM;
+                 (yyval.m_nInt) = FtpuserData::MODE_STREAM;
                }
     break;
 
@@ -2065,7 +2065,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 316 "ftp_parser.ypp"
     {
-                       (yyval.m_nInt) = FtpUserData::STRU_FILE;
+                       (yyval.m_nInt) = FtpuserData::STRU_FILE;
                }
     break;
 
@@ -2092,7 +2092,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 330 "ftp_parser.ypp"
     {
-                 (yyval.m_nInt) = FtpUserData::REPR_ASCII;
+                 (yyval.m_nInt) = FtpuserData::REPR_ASCII;
                }
     break;
 
@@ -2101,7 +2101,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 334 "ftp_parser.ypp"
     {
-                 (yyval.m_nInt) = FtpUserData::REPR_IMAGE;
+                 (yyval.m_nInt) = FtpuserData::REPR_IMAGE;
                }
     break;
 
@@ -2128,7 +2128,7 @@ yyreduce:
 /* Line 1455 of yacc.c  */
 #line 348 "ftp_parser.ypp"
     {
-                 (yyval.m_nInt) = FtpUserData::NON_PRINT;
+                 (yyval.m_nInt) = FtpuserData::NON_PRINT;
                }
     break;
 
@@ -2375,27 +2375,27 @@ yyreturn:
 #line 360 "ftp_parser.ypp"
 
 
-int Ftp::ParseControlConnection()
+int Ftp::parseControlConnection()
 {
        if ( td.buffer == NULL || td.buffer->getBuffer() == NULL )
                return ClientsThread::DELETE_CONNECTION;
-       FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
-       if ( pFtpUserData == NULL )
+       FtpuserData *pFtpuserData = static_cast<FtpuserData 
*>(td.pConnection->protocolBuffer);
+       if ( pFtpuserData == NULL )
                return ClientsThread::DELETE_CONNECTION;
 
        // awaiting commands reply
-       if ( pFtpUserData->m_nFtpState <= FtpUserData::NO_CONTROL_CONNECTION )
+       if ( pFtpuserData->m_nFtpstate <= FtpuserData::NO_CONTROL_CONNECTION )
        {
-               ftp_reply(220);
-               pFtpUserData->m_nFtpState = FtpUserData::CONTROL_CONNECTION_UP;
+               ftpReply(220);
+               pFtpuserData->m_nFtpstate = FtpuserData::CONTROL_CONNECTION_UP;
        }
 
        MemBuf out;
-       EscapeTelnet(*td.buffer, out);
+       escapeTelnet(*td.buffer, out);
        if ( !m_bEnablePipelining )
        {
                MemBuf tmpBuff(out);
-               RemovePipelinedCmds(tmpBuff, out);
+               removePipelinedCmds(tmpBuff, out);
        }
        char *pBuffToParse = out.getBuffer();
 
@@ -2405,14 +2405,14 @@ int Ftp::ParseControlConnection()
                pBuffToParse += td.m_nParseLength;
 
        yylex_init(&m_scanner);
-       yy_buffer_state *bufState = yy_scan_string (pBuffToParse, m_scanner);
+       yy_buffer_state *bufstate = yy_scan_string (pBuffToParse, m_scanner);
        int nParserRet = yyparse(this);
-       yy_delete_buffer(bufState, m_scanner);
+       yy_delete_buffer(bufstate, m_scanner);
        yylex_destroy(m_scanner);
        switch ( nParserRet )
        {
                case 0:
-                       if ( pFtpUserData->m_nFtpState == 
FtpUserData::NO_CONTROL_CONNECTION )
+                       if ( pFtpuserData->m_nFtpstate == 
FtpuserData::NO_CONTROL_CONNECTION )
                                return ClientsThread::DELETE_CONNECTION;
                        else
                                return ClientsThread::KEEP_CONNECTION;
@@ -2426,7 +2426,7 @@ int Ftp::ParseControlConnection()
        return ClientsThread::DELETE_CONNECTION;
 }
 
-u_long Ftp::ComputeParseLength(const YYLTYPE &location)
+u_long Ftp::computeParseLength(const YYLTYPE &location)
 {
        if ( td.buffer == NULL )
                return 1;
@@ -2457,6 +2457,6 @@ void yyerror(YYLTYPE *pLoc, Ftp *pContext, const char 
*msg)
 {
        if ( pContext == NULL )
                return;
-       pContext->PrintError(msg);
+       pContext->printError(msg);
 }
 
diff --git a/myserver/src/protocol/ftp/ftp_parser.ypp 
b/myserver/src/protocol/ftp/ftp_parser.ypp
index d011c01..589a4d3 100755
--- a/myserver/src/protocol/ftp/ftp_parser.ypp
+++ b/myserver/src/protocol/ftp/ftp_parser.ypp
@@ -20,7 +20,7 @@
 }
 
 %{
-#define yyscanner pContext->GetScanner()
+#define yyscanner pContext->getScanner()
 %}
 
 /* general tokens */
@@ -92,127 +92,127 @@
 cmd_list       :/* empty */
                | cmd_list cmd
                {
-                       pContext->ComputeParseLength(@$);
+                       pContext->computeParseLength(@$);
                }
                ;
        /* Minimal FTP implementation */
 cmd            : USER_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                       pContext->User($3);
+                       pContext->user($3);
                }
                | PASS_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                       pContext->Password($3);
+                       pContext->password($3);
                }
                | PORT_FTP_COMMAND SPACE_FTP_SEP host_port CRLF_FTP_SEP
                {
-                 pContext->Port($3);
+                 pContext->port($3);
                }
                | PASV_FTP_COMMAND CRLF_FTP_SEP
                {
-                 pContext->Pasv();
+                 pContext->pasv();
                }
                | MODE_FTP_COMMAND SPACE_FTP_SEP mode_code CRLF_FTP_SEP
                {
-                 pContext->Mode($3);
+                 pContext->mode($3);
                }
                | TYPE_FTP_COMMAND SPACE_FTP_SEP type_code CRLF_FTP_SEP
                {
       if ($3 == -1)
-        pContext->ftp_reply(504);
+        pContext->ftpReply(504);
       else
-        pContext->Type($3);
+        pContext->type($3);
                }
                | TYPE_FTP_COMMAND SPACE_FTP_SEP type_code SPACE_FTP_SEP 
format_control_code CRLF_FTP_SEP
                {
       if ($3 == -1 || $5 == -1)
-        pContext->ftp_reply(504);
+        pContext->ftpReply(504);
       else
-        pContext->Type($3, $5);
+        pContext->type($3, $5);
                }
                | STRU_FTP_COMMAND SPACE_FTP_SEP structure_code CRLF_FTP_SEP
                {
-                 pContext->Stru($3);
+                 pContext->stru($3);
                }
                | REST_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                 pContext->Rest($3);
+                 pContext->rest($3);
                }
                | ALLO_FTP_COMMAND SPACE_FTP_SEP NUMBER_FTP_ARG CRLF_FTP_SEP
                {
-                 pContext->Allo($3);
+                 pContext->allo($3);
                }
                | ALLO_FTP_COMMAND SPACE_FTP_SEP NUMBER_FTP_ARG SPACE_FTP_SEP 
'r' SPACE_FTP_SEP NUMBER_FTP_ARG CRLF_FTP_SEP
                {
-                 pContext->Allo($3, $7);
+                 pContext->allo($3, $7);
                }
                | RETR_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                 pContext->Retr($3);
+                 pContext->retr($3);
                }
                | ABOR_FTP_COMMAND CRLF_FTP_SEP
                {
-                       pContext->Abor();
+                       pContext->abor();
                }
                | LIST_FTP_COMMAND CRLF_FTP_SEP
                {
-                 pContext->List();
+                 pContext->list();
                }
                | LIST_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                 pContext->List($3);
+                 pContext->list($3);
                }
                | NLST_FTP_COMMAND CRLF_FTP_SEP
                {
-                 pContext->Nlst();
+                 pContext->nlst();
                }
                | NLST_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                 pContext->Nlst($3);
+                 pContext->nlst($3);
                }
                | CWD_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                       pContext->Cwd($3);
+                       pContext->cwd($3);
                }
                | CDUP_FTP_COMMAND CRLF_FTP_SEP
                {
-                       pContext->Cwd("..");
+                       pContext->cwd("..");
                }
                | PWD_FTP_COMMAND CRLF_FTP_SEP
                {
-                       pContext->Pwd();
+                       pContext->pwd();
                }
                | HELP_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                       pContext->Help($3);
+                       pContext->help($3);
                }
                | HELP_FTP_COMMAND CRLF_FTP_SEP
                {
-                       pContext->Help();
+                       pContext->help();
                }
                | SYST_FTP_COMMAND CRLF_FTP_SEP
                {
-                       pContext->Syst();
+                       pContext->syst();
                }
                | STAT_FTP_COMMAND CRLF_FTP_SEP
                {
-                       pContext->Stat();
+                       pContext->stat();
                }
                | QUIT_FTP_COMMAND CRLF_FTP_SEP
                {
-                       pContext->Quit();
+                       pContext->quit();
                }
                | NOOP_FTP_COMMAND CRLF_FTP_SEP
                {
-                       pContext->Noop();
+                       pContext->noop();
                }
                | STRING_FTP_ARG SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                       pContext->ftp_reply(502);//any new commands
+                       pContext->ftpReply(502);//any new commands
                }
                | STRING_FTP_ARG CRLF_FTP_SEP
                {
-                       pContext->ftp_reply(502);//any new commands
+                       pContext->ftpReply(502);//any new commands
                }
                | CRLF_FTP_SEP
                {
@@ -220,31 +220,31 @@ cmd               : USER_FTP_COMMAND SPACE_FTP_SEP 
STRING_FTP_ARG CRLF_FTP_SEP
                }
                | STOR_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                 pContext->Stor($3);
+                 pContext->stor($3);
                }
                | STOU_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                 pContext->Stou($3);
+                 pContext->stou($3);
                }
                | DELE_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                 pContext->Dele($3);
+                 pContext->dele($3);
                }
                | APPE_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                 pContext->Appe($3);
+                 pContext->appe($3);
                }
                | MKD_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                 pContext->Mkd($3);
+                 pContext->mkd($3);
                }
                | RMD_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                 pContext->Rmd($3);
+                 pContext->rmd($3);
                }
                | RNFR_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                 pContext->Rnfr($3);
+                 pContext->rnfr($3);
                }
                | RNTO_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
@@ -256,17 +256,17 @@ cmd               : USER_FTP_COMMAND SPACE_FTP_SEP 
STRING_FTP_ARG CRLF_FTP_SEP
                | CHMOD_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG SPACE_FTP_SEP 
STRING_FTP_ARG CRLF_FTP_SEP
                {
                        //pContext->Chmod($3, $5);
-                       pContext->ftp_reply(502);
+                       pContext->ftpReply(502);
                }
                | UTIME_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG SPACE_FTP_SEP 
STRING_FTP_ARG CRLF_FTP_SEP
                {
                        //pContext->Utime($3, $5);
-                       pContext->ftp_reply(502);
+                       pContext->ftpReply(502);
                }
                /* RFC 3659 commands*/
                | SIZE_FTP_COMMAND SPACE_FTP_SEP STRING_FTP_ARG CRLF_FTP_SEP
                {
-                       pContext->Size($3);
+                       pContext->size($3);
                }
                ;
 
@@ -300,7 +300,7 @@ port_number : NUMBER_FTP_ARG ',' NUMBER_FTP_ARG
 
 mode_code      : 's'
                {
-                 $$ = FtpUserData::MODE_STREAM;
+                 $$ = FtpuserData::MODE_STREAM;
                }
                | 'b'
                {
@@ -314,7 +314,7 @@ mode_code   : 's'
 
 structure_code : 'f'
                {
-                       $$ = FtpUserData::STRU_FILE;
+                       $$ = FtpuserData::STRU_FILE;
                }
                | 'r'
                {
@@ -328,11 +328,11 @@ structure_code    : 'f'
 
 type_code      : 'a'
                {
-                 $$ = FtpUserData::REPR_ASCII;
+                 $$ = FtpuserData::REPR_ASCII;
                }
                | 'i'
                {
-                 $$ = FtpUserData::REPR_IMAGE;
+                 $$ = FtpuserData::REPR_IMAGE;
                }
                | 'e'
                {
@@ -346,7 +346,7 @@ type_code   : 'a'
 
 format_control_code : 'n'
                {
-                 $$ = FtpUserData::NON_PRINT;
+                 $$ = FtpuserData::NON_PRINT;
                }
                | 't'
                {
@@ -359,27 +359,27 @@ format_control_code : 'n'
                ;
 %%
 
-int Ftp::ParseControlConnection()
+int Ftp::parseControlConnection()
 {
        if ( td.buffer == NULL || td.buffer->getBuffer() == NULL )
                return ClientsThread::DELETE_CONNECTION;
-       FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
-       if ( pFtpUserData == NULL )
+       FtpuserData *pFtpuserData = static_cast<FtpuserData 
*>(td.pConnection->protocolBuffer);
+       if ( pFtpuserData == NULL )
                return ClientsThread::DELETE_CONNECTION;
 
        // awaiting commands reply
-       if ( pFtpUserData->m_nFtpState <= FtpUserData::NO_CONTROL_CONNECTION )
+       if ( pFtpuserData->m_nFtpstate <= FtpuserData::NO_CONTROL_CONNECTION )
        {
-               ftp_reply(220);
-               pFtpUserData->m_nFtpState = FtpUserData::CONTROL_CONNECTION_UP;
+               ftpReply(220);
+               pFtpuserData->m_nFtpstate = FtpuserData::CONTROL_CONNECTION_UP;
        }
 
        MemBuf out;
-       EscapeTelnet(*td.buffer, out);
+       escapeTelnet(*td.buffer, out);
        if ( !m_bEnablePipelining )
        {
                MemBuf tmpBuff(out);
-               RemovePipelinedCmds(tmpBuff, out);
+               removePipelinedCmds(tmpBuff, out);
        }
        char *pBuffToParse = out.getBuffer();
 
@@ -389,14 +389,14 @@ int Ftp::ParseControlConnection()
                pBuffToParse += td.m_nParseLength;
 
        yylex_init(&m_scanner);
-       yy_buffer_state *bufState = yy_scan_string (pBuffToParse, m_scanner);
+       yy_buffer_state *bufstate = yy_scan_string (pBuffToParse, m_scanner);
        int nParserRet = yyparse(this);
-       yy_delete_buffer(bufState, m_scanner);
+       yy_delete_buffer(bufstate, m_scanner);
        yylex_destroy(m_scanner);
        switch ( nParserRet )
        {
                case 0:
-                       if ( pFtpUserData->m_nFtpState == 
FtpUserData::NO_CONTROL_CONNECTION )
+                       if ( pFtpuserData->m_nFtpstate == 
FtpuserData::NO_CONTROL_CONNECTION )
                                return ClientsThread::DELETE_CONNECTION;
                        else
                                return ClientsThread::KEEP_CONNECTION;
@@ -410,7 +410,7 @@ int Ftp::ParseControlConnection()
        return ClientsThread::DELETE_CONNECTION;
 }
 
-u_long Ftp::ComputeParseLength(const YYLTYPE &location)
+u_long Ftp::computeParseLength(const YYLTYPE &location)
 {
        if ( td.buffer == NULL )
                return 1;
@@ -441,5 +441,5 @@ void yyerror(YYLTYPE *pLoc, Ftp *pContext, const char *msg)
 {
        if ( pContext == NULL )
                return;
-       pContext->PrintError(msg);
+       pContext->printError(msg);
 }
diff --git a/myserver/tests/test_ftp.cpp b/myserver/tests/test_ftp.cpp
index 52dab44..2696020 100644
--- a/myserver/tests/test_ftp.cpp
+++ b/myserver/tests/test_ftp.cpp
@@ -1,6 +1,6 @@
 /*
  MyServer
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009 Free Software Foundation, Inc.
  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 3 of the License, or
@@ -24,28 +24,28 @@
 
 class TestFtp : public CppUnit::TestFixture
 {
-       CPPUNIT_TEST_SUITE( TestFtp );
-       CPPUNIT_TEST( testEscapeTelnet );
-       CPPUNIT_TEST_SUITE_END();
+       CPPUNIT_TEST_SUITE (TestFtp);
+       CPPUNIT_TEST (testEscapeTelnet);
+       CPPUNIT_TEST_SUITE_END ();
 
 public:
-       void setUp() {}
-       void tearDown() {}
-       void testEscapeTelnet()
+       void setUp () {}
+       void tearDown () {}
+       void testEscapeTelnet ()
        {
                MemBuf inBuf, outBuf;
                inBuf << "\377\366RE\377\374TTR 
abc\377\377def\015\377\376\012\012";
 
                Ftp ftp;
-               ftp.EscapeTelnet(inBuf, outBuf);
+               ftp.escapeTelnet (inBuf, outBuf);
                char szOut[128], szExpected[128];
-               memset(szOut, 0, 128);
-               strncpy(szOut, outBuf.getBuffer(), outBuf.getLength());
-               memset(szExpected, 0, 128);
-               strcpy(szExpected, "RETR abc\377def\015\012");
+               memset (szOut, 0, 128);
+               strncpy (szOut, outBuf.getBuffer (), outBuf.getLength ());
+               memset (szExpected, 0, 128);
+               strcpy (szExpected, "RETR abc\377def\015\012");
 
-               CPPUNIT_ASSERT( strcmp(szOut, szExpected) == 0);
+               CPPUNIT_ASSERT (strcmp (szOut, szExpected) == 0);
        }
 };
 
-CPPUNIT_TEST_SUITE_REGISTRATION( TestFtp );
+CPPUNIT_TEST_SUITE_REGISTRATION (TestFtp);



commit d0e7b4fab291566dd9f2e2dbf141e70ca96714c1
Author: Giuseppe Scrivano <address@hidden>
Date:   Wed Jul 15 21:33:07 2009 +0200

    Removed unused local variable.

diff --git a/myserver/src/protocol/ftp/ftp.cpp 
b/myserver/src/protocol/ftp/ftp.cpp
index 5d6e5b6..20b32e2 100755
--- a/myserver/src/protocol/ftp/ftp.cpp
+++ b/myserver/src/protocol/ftp/ftp.cpp
@@ -2454,7 +2454,6 @@ void Ftp::Size(const std::string &sPath)
     CloseDataConnection();
     return;
   }
-  FtpUserData *pFtpUserData = static_cast<FtpUserData 
*>(td.pConnection->protocolBuffer);
 
   if ( sPath.empty() || !GetLocalPath(sPath, sLocalPath) )
     {

-----------------------------------------------------------------------

Summary of changes:
 myserver/include/protocol/ftp/ftp.h        |  325 ++--
 myserver/include/protocol/ftp/ftp_common.h |   16 +-
 myserver/src/protocol/ftp/ftp.cpp          | 3130 ++++++++++++++--------------
 myserver/src/protocol/ftp/ftp_parser.cpp   |  120 +-
 myserver/src/protocol/ftp/ftp_parser.ypp   |  120 +-
 myserver/tests/test_ftp.cpp                |   28 +-
 6 files changed, 1928 insertions(+), 1811 deletions(-)


hooks/post-receive
-- 
GNU MyServer




reply via email to

[Prev in Thread] Current Thread [Next in Thread]