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. ab546da121


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. ab546da121d89d2fb8f74727080cd5dfeb4b7b84
Date: Fri, 14 Aug 2009 20:32:51 +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  ab546da121d89d2fb8f74727080cd5dfeb4b7b84 (commit)
       via  2eb4cb4c7413a9e4006d49899fe2fefde02d2f20 (commit)
      from  cc275508841c4d8c3195e6ee7ec1d521fd1c63fd (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 ab546da121d89d2fb8f74727080cd5dfeb4b7b84
Author: Giuseppe Scrivano <address@hidden>
Date:   Fri Aug 14 22:12:47 2009 +0200

    Log virtual hosts accesses and warnings using a formatting string.

diff --git a/myserver/include/conf/vhost/vhost.h 
b/myserver/include/conf/vhost/vhost.h
index b841fc5..95b8ac2 100644
--- a/myserver/include/conf/vhost/vhost.h
+++ b/myserver/include/conf/vhost/vhost.h
@@ -38,74 +38,74 @@
 #include <include/conf/nodetree.h>
 
 using namespace std;
-typedef int (*NULL_REFERENCECB)(class Vhost*); 
+typedef int (*NULL_REFERENCECB)(class Vhost*);
 
 class VhostProtocolData
 {
 public:
-  VhostProtocolData(){}
-  virtual ~VhostProtocolData(){}
+  VhostProtocolData (){}
+  virtual ~VhostProtocolData (){}
 };
 
 class Vhost
 {
 public:
   friend class VhostManager;
-  
+
   struct StringRegex
   {
     string name;
     Regex regex;
-    StringRegex() : regex()
+    StringRegex () : regex ()
     {}
-    ~StringRegex()
+    ~StringRegex ()
     {}
   };
-       
+
   /*! Get the host name. */
-  const char* getName()
-  {return name.c_str();}
-  
+  const char* getName ()
+  {return name.c_str ();}
+
   /*! Set the host name. */
-  void setName(const char* c)
-  {name.assign(c);}
-  
+  void setName (const char* c)
+  {name.assign (c);}
+
   /*! Get the system root. */
-  const string& getSystemRoot()
+  const string& getSystemRoot ()
   {return systemRoot;}
 
   /*! Set the system root. */
-  void setSystemRoot(const char* n)
+  void setSystemRoot (const char* n)
   {systemRoot.assign(n);}
 
   /*! Get the document root. */
-  const string& getDocumentRoot()
+  const string& getDocumentRoot ()
   {return documentRoot;}
 
   /*! Set the document root. */
-  void setDocumentRoot(const char* n)
-  {documentRoot.assign(n);}
+  void setDocumentRoot (const char* n)
+  {documentRoot.assign (n);}
 
   /*! Get a pointer to the vhost SSL context. */
-  SslContext *getVhostSSLContext()
+  SslContext *getVhostSSLContext ()
   {return &sslContext;}
 
   /*! Initialize SSL things. */
-  int initializeSSL();
-       
+  int initializeSSL ();
+
   /*! Clear SSL things. */
-  int freeSSL();
+  int freeSSL ();
 
   /*! Clear the data dictionary. */
   int freeHashedData();
-       
+
   /*! Generate the RSA key for the SSL context. */
-  void generateRsaKey();
+  void generateRsaKey ();
 
   SSL_CTX* getSSLContext();
 
   /*! Get the list of hosts allowed.*/
-  list<StringRegex*>* getHostList()
+  list<StringRegex*>* getHostList ()
   {return &hostList;}
 
   //TODO: remove
@@ -114,63 +114,61 @@ public:
   //{return &ipList;}
 
   /*! Return the port used by the host. */
-  u_short getPort()
+  u_short getPort ()
   {return port;}
 
   /*! Set the port used by the host. */
-  void setPort(u_short p)
+  void setPort (u_short p)
   {port = p;}
 
   /*! Get the protocol name for the virtual host. */
-  const char* getProtocolName()
-  {return protocolName.c_str();}
+  const char* getProtocolName ()
+  {return protocolName.c_str ();}
 
   /*! Set the protocol name for the virtual host. */
-  void setProtocolName(const char *name)
-  {protocolName.assign(name);}
+  void setProtocolName (const char *name)
+  {protocolName.assign (name);}
 
   /*! Get the throttling rate for the virtual host. */
-  u_long getThrottlingRate()
+  u_long getThrottlingRate ()
   {return throttlingRate;}
 
   /*! Set the throttling rate for the virtual host. */
-  void setThrottlingRate(u_long tr)
+  void setThrottlingRate (u_long tr)
   {throttlingRate = tr;}
 
   Vhost(LogManager* lm);
   ~Vhost();
 
-  const char* getHashedData(const char* name);
+  const char* getHashedData (const char* name);
 
   NodeTree<string>* getNodeTree (string& key)
   {
     return hashedData.get (key);
   }
 
-  void addHost(const char *, int);
-  void removeHost(const char *);
-  int areAllHostAllowed();
-  void addRef();
-  void removeRef();
-  int getRef();
-  void setRef(int);
-  void clearHostList();
-  int isHostAllowed(const char*);
-  int isMIME();
-  int getDefaultPriority(){return defaultPriority;}
-  void setDefaultPriority(int priority){defaultPriority = priority;}
-  void setNullRefCB(NULL_REFERENCECB);
-  NULL_REFERENCECB getNullRefCB();
-
-  ////////////////////
-  //IP related members
-  void addIP(const char *, int);
-  void removeIP(const char *);
-  void clearIPList();
-  int areAllIPAllowed();
-  int isIPAllowed(const char*);//used
-
-  MimeManager* getMIME();
+  void addHost (const char *, int);
+  void removeHost (const char *);
+  int areAllHostAllowed ();
+  void addRef ();
+  void removeRef ();
+  int getRef ();
+  void setRef (int);
+  void clearHostList ();
+  int isHostAllowed (const char*);
+  int isMIME ();
+  int getDefaultPriority (){return defaultPriority;}
+  void setDefaultPriority (int priority){defaultPriority = priority;}
+  void setNullRefCB (NULL_REFERENCECB);
+  NULL_REFERENCECB getNullRefCB ();
+
+  void addIP (const char *, int);
+  void removeIP (const char *);
+  void clearIPList ();
+  int areAllIPAllowed ();
+  int isIPAllowed (const char*);
+
+  MimeManager* getMIME ();
 
   /*!
    * \return 0 if the LogManager contains at least one valid entry where
@@ -183,7 +181,7 @@ public:
 
   /*! Set the access log options. */
   void setAccessLogOpt (const char* c) { accessLogOpt.assign (c); }
-  
+
   /*! Set the warnings log options. */
   void setWarningLogOpt (const char* c)  { warningLogOpt.assign (c); }
 
@@ -194,16 +192,16 @@ public:
   const char* getWarningLogOpt () { return warningLogOpt.c_str (); }
 
   /*! Write a message on the accesses log. */
-  int accessesLogWrite (const char*);
-  
+  int accessesLogWrite (const char* fmt, ...);
+
   /*! Write a message on the warnings log. */
-  int warningsLogWrite (const char*);
+  int warningsLogWrite (const char* fmt, ...);
 
   /*! Get the protocol data. */
-  VhostProtocolData* getProtocolData(){return protocolData;}
+  VhostProtocolData* getProtocolData (){return protocolData;}
 
   /*! Set the protocol data. */
-  void setProtocolData(VhostProtocolData* data){protocolData = data;}
+  void setProtocolData (VhostProtocolData* data){protocolData = data;}
 
   MimeRecord* getLocationMime (string& loc){return locationsMime.get (loc);}
 
@@ -253,10 +251,10 @@ private:
 
   /*! Path to the document root. */
   string documentRoot;
-       
+
   /*! Path to the system root. */
   string systemRoot;
-       
+
   /*! Description or name of the virtual host. */
   string name;
 
diff --git a/myserver/include/conf/vhost/vhost_manager.h 
b/myserver/include/conf/vhost/vhost_manager.h
index ccf646a..947148b 100644
--- a/myserver/include/conf/vhost/vhost_manager.h
+++ b/myserver/include/conf/vhost/vhost_manager.h
@@ -1,7 +1,7 @@
 /* -*- mode: c++ -*- */
 /*
   MyServer
-  Copyright (C) 2007 Free Software Foundation, Inc.
+  Copyright (C) 2007, 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
@@ -26,14 +26,14 @@
 class VhostSource
 {
 public:
-  VhostSource();
-  ~VhostSource();
-  int load();
-  int save();
-  int free();
-  Vhost* getVHost(const char*, const char*, u_short);
-  Vhost* getVHostByNumber(int n);
-  int addVHost(Vhost*);
+  VhostSource ();
+  ~VhostSource ();
+  int load ();
+  int save ();
+  int free ();
+  Vhost* getVHost (const char*, const char*, u_short);
+  Vhost* getVHostByNumber (int n);
+  int addVHost (Vhost*);
 private:
   list<Vhost*> *hostList;
 };
@@ -41,25 +41,25 @@ private:
 class VhostManager
 {
 public:
-  void setExternalSource(VhostSource* extSource);
-  VhostManager(ListenThreads* lt, LogManager* lm);
-  ~VhostManager();
-  int getHostsNumber();
-  Vhost* getVHostByNumber(int n);
-  void clean();
-  int removeVHost(int n);
-  int switchVhosts(int n1,int n2);
-  list<Vhost*>* getVHostList();
-       
+  void setExternalSource (VhostSource* extSource);
+  VhostManager (ListenThreads* lt, LogManager* lm);
+  ~VhostManager ();
+  int getHostsNumber ();
+  Vhost* getVHostByNumber (int n);
+  void clean ();
+  int removeVHost (int n);
+  int switchVhosts (int n1,int n2);
+  list<Vhost*>* getVHostList ();
+
   /*! Get a pointer to a vhost.  */
-  Vhost* getVHost(const char*,const char*,u_short);
-       
+  Vhost* getVHost (const char*,const char*,u_short);
+
   /*! Add an element to the vhost list.  */
-  int addVHost(Vhost*);
-       
+  int addVHost (Vhost*);
+
   /*! Load the virtual hosts list from a xml configuration file.  */
-  int loadXMLConfigurationFile(const char *);
-       
+  int loadXMLConfigurationFile (const char *);
+
   /*! Set the right owner for the log locations.  */
   void changeLocationsOwner ();
 private:
@@ -73,5 +73,4 @@ private:
   LogManager* logManager;
 };
 
-
 #endif
diff --git a/myserver/include/protocol/control/control_protocol.h 
b/myserver/include/protocol/control/control_protocol.h
index bb87302..feefa39 100755
--- a/myserver/include/protocol/control/control_protocol.h
+++ b/myserver/include/protocol/control/control_protocol.h
@@ -1,7 +1,7 @@
 /* -*- mode: c++ -*- */
 /*
 MyServer
-Copyright (C) 2004, 2005, 2008 Free Software Foundation, Inc.
+Copyright (C) 2004, 2005, 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
@@ -55,12 +55,7 @@ protected:
   int putFile(ConnectionPtr,char*, File* in, File* out, 
               char *b1,int bs1, ControlHeader&);
   int getVersion(ConnectionPtr,File* out, char *b1,int bs1, ControlHeader&);
-  int addToErrorLog(ConnectionPtr con, const char *b1, int bs1, 
ControlHeader&);
   int addToLog(int retCode, ConnectionPtr con, char *b1, int bs1, 
ControlHeader&);
-  int addToErrorLog(ConnectionPtr con, string& m, ControlHeader& header)
-  {
-    return addToErrorLog(con, m.c_str(), m.size(), header);
-  }
 };
 
 #endif
diff --git a/myserver/src/conf/vhost/vhost.cpp 
b/myserver/src/conf/vhost/vhost.cpp
index 9ca27cf..083cc9f 100644
--- a/myserver/src/conf/vhost/vhost.cpp
+++ b/myserver/src/conf/vhost/vhost.cpp
@@ -31,6 +31,7 @@
 # include <idna.h>
 #endif
 
+#include <cstdarg>
 
 const string Vhost::accessLogType ("ACCESSLOG");
 const string Vhost::warningLogType ("WARNINGLOG");
@@ -39,14 +40,13 @@ const string Vhost::warningLogType ("WARNINGLOG");
 /*!
  * Vhost costructor
  */
-Vhost::Vhost(LogManager* lm)
+Vhost::Vhost (LogManager* lm)
 {
-  //ipList.clear();
-  hostList.clear();
-  refMutex.init();
-  documentRoot.assign("");
-  systemRoot.assign("");
-  hashedData.clear();
+  hostList.clear ();
+  refMutex.init ();
+  documentRoot.assign ("");
+  systemRoot.assign ("");
+  hashedData.clear ();
   protocolData = 0;
 
   /*
@@ -65,14 +65,14 @@ Vhost::Vhost(LogManager* lm)
 /*!
  * Destroy the vhost.
  */
-Vhost::~Vhost()
+Vhost::~Vhost ()
 {
-  if(protocolData)
+  if (protocolData)
     delete protocolData;
-  clearHostList();
-  clearIPList();
-  freeSSL();
-  freeHashedData();
+  clearHostList ();
+  clearIPList ();
+  freeSSL ();
+  freeHashedData ();
 
   HashMap<string, MimeRecord*>::Iterator it = locationsMime.begin ();
 
@@ -82,10 +82,7 @@ Vhost::~Vhost()
       it++;
     }
 
-
-  refMutex.destroy();
-  documentRoot.assign("");
-  systemRoot.assign("");
+  refMutex.destroy ();
   mimeManager.clean();
   logManager->remove (this);
 }
@@ -118,15 +115,15 @@ int Vhost::freeHashedData()
 /*!
  * Check if a MIME type file is defined for the virtual host.
  */
-int Vhost::isMIME()
+int Vhost::isMIME ()
 {
-  return mimeManager.isLoaded();
+  return mimeManager.isLoaded ();
 }
 
 /*!
  * Get the MIME manager for the virtual host.
  */
-MimeManager* Vhost::getMIME()
+MimeManager* Vhost::getMIME ()
 {
   return &mimeManager;
 }
@@ -134,38 +131,38 @@ MimeManager* Vhost::getMIME()
 /*!
  * Clear the list of the hosts.
  */
-void Vhost::clearHostList()
+void Vhost::clearHostList ()
 {
-  list<StringRegex*>::iterator i = hostList.begin();
-  while(i != hostList.end())
+  list<StringRegex*>::iterator i = hostList.begin ();
+  while (i != hostList.end ())
     {
       StringRegex* sr = *i;
       delete sr;
       i++;
     }
-  hostList.clear();
+  hostList.clear ();
 }
 
 /*!
  * Clear the list of IPs.
  */
-void Vhost::clearIPList()
+void Vhost::clearIPList ()
 {
-  list<IpRange *>::iterator it = ipListAllow.begin();
-  while(it != ipListAllow.end())
+  list<IpRange *>::iterator it = ipListAllow.begin ();
+  while (it != ipListAllow.end ())
     {
       delete (*it);
       it++;
     }
-  ipListAllow.clear();
+  ipListAllow.clear ();
 
-  it = ipListDeny.begin();
-  while(it != ipListDeny.end())
+  it = ipListDeny.begin ();
+  while (it != ipListDeny.end ())
     {
       delete (*it);
       it++;
     }
-  ipListDeny.clear();
+  ipListDeny.clear ();
 }
 
 int
@@ -204,7 +201,7 @@ void Vhost::addIP (const char *ip, int isRegex)
  * Remove the IP address to the list.
  * \param ip The ip to remove.
  */
-void Vhost::removeIP(const char *ip)
+void Vhost::removeIP (const char *ip)
 {
   std::string sTempIp (ip);
   ipListDeny.push_back (IpRange::RangeFactory (sTempIp));
@@ -216,20 +213,19 @@ void Vhost::removeIP(const char *ip)
  */
 void Vhost::removeHost (const char *host)
 {
-  list<StringRegex*>::iterator i = hostList.begin();
+  list<StringRegex*>::iterator i = hostList.begin ();
 
-  while(i != hostList.end())
+  while (i != hostList.end ())
     {
       StringRegex* sr = *i;
       /*
        * If this is the virtual host with the right IP.
        */
-      if(!stringcmp(sr->name, host))
+      if (!stringcmp (sr->name, host))
         {
-          hostList.erase(i);
+          hostList.erase (i);
           return;
         }
-
       i++;
     }
 }
@@ -237,26 +233,21 @@ void Vhost::removeHost (const char *host)
  * Check if an host is allowed to the connection
  * \param host hostname to check.
  */
-int Vhost::isHostAllowed(const char* host)
+int Vhost::isHostAllowed (const char* host)
 {
   /* If no hosts are specified then every host is allowed to connect here.  */
-  if(!hostList.size() || !host)
+  if (!hostList.size () || !host)
     return 1;
 
-  list<StringRegex*>::iterator i = hostList.begin();
-  while(i != hostList.end())
+  list<StringRegex*>::iterator i = hostList.begin ();
+  while (i != hostList.end ())
     {
       StringRegex* sr = *i;
       regmatch_t pm;
-      if(sr->regex.isCompiled())
-        {
-          if (!sr->regex.exec(host, 1, &pm, REG_NOTBOL))
-            {
-              return 1;
-            }
-        }
+      if (sr->regex.isCompiled () &&!sr->regex.exec (host, 1, &pm, REG_NOTBOL))
+        return 1;
 
-      if(!stringcmp(sr->name, host))
+      if (!stringcmp (sr->name, host))
         return 1;
 
       i++;
@@ -267,9 +258,9 @@ int Vhost::isHostAllowed(const char* host)
 /*!
  * Check if all the host are allowed to the connection.
  */
-int Vhost::areAllHostAllowed()
+int Vhost::areAllHostAllowed ()
 {
-  if(hostList.size() == 0)
+  if (hostList.size () == 0)
     return 1;
   return 0;
 }
@@ -279,9 +270,7 @@ int Vhost::areAllHostAllowed()
  */
 int Vhost::areAllIPAllowed()
 {
-  if ( ipListDeny.empty() && ipListAllow.empty() )
-    return 1;
-  return 0;
+  return ipListDeny.empty () && ipListAllow.empty () ? 1 : 0;
 }
 
 /*!
@@ -289,31 +278,31 @@ int Vhost::areAllIPAllowed()
  * by the local IP).
  * \param ip The IP to check.
  */
-int Vhost::isIPAllowed(const char* ip)
+int Vhost::isIPAllowed (const char* ip)
 {
-  if ( areAllIPAllowed() )
+  if (areAllIPAllowed ())
     return 1;
 
-  std::string sTempIp(ip);
-  IpRange *pTempIp = IpRange::RangeFactory(sTempIp);
-  list<IpRange *>::const_iterator it = ipListDeny.begin();
-  while ( it != ipListDeny.end() )
+  std::string sTempIp (ip);
+  IpRange *pTempIp = IpRange::RangeFactory (sTempIp);
+  list<IpRange *>::const_iterator it = ipListDeny.begin ();
+  while (it != ipListDeny.end ())
     {
-      if ( (*it)->InRange(pTempIp) )
-       {
-         delete pTempIp;
-         return 0;
-       }
+      if ((*it)->InRange (pTempIp) )
+        {
+          delete pTempIp;
+          return 0;
+        }
       it++;
     }
-  it = ipListAllow.begin();
-  while ( it != ipListAllow.end() )
+  it = ipListAllow.begin ();
+  while (it != ipListAllow.end () )
     {
-      if ( (*it)->InRange(pTempIp) )
-       {
-         delete pTempIp;
-         return 1;
-       }
+      if ((*it)->InRange (pTempIp))
+        {
+          delete pTempIp;
+          return 1;
+        }
       it++;
     }
   delete pTempIp;
@@ -325,10 +314,10 @@ int Vhost::isIPAllowed(const char* ip)
  * \param host hostname to add.
  * \param isRegex Is the host a regex?
  */
-void Vhost::addHost(const char *host, int isRegex)
+void Vhost::addHost (const char *host, int isRegex)
 {
-  StringRegex* hl = new StringRegex();
-  if(hl == 0)
+  StringRegex* hl = new StringRegex ();
+  if (hl == 0)
     return;
 
 #ifdef HAVE_IDN
@@ -345,7 +334,7 @@ void Vhost::addHost(const char *host, int isRegex)
 
   ret = idna_to_ascii_4z (ucs4, &ascii, 0);
 
-  free(ucs4);
+  free (ucs4);
 
   if (ret != IDNA_SUCCESS)
     {
@@ -356,41 +345,48 @@ void Vhost::addHost(const char *host, int isRegex)
   host = ascii;
 #endif
 
-  hl->name.assign(host);
+  hl->name.assign (host);
 
-  if(isRegex)
-    hl->regex.compile(host, REG_EXTENDED);
-  hostList.push_back(hl);
+  if (isRegex)
+    hl->regex.compile (host, REG_EXTENDED);
+  hostList.push_back (hl);
 
 #ifdef HAVE_IDN
-  free(ascii);
+  free (ascii);
 #endif
 
 }
 
 /*!
  * Write to the accesses log.
- * \param str The line to log.
+ * \param fmt The log format string.
+ * \param ... Arguments.
  */
 int
-Vhost::accessesLogWrite (const char* str)
+Vhost::accessesLogWrite (const char* fmt, ...)
 {
-  string msg (str);
-  return logManager->log (this, accessLogType, msg);
+  va_list argptr;
+  va_start (argptr, fmt);
+  int ret = logManager->log (this, accessLogType, MYSERVER_LOG_MSG_INFO, false,
+                             false, fmt, argptr);
+  va_end (argptr);
+  return ret;
 }
 
 /*!
  * Write a line to the warnings log.
- * \param str The line to log.
+ * \param fmt The log format string.
+ * \param ... Arguments.
  */
 int
-Vhost::warningsLogWrite (const char* str)
+Vhost::warningsLogWrite (const char* fmt, ...)
 {
-  string msg;
-  getLocalLogFormatDate (msg, 100);
-  msg.append (" -- ");
-  msg.append (str);
-  return logManager->log (this, warningLogType, msg, true);
+  va_list argptr;
+  va_start (argptr, fmt);
+  int ret = logManager->log (this, warningLogType, MYSERVER_LOG_MSG_INFO, true,
+                             false, fmt, argptr);
+  va_end (argptr);
+  return ret;
 }
 
 /*!
@@ -398,7 +394,7 @@ Vhost::warningsLogWrite (const char* str)
  * counter for the virtual host is zero.
  * \param cb The null references callback function.
  */
-void Vhost::setNullRefCB(NULL_REFERENCECB cb)
+void Vhost::setNullRefCB (NULL_REFERENCECB cb)
 {
   nullReferenceCb = cb;
 }
@@ -406,7 +402,7 @@ void Vhost::setNullRefCB(NULL_REFERENCECB cb)
 /*!
  * Get the null reference callback function used by the virtual host.
  */
-NULL_REFERENCECB Vhost::getNullRefCB()
+NULL_REFERENCECB Vhost::getNullRefCB ()
 {
   return nullReferenceCb;
 }
@@ -414,7 +410,7 @@ NULL_REFERENCECB Vhost::getNullRefCB()
 /*!
  * Increment current references counter by 1.
  */
-void Vhost::addRef()
+void Vhost::addRef ()
 {
   refMutex.lock(0);
   refCount++;
@@ -424,7 +420,7 @@ void Vhost::addRef()
 /*!
  * Decrement current references counter by 1.
  */
-void Vhost::removeRef()
+void Vhost::removeRef ()
 {
   refMutex.lock(0);
   refCount--;
@@ -432,7 +428,7 @@ void Vhost::removeRef()
    * If the reference count reaches zero and a callback
    * function is defined call it.
    */
-  if(refCount == 0 && nullReferenceCb)
+  if (refCount == 0 && nullReferenceCb)
     nullReferenceCb(this);
   refMutex.unlock(0);
 }
@@ -440,7 +436,7 @@ void Vhost::removeRef()
 /*!
  * Get the references counter.
  */
-int Vhost::getRef()
+int Vhost::getRef ()
 {
   return refCount;
 }
@@ -449,7 +445,7 @@ int Vhost::getRef()
  * Set the reference counter for the virtual host.
  * \param n The new reference counter.
  */
-void Vhost::setRef(int n)
+void Vhost::setRef (int n)
 {
   refCount = n;
 }
@@ -458,7 +454,7 @@ void Vhost::setRef(int n)
  * Get the value for name in the hash dictionary.
  * \param name The hashed entry key.
  */
-const char* Vhost::getHashedData(const char* name)
+const char* Vhost::getHashedData (const char* name)
 {
   NodeTree<string> *s = hashedData.get(name);
 
@@ -468,34 +464,32 @@ const char* Vhost::getHashedData(const char* name)
 /*!
  * Initialize SSL on the virtual host.
  */
-int Vhost::initializeSSL()
+int Vhost::initializeSSL ()
 {
   Protocol* protocol;
 
-  protocol = Server::getInstance()->getProtocol(protocolName.c_str());
-  if(!protocol)
+  protocol = Server::getInstance ()->getProtocol (protocolName.c_str ());
+  if (!protocol)
     return 0;
 
-  if(!(protocol->getProtocolOptions() & PROTOCOL_USES_SSL))
+  if (!(protocol->getProtocolOptions () & PROTOCOL_USES_SSL))
     return 0;
 
-  return sslContext.initialize();
+  return sslContext.initialize ();
 }
 
-
 /*!
  * Get the SSL context.
  */
-SSL_CTX* Vhost::getSSLContext()
+SSL_CTX* Vhost::getSSLContext ()
 {
-  return sslContext.getContext();
+  return sslContext.getContext ();
 }
 
-
 /*!
  * Clean the memory used by the SSL context.
  */
-int Vhost::freeSSL()
+int Vhost::freeSSL ()
 {
-  return sslContext.free();
+  return sslContext.free ();
 }
diff --git a/myserver/src/conf/vhost/vhost_manager.cpp 
b/myserver/src/conf/vhost/vhost_manager.cpp
index 46dcc36..acd5790 100644
--- a/myserver/src/conf/vhost/vhost_manager.cpp
+++ b/myserver/src/conf/vhost/vhost_manager.cpp
@@ -29,34 +29,33 @@
 int VhostManager::addVHost(Vhost* vh)
 {
   list<Vhost*>::iterator it;
-  
+
   mutex.lock();
 
   /* Be sure there is a listening thread on the specified port.  */
   listenThreads->addListeningThread(vh->getPort());
-  
-  if(extSource)
+
+  if (extSource)
     {
-      int ret = extSource->addVHost(vh);
-      mutex.unlock();
+      int ret = extSource->addVHost (vh);
+      mutex.unlock ();
       return ret;
     }
 
-  it = hostList.begin();
+  it = hostList.begin ();
 
   try
     {
-      if(!vh->getProtocolName())
+      if (!vh->getProtocolName ())
         {
-          string error;
-          error.assign("Warning: protocol not defined for virtual host: " );
-          error.append(vh->getName());
-          error.append(", using HTTP by default");
           vh->setProtocolName("http");
-          Server::getInstance()->logWriteln(error.c_str(), 
MYSERVER_LOG_MSG_ERROR);
+          Server::getInstance()->logWriteln (MYSERVER_LOG_MSG_WARNING,
+                 _("Protocol not defined for vhost: %s, using HTTP by 
default"),
+                                             vh->getName ());
         }
-      hostList.push_back(vh);
-      mutex.unlock();
+
+      hostList.push_back (vh);
+      mutex.unlock ();
       return 0;
     }
   catch(...)
@@ -68,7 +67,7 @@ int VhostManager::addVHost(Vhost* vh)
 
 /*!
  *Get the vhost for the connection. A return value of 0 means that
- *a valid host was not found. 
+ *a valid host was not found.
  *\param host Hostname for the virtual host.
  *\param ip IP address for the virtual host.
  *\param port The port used by the client to connect to the server.
@@ -90,8 +89,8 @@ Vhost* VhostManager::getVHost(const char* host, const char* 
ip, u_short port)
 
       it = hostList.begin();
 
-      /*Do a linear search here. We have to use the first full-matching 
-       *virtual host. 
+      /*Do a linear search here. We have to use the first full-matching
+       *virtual host.
        */
       for(; it != hostList.end(); it++)
         {
@@ -117,7 +116,7 @@ Vhost* VhostManager::getVHost(const char* host, const char* 
ip, u_short port)
   catch(...)
     {
       mutex.unlock();
-      return 0;   
+      return 0;
     };
 }
 
@@ -144,21 +143,21 @@ void VhostManager::clean()
 
   mutex.lock();
 
-  it = hostList.begin();  
-  
+  it = hostList.begin();
+
   try
     {
       for(;it != hostList.end(); it++)
         delete *it;
-      
+
       hostList.clear();
-    
+
       mutex.unlock();
     }
   catch(...)
     {
       mutex.unlock();
-      return;  
+      return;
     };
 }
 
@@ -202,17 +201,13 @@ void VhostManager::changeLocationsOwner ()
           /* Chown the log files.  */
           err = logManager->chown (vh, "ACCESSLOG", uid, gid);
           if(err)
-            {
-              string str ("Error changing owner for accesses log locations");
-              Server::getInstance()->logWriteln(str.c_str (), 
MYSERVER_LOG_MSG_ERROR);
-            }
+            Server::getInstance()->logWriteln (MYSERVER_LOG_MSG_ERROR,
+                    _("Error while changing accesses log locations owner"));
 
           err = logManager->chown (vh, "WARNINGLOG", uid, gid);
           if(err)
-            {
-              string str ("Error changing owner for errors log locations");
-              Server::getInstance()->logWriteln(str.c_str (), 
MYSERVER_LOG_MSG_ERROR);
-            }
+            Server::getInstance()->logWriteln (MYSERVER_LOG_MSG_ERROR,
+                    _("Error while changing log locations owner"));
         }
     }
 }
@@ -289,18 +284,21 @@ VhostManager::loadXMLlogData (string name, Vhost* vh, 
xmlNode* lcur)
             {
               err = vh->openAccessLog (location, filters, cycle);
               vh->setAccessLogOpt (opt.c_str ());
-              str.assign ("Error opening accesses log location " + location);
+              if (err)
+                Server::getInstance()->logWriteln (MYSERVER_LOG_MSG_ERROR,
+                                                   _("Error opening %s"), 
location.c_str ());
             }
           else if (!name.compare ("WARNINGLOG"))
             {
               err = vh->openWarningLog (location, filters, cycle);
               vh->setWarningLogOpt (opt.c_str ());
-              str.assign ("Error opening warnings log location " + location);
-            }
-          if (err)
-            {
-              Server::getInstance ()->logWriteln (str.c_str (), 
MYSERVER_LOG_MSG_ERROR);
+              if (err)
+                Server::getInstance()->logWriteln (MYSERVER_LOG_MSG_ERROR,
+                                                   _("Error opening %s"), 
location.c_str ());
             }
+          else
+            Server::getInstance()->logWriteln (MYSERVER_LOG_MSG_ERROR,
+                                               _(" Unrecognized log type"));
         }
     }
 }
@@ -315,12 +313,10 @@ int VhostManager::loadXMLConfigurationFile(const char 
*filename)
   XmlParser parser;
   xmlDocPtr doc;
   xmlNodePtr node;
-  string errMsg;
   if(parser.open(filename))
     {
-      errMsg.assign("Error opening: ");
-      errMsg.append(filename);
-      Server::getInstance()->logWriteln(errMsg.c_str(), 
MYSERVER_LOG_MSG_ERROR);
+      Server::getInstance()->logWriteln (MYSERVER_LOG_MSG_ERROR,
+                                         _("Error opening %s"), filename);
       return -1;
     }
   doc = parser.getDoc();
@@ -338,8 +334,8 @@ int VhostManager::loadXMLConfigurationFile(const char 
*filename)
         {
           parser.close();
           clean();
-          errMsg.assign("Error: allocating memory");
-          Server::getInstance()->logWriteln(errMsg.c_str(), 
MYSERVER_LOG_MSG_ERROR);
+          Server::getInstance()->logWriteln (MYSERVER_LOG_MSG_ERROR,
+                                             _("internal error"), filename);
           return -1;
         }
 
@@ -415,8 +411,8 @@ int VhostManager::loadXMLConfigurationFile(const char 
*filename)
                 {
                   if (!xmlStrcmp(attrs->name, (const xmlChar *)"isRegex"))
                     {
-                      if (attrs->children && attrs->children->content && 
-                          (!xmlStrcmp(attrs->children->content, 
+                      if (attrs->children && attrs->children->content &&
+                          (!xmlStrcmp(attrs->children->content,
                                       (const xmlChar *)"YES")))
                         useRegex = 1;
                     }
@@ -428,12 +424,8 @@ int VhostManager::loadXMLConfigurationFile(const char 
*filename)
             {
               int val = atoi ((char*)lcur->children->content);
               if (val > (1 << 16) || strlen ((const 
char*)lcur->children->content) > 6)
-                {
-                  errMsg.assign ("Error: specified port greater than 65536 or 
invalid: ");
-                  errMsg.append ((char*)lcur->children->content);
-                  Server::getInstance()->logWriteln (errMsg.c_str(),
-                                                     MYSERVER_LOG_MSG_ERROR);
-                }
+                Server::getInstance()->logWriteln (MYSERVER_LOG_MSG_ERROR,
+                       _("Specified invalid port %s"), 
lcur->children->content);
               vh->setPort ((u_short)val);
             }
           else if (!xmlStrcmp (lcur->name, (const xmlChar *)"PROTOCOL"))
@@ -499,11 +491,11 @@ int VhostManager::loadXMLConfigurationFile(const char 
*filename)
 
           lcur = lcur->next;
         }// while(lcur)
-      
+
       if (vh->openLogFiles ())
         {
-          errMsg.assign ("Error: opening log files");
-          Server::getInstance ()->logWriteln (errMsg.c_str (), 
MYSERVER_LOG_MSG_ERROR);
+          Server::getInstance()->logWriteln (MYSERVER_LOG_MSG_ERROR,
+                                             _("Error opening log files"));
           delete vh;
           vh = 0;
           continue;
@@ -511,11 +503,9 @@ int VhostManager::loadXMLConfigurationFile(const char 
*filename)
 
       if (vh->initializeSSL () < 0)
         {
-          errMsg.assign ("Error: initializing vhost \"");
-          errMsg.append (vh->getName ());
-          errMsg.append ("\"");
-          Server::getInstance ()->logWriteln (errMsg.c_str (),
-                                              MYSERVER_LOG_MSG_ERROR);
+          Server::getInstance()->logWriteln (MYSERVER_LOG_MSG_ERROR,
+                                             _("Error initializing SSL for 
%s"),
+                                             vh->getName ());
           delete vh;
           vh = 0;
           continue;
@@ -523,11 +513,8 @@ int VhostManager::loadXMLConfigurationFile(const char 
*filename)
 
       if (addVHost (vh))
         {
-          errMsg.assign ("Error: adding vhost \"");
-          errMsg.append (vh->getName ());
-          errMsg.append ("\"");
-          Server::getInstance ()->logWriteln (errMsg.c_str (),
-                                              MYSERVER_LOG_MSG_ERROR);
+          Server::getInstance()->logWriteln (MYSERVER_LOG_MSG_ERROR,
+                                             _("Internal error"));
           delete vh;
           vh = 0;
           continue;
@@ -558,7 +545,7 @@ Vhost* VhostManager::getVHostByNumber(int n)
           mutex.unlock();
           return ret;
         }
-    
+
       for( ; i != hostList.end(); i++)
         {
           if(!(n--))
@@ -569,7 +556,7 @@ Vhost* VhostManager::getVHostByNumber(int n)
             }
         }
       mutex.unlock();
-    
+
       return ret;
     }
   catch(...)
@@ -590,7 +577,7 @@ int VhostManager::removeVHost(int n)
   try
     {
       list<Vhost*>::iterator i = hostList.begin();
-    
+
       for( ;i != hostList.end(); i++)
         {
           if(!(n--))
@@ -606,7 +593,7 @@ int VhostManager::removeVHost(int n)
   catch(...)
     {
       mutex.unlock();
-      return 0;   
+      return 0;
     };
 }
 
diff --git a/myserver/src/connections_scheduler/listen_threads.cpp 
b/myserver/src/connections_scheduler/listen_threads.cpp
index b81263e..2d0797e 100644
--- a/myserver/src/connections_scheduler/listen_threads.cpp
+++ b/myserver/src/connections_scheduler/listen_threads.cpp
@@ -86,7 +86,7 @@ int ListenThreads::createServerAndListener(u_short port)
    */
   try
     {
-      if ( serverSocketIPv4 != NULL )
+      if (serverSocketIPv4 != NULL)
         {
           serverSocketIPv4->socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
           if (serverSocketIPv4->getHandle() == (Handle)INVALID_SOCKET)
@@ -143,7 +143,7 @@ int ListenThreads::createServerAndListener(u_short port)
       if (serverSocketIPv6 != NULL)
         {
           serverSocketIPv6->socket (AF_INET6, SOCK_STREAM, IPPROTO_TCP);
-          if ( serverSocketIPv6->getHandle () == (FileHandle)INVALID_SOCKET)
+          if (serverSocketIPv6->getHandle () == (FileHandle)INVALID_SOCKET)
             {
               server->logWriteln (MYSERVER_LOG_MSG_ERROR,
                                  _("Error while creating the server socket"));
@@ -221,7 +221,7 @@ int ListenThreads::createServerAndListener(u_short port)
           serverSocketIPv6 = NULL;
         }
 
-      if ( serverSocketIPv4 == NULL && serverSocketIPv6 == NULL )
+      if (serverSocketIPv4 == NULL && serverSocketIPv6 == NULL)
         {
           delete si;
           return 1;
@@ -239,12 +239,12 @@ int ListenThreads::createServerAndListener(u_short port)
 
       return 0;
     }
-  catch( bad_alloc &ba)
+  catch(bad_alloc &ba)
     {
       server->logWriteln (MYSERVER_LOG_MSG_ERROR, _("Bad alloc: %s"),
                           ba.what ());
     }
-  catch( exception &e)
+  catch(exception &e)
     {
       server->logWriteln (MYSERVER_LOG_MSG_ERROR, _("Error: %s"),
                           e.what ());
diff --git a/myserver/src/http_handler/cgi/cgi.cpp 
b/myserver/src/http_handler/cgi/cgi.cpp
index fd9dafa..7b24ae3 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -35,9 +35,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 #include <string>
 #include <sstream>
 
-extern "C" {
+extern "C"
+{
 #ifdef WIN32
-#include <direct.h>
+# include <direct.h>
 #endif
 #include <string.h>
 }
@@ -177,18 +178,11 @@ int Cgi::send (HttpThreadContext* td, const char* 
scriptpath,
       if (!FilesUtility::fileExists (tmpCgiPath.c_str ()))
         {
           if (tmpCgiPath.length() > 0)
-            {
-              string msg;
-              msg.assign ("Cgi: Cannot find the ");
-              msg.append (tmpCgiPath);
-              msg.append (" executable");
-              td->connection->host->warningsLogWrite (msg.c_str ());
-            }
+            td->connection->host->warningsLogWrite (_("Cgi: cannot find the %s 
file")),
+              tmpCgiPath.c_str ();
           else
-            {
-              td->connection->host->warningsLogWrite(
-                             "Cgi: Executable file not specified");
-            }
+            td->connection->host->warningsLogWrite (_("Cgi: Executable file 
not specified"));
+
           td->scriptPath.assign ("");
           td->scriptFile.assign ("");
           td->scriptDir.assign ("");
@@ -220,8 +214,7 @@ int Cgi::send (HttpThreadContext* td, const char* 
scriptpath,
    */
   if (stdOutFile.create())
     {
-      td->connection->host->warningsLogWrite
-        ("Cgi: Cannot create CGI stdout file");
+      td->connection->host->warningsLogWrite (_("Cgi: internal error"));
       chain.clearAllFilters ();
       return td->http->raiseHTTPError (500);
     }
@@ -230,7 +223,7 @@ int Cgi::send (HttpThreadContext* td, const char* 
scriptpath,
   if (stdInFile.openFile(td->inputDataPath,
                          File::READ | File::FILE_OPEN_ALWAYS))
     {
-      td->connection->host->warningsLogWrite ("Cgi: Cannot open CGI stdin 
file.");
+      td->connection->host->warningsLogWrite (_("Cgi: internal error"));
       stdOutFile.close ();
       chain.clearAllFilters ();
       return td->http->raiseHTTPError (500);
@@ -263,12 +256,12 @@ int Cgi::send (HttpThreadContext* td, const char* 
scriptpath,
   if (spi.stdError == (FileHandle) -1 ||
       spi.stdIn == (FileHandle) -1 ||
       spi.stdOut == (FileHandle) -1)
-  {
-    td->connection->host->warningsLogWrite ("Cgi: Invalid file handler.");
-    stdOutFile.close ();
-    chain.clearAllFilters ();
-    return td->http->raiseHTTPError (500);
-  }
+    {
+      td->connection->host->warningsLogWrite (_("Cgi: internal error"));
+      stdOutFile.close ();
+      chain.clearAllFilters ();
+      return td->http->raiseHTTPError (500);
+    }
 
   /* Execute the CGI process. */
   {
@@ -293,8 +286,7 @@ int Cgi::send (HttpThreadContext* td, const char* 
scriptpath,
     {
       stdInFile.close();
       stdOutFile.close();
-      td->connection->host->warningsLogWrite
-                                       ("Cgi: Error in the CGI execution");
+      td->connection->host->warningsLogWrite (_("Cgi: internal error"));
       chain.clearAllFilters ();
       return td->http->raiseHTTPError (500);
       }
@@ -353,7 +345,7 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, 
FiltersChain& chain,
                                                                     &nbw,
                                                                     1))
     {
-      td->connection->host->warningsLogWrite("Cgi: Error loading filters");
+      td->connection->host->warningsLogWrite (_("Cgi: internal error"));
       return td->http->raiseHTTPError(500);
     }
 
@@ -369,9 +361,7 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, 
FiltersChain& chain,
       if (ticks >= timeout ||
           stdOutFile.waitForData ((timeout - ticks) / 1000, (timeout - ticks) 
% 1000) == 0)
         {
-          ostringstream msg;
-          msg << "Cgi: timeout for process " << cgiProc.getPid();
-          td->connection->host->warningsLogWrite (msg.str ().c_str ());
+          td->connection->host->warningsLogWrite (_("Cgi: process %i 
timeout"), cgiProc.getPid ());
           break;
         }
 
@@ -440,9 +430,7 @@ int Cgi::sendHeader (HttpThreadContext* td, Pipe 
&stdOutFile, FiltersChain& chai
     if (!term && 
         stdOutFile.waitForData ((timeout - ticks) / 1000, (timeout - ticks) % 
1000) == 0)
     {
-      ostringstream msg;
-      msg << "Cgi: timeout for process " << cgiProc.getPid ();
-      td->connection->host->warningsLogWrite (msg.str ().c_str ());    
+      td->connection->host->warningsLogWrite (_("Cgi: process %i timeout"), 
cgiProc.getPid ());
       break;
     }
 
diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp 
b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index bbd4710..12aef47 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -16,7 +16,7 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 */
 
 /*
- *To get more info about the FastCGI protocol please visit the official 
+ *To get more info about the FastCGI protocol please visit the official
  *FastCGI site at: http://www.fastcgi.com.
  *On that site you can find samples and all the supported languages.
  */
@@ -100,14 +100,14 @@ int FastCgi::send(HttpThreadContext* td, const char* 
scriptpath,
   chain.setProtocol(td->http);
   chain.setProtocolData(td);
   chain.setStream(td->connection->socket);
- 
+
   if(td->mime && Server::getInstance()->getFiltersFactory()->chain(&chain,
                                                                    
td->mime->filters,
                                                                    
td->connection->socket,
-                                                                   &nbw, 
+                                                                   &nbw,
                                                                    1))
   {
-    td->connection->host->warningsLogWrite("FastCGI: Error loading filters");
+    td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
     chain.clearAllFilters();
     return td->http->raiseHTTPError(500);
   }
@@ -169,7 +169,7 @@ int FastCgi::send(HttpThreadContext* td, const char* 
scriptpath,
         int len = strlen(cgipath);
         int subString = cgipath[0] == '"';
 
-        cmdLine << "\"" << td->cgiRoot << "/" << td->cgiFile << "\" " 
+        cmdLine << "\"" << td->cgiRoot << "/" << td->cgiFile << "\" "
                 << moreArg << " \"" <<  td->filenamePath << "\"";
       }
 #else
@@ -192,16 +192,12 @@ int FastCgi::send(HttpThreadContext* td, const char* 
scriptpath,
   }
 
   td->inputData.close();
-  if(td->inputData.openFile(td->inputDataPath, File::READ | 
+  if(td->inputData.openFile(td->inputDataPath, File::READ |
                             File::FILE_OPEN_ALWAYS |
                             File::NO_INHERIT))
   {
     td->buffer->setLength(0);
-    if(Server::getInstance()->getVerbosity() > 2)
-    {
-      *td->buffer << "FastCGI: Error opening stdin file" << '\0';
-      td->connection->host->warningsLogWrite(td->buffer->getBuffer());
-    }
+    td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
     chain.clearAllFilters();
     return td->http->raiseHTTPError(500);
   }
@@ -211,12 +207,8 @@ int FastCgi::send(HttpThreadContext* td, const char* 
scriptpath,
   if (server == 0)
   {
     td->buffer->setLength (0);
-    if(Server::getInstance ()->getVerbosity () > 2)
-    {
-      *td->buffer << "FastCGI: Error connecting to FastCGI "
-                  << cmdLine.str().c_str() << " process" << '\0';
-      td->connection->host->warningsLogWrite(td->buffer->getBuffer());
-    }
+    td->connection->host->warningsLogWrite (_("FastCGI: cannot connect to the 
%s process"),
+                                            cmdLine.str ().c_str ());
     chain.clearAllFilters();
     return td->http->raiseHTTPError(500);
   }
@@ -224,9 +216,7 @@ int FastCgi::send(HttpThreadContext* td, const char* 
scriptpath,
   id = td->id + 1;
 
   if (fastCgiRequest (&con, id))
-  {
     return td->http->raiseHTTPError(500);
-  }
 
   /*! Now read the output. This flag is used by the external loop.  */
   exit = 0;
@@ -242,7 +232,7 @@ int FastCgi::send(HttpThreadContext* td, const char* 
scriptpath,
   do
   {
     u_long dim;
-    
+
     if (readHeader (&con, &header, initialTicks, timeout, id))
     {
       exit = 1;
@@ -278,7 +268,7 @@ int FastCgi::send(HttpThreadContext* td, const char* 
scriptpath,
           break;
         case FCGISTDOUT:
           headerCompleted = false;
-          ret = sendData (&con, dim, static_cast<u_long>(timeout), &chain, 
+          ret = sendData (&con, dim, static_cast<u_long>(timeout), &chain,
                           &headerCompleted, onlyHeader);
 
           if (ret)
@@ -311,7 +301,7 @@ int FastCgi::send(HttpThreadContext* td, const char* 
scriptpath,
       while (toPad)
       {
         nbr = con.sock.recv(td->buffer->getBuffer(),
-                            std::min(toPad, 
(u_long)td->buffer->getRealLength()), 0, 
+                            std::min(toPad, 
(u_long)td->buffer->getRealLength()), 0,
                             static_cast<u_long>(timeout));
         if (nbr == (u_long)-1)
         {
@@ -325,13 +315,13 @@ int FastCgi::send(HttpThreadContext* td, const char* 
scriptpath,
   }while (!exit);
 
   /* Send the last null chunk if needed.  */
-  if(con.useChunks && 
+  if(con.useChunks &&
      (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL))
     chain.getStream ()->write("0\r\n\r\n", 5, &nbw);
 
   chain.clearAllFilters();
   con.sock.close();
- 
+
   return ret;
 }
 
@@ -505,10 +495,10 @@ FastCgiServer* FastCgi::connect(FcgiContext* con, const 
char* path)
 
 /*!
  *Run the FastCGI server.
- *If the path starts with a @ character, the path is handled as a 
+ *If the path starts with a @ character, the path is handled as a
  *remote server.
  */
-FastCgiServer* FastCgi::runFcgiServer(FcgiContext* context, 
+FastCgiServer* FastCgi::runFcgiServer(FcgiContext* context,
                                       const char* path)
 {
   /* This method needs a better home (and maybe better code).
@@ -538,8 +528,8 @@ FastCgiServer* FastCgi::runFcgiServer(FcgiContext* context,
     myserver_strlcpy(host, &path[1], min(128, i));
 
     myserver_strlcpy(port, &path[i + 1], 6);
-    
-    return processServerManager->addRemoteServer(SERVERS_DOMAIN, path, 
+
+    return processServerManager->addRemoteServer(SERVERS_DOMAIN, path,
                                                  host, atoi(port));
   }
 
@@ -584,11 +574,7 @@ int FastCgi::fastCgiRequest (FcgiContext* con, int id)
   if(sizeEnvString == -1)
   {
     td->buffer->setLength(0);
-    if(Server::getInstance()->getVerbosity() > 2)
-    {
-      *td->buffer << "FastCGI: Error to build env string" << '\0';
-      td->connection->host->warningsLogWrite(td->buffer->getBuffer());
-    }
+    td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
     return 1;
   }
 
@@ -601,11 +587,7 @@ int FastCgi::fastCgiRequest (FcgiContext* con, int id)
   if(sendFcgiBody(con, (char*)&tBody, sizeof(tBody), FCGIBEGIN_REQUEST, id))
   {
     td->buffer->setLength(0);
-    if(Server::getInstance()->getVerbosity() > 2)
-    {
-      *td->buffer<< "FastCGI: Error beginning the request" << '\0';
-      td->connection->host->warningsLogWrite(td->buffer->getBuffer());
-    }
+    td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
     return 1;
   }
 
@@ -613,22 +595,14 @@ int FastCgi::fastCgiRequest (FcgiContext* con, int id)
                   FCGIPARAMS, id))
   {
     td->buffer->setLength(0);
-    if(Server::getInstance()->getVerbosity() > 2)
-    {
-      *td->buffer << "FastCGI: Error sending params" << '\0';
-      td->connection->host->warningsLogWrite(td->buffer->getBuffer());
-    }
+    td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
     return 1;
   }
 
   if(sendFcgiBody(con, 0, 0, FCGIPARAMS, id))
   {
     td->buffer->setLength(0);
-    if(Server::getInstance()->getVerbosity() > 2)
-    {
-      *td->buffer << "FastCGI: Error sending params" << '\0';
-      td->connection->host->warningsLogWrite(td->buffer->getBuffer());
-    }
+    td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
     return 1;
   }
 
@@ -638,10 +612,9 @@ int FastCgi::fastCgiRequest (FcgiContext* con, int id)
 
 
     if(td->inputData.seek (0))
-      if(Server::getInstance()->getVerbosity() > 2)
       {
-        *td->buffer << "FastCGI: Error sending POST data" << '\0';
-        td->connection->host->warningsLogWrite(td->buffer->getBuffer());
+        td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
+        return 1;
       }
 
     /*! Send the STDIN data.  */
@@ -651,48 +624,34 @@ int FastCgi::fastCgiRequest (FcgiContext* con, int id)
                                     maxStdinChunk, &nbr))
       {
         td->buffer->setLength(0);
-        if(Server::getInstance()->getVerbosity() > 2)
-        {
-          *td->buffer << "FastCGI: Error reading from file" << '\0';
-          td->connection->host->warningsLogWrite(td->buffer->getBuffer());
-        }
+        td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
         return 1;
       }
 
       if(!nbr)
         break;
 
-      generateFcgiHeader( header, FCGISTDIN, id, nbr);
-      if(con->sock.send((char*)&header, sizeof(header), 0) == -1)
-      {
+      generateFcgiHeader (header, FCGISTDIN, id, nbr);
+      if (con->sock.send ((char*)&header, sizeof(header), 0) == -1)
         return 1;
-      }
 
-      if(con->sock.send(td->buffer->getBuffer(),nbr,0) == -1)
-      {
-        td->buffer->setLength(0);
-        if(Server::getInstance()->getVerbosity() > 2)
+      if (con->sock.send (td->buffer->getBuffer (), nbr, 0) == -1)
         {
-          *td->buffer << "FastCGI: Error sending data" << '\0';
-          td->connection->host->warningsLogWrite(td->buffer->getBuffer());
+          td->buffer->setLength(0);
+          td->connection->host->warningsLogWrite (_("FastCGI: internal 
error"));
+          return 1;
         }
-        return 1;
-      }
-    }while(nbr == maxStdinChunk);
+    }
+    while (nbr == maxStdinChunk);
   }
 
   /*! Final stdin chunk.  */
-  if(sendFcgiBody(con, 0, 0, FCGISTDIN, id))
-  {
-    td->buffer->setLength(0);
-    if(Server::getInstance()->getVerbosity() > 2)
+  if (sendFcgiBody (con, 0, 0, FCGISTDIN, id))
     {
-      *td->buffer << "FastCGI: Error sending POST data" << '\0';
-      td->connection->host->warningsLogWrite(td->buffer->getBuffer());
-
+      td->buffer->setLength(0);
+      td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
+      return 1;
     }
-    return 1;
-  }
 
   return 0;
 }
@@ -709,7 +668,7 @@ int FastCgi::fastCgiRequest (FcgiContext* con, int id)
  *\param onlyHeader Send only the HTTP header.
  *\return 0 on success.
  */
-int FastCgi::sendData (FcgiContext* con, u_long dim, u_long timeout, 
FiltersChain* chain, 
+int FastCgi::sendData (FcgiContext* con, u_long dim, u_long timeout, 
FiltersChain* chain,
                        bool *responseCompleted, int onlyHeader)
 {
   u_long dataRead = 0;
@@ -729,7 +688,7 @@ int FastCgi::sendData (FcgiContext* con, u_long dim, u_long 
timeout, FiltersChai
 
     u_long nbr = con->sock.recv (td->buffer->getBuffer () + 
td->buffer->getLength (),
                                  std::min ((u_long)td->buffer->getRealLength 
(),
-                                           dim - td->buffer->getLength ()), 
+                                           dim - td->buffer->getLength ()),
                                  0, timeout);
     if (nbr == (u_long)-1 || nbr == 0)
     {
@@ -749,7 +708,7 @@ int FastCgi::sendData (FcgiContext* con, u_long dim, u_long 
timeout, FiltersChai
   if (onlyHeader || con->td->response.getStatusType () != 
HttpResponseHeader::SUCCESSFUL)
     return 0;
 
-  if(HttpDataHandler::appendDataToHTTPChannel(con->td, 
+  if(HttpDataHandler::appendDataToHTTPChannel(con->td,
                                               con->td->buffer->getBuffer (),
                                               con->td->buffer->getLength (),
                                               &(con->td->outputData),
@@ -757,7 +716,7 @@ int FastCgi::sendData (FcgiContext* con, u_long dim, u_long 
timeout, FiltersChai
                                               con->td->appendOutputs,
                                               con->useChunks))
     return 1;
-  
+
   con->td->sentData += con->td->buffer->getLength ();
 
   return 0;
@@ -787,7 +746,7 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain* 
chain, bool* response
   }
 
   HttpHeaders::buildHTTPResponseHeaderStruct(con->td->buffer->getBuffer(),
-                                             &con->td->response, 
+                                             &con->td->response,
                                              &(con->td->nBytesToRead));
 
   if(!con->td->appendOutputs)
@@ -808,18 +767,18 @@ int FastCgi::handleHeader (FcgiContext* con, 
FiltersChain* chain, bool* response
     {
       *responseCompleted = true;
       return 1;
-    }  
+    }
 
   }
-  
+
   con->headerSent = true;
 
   /* Flush the buffer if remaining data is present.  */
-  if (con->td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL && 
+  if (con->td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL &&
       size - headerSize)
   {
-    if(HttpDataHandler::appendDataToHTTPChannel(con->td, 
-                                                con->td->buffer->getBuffer() + 
headerSize, 
+    if(HttpDataHandler::appendDataToHTTPChannel(con->td,
+                                                con->td->buffer->getBuffer() + 
headerSize,
                                                 size - headerSize,
                                                 &(con->td->outputData),
                                                 chain,
@@ -854,16 +813,14 @@ int FastCgi::readHeader (FcgiContext *con, FcgiHeader* 
header, u_long started, u
     u_long ticks = getTicks ();
 
     if (ticks - started > timeout)
-    {
-      td->buffer->setLength(0);
-      *td->buffer << "FastCGI: server timeout" << '\0';
-      td->connection->host->warningsLogWrite(td->buffer->getBuffer());
-      sendFcgiBody(con, 0, 0, FCGIABORT_REQUEST, id);
-      return 1;
-    }
+      {
+        td->connection->host->warningsLogWrite (_("FastCGI: server timeout"));
+        sendFcgiBody (con, 0, 0, FCGIABORT_REQUEST, id);
+        return 1;
+      }
 
-    nbr = con->sock.recv(buffer + readData, sizeof(FcgiHeader) - readData, 0, 
-                         timeout - (ticks - started));
+    nbr = con->sock.recv (buffer + readData, sizeof(FcgiHeader) - readData, 0,
+                          timeout - (ticks - started));
 
     if (nbr == static_cast<u_long>(-1) || nbr == 0)
       return 1;
@@ -875,9 +832,7 @@ int FastCgi::readHeader (FcgiContext *con, FcgiHeader* 
header, u_long started, u
 
     if (readData > sizeof (FcgiHeader))
     {
-      td->buffer->setLength(0);
-      *td->buffer << "FastCGI: Error reading data" << '\0';
-      td->connection->host->warningsLogWrite(td->buffer->getBuffer());
+      td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
       sendFcgiBody(con, 0, 0, FCGIABORT_REQUEST, id);
       return 1;
     }
diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp 
b/myserver/src/http_handler/http_dir/http_dir.cpp
index 9d2d919..5c12254 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -6,7 +6,7 @@ it under the terms of the GNU General Public License as 
published by
 the Free Software Foundation; either version 3 of the License, or
 (at your option) any later version.
 
-This program is distributed in the hope that it will be useful, 
+This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
@@ -23,7 +23,7 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 #include <include/filter/filters_chain.h>
 #include <include/base/file/files_utility.h>
 
-extern "C" 
+extern "C"
 {
 #include <errno.h>
 
@@ -36,8 +36,6 @@ extern "C"
 
 #include <include/base/find_data/find_data.h>
 #include <include/base/string/stringutils.h>
-#ifndef WIN32
-#endif
 
 #include <string>
 #include <sstream>
@@ -132,7 +130,7 @@ double HttpDir::formatBytes (u_long bytes, u_int power)
 /*!
  * Fullfill the string out with a formatted representation for bytes.
  * \param bytes Size to format.
- * \param out Out string. 
+ * \param out Out string.
  */
 void HttpDir::getFormattedSize (u_long bytes, string & out)
 {
@@ -159,7 +157,7 @@ void HttpDir::getFormattedSize (u_long bytes, string & out)
     osstr << std::fixed << setprecision(0) << result << " " << symbols[i];
   else
     osstr << std::fixed << setprecision(2) << result << " " << symbols[i];
-  
+
   out = osstr.str();
 }
 
@@ -221,8 +219,8 @@ void HttpDir::generateHeader (MemBuf &out, char sortType, 
bool sortReverse,
  * \param linkPrefix Prefix to use for the generated links.
  * \param formatString Specify which element show.
  */
-void HttpDir::generateElement (MemBuf &out, 
-                               FileStruct &file, 
+void HttpDir::generateElement (MemBuf &out,
+                               FileStruct &file,
                                string &linkPrefix,
                                const char *formatString)
 {
@@ -232,7 +230,7 @@ void HttpDir::generateElement (MemBuf &out,
   formatHtml (file.name, name);
 
   out << "<tr>\r\n";
-  
+
   const char* cur = formatString;
 
   for (;;)
@@ -291,7 +289,7 @@ void HttpDir::generateElement (MemBuf &out,
  * \param onlyHeader Specify if send only the HTTP header.
 */
 int HttpDir::send(HttpThreadContext* td,
-                  const char* directory, const char* cgi, 
+                  const char* directory, const char* cgi,
                   bool execute, bool onlyHeader)
 {
   u_long nbw;
@@ -310,7 +308,7 @@ int HttpDir::send(HttpThreadContext* td,
   char sortType = 0;
   bool sortReverse = false;
   string linkPrefix;
-  const char *formatString = td->securityToken.getHashedData 
("http.dir.format", 
+  const char *formatString = td->securityToken.getHashedData 
("http.dir.format",
                                                               
MYSERVER_SECURITY_CONF |
                                                               
MYSERVER_VHOST_CONF |
                                                               
MYSERVER_SERVER_CONF, "%f%t%s");
@@ -326,12 +324,12 @@ int HttpDir::send(HttpThreadContext* td,
   if ( !(td->permissions & MYSERVER_PERMISSION_BROWSE))
     return td->http->sendAuth ();
 
-  if(td->mime && Server::getInstance()->getFiltersFactory()->chain(&chain, 
-                                                        td->mime->filters, 
+  if(td->mime && Server::getInstance()->getFiltersFactory()->chain(&chain,
+                                                        td->mime->filters,
                                              td->connection->socket, &nbw, 1))
   {
-    td->connection->host->warningsLogWrite("HttpDir: Error loading filters");
-    chain.clearAllFilters(); 
+    td->connection->host->warningsLogWrite (_("HttpDir: internal error"));
+    chain.clearAllFilters();
     return td->http->raiseHTTPError(500);
   }
 
@@ -344,17 +342,17 @@ int HttpDir::send(HttpThreadContext* td,
   if(!td->appendOutputs)
   {
 
-    HttpHeaders::buildHTTPResponseHeader(td->buffer->getBuffer(), 
+    HttpHeaders::buildHTTPResponseHeader(td->buffer->getBuffer(),
                                          &(td->response));
 
-    if(td->connection->socket->send(td->buffer->getBuffer(), 
-                       (u_long)strlen(td->buffer->getBuffer()), 0) 
+    if(td->connection->socket->send(td->buffer->getBuffer(),
+                       (u_long)strlen(td->buffer->getBuffer()), 0)
        == SOCKET_ERROR)
     {
       /* Remove the connection.  */
       return 0;
-    }  
-  }    
+    }
+  }
 
   if(onlyHeader)
     return 1;
@@ -401,17 +399,17 @@ int HttpDir::send(HttpThreadContext* td,
   *td->secondaryBuffer << "</title>\r\n";
 
   /*
-   *If it is defined a CSS file for the graphic layout of 
-   *the browse directory insert it in the page.  
+   *If it is defined a CSS file for the graphic layout of
+   *the browse directory insert it in the page.
    */
   if(browseDirCSSpath)
   {
     *td->secondaryBuffer << "<link rel=\"stylesheet\" href=\""
-                 << browseDirCSSpath 
+                 << browseDirCSSpath
                  << "\" type=\"text/css\" media=\"all\"/>\r\n";
   }
 
-  *td->secondaryBuffer << "</head>\r\n"; 
+  *td->secondaryBuffer << "</head>\r\n";
 
   ret = appendDataToHTTPChannel(td, td->secondaryBuffer->getBuffer(),
                                 td->secondaryBuffer->getLength(),
@@ -421,12 +419,12 @@ int HttpDir::send(HttpThreadContext* td,
   {
     /* Return an internal server error. */
     td->outputData.close();
-    chain.clearAllFilters(); 
+    chain.clearAllFilters();
     return td->http->raiseHTTPError(500);
   }
 
   sentData = td->secondaryBuffer->getLength();
-              
+
   filename = directory;
   td->secondaryBuffer->setLength(0);
   *td->secondaryBuffer << "<body>\r\n<h1>Contents of directory ";
@@ -450,7 +448,7 @@ int HttpDir::send(HttpThreadContext* td,
 
   if(ret == -1)
   {
-    chain.clearAllFilters(); 
+    chain.clearAllFilters();
     return td->http->raiseHTTPError(404);
   }
 
@@ -471,7 +469,7 @@ int HttpDir::send(HttpThreadContext* td,
   if(ret)
   {
     td->outputData.close();
-    chain.clearAllFilters(); 
+    chain.clearAllFilters();
     /* Return an internal server error.  */
     return td->http->raiseHTTPError(500);
   }
@@ -486,14 +484,14 @@ int HttpDir::send(HttpThreadContext* td,
     string file;
     file.assign(td->request.uri);
     file.append("/../");
-    
+
     *td->secondaryBuffer << "<tr>\r\n";
 
     for (;;)
     {
       while (*cur && ((*cur == '%' ) || (*cur == ' ' )))
         cur++;
-      
+
       if (!(*cur))
         break;
 
@@ -509,7 +507,7 @@ int HttpDir::send(HttpThreadContext* td,
     }
 
     *td->secondaryBuffer << "</tr>\r\n";
-    
+
     ret = appendDataToHTTPChannel(td, td->secondaryBuffer->getBuffer(),
                                   td->secondaryBuffer->getLength(),
                                   &(td->outputData), &chain,
@@ -518,7 +516,7 @@ int HttpDir::send(HttpThreadContext* td,
     {
       fd.findclose();
       td->outputData.close();
-      chain.clearAllFilters(); 
+      chain.clearAllFilters();
       /* Return an internal server error.  */
       return td->http->raiseHTTPError(500);
     }
@@ -570,7 +568,7 @@ int HttpDir::send(HttpThreadContext* td,
   /* Build the files table and send it.  */
   for(vector<FileStruct>::iterator it = files.begin();
       it != files.end(); it++)
-  {  
+  {
     FileStruct& file = *it;
 
     td->secondaryBuffer->setLength(0);
@@ -584,7 +582,7 @@ int HttpDir::send(HttpThreadContext* td,
     if(ret)
     {
       td->outputData.close();
-      chain.clearAllFilters(); 
+      chain.clearAllFilters();
       /* Return an internal server error.  */
       return td->http->raiseHTTPError(500);
     }
@@ -596,9 +594,9 @@ int HttpDir::send(HttpThreadContext* td,
   td->secondaryBuffer->setLength(0);
   *td->secondaryBuffer << "</table>\r\n<hr />\r\n<address>"
                << MYSERVER_VERSION;
-              
+
   if(host && host->value->length())
-  {    
+  {
     ostringstream portBuff;
     size_t portSeparator = host->value->find(':');
     *td->secondaryBuffer << " on ";
@@ -606,7 +604,7 @@ int HttpDir::send(HttpThreadContext* td,
       *td->secondaryBuffer << host->value->substr(0, portSeparator).c_str() ;
     else
       *td->secondaryBuffer << host->value->c_str() ;
-    
+
     *td->secondaryBuffer << " Port ";
     portBuff << td->connection->getLocalPort();
     *td->secondaryBuffer << portBuff.str();
@@ -622,7 +620,7 @@ int HttpDir::send(HttpThreadContext* td,
     td->outputData.close();
     /* Return an internal server error.  */
     return td->http->raiseHTTPError(500);
-  }  
+  }
   sentData += td->secondaryBuffer->getLength();
 
   *td->secondaryBuffer << end_str;
@@ -638,10 +636,10 @@ int HttpDir::send(HttpThreadContext* td,
       return 1;
   }
 
-  /* For logging activity.  */  
+  /* For logging activity.  */
   td->sentData += sentData;
 
-  chain.clearAllFilters(); 
+  chain.clearAllFilters();
   return 1;
 
 }
@@ -661,13 +659,13 @@ void HttpDir::formatHtml(string& in, string& out)
    */
   for(pos = 0; out[pos] != '\0'; pos++)
   {
-    if(((u_char)out[pos] >= 32 && 
+    if(((u_char)out[pos] >= 32 &&
         (u_char)out[pos] <= 65)   ||
-       ((u_char)out[pos] >= 91 && 
+       ((u_char)out[pos] >= 91 &&
         (u_char)out[pos] <= 96)   ||
-       ((u_char)out[pos] >= 123 && 
+       ((u_char)out[pos] >= 123 &&
         (u_char)out[pos] <= 126) ||
-       ((u_char)out[pos] >= 160 && 
+       ((u_char)out[pos] >= 160 &&
         (u_char)out[pos] < 255))
     {
       ostringstream os;
diff --git a/myserver/src/http_handler/http_file/http_file.cpp 
b/myserver/src/http_handler/http_file/http_file.cpp
index 631f180..ae8856b 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -622,22 +622,14 @@ int HttpFile::send (HttpThreadContext* td,
     file->close ();
     delete file;
   }
-  catch (bad_alloc &ba)
-    {
-      file->close ();
-      delete file;
-      td->connection->host->warningsLogWrite ("HttpFile: Error allocating 
memory");
-      chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
   catch (...)
     {
       file->close ();
       delete file;
-      td->connection->host->warningsLogWrite ("HttpFile: Internal error");
+      td->connection->host->warningsLogWrite (_("HttpFile: internal error"));
       chain.clearAllFilters ();
       return td->http->raiseHTTPError (500);
-    };
+    }
 
   /* For logging activity.  */
   td->sentData += dataSent;
diff --git a/myserver/src/http_handler/isapi/isapi.cpp 
b/myserver/src/http_handler/isapi/isapi.cpp
index 349840d..3ff1119 100644
--- a/myserver/src/http_handler/isapi/isapi.cpp
+++ b/myserver/src/http_handler/isapi/isapi.cpp
@@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public 
License
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
- 
+
 #include <include/http_handler/isapi/isapi.h>
 #include <include/protocol/http/http.h>
 #include <include/server/server.h>
@@ -39,25 +39,25 @@ ConnTableRecord *Isapi::connTable = 0;
 
 
 BOOL WINAPI ISAPI_ServerSupportFunctionExport(HCONN hConn, DWORD dwHSERRequest,
-                                              LPVOID lpvBuffer, LPDWORD 
lpdwSize, 
-                                              LPDWORD lpdwDataType) 
+                                              LPVOID lpvBuffer, LPDWORD 
lpdwSize,
+                                              LPDWORD lpdwDataType)
 {
   string tmp;
   ConnTableRecord *ConnInfo;
   int ret;
-  char *buffer = 0;  
-  char uri[MAX_PATH];/*! Under windows use MAX_PATH. */  
+  char *buffer = 0;
+  char uri[MAX_PATH];/*! Under windows use MAX_PATH. */
   Isapi::isapiMutex->lock();
   ConnInfo = Isapi::HConnRecord(hConn);
   Isapi::isapiMutex->unlock();
-  if (ConnInfo == NULL) 
-  {
-    Server::getInstance()->logWriteln("isapi::ServerSupportFunctionExport: 
invalid hConn");
-    return 0;
-  }
+  if (ConnInfo == NULL)
+    {
+      Server::getInstance()->logWriteln("isapi::ServerSupportFunctionExport: 
invalid hConn");
+      return 0;
+    }
 
-  switch (dwHSERRequest) 
-  {
+  switch (dwHSERRequest)
+    {
     case HSE_REQ_MAP_URL_TO_PATH_EX:
       HSE_URL_MAPEX_INFO  *mapInfo;
       mapInfo=(HSE_URL_MAPEX_INFO*)lpdwDataType;
@@ -66,20 +66,20 @@ BOOL WINAPI ISAPI_ServerSupportFunctionExport(HCONN hConn, 
DWORD dwHSERRequest,
       ret=ConnInfo->td->http->getPath(tmp,(char*)lpvBuffer, 0);
       if(ret != 200)
         return 1;
-      
+
       mapInfo->cchMatchingURL=(DWORD)strlen((char*)lpvBuffer);
       mapInfo->cchMatchingPath=(DWORD)strlen(mapInfo->lpszPath);
       delete [] mapInfo->lpszPath;
       mapInfo->lpszPath = new char[tmp.length() + 1];
       if(mapInfo->lpszPath == 0)
         if(buffer==0)
-        {
-          SetLastError(ERROR_INSUFFICIENT_BUFFER);
-          return 0;            
-        }
+          {
+            SetLastError(ERROR_INSUFFICIENT_BUFFER);
+            return 0;
+          }
       strcpy(mapInfo->lpszPath, tmp.c_str());
-      mapInfo->dwFlags = HSE_URL_FLAGS_WRITE | HSE_URL_FLAGS_SCRIPT 
-                                             | HSE_URL_FLAGS_EXECUTE;
+      mapInfo->dwFlags = HSE_URL_FLAGS_WRITE | HSE_URL_FLAGS_SCRIPT
+        | HSE_URL_FLAGS_EXECUTE;
       break;
     case HSE_REQ_MAP_URL_TO_PATH:
       if(((char*)lpvBuffer)[0])
@@ -89,78 +89,76 @@ BOOL WINAPI ISAPI_ServerSupportFunctionExport(HCONN hConn, 
DWORD dwHSERRequest,
                  
(int)ConnInfo->td->request.uri.length()-ConnInfo->td->pathInfo.length() +1);
       ret = ConnInfo->td->http->getPath(tmp ,uri,0);
       if(ret!=200)
-      {
-        if(buffer)
-          delete [] buffer;
-        return 1;
-      }
-      
+        {
+          if(buffer)
+            delete [] buffer;
+          return 1;
+        }
+
       if(tmp.length() >= *lpdwSize)
-      {
-        SetLastError(ERROR_INSUFFICIENT_BUFFER);
-        return 0;
-      }    
+        {
+          SetLastError(ERROR_INSUFFICIENT_BUFFER);
+          return 0;
+        }
       strcpy((char*)lpvBuffer, tmp.c_str());
       if(FilesUtility::completePath((char**)&lpvBuffer,(int*)lpdwSize,  1))
-      {
-        SetLastError(ERROR_INSUFFICIENT_BUFFER);
-        return 0;
-      }
+        {
+          SetLastError(ERROR_INSUFFICIENT_BUFFER);
+          return 0;
+        }
       *lpdwSize=(DWORD)strlen((char*)lpvBuffer);
       break;
-  case HSE_REQ_SEND_URL_REDIRECT_RESP:
-    return ((Isapi*)ConnInfo->isapi)->Redirect(ConnInfo->td,
-                              ConnInfo->connection,(char *)lpvBuffer);
-    break;
-  case HSE_REQ_SEND_URL:
-    return ((Isapi*)ConnInfo->isapi)->Senduri(ConnInfo->td,
-                                           ConnInfo->connection,(char 
*)lpvBuffer);
-    break;
-  case HSE_REQ_SEND_RESPONSE_HEADER:
-    return ((Isapi*)ConnInfo->isapi)->SendHeader(ConnInfo->td,
-                                           ConnInfo->connection,(char 
*)lpvBuffer);
-    break;
-  case HSE_REQ_DONE_WITH_SESSION:
-    ConnInfo->td->response.httpStatus=*(DWORD*)lpvBuffer;
-    SetEvent(ConnInfo->ISAPIDoneEvent);
-    break;
-  case HSE_REQ_IS_KEEP_CONN:
-    if(ConnInfo->td->request.isKeepAlive())
-      *((BOOL*)lpvBuffer)=1;
-    else
-      *((BOOL*)lpvBuffer)=0;
-    break;
-  default:
-    return 0;
-  }
+    case HSE_REQ_SEND_URL_REDIRECT_RESP:
+      return ((Isapi*)ConnInfo->isapi)->Redirect(ConnInfo->td,
+                                                 ConnInfo->connection,(char 
*)lpvBuffer);
+      break;
+    case HSE_REQ_SEND_URL:
+      return ((Isapi*)ConnInfo->isapi)->Senduri(ConnInfo->td,
+                                                ConnInfo->connection,(char 
*)lpvBuffer);
+      break;
+    case HSE_REQ_SEND_RESPONSE_HEADER:
+      return ((Isapi*)ConnInfo->isapi)->SendHeader(ConnInfo->td,
+                                                   ConnInfo->connection,(char 
*)lpvBuffer);
+      break;
+    case HSE_REQ_DONE_WITH_SESSION:
+      ConnInfo->td->response.httpStatus=*(DWORD*)lpvBuffer;
+      SetEvent(ConnInfo->ISAPIDoneEvent);
+      break;
+    case HSE_REQ_IS_KEEP_CONN:
+      if(ConnInfo->td->request.isKeepAlive())
+        *((BOOL*)lpvBuffer)=1;
+      else
+        *((BOOL*)lpvBuffer)=0;
+      break;
+    default:
+      return 0;
+    }
   return 1;
 }
 
 /*!
- *Add a connection to the table.
+ * Add a connection to the table.
  */
-ConnTableRecord *Isapi::HConnRecord(HCONN hConn) 
+ConnTableRecord *Isapi::HConnRecord (HCONN hConn)
 {
   u_long connIndex;
 
   connIndex =((u_long) hConn) - 1;
   ConnTableRecord *ConnInfo;
-  if ((connIndex < 0) || (connIndex >= maxConnections)) 
-  {
+  if ((connIndex < 0) || (connIndex >= maxConnections))
     return NULL;
-  }
+
   ConnInfo = &(connTable[connIndex]);
-  if (ConnInfo->Allocated == 0) 
-  {
+  if (ConnInfo->Allocated == 0)
     return NULL;
-  }
+
   return ConnInfo;
 }
 
 /*!
  *Send an HTTP redirect.
  */
-int Isapi::Redirect(HttpThreadContext* td, ConnectionPtr a, char *URL) 
+int Isapi::Redirect(HttpThreadContext* td, ConnectionPtr a, char *URL)
 {
   return td->http->sendHTTPRedirect(URL);
 }
@@ -181,7 +179,7 @@ int Isapi::Senduri(HttpThreadContext* td, ConnectionPtr a, 
char *URL)
 int Isapi::SendHeader(HttpThreadContext* td,ConnectionPtr a,char *data)
 {
   HttpHeaders::buildHTTPResponseHeaderStruct(data,
-                                             &td->response, 
+                                             &td->response,
                                              &(td->nBytesToRead));
   return 1;
 }
@@ -189,7 +187,7 @@ int Isapi::SendHeader(HttpThreadContext* td,ConnectionPtr 
a,char *data)
 /*!
  *Write directly to the output.
  */
-BOOL WINAPI ISAPI_WriteClientExport(HCONN hConn, LPVOID Buffer, LPDWORD 
lpdwBytes, 
+BOOL WINAPI ISAPI_WriteClientExport(HCONN hConn, LPVOID Buffer, LPDWORD 
lpdwBytes,
                                     DWORD /*!dwReserved*/)
 {
   int keepalive;
@@ -200,20 +198,19 @@ BOOL WINAPI ISAPI_WriteClientExport(HCONN hConn, LPVOID 
Buffer, LPDWORD lpdwByte
 
   if(*lpdwBytes == 0)
     return 1;
-  
+
   Isapi::isapiMutex->lock();
   ConnInfo = Isapi::HConnRecord(hConn);
   Isapi::isapiMutex->unlock();
-  
+
   if(ConnInfo == NULL)
     return 1;
   buffer=(char*)ConnInfo->td->buffer->getBuffer();
   HttpRequestHeader::Entry *connection = 
ConnInfo->td->request.other.get("Connection");
 
-  if (ConnInfo == NULL) 
+  if (ConnInfo == NULL)
   {
-    ((Vhost*)(ConnInfo->td->connection->host))->warningsLogWrite(
-                                        "ISAPI: WriteClientExport: invalid 
hConn");
+    ((Vhost*)(ConnInfo->td->connection->host))->warningsLogWrite(_("ISAPI: 
internal error"));
     return 0;
   }
   keepalive =connection && (!stringcmpi(connection->value->c_str(), 
"keep-alive")) ;
@@ -253,7 +250,7 @@ BOOL WINAPI ISAPI_WriteClientExport(HCONN hConn, LPVOID 
Buffer, LPDWORD lpdwByte
           }
         }
       }
-    } 
+    }
     /*!
      *Handle the HTTP header if exists.
      */
@@ -262,7 +259,7 @@ BOOL WINAPI ISAPI_WriteClientExport(HCONN hConn, LPVOID 
Buffer, LPDWORD lpdwByte
       int len = ConnInfo->headerSize-headerSize;
 
       
HttpHeaders::buildHTTPResponseHeaderStruct(ConnInfo->td->buffer->getBuffer(),
-                                                 &ConnInfo->td->response, 
+                                                 &ConnInfo->td->response,
                                                  
&(ConnInfo->td->nBytesToRead));
 
 
@@ -284,17 +281,17 @@ BOOL WINAPI ISAPI_WriteClientExport(HCONN hConn, LPVOID 
Buffer, LPDWORD lpdwByte
         }
         else
           ConnInfo->td->response.connection.assign("Close");
-        
+
         u_long hdrLen = HttpHeaders::buildHTTPResponseHeader 
((char*)ConnInfo->td->secondaryBuffer->getBuffer(),
                                                               
&(ConnInfo->td->response));
-  
+
         if(ConnInfo->connection->socket->send(
                      (char*)ConnInfo->td->secondaryBuffer->getBuffer(), 
hdrLen, 0)==-1)
           return 0;
       }
       /*! Save the headerSent status. */
       ConnInfo->headerSent=1;
-      
+
       /*! If only the header was requested return. */
       if(ConnInfo->headerSent && ConnInfo->onlyHeader || 
ConnInfo->td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
         return 0;
@@ -310,7 +307,7 @@ BOOL WINAPI ISAPI_WriteClientExport(HCONN hConn, LPVOID 
Buffer, LPDWORD lpdwByte
                                                  (int)strlen(chunkSize), &nbw))
             return 0;
         }
-        
+
         if(ConnInfo->td->appendOutputs)
         {
           if(ConnInfo->td->outputData.writeToFile((char*)(buffer + headerSize),
@@ -344,7 +341,7 @@ BOOL WINAPI ISAPI_WriteClientExport(HCONN hConn, LPVOID 
Buffer, LPDWORD lpdwByte
     if(keepalive  && (!ConnInfo->td->appendOutputs))
     {
       sprintf (chunkSize, "%x\r\n", *lpdwBytes);
-      nbw = ConnInfo->connection->socket->send (chunkSize, 
+      nbw = ConnInfo->connection->socket->send (chunkSize,
                                                 (int)strlen(chunkSize), 0);
       if((nbw == (u_long)-1) || (!nbw))
         return 0;
@@ -381,30 +378,29 @@ BOOL WINAPI ISAPI_WriteClientExport(HCONN hConn, LPVOID 
Buffer, LPDWORD lpdwByte
 /*!
  *Read directly from the client.
  */
-BOOL WINAPI ISAPI_ReadClientExport(HCONN hConn, LPVOID lpvBuffer, 
-                                   LPDWORD lpdwSize ) 
+BOOL WINAPI ISAPI_ReadClientExport(HCONN hConn, LPVOID lpvBuffer,
+                                   LPDWORD lpdwSize )
 {
   ConnTableRecord *ConnInfo;
   u_long NumRead;
-  
+
   Isapi::isapiMutex->lock();
   ConnInfo = Isapi::HConnRecord(hConn);
   Isapi::isapiMutex->unlock();
-  if (ConnInfo == NULL) 
+  if (ConnInfo == NULL)
   {
-    ((Vhost*)(ConnInfo->td->connection->host))->warningsLogWrite(
-                                    "ISAPI: ReadClientExport: invalid hConn");
+    ((Vhost*)(ConnInfo->td->connection->host))->warningsLogWrite(_("ISAPI: 
internal error"));
     return 0;
   }
 
   ConnInfo->td->inputData.read((char*)lpvBuffer, *lpdwSize, &NumRead);
 
-  if (NumRead == -1) 
+  if (NumRead == -1)
   {
     *lpdwSize = 0;
     return 0;
   }
-  else 
+  else
   {
     *lpdwSize = (DWORD)NumRead;
     return 1;
@@ -414,36 +410,36 @@ BOOL WINAPI ISAPI_ReadClientExport(HCONN hConn, LPVOID 
lpvBuffer,
 /*!
  *Get server environment variable.
  */
-BOOL WINAPI ISAPI_GetServerVariableExport(HCONN hConn, 
-                                          LPSTR lpszVariableName, 
-                                          LPVOID lpvBuffer, 
-                                          LPDWORD lpdwSize) 
+BOOL WINAPI ISAPI_GetServerVariableExport(HCONN hConn,
+                                          LPSTR lpszVariableName,
+                                          LPVOID lpvBuffer,
+                                          LPDWORD lpdwSize)
 {
   ConnTableRecord *ConnInfo;
   BOOL ret =1;
   Isapi::isapiMutex->lock();
   ConnInfo = Isapi::HConnRecord(hConn);
   Isapi::isapiMutex->unlock();
-  if (ConnInfo == NULL) 
+  if (ConnInfo == NULL)
   {
     Server::getInstance()->logWriteln(
                        "Isapi::GetServerVariableExport: invalid hConn");
     return 0;
   }
 
-  if (!strcmp(lpszVariableName, "ALL_HTTP")) 
+  if (!strcmp(lpszVariableName, "ALL_HTTP"))
   {
 
         if(Isapi::buildAllHttpHeaders(ConnInfo->td,ConnInfo->connection, 
lpvBuffer, lpdwSize))
       ret=1;
-    
+
         else
     {
       SetLastError(ERROR_INSUFFICIENT_BUFFER);
       ret=0;
     }
-      
-  }else if(!strcmp(lpszVariableName, "ALL_RAW")) 
+
+  }else if(!strcmp(lpszVariableName, "ALL_RAW"))
   {
     if(Isapi::buildAllRawHeaders(ConnInfo->td,ConnInfo->connection,
                                  lpvBuffer, lpdwSize))
@@ -453,12 +449,12 @@ BOOL WINAPI ISAPI_GetServerVariableExport(HCONN hConn,
       SetLastError(ERROR_INSUFFICIENT_BUFFER);
       ret = 0;
     }
-      
+
   }
   else
   {
     /*!
-     *find in ConnInfo->envString the value lpszVariableName 
+     *find in ConnInfo->envString the value lpszVariableName
      *and copy next string in lpvBuffer.
      */
     char *localEnv;
@@ -471,7 +467,7 @@ BOOL WINAPI ISAPI_GetServerVariableExport(HCONN hConn,
       if(((localEnv[i + variableNameLen]) == '=') &&
          (!strncmp(&localEnv[i], lpszVariableName, variableNameLen)))
       {
-        strncpy((char*)lpvBuffer, &localEnv[i + variableNameLen + 1], 
+        strncpy((char*)lpvBuffer, &localEnv[i + variableNameLen + 1],
                 *lpdwSize);
         break;
       }
@@ -500,16 +496,16 @@ BOOL Isapi::buildAllHttpHeaders(HttpThreadContext* td, 
ConnectionPtr /*!a*/,
   if(accept && accept->value->length() && (valLen+30<maxLen))
     valLen += sprintf(&ValStr[valLen],"HTTP_ACCEPT:%s\n",
                     accept->value->c_str());
-  else if(valLen + 30 < maxLen) 
+  else if(valLen + 30 < maxLen)
     return 0;
 
   if(cache && cache->value->length() && (valLen+30<maxLen))
-    valLen += sprintf(&ValStr[valLen], "HTTP_CACHE_CONTROL:%s\n", 
+    valLen += sprintf(&ValStr[valLen], "HTTP_CACHE_CONTROL:%s\n",
                     cache->value->c_str());
-  else if(valLen + 30 < maxLen) 
+  else if(valLen + 30 < maxLen)
     return 0;
 
-  if((td->request.rangeByteBegin || td->request.rangeByteEnd) && 
+  if((td->request.rangeByteBegin || td->request.rangeByteEnd) &&
      (valLen + 30 < maxLen))
   {
     ostringstream rangeBuffer;
@@ -522,7 +518,7 @@ BOOL Isapi::buildAllHttpHeaders(HttpThreadContext* td, 
ConnectionPtr /*!a*/,
     if(td->request.rangeByteEnd)
     {
       rangeBuffer << td->request.rangeByteEnd;
-     }   
+     }
     valLen += sprintf(&ValStr[valLen], "%s\n", rangeBuffer.str().c_str());
   }
 
@@ -531,7 +527,7 @@ BOOL Isapi::buildAllHttpHeaders(HttpThreadContext* td, 
ConnectionPtr /*!a*/,
     if(e && (valLen + 30 < maxLen))
       valLen += sprintf(&ValStr[valLen], "HTTP_ACCEPT_ENCODING:%s\n",
                         e->value->c_str());
-    else if(valLen + 30 < maxLen) 
+    else if(valLen + 30 < maxLen)
       return 0;
   }
 
@@ -541,7 +537,7 @@ BOOL Isapi::buildAllHttpHeaders(HttpThreadContext* td, 
ConnectionPtr /*!a*/,
     if(e && (valLen + 30 < maxLen))
       valLen += sprintf(&ValStr[valLen],"HTTP_ACCEPT_LANGUAGE:%s\n",
                       e->value->c_str());
-    else if(valLen + 30 < maxLen) 
+    else if(valLen + 30 < maxLen)
       return 0;
   }
 
@@ -551,7 +547,7 @@ BOOL Isapi::buildAllHttpHeaders(HttpThreadContext* td, 
ConnectionPtr /*!a*/,
     if(e && (valLen + 30 < maxLen))
       valLen += sprintf(&ValStr[valLen],"HTTP_ACCEPT_CHARSET:%s\n",
                       e->value->c_str());
-    else if(valLen + 30 < maxLen) 
+    else if(valLen + 30 < maxLen)
       return 0;
   }
 
@@ -560,7 +556,7 @@ BOOL Isapi::buildAllHttpHeaders(HttpThreadContext* td, 
ConnectionPtr /*!a*/,
     if(e && (valLen + 30 < maxLen))
       valLen += sprintf(&ValStr[valLen],"HTTP_PRAGMA:%s\n",
                       e->value->c_str());
-    else if(valLen + 30 < maxLen) 
+    else if(valLen + 30 < maxLen)
       return 0;
   }
 
@@ -569,7 +565,7 @@ BOOL Isapi::buildAllHttpHeaders(HttpThreadContext* td, 
ConnectionPtr /*!a*/,
     if(e && (valLen + 30< maxLen))
       valLen += sprintf(&ValStr[valLen],"HTTP_CONNECTION:%s\n",
                       e->value->c_str());
-    else if(valLen + 30 < maxLen) 
+    else if(valLen + 30 < maxLen)
       return 0;
   }
 
@@ -578,7 +574,7 @@ BOOL Isapi::buildAllHttpHeaders(HttpThreadContext* td, 
ConnectionPtr /*!a*/,
     if(e && (valLen + 30 < maxLen))
       valLen += sprintf(&ValStr[valLen],"HTTP_COOKIE:%s\n",
                       e->value->c_str());
-    else if(valLen + 30 < maxLen) 
+    else if(valLen + 30 < maxLen)
       return 0;
   }
 
@@ -587,7 +583,7 @@ BOOL Isapi::buildAllHttpHeaders(HttpThreadContext* td, 
ConnectionPtr /*!a*/,
     if(e && (valLen + 30 < maxLen))
       valLen += sprintf(&ValStr[valLen],"HTTP_HOST:%s\n",
                       e->value->c_str());
-    else if(valLen + 30 < maxLen) 
+    else if(valLen + 30 < maxLen)
       return 0;
   }
 
@@ -596,7 +592,7 @@ BOOL Isapi::buildAllHttpHeaders(HttpThreadContext* td, 
ConnectionPtr /*!a*/,
     if(e && (valLen + 30 < maxLen))
       valLen += sprintf(&ValStr[valLen],"HTTP_DATE:%s\n",
                       e->value->c_str());
-    else if(valLen + 30 < maxLen) 
+    else if(valLen + 30 < maxLen)
       return 0;
   }
 
@@ -605,7 +601,7 @@ BOOL Isapi::buildAllHttpHeaders(HttpThreadContext* td, 
ConnectionPtr /*!a*/,
     if(e && (valLen + 30 < maxLen))
       valLen += sprintf(&ValStr[valLen],"HTTP_IF_MODIFIED_SINCE:%s\n",
                       e->value->c_str());
-    else if(valLen + 30 < maxLen) 
+    else if(valLen + 30 < maxLen)
       return 0;
   }
 
@@ -614,7 +610,7 @@ BOOL Isapi::buildAllHttpHeaders(HttpThreadContext* td, 
ConnectionPtr /*!a*/,
     if(e && (valLen + 30 < maxLen))
       valLen += sprintf(&ValStr[valLen],"HTTP_REFERER:%s\n",
                       e->value->c_str());
-    else if(valLen + 30 < maxLen) 
+    else if(valLen + 30 < maxLen)
       return 0;
   }
 
@@ -623,7 +619,7 @@ BOOL Isapi::buildAllHttpHeaders(HttpThreadContext* td, 
ConnectionPtr /*!a*/,
     if(e && (valLen + 30 < maxLen))
       valLen += sprintf(&ValStr[valLen],"HTTP_USER_AGENT:%s\n",
                       e->value->c_str());
-    else if(valLen + 30 < maxLen) 
+    else if(valLen + 30 < maxLen)
       return 0;
   }
 
@@ -632,7 +628,7 @@ BOOL Isapi::buildAllHttpHeaders(HttpThreadContext* td, 
ConnectionPtr /*!a*/,
     if(e && (valLen + 30 < maxLen))
       valLen += sprintf(&ValStr[valLen],"HTTP_FROM:%s\n",
                       e->value->c_str());
-    else if(valLen + 30 < maxLen) 
+    else if(valLen + 30 < maxLen)
       return 0;
   }
 
@@ -655,63 +651,63 @@ BOOL Isapi::buildAllRawHeaders(HttpThreadContext* 
td,ConnectionPtr a,
   if(td->pathInfo.length() && (valLen + 30 < maxLen))
     valLen += sprintf(&ValStr[valLen], "PATH_INFO:%s\n",
                       td->pathInfo.c_str());
-  else if(valLen + 30 < maxLen) 
+  else if(valLen + 30 < maxLen)
     return 0;
-  
+
   if(td->pathTranslated.length() && (valLen + 30 < maxLen))
     valLen += sprintf(&ValStr[valLen], "PATH_INFO:%s\n",
                       td->pathTranslated.c_str());
-  else if(valLen + 30 < maxLen) 
+  else if(valLen + 30 < maxLen)
     return 0;
 
   if(td->request.uriOpts[0] && (valLen + 30 < maxLen))
     valLen += sprintf(&ValStr[valLen], "QUERY_STRING:%s\n",
                       td->request.uriOpts[0]);
-  else if(valLen + 30 < maxLen) 
+  else if(valLen + 30 < maxLen)
     return 0;
 
   if(td->request.cmd[0] && (valLen + 30 < maxLen))
     valLen += sprintf(&ValStr[valLen], "REQUEST_METHOD:%s\n",
                       td->request.cmd[0]);
-  else if(valLen + 30 < maxLen) 
+  else if(valLen + 30 < maxLen)
     return 0;
 
   if(td->filenamePath.length() && (valLen + 30 < maxLen))
-    valLen += sprintf(&ValStr[valLen], "SCRIPT_FILENAME:%s\n", 
+    valLen += sprintf(&ValStr[valLen], "SCRIPT_FILENAME:%s\n",
                       td->filenamePath[0]);
-  else if(valLen + 30 < maxLen) 
+  else if(valLen + 30 < maxLen)
     return 0;
 
   if(valLen + 30 < maxLen)
-    valLen += sprintf(&ValStr[valLen], "SERVER_PORT:%u\n", 
+    valLen += sprintf(&ValStr[valLen], "SERVER_PORT:%u\n",
                       td->connection->getLocalPort());
-  else if(valLen + 30 < maxLen) 
+  else if(valLen + 30 < maxLen)
     return 0;
 
   if(valLen + 30 < maxLen)
-    valLen += sprintf(&ValStr[valLen], 
+    valLen += sprintf(&ValStr[valLen],
                       "SERVER_SIGNATURE:<address>%s</address>\n",
                       MYSERVER_VERSION);
-  else if(valLen + 30 < maxLen) 
+  else if(valLen + 30 < maxLen)
     return 0;
 
   if(td->connection->getIpAddr()[0] && valLen + 30 < maxLen)
     valLen += sprintf(&ValStr[valLen], "REMOTE_ADDR:\n",
                       td->connection->getIpAddr());
-  else if(valLen + 30 < maxLen) 
+  else if(valLen + 30 < maxLen)
     return 0;
 
   if(td->connection->getPort() && valLen + 30 < maxLen)
     valLen += sprintf(&ValStr[valLen], "REMOTE_PORT:%u\n",
                       td->connection->getPort());
-  else if(valLen + 30 < maxLen) 
+  else if(valLen + 30 < maxLen)
     return 0;
 
   if(valLen + 30 < maxLen)
-    valLen += sprintf(&ValStr[valLen], "SERVER_ADMIN:%s\n", 
+    valLen += sprintf(&ValStr[valLen], "SERVER_ADMIN:%s\n",
                       td->securityToken.getHashedData ("server.admin", 
MYSERVER_VHOST_CONF |
                                                        MYSERVER_SERVER_CONF, 
""));
-  else if(valLen + 30 < maxLen) 
+  else if(valLen + 30 < maxLen)
     return 0;
 
   if(valLen + MAX_PATH < maxLen)
@@ -722,7 +718,7 @@ BOOL Isapi::buildAllRawHeaders(HttpThreadContext* 
td,ConnectionPtr a,
     valLen += (DWORD)td->request.uri.length()-td->pathInfo.length() + 1;
     valLen += (DWORD)sprintf(&ValStr[valLen],"\n");
   }
-  else if(valLen + 30 < maxLen) 
+  else if(valLen + 30 < maxLen)
     return 0;
   return 1;
 }
@@ -733,7 +729,7 @@ BOOL Isapi::buildAllRawHeaders(HttpThreadContext* 
td,ConnectionPtr a,
  *Main procedure to call an ISAPI module.
  */
 int Isapi::send(HttpThreadContext* td,
-                const char* scriptpath, const char *cgipath, 
+                const char* scriptpath, const char *cgipath,
                 bool execute, bool onlyHeader)
 {
 /*!
@@ -750,18 +746,18 @@ int Isapi::send(HttpThreadContext* td,
   const char *loadLib;
   int retvalue = 0;
   /*! Under windows there is MAX_PATH then we can use it. */
-  char fullpath[MAX_PATH * 2];
+  char fullpath[MAX_PATH * 2 + 5];
 
-  if(!execute)
+  if (!execute)
   {
-    if(cgipath && strlen(cgipath))
-      sprintf(fullpath, "%s \"%s\"", cgipath, td->filenamePath.c_str());
+    if (cgipath && strlen(cgipath))
+      sprintf (fullpath, "%s \"%s\"", cgipath, td->filenamePath.c_str());
     else
-      sprintf(fullpath, "%s", td->filenamePath.c_str());
+      sprintf (fullpath, "%s", td->filenamePath.c_str());
   }
   else
   {
-    sprintf(fullpath, "%s", cgipath);
+    sprintf (fullpath, "%s", cgipath);
   }
 
   if (!(td->permissions & MYSERVER_PERMISSION_EXECUTE))
@@ -772,19 +768,18 @@ int Isapi::send(HttpThreadContext* td,
   EnterCriticalSection(&GetTableEntryCritSec);
   connIndex = 0;
   Isapi::isapiMutex->lock();
-  while ((connTable[connIndex].Allocated != 0) && 
-         (connIndex < maxConnections)) 
+  while ((connTable[connIndex].Allocated != 0) &&
+         (connIndex < maxConnections))
   {
     connIndex++;
   }
   Isapi::isapiMutex->unlock();
   LeaveCriticalSection(&GetTableEntryCritSec);
 
-  if (connIndex == maxConnections) 
+  if (connIndex == maxConnections)
   {
-    td->connection->host->warningsLogWrite(
-                                            "ISAPI: Error max connections");
-    return td->http->raiseHTTPError(503);
+    td->connection->host->warningsLogWrite (_("ISAPI: max connections"));
+    return td->http->raiseHTTPError (503);
   }
   if(execute)
     loadLib = scriptpath;
@@ -794,13 +789,10 @@ int Isapi::send(HttpThreadContext* td,
   Ret = appHnd.loadLibrary(loadLib);
 
   if(Ret)
-  {
-    string msg;
-    msg.assign("ISAPI: Cannot load library ");
-    msg.append(loadLib);
-    td->connection->host->warningsLogWrite(msg.c_str());
-    return td->http->raiseHTTPError(500);
-  }
+    {
+      td->connection->host->warningsLogWrite (_("ISAPI: cannot load %s"), 
loadLib);
+      return td->http->raiseHTTPError(500);
+    }
 
   connTable[connIndex].chain.setProtocol(td->http);
   connTable[connIndex].chain.setProtocolData(td);
@@ -808,14 +800,14 @@ int Isapi::send(HttpThreadContext* td,
   if(td->mime)
   {
     u_long nbw;
-    if(td->mime && Server::getInstance()->getFiltersFactory()->chain(
+    if(td->mime && Server::getInstance()->getFiltersFactory()->chain (
                                           &(connTable[connIndex].chain),
-                                          td->mime->filters, 
-                                          td->connection->socket, 
+                                          td->mime->filters,
+                                          td->connection->socket,
                                           &nbw, 1))
       {
-        td->connection->host->warningsLogWrite("Error loading filters");
-        connTable[connIndex].chain.clearAllFilters(); 
+        td->connection->host->warningsLogWrite (_("ISAPI: internal error"));
+        connTable[connIndex].chain.clearAllFilters();
         return td->http->raiseHTTPError(500);
       }
   }
@@ -828,76 +820,51 @@ int Isapi::send(HttpThreadContext* td,
   connTable[connIndex].dataSent = 0;
   connTable[connIndex].Allocated = 1;
   connTable[connIndex].isapi = this;
-  connTable[connIndex].ISAPIDoneEvent = CreateEvent(NULL, 1, 0, NULL);
-  
-  GetExtensionVersion = 
(PFN_GETEXTENSIONVERSION)appHnd.getProc("GetExtensionVersion");
+  connTable[connIndex].ISAPIDoneEvent = CreateEvent (NULL, 1, 0, NULL);
 
-  if (GetExtensionVersion == NULL) 
+  GetExtensionVersion = (PFN_GETEXTENSIONVERSION)appHnd.getProc 
("GetExtensionVersion");
+
+  if (GetExtensionVersion == NULL)
   {
-    td->connection->host->warningsLogWrite(
-           "ISAPI: Failed to get pointer to GetExtensionVersion() in ISAPI 
application");
-    if(!appHnd.close())
-    {
-      string msg;
-      msg.assign("ISAPI: Failed to freeLibrary in ISAPI module: ");
-      msg.append(cgipath);
-      msg.append("\r\n");
-      td->connection->host->warningsLogWrite(msg.c_str());
-    }
-    connTable[connIndex].chain.clearAllFilters(); 
-    return td->http->raiseHTTPError(500);
+    td->connection->host->warningsLogWrite (_("ISAPI: internal error"));
+    appHnd.close ();
+    connTable[connIndex].chain.clearAllFilters ();
+    return td->http->raiseHTTPError (500);
   }
-  if(!GetExtensionVersion(&Ver)) 
+  if (!GetExtensionVersion (&Ver))
   {
-    td->connection->host->warningsLogWrite(
-                             "ISAPI: GetExtensionVersion() returned FALSE");
-
-    if(!appHnd.close())
-    {
-      string msg;
-      msg.assign("ISAPI: Failed to freeLibrary in ISAPI module: ");
-      msg.append(cgipath);
-      td->connection->host->warningsLogWrite(msg.c_str());
-    }
-    connTable[connIndex].chain.clearAllFilters(); 
+    td->connection->host->warningsLogWrite (_("ISAPI: internal error"));
+    appHnd.close ();
+    connTable[connIndex].chain.clearAllFilters ();
     return td->http->raiseHTTPError(500);
   }
-  if (Ver.dwExtensionVersion > MAKELONG(HSE_VERSION_MINOR, 
-                                        HSE_VERSION_MAJOR)) 
+  if (Ver.dwExtensionVersion > MAKELONG(HSE_VERSION_MINOR,
+                                        HSE_VERSION_MAJOR))
   {
-    td->connection->host->warningsLogWrite(
-                                       "ISAPI: version not supported");
-
-    if(!appHnd.close())
-    {
-      string msg;
-      msg.assign("ISAPI: Failed to freeLibrary in ISAPI module: ");
-      msg.append(cgipath);
-      td->connection->host->warningsLogWrite(msg.c_str());
-    }
-    connTable[connIndex].chain.clearAllFilters(); 
-    return td->http->raiseHTTPError(500);
+    td->connection->host->warningsLogWrite (_("ISAPI: version not supported"));
+    appHnd.close ();
+    connTable[connIndex].chain.clearAllFilters ();
+    return td->http->raiseHTTPError (500);
   }
   /*!
    *Store the environment string in the secondaryBuffer.
    */
   connTable[connIndex].envString=td->secondaryBuffer->getBuffer();
-  
+
   /*!
    *Build the environment string.
    */
   td->scriptPath.assign(scriptpath);
 
-  {
-    string tmp;
-    tmp.assign(cgipath);
-    FilesUtility::splitPath(tmp, td->cgiRoot, td->cgiFile);
-    tmp.assign(scriptpath);
-    FilesUtility::splitPath(tmp, td->scriptDir, td->scriptFile);
-  }
+  string tmp;
+  tmp.assign (cgipath);
+  FilesUtility::splitPath (tmp, td->cgiRoot, td->cgiFile);
+  tmp.assign (scriptpath);
+  FilesUtility::splitPath (tmp, td->scriptDir, td->scriptFile);
+
   connTable[connIndex].envString[0]='\0';
   Env::buildEnvironmentString(td,connTable[connIndex].envString);
-  
+
   ZeroMemory(&ExtCtrlBlk, sizeof(ExtCtrlBlk));
   ExtCtrlBlk.cbSize = sizeof(ExtCtrlBlk);
   ExtCtrlBlk.dwVersion = MAKELONG(HSE_VERSION_MINOR, HSE_VERSION_MAJOR);
@@ -919,23 +886,20 @@ int Isapi::send(HttpThreadContext* td,
   ExtCtrlBlk.cbAvailable = 0;
   ExtCtrlBlk.lpbData = 0;
   {
-    HttpRequestHeader::Entry *content = 
+    HttpRequestHeader::Entry *content =
       td->request.other.get("Content-Type");
-    ExtCtrlBlk.lpszContentType = content ? (char*)content->value->c_str() 
+    ExtCtrlBlk.lpszContentType = content ? (char*)content->value->c_str()
                                          : 0;
   }
 
   connTable[connIndex].td->buffer->setLength(0);
   connTable[connIndex].td->buffer->getAt(0)='\0';
   HttpExtensionProc = 
(PFN_HTTPEXTENSIONPROC)appHnd.getProc("HttpExtensionProc");
-  if (HttpExtensionProc == NULL) 
+  if (HttpExtensionProc == NULL)
   {
-    td->connection->host->warningsLogWrite(
-                     "ISAPI: Failed to get pointer to HttpExtensionProc() \
-in ISAPI application module");
-
+    td->connection->host->warningsLogWrite(_("ISAPI: internal error"));
     appHnd.close();
-    connTable[connIndex].chain.clearAllFilters(); 
+    connTable[connIndex].chain.clearAllFilters();
     return td->http->raiseHTTPError(500);
   }
 
@@ -944,7 +908,7 @@ in ISAPI application module");
   {
     WaitForSingleObject(connTable[connIndex].ISAPIDoneEvent, 
td->http->getTimeout ());
   }
-  
+
   {
     u_long nbw = 0;
     HttpRequestHeader::Entry *connection = 
connTable[connIndex].td->request.other.get("Connection");
@@ -952,8 +916,8 @@ in ISAPI application module");
     if(connection && !stringcmpi(connection->value->c_str(), "keep-alive"))
       Ret = connTable[connIndex].chain.getStream ()->write("0\r\n\r\n", 5, 
&nbw);
   }
-  
-  switch(Ret) 
+
+  switch(Ret)
   {
     case HSE_STATUS_SUCCESS_AND_KEEP_CONN:
       retvalue = 1;
@@ -966,43 +930,34 @@ in ISAPI application module");
       break;
   }
 
-  if(!appHnd.close())
-  {
-    string msg;
-    msg.assign("ISAPI: Failed to unLoad module "); 
-    msg.append(cgipath);
-    td->connection->host->warningsLogWrite(msg.c_str());
-  }
+  appHnd.close();
 
-  {
-    ostringstream tmp;
-    tmp <<  connTable[connIndex].dataSent;
-    connTable[connIndex].td->response.contentLength.assign(tmp.str()); 
-  }                                      
-  connTable[connIndex].chain.clearAllFilters(); 
+  ostringstream tmp;
+  tmp <<  connTable[connIndex].dataSent;
+  connTable[connIndex].td->response.contentLength.assign (tmp.str ());
+  connTable[connIndex].chain.clearAllFilters();
   connTable[connIndex].Allocated = 0;
   return retvalue;
 #else
-  /*!
-   *On other archs returns a non implemented error. 
+  /*
+   * On other archs returns a non implemented error.
    */
-  td->connection->host->warningsLogWrite(
-                                   "ISAPI: Not implemented");
+  td->connection->host->warningsLogWrite (_("ISAPI: Not implemented"));
   return td->http->raiseHTTPError(501);
-#endif  
+#endif
 }
 
 /*!
-*Constructor for the ISAPI class.
-*/
+ * Constructor for the ISAPI class.
+ */
 Isapi::Isapi()
 {
 
 }
 
 /*!
-*Initialize the ISAPI engine under WIN32.
-*/
+ * Initialize the ISAPI engine under WIN32.
+ */
 int Isapi::load ()
 {
 #ifdef WIN32
@@ -1012,10 +967,10 @@ int Isapi::load ()
 
   isapiMutex = new Mutex;
   maxConnections = nThreads ? nThreads : 20 ;
-  
+
   if(connTable)
     free(connTable);
-    
+
   connTable = new ConnTableRecord[maxConnections];
   for(int i=0;i<maxConnections; i++)
   {
@@ -1028,16 +983,16 @@ int Isapi::load ()
     connTable[i].envString=0;
     connTable[i].connection=0;
     connTable[i].ISAPIDoneEvent=0;
-    connTable[i].isapi=0;         
+    connTable[i].isapi=0;
   }
-  InitializeCriticalSection(&GetTableEntryCritSec);  
+  InitializeCriticalSection(&GetTableEntryCritSec);
   initialized=1;
 #endif
   return 0;
 }
 
 /*!
- *Cleanup the memory used by ISAPI.
+ * Cleanup the memory used by ISAPI.
  */
 int Isapi::unLoad()
 {
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp 
b/myserver/src/http_handler/mscgi/mscgi.cpp
index e479b0b..c51ba45 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -101,7 +101,7 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, 
const char* cmdLine,
                                                                       &nbw,
                                                                       1))
     {
-      td->connection->host->warningsLogWrite ("MSCGI: Error loading filters");
+      td->connection->host->warningsLogWrite (_("MSCGI: internal error"));
       chain.clearAllFilters ();
       return td->http->raiseHTTPError (500);
     }
@@ -112,12 +112,8 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, 
const char* cmdLine,
 
   if (ret)
     {
-      string msg;
-      msg.assign ("MSCGI: cannot load ");
-      msg.append (exec);
-      td->connection->host->warningsLogWrite (msg.c_str ());
+      td->connection->host->warningsLogWrite (_("MSCGI: cannot load %s"), 
exec);
       chain.clearAllFilters ();
-
       /* Internal server error.  */
       return td->http->raiseHTTPError (500);
     }
@@ -129,10 +125,7 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, 
const char* cmdLine,
     (ProcMain)(td->request.uriOpts.c_str (), &data);
   else
     {
-      string msg;
-      msg.assign ("MSCGI: error accessing entrypoint for ");
-      msg.append (exec);
-      td->connection->host->warningsLogWrite (msg.c_str ());
+      td->connection->host->warningsLogWrite (_("MSCGI: cannot find 
entry-point for %s"), exec);
       return td->http->raiseHTTPError (500);
     }
   hinstLib.close ();
diff --git a/myserver/src/http_handler/proxy/proxy.cpp 
b/myserver/src/http_handler/proxy/proxy.cpp
index 6ea0968..64256de 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -62,9 +62,7 @@ int Proxy::send (HttpThreadContext *td,
 
   if (destUrl.getProtocol ().compare ("http") && destUrl.getProtocol 
().compare ("HTTP"))
     {
-      ostringstream msg;
-      msg << "Proxy: " << destUrl.getProtocol () << " is not a known 
protocol.";
-      td->connection->host->warningsLogWrite (msg.str ().c_str ());
+      td->connection->host->warningsLogWrite ("Proxy: %s is not a known 
protocol", destUrl.getProtocol ());
       return 0;
     }
 
diff --git a/myserver/src/http_handler/scgi/scgi.cpp 
b/myserver/src/http_handler/scgi/scgi.cpp
index 28e944c..216e962 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -71,18 +71,18 @@ int Scgi::send(HttpThreadContext* td, const char* 
scriptpath,
   chain.setProtocol(td->http);
   chain.setProtocolData(td);
   chain.setStream(td->connection->socket);
-  if(td->mime)
+  if (td->mime)
   {
     u_long nbw;
-    if(td->mime && Server::getInstance()->getFiltersFactory()->chain(&chain,
+    if (td->mime && Server::getInstance()->getFiltersFactory ()->chain(&chain,
                                                     td->mime->filters,
                                                     td->connection->socket,
-                                                    &nbw, 
+                                                    &nbw,
                                                     1))
     {
-      td->connection->host->warningsLogWrite("SCGI: Error loading filters");
+      td->connection->host->warningsLogWrite(_("SCGI: internal error"));
       chain.clearAllFilters();
-      return td->http->raiseHTTPError(500);
+      return td->http->raiseHTTPError (500);
     }
   }
 
@@ -95,11 +95,11 @@ int Scgi::send(HttpThreadContext* td, const char* 
scriptpath,
     int subString = cgipath[0] == '"';
     int len = strlen(cgipath);
     string tmpCgiPath;
-    for(i = 1; i < len; i++)
+    for (i = 1; i < len; i++)
     {
-      if(!subString && cgipath[i]==' ')
+      if (!subString && cgipath[i]==' ')
         break;
-      if(cgipath[i] == '"' && cgipath[i - 1] != '\\')
+      if (cgipath[i] == '"' && cgipath[i - 1] != '\\')
         subString = !subString;
     }
     /*!
@@ -108,15 +108,15 @@ int Scgi::send(HttpThreadContext* td, const char* 
scriptpath,
      *If the cgipath is enclosed between " and " do not consider them
      *when splitting directory and file name.
      */
-    if(len)
+    if (len)
     {
-      if(i < len)
+      if (i < len)
       {
         string tmpString(cgipath);
         int begin = tmpString[0]=='"' ? 1: 0;
         int end = tmpString[i] == '"' ? i - 1: i;
-        tmpCgiPath.assign(tmpString.substr(begin, end - begin));
-        moreArg.assign(tmpString.substr(i, len - 1));
+        tmpCgiPath.assign(tmpString.substr (begin, end - begin));
+        moreArg.assign(tmpString.substr (i, len - 1));
       }
       else
       {
@@ -131,9 +131,9 @@ int Scgi::send(HttpThreadContext* td, const char* 
scriptpath,
     FilesUtility::splitPath(tmpCgiPath, td->scriptDir, td->scriptFile);
   }
 
-  if(execute)
+  if (execute)
   {
-    if(cgipath && strlen(cgipath))
+    if (cgipath && strlen(cgipath))
     {
 #ifdef WIN32
       {
@@ -142,13 +142,13 @@ int Scgi::send(HttpThreadContext* td, const char* 
scriptpath,
         int len = strlen(cgipath);
         int subString = cgipath[0] == '"';
 
-        cmdLine << "\"" << td->cgiRoot << "/" << td->cgiFile << "\" " 
+        cmdLine << "\"" << td->cgiRoot << "/" << td->cgiFile << "\" "
                 << moreArg << " \"" <<  td->filenamePath << "\"";
       }
 #else
        cmdLine << cgipath << " " << td->filenamePath;
 #endif
-    }/*if(execute).  */
+    }/*if (execute).  */
     else
     {
       cmdLine << scriptpath;
@@ -164,61 +164,46 @@ int Scgi::send(HttpThreadContext* td, const char* 
scriptpath,
 #endif
   }
 
-  Env::buildEnvironmentString(td, td->buffer->getBuffer());
-  sizeEnvString = buildScgiEnvironmentString(td,td->buffer->getBuffer(),
-                                             td->secondaryBuffer->getBuffer());
-  if(sizeEnvString == -1)
+  Env::buildEnvironmentString(td, td->buffer->getBuffer ());
+  sizeEnvString = buildScgiEnvironmentString(td,td->buffer->getBuffer (),
+                                             td->secondaryBuffer->getBuffer 
());
+  if (sizeEnvString == -1)
   {
-    td->buffer->setLength(0);
-    if(Server::getInstance()->getVerbosity() > 2)
-    {
-      *td->buffer << "SCGI: Error to build env string" << '\0';
-      td->connection->host->warningsLogWrite(td->buffer->getBuffer());
-    }
+    td->connection->host->warningsLogWrite(_("SCGI: internal error"));
     chain.clearAllFilters();
-    return td->http->raiseHTTPError(500);
+    return td->http->raiseHTTPError (500);
   }
   td->inputData.close();
-  if(td->inputData.openFile(td->inputDataPath, File::READ | 
+  if (td->inputData.openFile(td->inputDataPath, File::READ |
                             File::FILE_OPEN_ALWAYS |
                             File::NO_INHERIT))
   {
-    td->buffer->setLength(0);
-    if(Server::getInstance()->getVerbosity() > 2)
-    {
-      *td->buffer << "SCGI: Error opening stdin file" << '\0';
-      td->connection->host->warningsLogWrite(td->buffer->getBuffer());
-    }
+    td->connection->host->warningsLogWrite(_("SCGI: internal error"));
     chain.clearAllFilters();
-    return td->http->raiseHTTPError(500);
+    return td->http->raiseHTTPError (500);
   }
 
-  server = connect(&con, cmdLine.str().c_str());
+  server = connect(&con, cmdLine.str ().c_str ());
 
-  if(server == 0)
+  if (server == 0)
   {
-    td->buffer->setLength(0);
-    if(Server::getInstance()->getVerbosity() > 2)
-    {
-      *td->buffer << "SCGI: Error connecting to SCGI "
-                  << cmdLine.str().c_str() << " process" << '\0';
-      td->connection->host->warningsLogWrite(td->buffer->getBuffer());
-    }
+    td->connection->host->warningsLogWrite(_("SCGI: error connecting to the 
process %s"),
+                                           cmdLine.str ().c_str ());
     chain.clearAllFilters();
-    return td->http->raiseHTTPError(500);
+    return td->http->raiseHTTPError (500);
   }
-  ret = sendNetString(&con, td->secondaryBuffer->getBuffer(), sizeEnvString);
-  
-  if(td->request.contentLength.size() && 
+  ret = sendNetString(&con, td->secondaryBuffer->getBuffer (), sizeEnvString);
+
+  if (td->request.contentLength.size() &&
      !td->request.contentLength.compare("0"))
   {
-    if(sendPostData(&con))
+    if (sendPostData(&con))
      {
       chain.clearAllFilters();
-      return td->http->raiseHTTPError(500);
+      return td->http->raiseHTTPError (500);
     }
   }
-  
+
   ret = !sendResponse(&con, onlyHeader, &chain);
 
 
@@ -247,96 +232,96 @@ int Scgi::sendResponse(ScgiContext* ctx, int onlyHeader, 
FiltersChain* chain)
 
   checkDataChunks(td, &keepalive, &useChunks);
 
-  for(;;)
+  for (;;)
   {
     while(!ctx->sock.bytesToRead())
     {
-      if((clock_t)(getTicks() - initialTicks) > td->http->getTimeout ())
+      if ((clock_t)(getTicks() - initialTicks) > td->http->getTimeout ())
         break;
       Thread::wait(1);
     }
 
-    if(!ctx->sock.bytesToRead())
+    if (!ctx->sock.bytesToRead())
       return -1;
 
-    nbr = ctx->sock.recv(td->secondaryBuffer->getBuffer() + read,
+    nbr = ctx->sock.recv(td->secondaryBuffer->getBuffer () + read,
                         td->secondaryBuffer->getRealLength() - read,
                          td->http->getTimeout ());
 
     read += nbr;
 
 
-    for(tmpHeaderSize = (tmpHeaderSize > 3) 
+    for (tmpHeaderSize = (tmpHeaderSize > 3)
           ? tmpHeaderSize - 4 : tmpHeaderSize;
         tmpHeaderSize < read - 4; tmpHeaderSize++)
-      if((td->secondaryBuffer->getBuffer()[tmpHeaderSize] == '\r') &&
-         (td->secondaryBuffer->getBuffer()[tmpHeaderSize + 1] == '\n') &&
-         (td->secondaryBuffer->getBuffer()[tmpHeaderSize + 2] == '\r') &&
-         (td->secondaryBuffer->getBuffer()[tmpHeaderSize + 3] == '\n'))
+      if ((td->secondaryBuffer->getBuffer ()[tmpHeaderSize] == '\r') &&
+         (td->secondaryBuffer->getBuffer ()[tmpHeaderSize + 1] == '\n') &&
+         (td->secondaryBuffer->getBuffer ()[tmpHeaderSize + 2] == '\r') &&
+         (td->secondaryBuffer->getBuffer ()[tmpHeaderSize + 3] == '\n'))
       {
         headerSize = tmpHeaderSize + 4;
         break;
       }
-    if(headerSize)
+    if (headerSize)
       break;
   }
 
 
-  if(!td->appendOutputs)
+  if (!td->appendOutputs)
   {
-    if(headerSize)
+    if (headerSize)
     {
-      
HttpHeaders::buildHTTPResponseHeaderStruct(td->secondaryBuffer->getBuffer(),
-                                                 &td->response, 
+      
HttpHeaders::buildHTTPResponseHeaderStruct(td->secondaryBuffer->getBuffer (),
+                                                 &td->response,
                                                  &(td->nBytesToRead));
     }
-    u_long hdrLen = 
HttpHeaders::buildHTTPResponseHeader(td->buffer->getBuffer(),
+    u_long hdrLen = HttpHeaders::buildHTTPResponseHeader 
(td->buffer->getBuffer (),
                                                          &td->response);
-    
-    if(chain->write(td->buffer->getBuffer(), hdrLen, &nbw))
+
+    if (chain->write(td->buffer->getBuffer (), hdrLen, &nbw))
       return -1;
   }
 
-  if(read - headerSize)
-    if(appendDataToHTTPChannel(td, td->secondaryBuffer->getBuffer() + 
headerSize,
+  if (read - headerSize)
+    if (appendDataToHTTPChannel(td, td->secondaryBuffer->getBuffer () + 
headerSize,
                                read - headerSize,
-                               &(td->outputData), 
+                               &(td->outputData),
                                chain,
-                               td->appendOutputs, 
+                               td->appendOutputs,
                                useChunks))
      return -1;
-  
+
   sentData += read - headerSize;
 
   if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
   {
-    for(;;)
+    for (;;)
     {
-      nbr = ctx->sock.recv(td->secondaryBuffer->getBuffer(),
+      nbr = ctx->sock.recv(td->secondaryBuffer->getBuffer (),
                            td->secondaryBuffer->getRealLength(),
                            0);
-      
-      if(!nbr || (nbr == (u_long)-1))
+
+      if (!nbr || (nbr == (u_long)-1))
         break;
 
-      if(appendDataToHTTPChannel(td, td->secondaryBuffer->getBuffer(),
+      if (appendDataToHTTPChannel(td, td->secondaryBuffer->getBuffer (),
                                  nbr,
-                                 &(td->outputData), 
+                                 &(td->outputData),
                                  chain,
-                                 td->appendOutputs, 
+                                 td->appendOutputs,
                                  useChunks))
         return -1;
-      
+
       sentData += nbr;
     }
-    
-    if(!td->appendOutputs && useChunks)
+
+    if (!td->appendOutputs && useChunks)
     {
-      if(chain->getStream ()->write("0\r\n\r\n", 5, &nbw))
+      if (chain->getStream ()->write("0\r\n\r\n", 5, &nbw))
         return -1;
     }
   }
-  /* For logging activity.  */  
+  /* For logging activity.  */
   td->sentData += sentData;
 
   return 0;
@@ -348,15 +333,15 @@ int Scgi::sendResponse(ScgiContext* ctx, int onlyHeader, 
FiltersChain* chain)
 int Scgi::sendNetString(ScgiContext* ctx, const char* data, int len)
 {
   char header[7];
-  int headerLen = sprintf(header, "%i:", len);
+  int headerLen = sprintf (header, "%i:", len);
 
-  if(ctx->sock.send(header, headerLen, 0) == -1)
+  if (ctx->sock.send(header, headerLen, 0) == -1)
     return -1;
 
-  if(ctx->sock.send(data, len, 0) == -1)
+  if (ctx->sock.send(data, len, 0) == -1)
     return -1;
 
-  if(ctx->sock.send(",", 1, 0) == -1)
+  if (ctx->sock.send(",", 1, 0) == -1)
     return -1;
 
   return 0;
@@ -370,15 +355,15 @@ int Scgi::sendPostData(ScgiContext* ctx)
     u_long nbr;
     do
     {
-      if(ctx->td->inputData.read(ctx->td->secondaryBuffer->getBuffer(),
-                                         
ctx->td->secondaryBuffer->getRealLength(), 
+      if (ctx->td->inputData.read(ctx->td->secondaryBuffer->getBuffer (),
+                                         
ctx->td->secondaryBuffer->getRealLength(),
                                          &nbr))
       {
         return -1;
       }
 
-      if(nbr && (ctx->sock.send(ctx->td->secondaryBuffer->getBuffer(), nbr, 0) 
== -1))
-      { 
+      if (nbr && (ctx->sock.send(ctx->td->secondaryBuffer->getBuffer (), nbr, 
0) == -1))
+      {
         return -1;
       }
     }
@@ -397,25 +382,25 @@ int Scgi::buildScgiEnvironmentString(HttpThreadContext* 
td, char* src,
   char *sptr = src;
   char varName[100];
   char varValue[2500];
-  
-  ptr += myserver_strlcpy(ptr, "CONTENT_LENGTH", 15);
+
+  ptr += myserver_strlcpy (ptr, "CONTENT_LENGTH", 15);
   *ptr++ = '\0';
 
-  if( td->request.contentLength.size())
-    ptr += myserver_strlcpy(ptr, td->request.contentLength.c_str(),  
+  if ( td->request.contentLength.size())
+    ptr += myserver_strlcpy (ptr, td->request.contentLength.c_str (),
                             td->request.contentLength.size() + 1);
   else
     *ptr++ = '0';
-    
+
   *ptr++ = '\0';
 
-  ptr += myserver_strlcpy(ptr, "SCGI", 5);
+  ptr += myserver_strlcpy (ptr, "SCGI", 5);
   *ptr++ = '\0';
 
-  ptr += myserver_strlcpy(ptr, "1", 2);
+  ptr += myserver_strlcpy (ptr, "1", 2);
   *ptr++ = '\0';
 
-  for(;;)
+  for (;;)
   {
     int i;
     int max = 100;
@@ -434,7 +419,7 @@ int Scgi::buildScgiEnvironmentString(HttpThreadContext* td, 
char* src,
       varName[varNameLen++] = *sptr++;
       varName[varNameLen] = '\0';
     }
-    if(max == 0)
+    if (max == 0)
       return -1;
     sptr++;
     max = 2500;
@@ -444,22 +429,22 @@ int Scgi::buildScgiEnvironmentString(HttpThreadContext* 
td, char* src,
       varValue[varValueLen] = '\0';
     }
 
-    if(max == 0)
+    if (max == 0)
       return -1;
 
-    if(!strcmpi(varName, "CONTENT_LENGTH") || !strcmpi(varName, "SCGI") ||
+    if (!strcmpi(varName, "CONTENT_LENGTH") || !strcmpi(varName, "SCGI") ||
        !varNameLen || !varValueLen)
       continue;
 
-    for(i = 0; i < varNameLen; i++)
+    for (i = 0; i < varNameLen; i++)
       *ptr++ = varName[i];
     *ptr++ = '\0';
 
-    for(i = 0; i < varValueLen; i++)
+    for (i = 0; i < varValueLen; i++)
       *ptr++ = varValue[i];
     *ptr++ = '\0';
 
-    if(*(++sptr) == '\0')
+    if (*(++sptr) == '\0')
       break;
   }
   return static_cast<int>(ptr - dest);
@@ -478,10 +463,10 @@ Scgi::Scgi()
  */
 int Scgi::load ()
 {
-  if(initialized)
+  if (initialized)
     return 1;
   initialized = 1;
-  processServerManager = Server::getInstance()->getProcessServerManager();
+  processServerManager = Server::getInstance()->getProcessServerManager ();
   processServerManager->createDomain(SERVERS_DOMAIN);
   return 0;
 }
@@ -501,7 +486,7 @@ int Scgi::unLoad()
  */
 ScgiServer* Scgi::isScgiServerRunning(const char* path)
 {
-  return processServerManager->getServer(SERVERS_DOMAIN, path);
+  return processServerManager->getServer (SERVERS_DOMAIN, path);
 }
 
 
@@ -510,15 +495,15 @@ ScgiServer* Scgi::isScgiServerRunning(const char* path)
  */
 ScgiServer* Scgi::connect(ScgiContext* con, const char* path)
 {
-  ScgiServer* server = runScgiServer(con, path);
+  ScgiServer* server = runScgiServer (con, path);
   /*!
    *If we find a valid server try the connection to it.
    */
-  if(server)
+  if (server)
   {
     int ret = processServerManager->connect(&(con->sock), server);
 
-    if(ret == -1)
+    if (ret == -1)
       return 0;
   }
   return server;
@@ -526,27 +511,27 @@ ScgiServer* Scgi::connect(ScgiContext* con, const char* 
path)
 
 /*!
  *Run the SCGI server.
- *If the path starts with a @ character, the path is handled as a 
+ *If the path starts with a @ character, the path is handled as a
  *remote server.
  */
-ScgiServer* Scgi::runScgiServer(ScgiContext* context, 
+ScgiServer* Scgi::runScgiServer (ScgiContext* context,
                                 const char* path)
 {
   /* This method needs a better home (and maybe better code).
    * Compute a simple hash from the IP address.  */
-  const char *ip = context->td->connection->getIpAddr();
+  const char *ip = context->td->connection->getIpAddr ();
   int seed = 13;
   for (const char *c = ip; *c; c++)
     seed = *c * 21 + seed;
 
-  ScgiServer* server =  processServerManager->getServer(SERVERS_DOMAIN, 
+  ScgiServer* server =  processServerManager->getServer (SERVERS_DOMAIN,
                                                         path,
                                                         seed);
-  if(server)
+  if (server)
     return server;
 
   /* If the path starts with @ then the server is remote.  */
-  if(path[0] == '@')
+  if (path[0] == '@')
   {
     int i = 1;
     char host[128];
@@ -555,13 +540,13 @@ ScgiServer* Scgi::runScgiServer(ScgiContext* context,
     while(path[i] && path[i] != ':')
       i++;
 
-    myserver_strlcpy(host, &path[1], min(128, i));
+    myserver_strlcpy (host, &path[1], min(128, i));
+
+    myserver_strlcpy (port, &path[i + 1], 6);
 
-    myserver_strlcpy(port, &path[i + 1], 6);
-    
-    return processServerManager->addRemoteServer(SERVERS_DOMAIN, path, 
+    return processServerManager->addRemoteServer (SERVERS_DOMAIN, path,
                                                  host, atoi(port));
   }
 
-  return processServerManager->runAndAddServer(SERVERS_DOMAIN, path);
+  return processServerManager->runAndAddServer (SERVERS_DOMAIN, path);
 }
diff --git a/myserver/src/http_handler/wincgi/wincgi.cpp 
b/myserver/src/http_handler/wincgi/wincgi.cpp
index 99f192f..970c2da 100644
--- a/myserver/src/http_handler/wincgi/wincgi.cpp
+++ b/myserver/src/http_handler/wincgi/wincgi.cpp
@@ -28,10 +28,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 #include <include/filter/filters_chain.h>
 #include <include/base/safetime/safetime.h>
 
-extern "C" 
+extern "C"
 {
 #ifdef WIN32
-#include <direct.h>
+# include <direct.h>
 #endif
 #include <string.h>
 }
@@ -42,26 +42,26 @@ using namespace std;
 
 
 /*!
- *Constructor for the wincgi class.
+ * Constructor for the wincgi class.
  */
-WinCgi::WinCgi()
+WinCgi::WinCgi ()
 {
 
 }
 
 /*!
- *Destructor for the wincgi class.
+ * Destructor for the wincgi class.
  */
-WinCgi::~WinCgi()
+WinCgi::~WinCgi ()
 {
 
 }
 
 /*!
- *Send the WinCGI data.
+ * Send the WinCGI data.
  */
-int WinCgi::send(HttpThreadContext* td, const char* scriptpath,
-                 const char *cgipath, bool /*execute*/, bool onlyHeader)
+int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
+                  const char *cgipath, bool /*execute*/, bool onlyHeader)
 {
 #ifdef WIN32
   FiltersChain chain;
@@ -75,7 +75,7 @@ int WinCgi::send(HttpThreadContext* td, const char* 
scriptpath,
   time_t ltime = 100;
   int gmhour;
   int bias;
-  
+
   int ret;
   char execname[MAX_PATH];/*! Use MAX_PATH under windows. */
   char pathname[MAX_PATH];/*! Use MAX_PATH under windows. */
@@ -86,163 +86,163 @@ int WinCgi::send(HttpThreadContext* td, const char* 
scriptpath,
   ostringstream stream;
 
   if (!(td->permissions & MYSERVER_PERMISSION_EXECUTE))
-    return td->http->sendAuth();
+    return td->http->sendAuth ();
 
-  if(!FilesUtility::fileExists(scriptpath))
-    return td->http->raiseHTTPError(404);
+  if (!FilesUtility::fileExists (scriptpath))
+    return td->http->raiseHTTPError (404);
 
   FilesUtility::splitPath(scriptpath, pathname, execname);
-  
+
   getdefaultwd(dataFilePath,MAX_PATH);
-  GetShortPathName(dataFilePath,dataFilePath,MAX_PATH);
-  sprintf(&dataFilePath[strlen(dataFilePath)],"/data_%u.ini",td->id);
-  
-  strcpy(outFilePath,td->outputDataPath.c_str());
+  GetShortPathName (dataFilePath,dataFilePath,MAX_PATH);
+  sprintf (&dataFilePath[strlen(dataFilePath)],"/data_%u.ini",td->id);
+
+  strcpy (outFilePath,td->outputDataPath.c_str ());
   strcat(outFilePath,"WC");
   td->inputData.seek (0);
 
   chain.setProtocol(td->http);
   chain.setProtocolData(td);
   chain.setStream(td->connection->socket);
-  if(td->mime)
-  {
-    u_long nbw2;
-    if(td->mime && Server::getInstance()->getFiltersFactory()->chain(&chain, 
-                                                 td->mime->filters, 
-                                                 td->connection->socket, 
&nbw2, 1))
-      {
-        td->connection->host->warningsLogWrite("WinCGI: Error loading 
filters");
-        chain.clearAllFilters(); 
-        return td->http->raiseHTTPError(500);
-      }
-  }
-  
+  if (td->mime)
+    {
+      u_long nbw2;
+      if (td->mime && Server::getInstance ()->getFiltersFactory 
()->chain(&chain,
+                                                                         
td->mime->filters,
+                                                                         
td->connection->socket, &nbw2, 1))
+        {
+          td->connection->host->warningsLogWrite (_("WinCGI: internal error"));
+          chain.clearAllFilters();
+          return td->http->raiseHTTPError (500);
+        }
+    }
+
 
   /*!
    *The WinCGI protocol uses a .ini file to send data to the new process.
    */
-  ret=DataFileHandle.openFile(dataFilePath,
-                     File::FILE_CREATE_ALWAYS|File::WRITE);
-  if ( ret ) 
-  {
-    td->connection->host->warningsLogWrite("WinCGI: Error creating .ini");
-    return td->http->raiseHTTPError(500);
-  }
+  ret = DataFileHandle.openFile (dataFilePath, File::FILE_CREATE_ALWAYS
+                                 | File::WRITE);
+  if (ret)
+    {
+      td->connection->host->warningsLogWrite (_("WinCGI: internal error"));
+      return td->http->raiseHTTPError (500);
+    }
 
   td->secondaryBuffer->setLength(0);
-  buffer=td->secondaryBuffer->getBuffer();
+  buffer = td->secondaryBuffer->getBuffer ();
 
-  strcpy(buffer, "[CGI]\r\n");
-  DataFileHandle.writeToFile(buffer,7,&nbr);
+  strcpy (buffer, "[CGI]\r\n");
+  DataFileHandle.writeToFile (buffer,7,&nbr);
 
-  strcpy(buffer, "CGI Version=CGI/1.3a WIN\r\n");
-  DataFileHandle.writeToFile(buffer,26,&nbr);
+  strcpy (buffer, "CGI Version=CGI/1.3a WIN\r\n");
+  DataFileHandle.writeToFile (buffer,26,&nbr);
 
-  *td->secondaryBuffer << "Server Admin=" << 
+  *td->secondaryBuffer << "Server Admin=" <<
     td->securityToken.getHashedData ("server.admin", MYSERVER_VHOST_CONF |
                                      MYSERVER_SERVER_CONF, "")<< "\r\n";
-  DataFileHandle.writeToFile(buffer,td->secondaryBuffer->getLength(),&nbr);
+  DataFileHandle.writeToFile (buffer,td->secondaryBuffer->getLength(),&nbr);
 
   {
-    if(td->request.isKeepAlive())
-    {
-      strcpy(buffer,"Request Keep-Alive=No\r\n");
-      DataFileHandle.writeToFile(buffer, 23, &nbr);
-    }
+    if (td->request.isKeepAlive ())
+      {
+        strcpy (buffer,"Request Keep-Alive=No\r\n");
+        DataFileHandle.writeToFile (buffer, 23, &nbr);
+      }
     else
-    {
-      strcpy(buffer,"Request Keep-Alive=Yes\r\n");
-      DataFileHandle.writeToFile(buffer, 24, &nbr);
-    }
+      {
+        strcpy (buffer,"Request Keep-Alive=Yes\r\n");
+        DataFileHandle.writeToFile (buffer, 24, &nbr);
+      }
   }
 
   td->secondaryBuffer->setLength(0);
   *td->secondaryBuffer << "Request Method=" << td->request.cmd << "\r\n";
-  DataFileHandle.writeToFile(buffer, td->secondaryBuffer->getLength(), &nbr);
+  DataFileHandle.writeToFile (buffer, td->secondaryBuffer->getLength(), &nbr);
 
   td->secondaryBuffer->setLength(0);
   *td->secondaryBuffer << "Request Protocol=HTTP/" << td->request.ver << 
"\r\n";
-  DataFileHandle.writeToFile(buffer, td->secondaryBuffer->getLength(), &nbr);
+  DataFileHandle.writeToFile (buffer, td->secondaryBuffer->getLength(), &nbr);
 
-   td->secondaryBuffer->setLength(0);  
+  td->secondaryBuffer->setLength(0);
   *td->secondaryBuffer << "Executable Path=" << execname << "\r\n";
-  DataFileHandle.writeToFile(buffer,td->secondaryBuffer->getLength(),&nbr);
+  DataFileHandle.writeToFile (buffer,td->secondaryBuffer->getLength(),&nbr);
 
-  if(td->request.uriOpts[0])
-  {
-    sprintf(buffer, "Query String=%s\r\n", td->request.uriOpts.c_str());
-    DataFileHandle.writeToFile(buffer,(u_long)strlen(buffer), &nbr);
-  }
+  if (td->request.uriOpts[0])
+    {
+      sprintf (buffer, "Query String=%s\r\n", td->request.uriOpts.c_str ());
+      DataFileHandle.writeToFile (buffer,(u_long)strlen(buffer), &nbr);
+    }
 
   {
     HttpRequestHeader::Entry *referer = td->request.other.get("Referer");
 
-    if(referer && referer->value->length())
-    {
-      sprintf(buffer,"Referer=%s\r\n", referer->value->c_str());
-      DataFileHandle.writeToFile(buffer,(u_long)strlen(buffer),&nbr);
-    }
+    if (referer && referer->value->length())
+      {
+        sprintf (buffer,"Referer=%s\r\n", referer->value->c_str ());
+        DataFileHandle.writeToFile (buffer,(u_long)strlen(buffer),&nbr);
+      }
   }
 
   {
     HttpRequestHeader::Entry *contentType = 
td->request.other.get("Content-Type");
 
-    if(contentType && contentType->value->length())
-    {
-      sprintf(buffer, "Content Type=%s\r\n", contentType->value->c_str());
-      DataFileHandle.writeToFile(buffer, (u_long)strlen(buffer), &nbr);
-    }
+    if (contentType && contentType->value->length())
+      {
+        sprintf (buffer, "Content Type=%s\r\n", contentType->value->c_str ());
+        DataFileHandle.writeToFile (buffer, (u_long)strlen(buffer), &nbr);
+      }
   }
 
   {
     HttpRequestHeader::Entry *userAgent = td->request.other.get("User-Agent");
-    
-    if(userAgent && userAgent->value->length())
-    {
-      sprintf(buffer,"User Agent=%s\r\n", userAgent->value->c_str());
-      DataFileHandle.writeToFile(buffer, (u_long)strlen(buffer), &nbr);
-    }
+
+    if (userAgent && userAgent->value->length())
+      {
+        sprintf (buffer,"User Agent=%s\r\n", userAgent->value->c_str ());
+        DataFileHandle.writeToFile (buffer, (u_long)strlen(buffer), &nbr);
+      }
   }
 
-  sprintf(buffer,"Content File=%s\r\n", td->inputData.getFilename());
-  DataFileHandle.writeToFile(buffer, (u_long)strlen(buffer), &nbr);
+  sprintf (buffer,"Content File=%s\r\n", td->inputData.getFilename ());
+  DataFileHandle.writeToFile (buffer, (u_long)strlen(buffer), &nbr);
 
-  if(td->request.contentLength[0])
-  {
-    sprintf(buffer, "Content Length=%s\r\n", 
-            td->request.contentLength.c_str());
-    DataFileHandle.writeToFile(buffer, (u_long)strlen(buffer), &nbr);
-  }
+  if (td->request.contentLength[0])
+    {
+      sprintf (buffer, "Content Length=%s\r\n",
+              td->request.contentLength.c_str ());
+      DataFileHandle.writeToFile (buffer, (u_long)strlen(buffer), &nbr);
+    }
   else
-  {
-    strcpy(buffer, "Content Length=0\r\n");
-    DataFileHandle.writeToFile(buffer, 18, &nbr);  
-  }
+    {
+      strcpy (buffer, "Content Length=0\r\n");
+      DataFileHandle.writeToFile (buffer, 18, &nbr);
+    }
+
+  strcpy (buffer,"Server Software=MyServer\r\n");
+  DataFileHandle.writeToFile (buffer, 26, &nbr);
 
-  strcpy(buffer,"Server Software=MyServer\r\n");
-  DataFileHandle.writeToFile(buffer, 26, &nbr);
+  sprintf (buffer, "Remote Address=%s\r\n", td->connection->getIpAddr ());
+  DataFileHandle.writeToFile (buffer, (u_long)strlen(buffer), &nbr);
 
-  sprintf(buffer, "Remote Address=%s\r\n", td->connection->getIpAddr());
-  DataFileHandle.writeToFile(buffer, (u_long)strlen(buffer), &nbr);
+  sprintf (buffer, "Server Port=%u\r\n", td->connection->getLocalPort());
+  DataFileHandle.writeToFile (buffer, (u_long)strlen(buffer), &nbr);
 
-  sprintf(buffer, "Server Port=%u\r\n", td->connection->getLocalPort());
-  DataFileHandle.writeToFile(buffer, (u_long)strlen(buffer), &nbr);
-  
   {
     HttpRequestHeader::Entry *host = td->request.other.get("Host");
-    if(host)
-      sprintf(buffer, "Server Name=%s\r\n", host->value->c_str());
-    DataFileHandle.writeToFile(buffer, (u_long)strlen(buffer), &nbr);
+    if (host)
+      sprintf (buffer, "Server Name=%s\r\n", host->value->c_str ());
+    DataFileHandle.writeToFile (buffer, (u_long)strlen(buffer), &nbr);
   }
 
-  strcpy(buffer, "[System]\r\n");
-  DataFileHandle.writeToFile(buffer, 10, &nbr);
+  strcpy (buffer, "[System]\r\n");
+  DataFileHandle.writeToFile (buffer, 10, &nbr);
 
-  sprintf(buffer, "Output File=%s\r\n", outFilePath);
-  DataFileHandle.writeToFile(buffer, (u_long)strlen(buffer), &nbr);
+  sprintf (buffer, "Output File=%s\r\n", outFilePath);
+  DataFileHandle.writeToFile (buffer, (u_long)strlen(buffer), &nbr);
 
-  sprintf(buffer,"Content File=%s\r\n", td->inputData.getFilename());
-  DataFileHandle.writeToFile(buffer, (u_long)strlen(buffer), &nbr);
+  sprintf (buffer,"Content File=%s\r\n", td->inputData.getFilename ());
+  DataFileHandle.writeToFile (buffer, (u_long)strlen(buffer), &nbr);
 
   /*
    *Compute the local offset from the GMT time
@@ -250,35 +250,34 @@ int WinCgi::send(HttpThreadContext* td, const char* 
scriptpath,
   {
     tm tmpTm;
     ltime = 100;
-    gmhour = myserver_gmtime( &ltime, &tmpTm)->tm_hour;
-    bias = myserver_localtime(&ltime, &tmpTm)->tm_hour - gmhour;
+    gmhour = myserver_gmtime ( &ltime, &tmpTm)->tm_hour;
+    bias = myserver_localtime (&ltime, &tmpTm)->tm_hour - gmhour;
   }
-  sprintf(buffer, "GMT Offset=%i\r\n", bias);
-  DataFileHandle.writeToFile(buffer, (u_long)strlen(buffer), &nbr);
+  sprintf (buffer, "GMT Offset=%i\r\n", bias);
+  DataFileHandle.writeToFile (buffer, (u_long)strlen(buffer), &nbr);
 
-  sprintf(buffer, "Debug Mode=No\r\n", bias);
-  DataFileHandle.writeToFile(buffer, 15, &nbr);
+  sprintf (buffer, "Debug Mode=No\r\n", bias);
+  DataFileHandle.writeToFile (buffer, 15, &nbr);
 
-  DataFileHandle.close();
+  DataFileHandle.close ();
 
   /*
    *Create the out file.
    */
-  if(!FilesUtility::fileExists(outFilePath))
-  {
-    ret = OutFileHandle.openFile(outFilePath, File::FILE_CREATE_ALWAYS);
-    if (ret)
+  if (!FilesUtility::fileExists(outFilePath))
     {
-      td->connection->host->warningsLogWrite(
-                                      "WinCGI: Error creating output file");
-      DataFileHandle.close();
-      FilesUtility::deleteFile(outFilePath);
-      FilesUtility::deleteFile(dataFilePath);
-      chain.clearAllFilters(); 
-      return td->http->raiseHTTPError(500);
+      ret = OutFileHandle.openFile (outFilePath, File::FILE_CREATE_ALWAYS);
+      if (ret)
+        {
+          td->connection->host->warningsLogWrite (_("WinCGI: internal error"));
+          DataFileHandle.close ();
+          FilesUtility::deleteFile (outFilePath);
+          FilesUtility::deleteFile (dataFilePath);
+          chain.clearAllFilters();
+          return td->http->raiseHTTPError (500);
+        }
     }
-  }
-  OutFileHandle.close();
+  OutFileHandle.close ();
   spi.cmdLine.assign("cmd /c \"");
   spi.cmdLine.append(scriptpath);
   spi.cmdLine.append("\" ");
@@ -286,57 +285,55 @@ int WinCgi::send(HttpThreadContext* td, const char* 
scriptpath,
   spi.cwd.assign(pathname);
   spi.envString = 0;
   if (proc.exec (&spi, true))
-  {
-    ostringstream msg;
-    msg << "WinCGI: Error executing process " << scriptpath;
-    td->connection->host->warningsLogWrite(msg.str().c_str());
-
-    FilesUtility::deleteFile(outFilePath);
-    FilesUtility::deleteFile(dataFilePath);
-    chain.clearAllFilters();
-    return td->http->raiseHTTPError(500);
-  }
+    {
+      td->connection->host->warningsLogWrite (_("WinCGI: error executing %s"), 
scriptpath);
 
-  ret=OutFileHandle.openFile(outFilePath, File::FILE_OPEN_ALWAYS|
-                             File::READ);
+      FilesUtility::deleteFile (outFilePath);
+      FilesUtility::deleteFile (dataFilePath);
+      chain.clearAllFilters();
+      return td->http->raiseHTTPError (500);
+    }
+
+  ret=OutFileHandle.openFile (outFilePath, File::FILE_OPEN_ALWAYS|
+                              File::READ);
   if (ret)
-  {
-    ostringstream msg;
-    msg << "WinCGI: Error opening output file " << outFilePath;
-    td->connection->host->warningsLogWrite(msg.str().c_str());
-    chain.clearAllFilters();
-    return td->http->raiseHTTPError(500);
-  }
+    {
+      ostringstream msg;
+      msg << "WinCGI: Error opening output file " << outFilePath;
+      td->connection->host->warningsLogWrite (msg.str ().c_str ());
+      chain.clearAllFilters();
+      return td->http->raiseHTTPError (500);
+    }
   OutFileHandle.read(buffer,td->secondaryBuffer->getRealLength(),&nBytesRead);
-  if(!nBytesRead)
-  {
-    ostringstream msg;
-    msg << "WinCGI: Error zero bytes read from the WinCGI output file " 
-        << outFilePath;
-    td->connection->host->warningsLogWrite(msg.str().c_str());
-    OutFileHandle.close();
-    FilesUtility::deleteFile(outFilePath);
-    FilesUtility::deleteFile(dataFilePath);
-    chain.clearAllFilters();
-    return td->http->raiseHTTPError(500);
-  }
+  if (!nBytesRead)
+    {
+      ostringstream msg;
+      msg << "WinCGI: Error zero bytes read from the WinCGI output file "
+          << outFilePath;
+      td->connection->host->warningsLogWrite (msg.str ().c_str ());
+      OutFileHandle.close ();
+      FilesUtility::deleteFile (outFilePath);
+      FilesUtility::deleteFile (dataFilePath);
+      chain.clearAllFilters();
+      return td->http->raiseHTTPError (500);
+    }
 
-  for(u_long i = 0; i < nBytesRead; i++)
-  {
-    if((buffer[i] == '\r') && (buffer[i+1] == '\n')
-       &&(buffer[i+2] == '\r') && (buffer[i+3] == '\n'))
+  for (u_long i = 0; i < nBytesRead; i++)
     {
-      /*
-       *The HTTP header ends with a \r\n\r\n sequence so
-       *determinate where it ends and set the header size
-       *to i + 4.
-       */
-      headerSize = i + 4;
-      break;
+      if ((buffer[i] == '\r') && (buffer[i+1] == '\n')
+         &&(buffer[i+2] == '\r') && (buffer[i+3] == '\n'))
+        {
+          /*
+           *The HTTP header ends with a \r\n\r\n sequence so
+           *determinate where it ends and set the header size
+           *to i + 4.
+           */
+          headerSize = i + 4;
+          break;
+        }
     }
-  }
 
-  if(td->request.isKeepAlive())
+  if (td->request.isKeepAlive ())
     td->response.connection.assign("keep-alive");
 
   HttpHeaders::buildHTTPResponseHeaderStruct(buffer, &td->response, 
&(td->nBytesToRead));
@@ -344,115 +341,114 @@ int WinCgi::send(HttpThreadContext* td, const char* 
scriptpath,
   /*
    *Always specify the size of the HTTP contents.
    */
-  stream << OutFileHandle.getFileSize() - headerSize;
-  td->response.contentLength.assign(stream.str());
-  if(!td->appendOutputs)
-  {
-    u_long nbw2;
-    /*!
-     *Send the header if it is not appending.
-     */
-    u_long hdrLen = 
HttpHeaders::buildHTTPResponseHeader(td->buffer->getBuffer(),
-                                                         &td->response);
-    if(chain.getStream ()->write((const char*)td->buffer->getBuffer(),
-                                 hdrLen,
-                                 &nbw2))
-    {
-      OutFileHandle.close();
-      FilesUtility::deleteFile(outFilePath);
-      FilesUtility::deleteFile(dataFilePath);
-      chain.clearAllFilters();
-      return 0;
-    }
-      
-    if(onlyHeader)
+  stream << OutFileHandle.getFileSize () - headerSize;
+  td->response.contentLength.assign(stream.str ());
+  if (!td->appendOutputs)
     {
-      OutFileHandle.close();
-      FilesUtility::deleteFile(outFilePath);
-      FilesUtility::deleteFile(dataFilePath);
-      chain.clearAllFilters();
-      return 1;
+      u_long nbw2;
+      /*!
+       *Send the header if it is not appending.
+       */
+      u_long hdrLen = HttpHeaders::buildHTTPResponseHeader 
(td->buffer->getBuffer (),
+                                                            &td->response);
+      if (chain.getStream ()->write ((const char*)td->buffer->getBuffer (),
+                                    hdrLen,
+                                    &nbw2))
+        {
+          OutFileHandle.close ();
+          FilesUtility::deleteFile (outFilePath);
+          FilesUtility::deleteFile (dataFilePath);
+          chain.clearAllFilters();
+          return 0;
+        }
+
+      if (onlyHeader)
+        {
+          OutFileHandle.close ();
+          FilesUtility::deleteFile (outFilePath);
+          FilesUtility::deleteFile (dataFilePath);
+          chain.clearAllFilters();
+          return 1;
+        }
+      /*!
+       *Send other data in the buffer.
+       */
+      chain.write ((char*)(buffer + headerSize), nBytesRead - headerSize,
+                   &nbw2);
+      nbw += nbw2;
     }
-    /*!
-     *Send other data in the buffer.
-     */
-    chain.write((char*)(buffer + headerSize), nBytesRead - headerSize, 
-                &nbw2);
-    nbw += nbw2;
-  }
   else
-  {
-    u_long nbw2;
-    HttpHeaders::buildHTTPResponseHeader(td->buffer->getBuffer(),
-                                         &td->response);
-    if(onlyHeader)
     {
-      chain.clearAllFilters();
-      return 1;
-    }
+      u_long nbw2;
+      HttpHeaders::buildHTTPResponseHeader (td->buffer->getBuffer (),
+                                            &td->response);
+      if (onlyHeader)
+        {
+          chain.clearAllFilters();
+          return 1;
+        }
 
-    td->outputData.writeToFile((char*)(buffer + headerSize),
-                               nBytesRead - headerSize,
-                               &nbw2);
-    nbw += nbw2;
-  }
+      td->outputData.writeToFile ((char*)(buffer + headerSize),
+                                  nBytesRead - headerSize,
+                                  &nbw2);
+      nbw += nbw2;
+    }
 
   if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
-  {
-    /* Flush the rest of the file.  */
-    do
     {
-      OutFileHandle.read(buffer, td->secondaryBuffer->getLength(), 
-                                 &nBytesRead);
-      if(nBytesRead)
-      {
-        int ret;
-        if(td->appendOutputs)
+      /* Flush the rest of the file.  */
+      do
         {
-          ret = td->outputData.writeToFile(buffer, nBytesRead, &nbw);
-          if(ret)
-          {
-            OutFileHandle.close();
-            FilesUtility::deleteFile(outFilePath);
-            FilesUtility::deleteFile(dataFilePath);
-            chain.clearAllFilters();
-            return 0;
-          }
-        }      
-        else
-        {
-          u_long nbw2;
-          ret = chain.write((char*)buffer, nBytesRead, &nbw2);
-          if(ret == -1)
-          {
-            OutFileHandle.close();
-            FilesUtility::deleteFile(outFilePath);
-            FilesUtility::deleteFile(dataFilePath);
-            chain.clearAllFilters();
-            return 0;
-          }
-        }
-      }
-      else
-        break;
-      
-    }while(nBytesRead);
-  }
+          OutFileHandle.read(buffer, td->secondaryBuffer->getLength(),
+                             &nBytesRead);
+          if (nBytesRead)
+            {
+              int ret;
+              if (td->appendOutputs)
+                {
+                  ret = td->outputData.writeToFile (buffer, nBytesRead, &nbw);
+                  if (ret)
+                    {
+                      OutFileHandle.close ();
+                      FilesUtility::deleteFile (outFilePath);
+                      FilesUtility::deleteFile (dataFilePath);
+                      chain.clearAllFilters();
+                      return 0;
+                    }
+                }
+              else
+                {
+                  u_long nbw2;
+                  ret = chain.write ((char*)buffer, nBytesRead, &nbw2);
+                  if (ret == -1)
+                    {
+                      OutFileHandle.close ();
+                      FilesUtility::deleteFile (outFilePath);
+                      FilesUtility::deleteFile (dataFilePath);
+                      chain.clearAllFilters();
+                      return 0;
+                    }
+                }
+            }
+          else
+            break;
+
+        }while (nBytesRead);
+    }
   td->sentData += nbw;
 
-  chain.clearAllFilters();  
-  OutFileHandle.close();
-  FilesUtility::deleteFile(outFilePath);
-  FilesUtility::deleteFile(dataFilePath);
+  chain.clearAllFilters();
+  OutFileHandle.close ();
+  FilesUtility::deleteFile (outFilePath);
+  FilesUtility::deleteFile (dataFilePath);
   return 1;
 #else
   /*
-   *WinCGI is available only under windows. Raise the right error 
-   *when it is used under another architecture.
+   * WinCGI is available only under windows. Raise the right error
+   * when it is used under another architecture.
    */
-  td->buffer->setLength(0);
-  *td->buffer << "WinCGI: Not implemented";
-  td->connection->host->warningsLogWrite(td->buffer->getBuffer());
-  return td->http->raiseHTTPError(501);
+  td->connection->host->warningsLogWrite(_("WinCGI: not implemented"));
+
+  return td->http->raiseHTTPError (501);
 #endif
 }
diff --git a/myserver/src/protocol/control/control_protocol.cpp 
b/myserver/src/protocol/control/control_protocol.cpp
index 623918c..3f1204d 100755
--- a/myserver/src/protocol/control/control_protocol.cpp
+++ b/myserver/src/protocol/control/control_protocol.cpp
@@ -27,15 +27,14 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 #include <include/base/file/files_utility.h>
 #include <string.h>
 
-extern "C" 
+extern "C"
 {
 #ifdef WIN32
-#include <direct.h>
-#include <errno.h>
-#endif
-#ifndef WIN32
-#include <string.h>
-#include <errno.h>
+# include <direct.h>
+# include <errno.h>
+#else
+# include <string.h>
+# include <errno.h>
 #endif
 }
 #include <string>
@@ -63,15 +62,14 @@ struct ControlProtocolVisitorArg
 };
 
 /*!
- *Returns the name of the protocol. If an out buffer is defined 
+ *Returns the name of the protocol. If an out buffer is defined
  *fullfill it with the name too.
  */
 char* ControlProtocol::registerName (char* out,int len)
 {
   if (out)
-  {
-    strncpy (out,"CONTROL",len);
-  }
+    strncpy (out, "CONTROL", len);
+
   return (char*)"CONTROL";
 }
 
@@ -115,7 +113,7 @@ int ControlProtocol::loadProtocol (XmlParser* 
languageParser)
   if (data && (!strcmpi (data, "YES")))
   {
     controlEnabled = 1;
-  }  
+  }
   else
   {
     controlEnabled = 0;
@@ -125,27 +123,27 @@ int ControlProtocol::loadProtocol (XmlParser* 
languageParser)
   if (data)
   {
     strncpy (tmpName, data, 64);
-  }  
+  }
 
   data = Server::getInstance ()->getHashedData ("control.password");
   if (data)
   {
     strncpy (tmpPassword, data, 64);
-  }  
+  }
 
   data = Server::getInstance ()->getHashedData ("control.admin.md5");
   if (data)
   {
     if (strcmpi (data, "YES") == 0)
       adminNameMD5ized = 1;
-  }  
+  }
 
   data = Server::getInstance ()->getHashedData ("control.password.md5");
   if (data)
   {
     if (strcmpi (data, "YES") == 0)
       adminPasswordMD5ized = 1;
-  }  
+  }
 
   if (adminNameMD5ized)
   {
@@ -263,340 +261,288 @@ int ControlProtocol::controlConnection (ConnectionPtr 
a, char *b1, char *b2,
     sendResponse(b2, bs2, a, ret, header, 0);
     return 0;
   }
-  specifiedLength = header.getLength();
-  version = header.getVersion();
+  specifiedLength = header.getLength ();
+  version = header.getVersion ();
   timeout=getTicks();
   if (specifiedLength)
   {
     inFile = new File ();
     if (inFile == 0)
     {
-      strncpy (b2,"Control: Error allocating memory",strlen (b2));
-      addToErrorLog (a,b2, strlen (b2), header);
-      sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0);
-      return 0;                                   
+      a->host->warningsLogWrite (_("Control: internal error"));
+      return 0;
     }
 
     inFilePath << getdefaultwd(0,0) << "/ControlInput_" << (u_int) id;
-  
+
     ret = inFile->createTemporaryFile (inFilePath.str().c_str());
     if (ret)
-    {
-      strcpy (b2,"Control: Error in the temporary file creation");
-      addToErrorLog (a,b2, strlen (b2), header);
-      sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0);
-      inFile->close ();
-      FilesUtility::deleteFile (inFilePath.str().c_str());
-      delete inFile;
-      return 0;
-    }
-    if (nbtr - realHeaderLength)
-    {
-      ret = inFile->writeToFile (b1 + realHeaderLength, nbtr - 
realHeaderLength,
-                               &nbw);
-      dataWritten += nbw;
-      if (ret)
       {
-        strcpy (b2,"Control: Error writing to temporary file");
-        addToErrorLog (a,b2, strlen (b2), header);
-        sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0);
+        a->host->warningsLogWrite (_("Control: internal error"));
+        sendResponse (b2, bs2, a, CONTROL_INTERNAL, header, 0);
         inFile->close ();
         FilesUtility::deleteFile (inFilePath.str().c_str());
         delete inFile;
-        inFile=0;
         return 0;
       }
-    }
+    if (nbtr - realHeaderLength)
+      {
+        ret = inFile->writeToFile (b1 + realHeaderLength, nbtr - 
realHeaderLength,
+                                   &nbw);
+        dataWritten += nbw;
+        if (ret)
+          {
+            a->host->warningsLogWrite (_("Control: internal error"));
+            sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0);
+            inFile->close ();
+            FilesUtility::deleteFile (inFilePath.str().c_str());
+            delete inFile;
+            inFile=0;
+            return 0;
+          }
+      }
   }
 
   /* Check if there are other bytes waiting to be read. */
   if (specifiedLength && (specifiedLength != static_cast<int>(nbtr - 
realHeaderLength) ))
-  {
-    /* Check if we can read all the specified data. */
-    while (specifiedLength != static_cast<int>(nbtr - realHeaderLength))
     {
-      if (a->socket->bytesToRead())
-      {
-        ret = a->socket->recv(b2, bs2, 0);
-        if (ret == -1)
+      /* Check if we can read all the specified data. */
+      while (specifiedLength != static_cast<int>(nbtr - realHeaderLength))
         {
-          strcpy (b2,"Control: Error in communication");
-          addToErrorLog (a,b2, strlen (b2), header);
-          sendResponse (b2, bs2, a, CONTROL_INTERNAL, header, 0);
-          inFile->close ();
-          FilesUtility::deleteFile (inFilePath.str().c_str());
-          delete inFile;
-          inFile=0;
-          return -1;
+          if (a->socket->bytesToRead())
+            {
+              ret = a->socket->recv(b2, bs2, 0);
+              if (ret == -1)
+                {
+                  a->host->warningsLogWrite (_("Control: internal error"));
+                  sendResponse (b2, bs2, a, CONTROL_INTERNAL, header, 0);
+                  inFile->close ();
+                  FilesUtility::deleteFile (inFilePath.str().c_str());
+                  delete inFile;
+                  inFile=0;
+                  return -1;
+                }
+              ret = inFile->writeToFile (b2, ret, &nbw);
+              dataWritten += nbw;
+              if (ret)
+                {
+                  a->host->warningsLogWrite (_("Control: internal error"));
+                  sendResponse (b2, bs2, a, CONTROL_INTERNAL, header, 0);
+                  inFile->close ();
+                  FilesUtility::deleteFile (inFilePath.str().c_str());
+                  delete inFile;
+                  inFile=0;
+                }
+
+              if (dataWritten >=  specifiedLength)
+                break;
+              timeout = getTicks();
+            }
+          else if (getTicks() - timeout > MYSERVER_SEC(5))
+            {
+              sendResponse (b2, bs2, a, CONTROL_BAD_LEN, header, 0);
+              inFile->close ();
+              FilesUtility::deleteFile (inFilePath.str().c_str());
+              delete inFile;
+              inFile=0;
+              return 0;
+            }
+          else
+            {
+              /* Wait a bit.  */
+              Thread::wait (2);
+            }
         }
-        ret = inFile->writeToFile (b2, ret, &nbw);
-        dataWritten += nbw;
-        if (ret)
+    }
+  if (inFile)
+    {
+      inFile->seek (0);
+    }
+
+  if (strcmpi (version, "CONTROL/1.0"))
+    {
+      a->host->warningsLogWrite (_("Control: specified version not 
supported"));
+      if (inFile)
         {
-          strcpy (b2,"Control: Error trying to write on the temporary file");
-          addToErrorLog (a,b2, strlen (b2), header);
-          sendResponse (b2, bs2, a, CONTROL_INTERNAL, header, 0);
           inFile->close ();
           FilesUtility::deleteFile (inFilePath.str().c_str());
           delete inFile;
-          inFile=0;
+          inFile = 0;
         }
-      
-        if (dataWritten >=  specifiedLength)
-          break;
-        timeout = getTicks();
-      }
-      else if (getTicks() - timeout > MYSERVER_SEC(5))
-      {
-        strcpy (b2,"Control: Bad content length specified");
-        addToErrorLog (a,b2, strlen (b2), header);
-        sendResponse (b2, bs2, a, CONTROL_BAD_LEN, header, 0);
-        inFile->close ();
-        FilesUtility::deleteFile (inFilePath.str().c_str());
-        delete inFile;
-        inFile=0;
-        return 0;
-      }
-      else
-      {
-        /* Wait a bit.  */
-        Thread::wait (2);
-      }
+      sendResponse(b2, bs2, a, CONTROL_BAD_VERSION, header, 0);
+      return 0;
     }
-  }
-  if (inFile)
-  {
-    inFile->seek (0);
-  }
 
-  if (strcmpi (version, "CONTROL/1.0"))
-  {
-    strcpy (b2,"Control: Bad version specified");
-    addToErrorLog (a,b2, strlen (b2), header);
-    if (inFile)
-    {
-      inFile->close ();
-      FilesUtility::deleteFile (inFilePath.str().c_str());
-      delete inFile;
-      inFile=0;
-    }
-    sendResponse(b2, bs2, a, CONTROL_BAD_VERSION, header, 0);
-    return 0;
-  }
-     
   authorized = checkAuth(header);
 
-  /* 
+  /*
    *If the client is not authorized remove the connection.
    */
   if (authorized == 0)
-  {
-    strcpy (b2,"Control: Bad authorization");
-    addToErrorLog (a,b2, strlen (b2), header);
-    if (inFile)
     {
-      inFile->close ();
-      FilesUtility::deleteFile (inFilePath.str().c_str());
-      delete inFile;
-      inFile=0;
+      if (inFile)
+        {
+          inFile->close ();
+          FilesUtility::deleteFile (inFilePath.str().c_str());
+          delete inFile;
+          inFile=0;
+        }
+      sendResponse(b2, bs2, a, CONTROL_AUTH, header, 0);
+      return 0;
     }
-    sendResponse(b2, bs2, a, CONTROL_AUTH, header, 0);
-    return 0;
-  }
   /*
-   *If the specified length is different from the length that the 
+   *If the specified length is different from the length that the
    *server can read, remove the connection.
    */
   if (dataWritten != specifiedLength)
-  {
-    strcpy (b2,"Control: Bad content length specified");
-    addToErrorLog (a,b2, strlen (b2), header);
-    if (inFile)
     {
-      inFile->close ();
-      FilesUtility::deleteFile (inFilePath.str().c_str());
-      delete inFile;
-      inFile=0;
+      if (inFile)
+        {
+          inFile->close ();
+          FilesUtility::deleteFile (inFilePath.str().c_str());
+          delete inFile;
+          inFile = 0;
+        }
+      sendResponse(b2, bs2, a, CONTROL_BAD_LEN, header, 0);
+      return 0;
     }
-    sendResponse(b2, bs2, a, CONTROL_BAD_LEN, header, 0);
-    return 0;
-  }
 
   command = header.getCommand();
   opt     = header.getOptions();
 
   knownCommand = 0;
 
-  /* 
+  /*
    *Create an out file. This can be used by commands that
    *needs it.
    */
   outFile = new File ();
-  if (outFile == 0)
-  {
-    strcpy (b2,"Control: Error in allocating memory");
-    addToErrorLog (a,b2, strlen (b2), header);
-    sendResponse (b2, bs2, a, CONTROL_INTERNAL, header, 0);
-    inFile->close ();
-    FilesUtility::deleteFile (inFilePath.str().c_str());
-    delete inFile;
-    inFile=0;
-    return 0;                                   
-  }
+  outFilePath << getdefaultwd (0, 0) << "/ControlOutput_" << (u_int) id;
 
-  outFilePath << getdefaultwd(0, 0) << "/ControlOutput_" << (u_int) id;
-  
   ret = outFile->createTemporaryFile (outFilePath.str().c_str());
   if (ret)
-  {
-    strcpy (b2,"Control: Error creating temporary file");
-    addToErrorLog (a,b2, strlen (b2), header);
-    sendResponse (b2, bs2, a, CONTROL_INTERNAL, header, 0);
-    delete outFile;
-    inFile->close ();
-    delete inFile;
-
-    FilesUtility::deleteFile (inFilePath.str().c_str());
-    FilesUtility::deleteFile (outFilePath.str().c_str());
-
-    inFile=0;
-    outFile=0;
-    return 0;
-  }
+    {
+      a->host->warningsLogWrite (_("Control: internal error"));
+      sendResponse (b2, bs2, a, CONTROL_INTERNAL, header, 0);
+      delete outFile;
+      inFile->close ();
+      delete inFile;
+
+      FilesUtility::deleteFile (inFilePath.str().c_str());
+      FilesUtility::deleteFile (outFilePath.str().c_str());
+
+      inFile=0;
+      outFile=0;
+      return 0;
+    }
   if (!strcmp(command, "SHOWCONNECTIONS"))
-  {
-    knownCommand = 1;
-    ret = showConnections(a, outFile, b1, bs1, header);
-  }
+    {
+      knownCommand = 1;
+      ret = showConnections(a, outFile, b1, bs1, header);
+    }
   else if (!strcmp (command, "KILLCONNECTION"))
-  {
-    char buff[11];
-    u_long id;
-    knownCommand = 1;
-    strncpy (buff, header.getOptions (), 10 );
-    buff[10] = '\0';
-    id = header.getOptions () ? atol (buff) : 0;
-    ret = killConnection(a, id, outFile, b1, bs1, header);
-  }
+    {
+      char buff[11];
+      u_long id;
+      knownCommand = 1;
+      strncpy (buff, header.getOptions (), 10 );
+      buff[10] = '\0';
+      id = header.getOptions () ? atol (buff) : 0;
+      ret = killConnection(a, id, outFile, b1, bs1, header);
+    }
   else if (!strcmp(command, "REBOOT"))
-  {
-    knownCommand = 1;
-    Server::getInstance ()->rebootOnNextLoop ();
-    ret = 0;
-  }
+    {
+      knownCommand = 1;
+      Server::getInstance ()->rebootOnNextLoop ();
+      ret = 0;
+    }
   else if (!strcmp(command, "GETFILE"))
-  {
-    knownCommand = 1;
-    ret = getFile (a,header.getOptions (), inFile, outFile, b1, bs1, header);
-  }
+    {
+      knownCommand = 1;
+      ret = getFile (a,header.getOptions (), inFile, outFile, b1, bs1, header);
+    }
   else if (!strcmp(command, "PUTFILE"))
-  {
-    knownCommand = 1;
-    ret = putFile (a,header.getOptions (), inFile, outFile, b1, bs1, header);
-  }
+    {
+      knownCommand = 1;
+      ret = putFile (a,header.getOptions (), inFile, outFile, b1, bs1, header);
+    }
   else if (!strcmp(command, "DISABLEREBOOT"))
-  {
-    Server::getInstance ()->disableAutoReboot ();
-    knownCommand = 1;
+    {
+      Server::getInstance ()->disableAutoReboot ();
+      knownCommand = 1;
 
-  }
+    }
   else if (!strcmp(command, "ENABLEREBOOT"))
-  {
-    Server::getInstance ()->enableAutoReboot();
-    knownCommand = 1;
+    {
+      Server::getInstance ()->enableAutoReboot();
+      knownCommand = 1;
 
-  }
+    }
   else if (!strcmp(command, "SHOWLANGUAGEFILES"))
-  {
-    knownCommand = 1;
-    ret = showLanguageFiles(a, outFile, b1, bs1, header);
-  }
-  else if (!strcmp(command, "VERSION"))
-  {
-    knownCommand = 1;
-    ret = getVersion(a, outFile, b1, bs1, header);
-  }
-
-  if (knownCommand)
-  {
-    char *connection;
-    outFile->seek (0);
-    if (ret)
     {
-      sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0);
+      knownCommand = 1;
+      ret = showLanguageFiles(a, outFile, b1, bs1, header);
     }
-    else
-      sendResponse(b2, bs2, a, CONTROL_OK, header, outFile);
-    if (inFile)
+  else if (!strcmp(command, "VERSION"))
     {
-      inFile->close ();
-      delete inFile;
-      inFile=0;
+      knownCommand = 1;
+      ret = getVersion(a, outFile, b1, bs1, header);
     }
-    if (outFile)
-    {
-      outFile->close ();
-      delete outFile;
-      outFile=0;
-    }
-    FilesUtility::deleteFile (inFilePath.str().c_str());
-    FilesUtility::deleteFile (outFilePath.str().c_str());
-    connection = header.getConnection();
-    /* 
-     *If the Keep-Alive was specified keep the connection in the
-     *active connections list.
-     */
-    if (!strcmpi (connection,"keep-alive"))
-      return 1;
-    else 
-      return 0;
-  }
-  else
-  {
-    strcpy (b2,"Control: Command unknown");
-    addToErrorLog (a,b2, strlen (b2), header);
-    sendResponse(b2, bs2, a, CONTROL_CMD_NOT_FOUND, header, 0);
 
-    if (inFile)
+  if (knownCommand)
     {
-      inFile->close ();
-      delete inFile;
-      inFile = NULL;
+      char *connection;
+      outFile->seek (0);
+      if (ret)
+        {
+          sendResponse(b2, bs2, a, CONTROL_INTERNAL, header, 0);
+        }
+      else
+        sendResponse(b2, bs2, a, CONTROL_OK, header, outFile);
+      if (inFile)
+        {
+          inFile->close ();
+          delete inFile;
+          inFile=0;
+        }
+      if (outFile)
+        {
+          outFile->close ();
+          delete outFile;
+          outFile=0;
+        }
+      FilesUtility::deleteFile (inFilePath.str().c_str());
+      FilesUtility::deleteFile (outFilePath.str().c_str());
+      connection = header.getConnection();
+      /*
+       *If the Keep-Alive was specified keep the connection in the
+       *active connections list.
+       */
+      if (!strcmpi (connection,"keep-alive"))
+        return 1;
+      else
+        return 0;
     }
-    if (outFile)
+  else
     {
-      outFile->close ();
-      delete outFile;
-      outFile = NULL;
-    }
-    FilesUtility::deleteFile (inFilePath.str().c_str());
-    FilesUtility::deleteFile (outFilePath.str().c_str());
-    return 0;
-  }
-}
-
-/*!
- *Add the entry to the error log file.
- */
-int ControlProtocol::addToErrorLog (ConnectionPtr con, const char *b1, int bs1,
-                                   ControlHeader& header)
-{
-  string time;
-  ostringstream out;
-  /*
-   *Check that the verbosity is at least 1.
-   */
-  if (Server::getInstance ()->getVerbosity() < 1)
-    return 0;
-
-  getRFC822GMTTime (time, 32);
-  
-  getRFC822GMTTime (time, 32);
-
-  out << con->getIpAddr() << " [" << time.c_str() << "] " << b1;
-  ((Vhost*)(con->host))->warningsLogWrite (out.str ().c_str ());
+      sendResponse(b2, bs2, a, CONTROL_CMD_NOT_FOUND, header, 0);
 
-  return 0;
+      if (inFile)
+        {
+          inFile->close ();
+          delete inFile;
+          inFile = NULL;
+        }
+      if (outFile)
+        {
+          outFile->close ();
+          delete outFile;
+          outFile = NULL;
+        }
+      FilesUtility::deleteFile (inFilePath.str().c_str());
+      FilesUtility::deleteFile (outFilePath.str().c_str());
+      return 0;
+    }
 }
 
 /*!
@@ -613,11 +559,10 @@ int ControlProtocol::addToLog (int retCode, ConnectionPtr 
con, char *b1,
 #else
   sprintf(b1,
 #endif
-          "%s [%s] %s:%s:%s - %s  - %i\r\n", con->getIpAddr (), time.c_str (), 
-          header.getCommand (),  header.getVersion (), header.getOptions (), 
-          header.getAuthLogin () , retCode);
-
-           ((Vhost*)(con->host))->accessesLogWrite (b1);
+  "%s [%s] %s:%s:%s - %s  - %i\r\n", con->getIpAddr (), time.c_str (),
+  header.getCommand (),  header.getVersion (), header.getOptions (),
+  header.getAuthLogin () , retCode);
+  con->host->accessesLogWrite ("%s", b1);
   return 0;
 }
 
@@ -625,19 +570,16 @@ int ControlProtocol::addToLog (int retCode, ConnectionPtr 
con, char *b1,
  *Send the response with status=errID and the data contained in the outFile.
  *Return nonzero on errors.
  */
-int ControlProtocol::sendResponse (char *buffer, int buffersize, 
-                                   ConnectionPtr conn, int errID, 
+int ControlProtocol::sendResponse (char *buffer, int buffersize,
+                                   ConnectionPtr a, int errID,
                                    ControlHeader& header, File* outFile)
 {
   u_long dataLength = 0;
   int err;
-  err = addToLog (errID, conn, buffer, buffersize, header);
+  err = addToLog (errID, a, buffer, buffersize, header);
   if (err)
-  {
-    strcpy (buffer,"Control: Error registering the connection to the log");
-    addToErrorLog (conn,buffer, strlen (buffer), header);
     return err;
-  }
+
   if (outFile)
     dataLength = outFile->getFileSize ();
   /* Build and send the first line.  */
@@ -646,13 +588,12 @@ int ControlProtocol::sendResponse (char *buffer, int 
buffersize,
 #else
   sprintf (buffer,
 #endif
-           "/%i\r\n", errID);
+          "/%i\r\n", errID);
 
-  err = conn->socket->send (buffer, strlen (buffer), 0);
+  err = a->socket->send (buffer, strlen (buffer), 0);
   if (err == -1)
   {
-    strcpy (buffer,"Control: Error sending data");
-    addToErrorLog (conn,buffer, strlen (buffer), header);
+    a->host->warningsLogWrite (_("Control: socket error"));
     return -1;
   }
 
@@ -660,24 +601,22 @@ int ControlProtocol::sendResponse (char *buffer, int 
buffersize,
 #ifdef HAVE_SNPRINTF
   snprintf(buffer, buffersize,
 #else
-  sprintf(buffer, 
-#endif 
+  sprintf(buffer,
+#endif
           "/LEN %u\r\n", (u_int)dataLength);
- 
-  err = conn->socket->send (buffer, strlen (buffer), 0);
-  if (err == -1)
+
+  err = a->socket->send (buffer, strlen (buffer), 0);
+           if (err == -1)
   {
-    strcpy (buffer,"Control: Error sending data");
-    addToErrorLog (conn,buffer, strlen (buffer), header);
+    a->host->warningsLogWrite (_("Control: socket error"));
     return -1;
   }
 
   /* Send the end of the header.  */
-  err = conn->socket->send ("\r\n", 2, 0);
+  err = a->socket->send ("\r\n", 2, 0);
   if (err == -1)
   {
-    strcpy (buffer,"Control: Error sending data");
-    addToErrorLog (conn,buffer, strlen (buffer), header);
+    a->host->warningsLogWrite (_("Control: socket error"));
     return -1;
   }
 
@@ -691,24 +630,22 @@ int ControlProtocol::sendResponse (char *buffer, int 
buffersize,
       err = outFile->read(buffer, min (dataToSend, buffersize), &nbr);
       if (err)
       {
-        strcpy (buffer,"Control: Error reading from temporary file");
-        addToErrorLog (conn, buffer, strlen (buffer), header);
+        a->host->warningsLogWrite (_("Control: internal error"));
         return -1;
       }
       dataToSend -= nbr;
-      err = conn->socket->send (buffer, nbr, 0);
+      err = a->socket->send (buffer, nbr, 0);
       if (dataToSend == 0)
         break;
       if (err == -1)
       {
-        strcpy (buffer,"Control: Error sending data");
-        addToErrorLog (conn,buffer, strlen (buffer), header);
+        a->host->warningsLogWrite (_("Control: socket error"));
         return -1;
       }
     }
   }
 
-  return 0; 
+  return 0;
 }
 
 /*!
@@ -724,20 +661,19 @@ int  ControlProtocol::showConnections (ConnectionPtr 
a,File* out, char *b1,
   args.b1 = b1;
   args.bs1 = bs1;
   args.header = &header;
-  
+
   return Server::getInstance ()->getConnectionsScheduler ()->accept (this, 
&args);
 }
 
 /*!
  *Kill a connection by its ID.
  */
-int ControlProtocol::killConnection(ConnectionPtr a, u_long id, File* out, 
+int ControlProtocol::killConnection(ConnectionPtr a, u_long id, File* out,
                                     char *b1, int bs1, ControlHeader& header)
 {
   if (id == 0)
     return -1;
 
-
   ControlProtocolVisitorArg args;
   args.command = ControlProtocolVisitorArg::KILL_CONNECTION;
   args.connection = a;
@@ -751,10 +687,10 @@ int ControlProtocol::killConnection(ConnectionPtr a, 
u_long id, File* out,
 
   return 0;
 }
-           
+
 /*!
  *Visitor.
- */ 
+ */
 int ControlProtocol::visitConnection (ConnectionPtr con, void* argP)
 {
   int ret = 0;
@@ -765,36 +701,35 @@ int ControlProtocol::visitConnection (ConnectionPtr con, 
void* argP)
   {
 #ifdef HAVE_SNPRINTF
     snprintf (arg->b1, arg->bs1, "%i - %s - %i - %s - %i - %s - %s\r\n",
-             static_cast<int>(con->getID()),  con->getIpAddr(), 
-             static_cast<int>(con->getPort()), 
-             con->getLocalIpAddr(),  static_cast<int>(con->getLocalPort()), 
+             static_cast<int>(con->getID()),  con->getIpAddr(),
+             static_cast<int>(con->getPort()),
+             con->getLocalIpAddr(),  static_cast<int>(con->getLocalPort()),
              con->getLogin(), con->getPassword());
 #else
     sprintf (arg->b1, "%i - %s - %i - %s - %i - %s - %s\r\n",
-            static_cast<int>(con->getID()),  con->getIpAddr(), 
-            static_cast<int>(con->getPort()), 
-            con->getLocalIpAddr(),  static_cast<int>(con->getLocalPort()), 
+            static_cast<int>(con->getID()),  con->getIpAddr(),
+            static_cast<int>(con->getPort()),
+            con->getLocalIpAddr(),  static_cast<int>(con->getLocalPort()),
             con->getLogin(), con->getPassword());
 #endif
-           
+
     ret = arg->out->writeToFile (arg->b1, strlen (arg->b1), &nbw);
 
     if (ret)
-    {
-      strcpy (arg->b1,"Control: Error while writing to file");
-      addToErrorLog (arg->connection, arg->b1, strlen (arg->b1), *arg->header);
-      return ret;
-    }
+      {
+        con->host->warningsLogWrite (_("Control: internal error"));
+        return ret;
+      }
   }
   else if (arg->command == ControlProtocolVisitorArg::KILL_CONNECTION)
-  {
-    if (con->getID () == arg->id)
     {
-      /* Define why the connection is killed.  */
-      con->setToRemove (Connection::USER_KILL);
-      return 1;
+      if (con->getID () == arg->id)
+        {
+          /* Define why the connection is killed.  */
+          con->setToRemove (Connection::USER_KILL);
+          return 1;
+        }
     }
-  }
 
   return 0;
 }
@@ -802,7 +737,7 @@ int ControlProtocol::visitConnection (ConnectionPtr con, 
void* argP)
 
 
 /*!
- *Return the requested file to the client.
+ * Return the requested file to the client.
  */
 int ControlProtocol::getFile (ConnectionPtr a, char* fn, File* in, File* out,
                               char *b1,int bs1, ControlHeader& header)
@@ -824,65 +759,47 @@ int ControlProtocol::getFile (ConnectionPtr a, char* fn, 
File* in, File* out,
   else if (!strcmpi (fn, "virtualhosts.xml"))
     filename = Server::getInstance ()->getVhostConfFile ();
   else if (!FilesUtility::fileExists (fn))
-  {
-    /* If we cannot find the file send the right error ID.  */
-    string msg;
-    msg.assign ("Control: Requested file doesn't exist ");
-    msg.append (fn);
-    addToErrorLog (a, msg, header);
     return CONTROL_FILE_NOT_FOUND;
-  }
   else
-  {
-    filename = fn;    
-  }
-  
+    filename = fn;
+
   ret = localfile.openFile (filename, File::READ | File::OPEN_IF_EXISTS);
 
   /* An internal server error happens.  */
   if (ret)
-  {
-    string msg;
-    msg.assign ("Control: Error while opening the file ");
-    msg.append (filename);
-    addToErrorLog (a, msg, header);
+    {
+    a->host->warningsLogWrite (_("Control: internal error"));
     return CONTROL_INTERNAL;
-  }
+    }
   for(;;)
-  {
+    {
     ret = localfile.read(b1, bs1, &nbr);
     if (ret)
-    {
-      string msg;
-      msg.assign ("Control: Error while reading from file ");
-      msg.append (filename);
-      addToErrorLog (a, msg, header);
-      return CONTROL_INTERNAL;
-    }
+      {
+        a->host->warningsLogWrite (_("Control: internal error"));
+        return CONTROL_INTERNAL;
+      }
 
     /* Break the loop when we can't read no more data.  */
     if (!nbr)
       break;
-    
+
     ret = out->writeToFile (b1, nbr, &nbw);
 
     if (ret)
-    {
-      string msg;
-      msg.assign ("Control: Error while writing to file ");
-      msg.append (filename);
-      addToErrorLog (a, msg, header);
-      return CONTROL_INTERNAL;
-    }
+      {
+        a->host->warningsLogWrite (_("Control: internal error"));
+        return CONTROL_INTERNAL;
+      }
 
-  }
+    }
 
   localfile.close ();
   return 0;
 }
 
 /*!
- *Save the file on the local FS.
+ * Save the file on the local FS.
  */
 int ControlProtocol::putFile (ConnectionPtr a, char* fn, File* in,
                               File* out, char *b1,int bs1, ControlHeader& 
header)
@@ -904,74 +821,62 @@ int ControlProtocol::putFile (ConnectionPtr a, char* fn, 
File* in,
   else if (!strcmpi (fn, "virtualhosts.xml"))
     filename = Server::getInstance ()->getVhostConfFile ();
   else
-    filename = fn;    
+    filename = fn;
 
   /* Remove the file before create it.  */
   ret = FilesUtility::deleteFile (filename);
 
   /* An internal server error happens.  */
   if (ret)
-  {
-    strcpy (b1,"Control: Error deleting the file");
-    addToErrorLog (a, b1, strlen (b1), header);
-    return CONTROL_INTERNAL;
-  }
+    {
+      a->host->warningsLogWrite (_("Control: internal error"));
+      return CONTROL_INTERNAL;
+    }
 
   ret = localfile.openFile (filename, File::WRITE | File::FILE_OPEN_ALWAYS);
 
   /* An internal server error happens.  */
   if (ret)
-  {
-    string msg;
-    msg.assign ("Control: Error while opening the file ");
-    msg.append (filename);
-    addToErrorLog (a, msg, header);
-    return CONTROL_INTERNAL;
-  }
+    {
+      a->host->warningsLogWrite (_("Control: internal error"));
+      return CONTROL_INTERNAL;
+    }
 
   if (in == NULL)
-  {
-    string msg;
-    msg.assign ("Control: invalid input file ");
-    msg.append (filename);
-    addToErrorLog (a, msg, header);
-    return CONTROL_INTERNAL;
-  }
-
-  for(;;)
-  {
-    ret = in->read(b1, bs1, &nbr);
-    if (ret)
     {
-      string msg;
-      msg.assign ("Control: Error while reading to file ");
-      msg.append (filename);
-      addToErrorLog (a, msg, header);
+      a->host->warningsLogWrite (_("Control: internal error"));
       return CONTROL_INTERNAL;
     }
 
-    /* Break the loop when we can't read no more data.  */
-    if (!nbr)
-      break;
-    
-    ret = localfile.writeToFile (b1, nbr, &nbw);
-
-    if (ret)
+  for(;;)
     {
-      string msg;
-      msg.assign ("Control: Error while writing to file ");
-      msg.append (filename);
-      addToErrorLog (a, msg, header);
-      return CONTROL_INTERNAL;
+      ret = in->read(b1, bs1, &nbr);
+
+      if (ret)
+        {
+          a->host->warningsLogWrite (_("Control: internal error"));
+          return CONTROL_INTERNAL;
+        }
+
+      /* Break the loop when we can't read no more data.  */
+      if (!nbr)
+        break;
+
+      ret = localfile.writeToFile (b1, nbr, &nbw);
+
+      if (ret)
+        {
+          a->host->warningsLogWrite (_("Control: internal error"));
+          return CONTROL_INTERNAL;
+        }
     }
-  }
   localfile.close ();
 
   return 0;
 }
 
 /*!
- *Show all the language files that the server can use.
+ * Show all the language files that the server can use.
  */
 int ControlProtocol::showLanguageFiles (ConnectionPtr a, File* out,
                                         char *b1,int bs1, ControlHeader& 
header)
@@ -981,50 +886,45 @@ int ControlProtocol::showLanguageFiles (ConnectionPtr a, 
File* out,
   FindData fd;
   int ret = 0;
   if (path == 0)
-  {
-    strcpy (b1,"Control: Error retrieving the language files path");
-    addToErrorLog (a,b1, strlen (b1), header);
-    return CONTROL_INTERNAL;
-  }
+    {
+      a->host->warningsLogWrite (_("Control: internal error"));
+      return CONTROL_INTERNAL;
+    }
   searchPath.assign (path);
-  
+
 #ifdef WIN32
   searchPath.append ("*.xml");
 #endif
   ret=fd.findfirst (searchPath.c_str ());
   if (ret == -1)
-  {
-    strcpy (b1, "Control: Error in directory lookup");
-    addToErrorLog (a, b1, strlen (b1), header);
-    return CONTROL_INTERNAL;
-  }
-  do
-  {
-    string filename;
-    string ext;
-    u_long nbw = 0;
-    /* Do not show files starting with a dot.  */
-    if (fd.name[0]=='.')
-      continue;
- 
-    filename.assign (fd.name);
-    FilesUtility::getFileExt (ext, filename);
-    if (stringcmpi (ext, "xml") == 0)
     {
-      ret = out->writeToFile (filename.c_str(), filename.length(), &nbw);
-      if (ret == 0)
-        ret = out->writeToFile ("\r\n", 2, &nbw);
+      a->host->warningsLogWrite (_("Control: internal error"));
+      return CONTROL_INTERNAL;
     }
-
-    if (ret)
+  do
     {
-      string outMsg;
-      outMsg.assign ("Control: Error while writing to temporary file ");
-      outMsg.append (filename);
-      addToErrorLog (a,outMsg, header);
-      return CONTROL_INTERNAL;
+      string filename;
+      string ext;
+      u_long nbw = 0;
+      /* Do not show files starting with a dot.  */
+      if (fd.name[0]=='.')
+        continue;
+
+      filename.assign (fd.name);
+      FilesUtility::getFileExt (ext, filename);
+      if (stringcmpi (ext, "xml") == 0)
+        {
+          ret = out->writeToFile (filename.c_str(), filename.length(), &nbw);
+          if (ret == 0)
+            ret = out->writeToFile ("\r\n", 2, &nbw);
+        }
+
+      if (ret)
+        {
+          a->host->warningsLogWrite (_("Control: internal error"));
+          return CONTROL_INTERNAL;
+        }
     }
-  }
   while (!fd.findnext ());
   fd.findclose ();
   return 0;
@@ -1037,8 +937,8 @@ int ControlProtocol::getVersion (ConnectionPtr a, File* 
out, char *b1, int bs1,
                                  ControlHeader& header)
 {
   u_long nbw;
-  
+
   myserver_strlcpy (b1, MYSERVER_VERSION, bs1);
- 
+
   return out->writeToFile (b1, strlen (b1), &nbw);
 }
diff --git a/myserver/src/protocol/ftp/ftp.cpp 
b/myserver/src/protocol/ftp/ftp.cpp
index 2eb65cf..f090a21 100755
--- a/myserver/src/protocol/ftp/ftp.cpp
+++ b/myserver/src/protocol/ftp/ftp.cpp
@@ -462,7 +462,7 @@ void Ftp::logAccess (int nReplyCode, const std::string & 
sCustomText)
 #endif
 
   if (td.pConnection->host)
-    td.pConnection->host->accessesLogWrite (td.secondaryBuffer->getBuffer ());
+    td.pConnection->host->accessesLogWrite ("%s", 
td.secondaryBuffer->getBuffer ());
 }
 
 int Ftp::closeDataConnection ()
@@ -475,17 +475,7 @@ int Ftp::closeDataConnection ()
 
 int Ftp::printError (const char *msg)
 {
-  /* Log the reply.  */
-  string time;
-  getLocalLogFormatDate (time, 32);
-
-  td.secondaryBuffer->setLength (0);
-  *td.secondaryBuffer << td.pConnection->getIpAddr ();
-  *td.secondaryBuffer << " " << time << " " << msg;
-
-  if (td.pConnection->host)
-    td.pConnection->host->warningsLogWrite (td.secondaryBuffer->getBuffer ());
-
+  td.pConnection->host->warningsLogWrite ("%s", msg);
   return 1;
 }
 
@@ -1365,7 +1355,7 @@ DEFINE_THREAD (ReceiveImageFile, pParam)
 #endif
         }
     }
-  
+
   if (pFtpuserData->m_pDataConnection == NULL ||
       pFtpuserData->m_pDataConnection->socket == NULL)
     {
@@ -1562,7 +1552,7 @@ Ftp::OpenDataConnection ()
   if (pFtpuserData->m_nFtpstate == FtpuserData::DATA_CONNECTION_UP)
     return 1;
 
-  int nRet = pFtpuserData->m_bPassiveSrv ? openDataPassive () 
+  int nRet = pFtpuserData->m_bPassiveSrv ? openDataPassive ()
                                          : openDataActive ();
   if (nRet != 0)
     pFtpuserData->m_nFtpstate = FtpuserData::DATA_CONNECTION_UP;
diff --git a/myserver/src/protocol/http/http.cpp 
b/myserver/src/protocol/http/http.cpp
index ac4e8fa..9562fee 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -117,18 +117,14 @@ int Http::optionsHTTPRESOURCE (string& filename, int 
yetmapped)
                                           (u_long) 
td->secondaryBuffer->getLength (), 0);
       if (ret == SOCKET_ERROR)
         {
-          string error;
-          error.assign ("HTTP<SOCKET ERROR>: unable to send ");
-          error.append (filename);
-          error.append (".");
-          td->connection->host->warningsLogWrite (error.c_str ());
+          td->connection->host->warningsLogWrite (_("HTTP: socket error"));
           return 0;
         }
       return 1;
     }
   catch (...)
     {
-      td->connection->host->warningsLogWrite ("HTTP<ERROR>: unable to build a 
response for an OPTION request.");
+      td->connection->host->warningsLogWrite (_("HTTP: internal error"));
       return raiseHTTPError (500);
     };
 }
@@ -172,11 +168,7 @@ int Http::traceHTTPRESOURCE (string& filename, int 
yetmapped)
                                           (u_long) 
td->secondaryBuffer->getLength (), 0);
       if (ret == SOCKET_ERROR)
         {
-          string error;
-          error.assign ("HTTP<SOCKET ERROR>: unable to send ");
-          error.append (filename);
-          error.append (".");
-          td->connection->host->warningsLogWrite (error.c_str ());
+          td->connection->host->warningsLogWrite (_("HTTP: socket error"));
           return 0;
         }
 
@@ -185,18 +177,14 @@ int Http::traceHTTPRESOURCE (string& filename, int 
yetmapped)
                                           contentLength, 0);
       if (ret == SOCKET_ERROR)
         {
-          string error;
-          error.assign ("HTTP<SOCKET ERROR>: unable to send ");
-          error.append (filename);
-          error.append (".");
-          td->connection->host->warningsLogWrite (error.c_str ());
+          td->connection->host->warningsLogWrite (_("HTTP: socket error"));
           return 0;
         }
       return 1;
     }
   catch (...)
     {
-      td->connection->host->warningsLogWrite ("HTTP<ERROR>: Unable to handle 
the HTTP TRACE command.");
+      td->connection->host->warningsLogWrite (_("HTTP: internal error"));
       return raiseHTTPError (500);
     };
 }
@@ -309,7 +297,7 @@ int Http::getFilePermissions (string& filename, string& 
directory, string& file,
           td->connection->protocolBuffer = new HttpUserData;
           if (!td->connection->protocolBuffer)
             {
-              td->connection->host->warningsLogWrite ("HTTP<ERROR>: Unable to 
access protocol buffer.");
+              td->connection->host->warningsLogWrite (_("HTTP: internal 
error"));
               return 500;
             }
           ((HttpUserData*) (td->connection->protocolBuffer))->reset ();
@@ -332,7 +320,7 @@ int Http::getFilePermissions (string& filename, string& 
directory, string& file,
       if (*permissions == -1)
         {
           td->connection->host->warningsLogWrite (
-                                   "HTTP<ERROR>: Error reading security 
file.");
+                                 _("HTTP: error accessing the security file"));
           return 500;
         }
 
@@ -383,11 +371,9 @@ int Http::getFilePermissions (string& filename, string& 
directory, string& file,
     }
   catch (...)
     {
-      string error;
-      error.assign ("HTTP<ERROR>: unable to get file permission: ");
-      error.append (filename);
-      error.append (".");
-      td->connection->host->warningsLogWrite (error.c_str ());
+      td->connection->host->warningsLogWrite (
+                                 _("HTTP: cannot get permissions for %s"),
+                                 filename.c_str ());
       return 500;
     }
 
@@ -429,7 +415,6 @@ int Http::preprocessHttpRequest (string& filename, int 
yetmapped, int* permissio
 
       ret = getFilePermissions (filename, directory, file,
                                 td->filenamePath, yetmapped, permissions);
-
       if (ret != 200)
         return ret;
 
@@ -513,11 +498,7 @@ int Http::preprocessHttpRequest (string& filename, int 
yetmapped, int* permissio
     }
   catch (...)
     {
-      string error;
-      error.assign ("HTTP<ERROR>: unable to preprocess HTTP request on file:  
");
-      error.append (filename);
-      error.append (".");
-      td->connection->host->warningsLogWrite (error.c_str ());
+      td->connection->host->warningsLogWrite (_("HTTP: internal error"));
       return 500;
     }
 
@@ -688,24 +669,14 @@ Http::sendHTTPResource (string& uri, int systemrequest, 
int onlyHeader,
 
       if (!manager)
         {
-          string error;
-          error.assign ("HTTP<ERROR>: unable to get SEND Http Manager on 
sending ");
-          error.append (uri);
-          error.append (".");
-          td->connection->host->warningsLogWrite (error.c_str ());
+          td->connection->host->warningsLogWrite (_("HTTP: internal error"));
           return raiseHTTPError (500);
         }
-
-
       return manager->send (td, td->filenamePath.c_str (), 0, onlyHeader);
     }
   catch (...)
     {
-      string error;
-      error.assign ("HTTP<ERROR>: unable to send ");
-      error.append (uri);
-      error.append (".");
-      td->connection->host->warningsLogWrite (error.c_str ());
+      td->connection->host->warningsLogWrite (_("HTTP: internal error"));
       return raiseHTTPError (500);
     };
 
@@ -788,9 +759,8 @@ int Http::logHTTPaccess ()
        * Request the access to the log file then append the message.
        */
       if (td->connection->host)
-        {
-          td->connection->host->accessesLogWrite 
(td->secondaryBuffer->getBuffer ());
-        }
+        td->connection->host->accessesLogWrite ("%s", 
td->secondaryBuffer->getBuffer ());
+
       td->secondaryBuffer->setLength (0);
     }
   catch (...)
@@ -1252,7 +1222,7 @@ int Http::controlConnection (ConnectionPtr a, char* 
/*b1*/, char* /*b2*/,
   catch (...)
     {
 
-      td->connection->host->warningsLogWrite ("HTTP<ERROR>: unable to handle 
the HTTP Request.");
+      td->connection->host->warningsLogWrite (_("HTTP: internal error"));
       return raiseHTTPError (500);
       logHTTPaccess ();
       return ClientsThread::DELETE_CONNECTION;
@@ -1365,7 +1335,7 @@ int Http::requestAuthorization ()
   if (td->connection->socket->send (td->secondaryBuffer->getBuffer (),
                                     td->secondaryBuffer->getLength (), 0) == 
-1)
     {
-      td->connection->host->warningsLogWrite ("HTTP<SOCKET ERROR>: unable to 
send the authorization request.");
+      td->connection->host->warningsLogWrite (_("HTTP: socket error"));
       return 0;
     }
   return 1;
@@ -1401,7 +1371,7 @@ int Http::raiseHTTPError (int ID)
 
       if (td->lastError)
         {
-          td->connection->host->warningsLogWrite ("HTTP<ERROR>: recursive 
error.");
+          td->connection->host->warningsLogWrite (_("HTTP: recursive error"));
           return sendHTTPhardError500 ();
         }
 
@@ -1472,10 +1442,9 @@ int Http::raiseHTTPError (int ID)
               return sendHTTPResource (errorFileStr, 1, td->onlyHeader);
             }
           else
-            {
-              string error = "HTTP<ERROR>: The specified error page " + 
errorFile.str () + " does not exist";
-              td->connection->host->warningsLogWrite (error.c_str ());
-            }
+            td->connection->host->warningsLogWrite (_("HTTP: The specified 
error page: %s does not exist"),
+                                                    errorFile.str ().c_str ());
+
         }
 
       HttpErrors::getErrorMessage (ID, errorMessage);
@@ -1510,23 +1479,18 @@ int Http::raiseHTTPError (int ID)
                                                             errorBodyLength, 0)
                               == -1))
         {
-          td->connection->host->warningsLogWrite ("HTTP<ERROR>: unable to 
raise HTTP Error.");
+          td->connection->host->warningsLogWrite (_("HTTP: socket error"));
           return 0;
         }
 
 
       return 1;
     }
-  catch (bad_alloc &ba)
-    {
-      td->connection->host->warningsLogWrite ("HTTP<ERROR>: unable to raise 
HTTP Error.");
-      return 0;
-    }
   catch (...)
     {
-      td->connection->host->warningsLogWrite ("HTTP<ERROR>: unable to raise 
HTTP Error.");
+      td->connection->host->warningsLogWrite (_("HTTP: internal error"));
       return 0;
-    };
+    }
 }
 
 /*!
@@ -1731,7 +1695,7 @@ int Http::processDefaultFile (string& uri, int 
permissions, int onlyHeader)
 
   if (!handler)
     {
-      td->connection->host->warningsLogWrite ("HTTP<ERROR>: cannot find a 
valid handler.");
+      td->connection->host->warningsLogWrite (_("HTTP: internal error"));
       return raiseHTTPError (500);
     }
 
@@ -1766,7 +1730,7 @@ int Http::sendHTTPRedirect (const char *newURL)
   if (td->connection->socket->send (td->secondaryBuffer->getBuffer (),
                                     (int) td->secondaryBuffer->getLength (), 
0) == -1)
     {
-      td->connection->host->warningsLogWrite ("HTTP<SOCKET ERROR>: unable to 
send a redirect message.");
+      td->connection->host->warningsLogWrite (_("HTTP: socket error"));
       return 0;
     }
 
@@ -1799,7 +1763,7 @@ int Http::sendHTTPNonModified ()
   if (td->connection->socket->send (td->secondaryBuffer->getBuffer (),
                                     (int) td->secondaryBuffer->getLength (), 
0) == -1)
     {
-      td->connection->host->warningsLogWrite ("HTTP<SOCKET ERROR>: unable to 
send a non-modified message.");
+      td->connection->host->warningsLogWrite (_("HTTP: socket error"));
       return 0;
     }
   return 1;
diff --git a/myserver/src/protocol/http/http_data_handler.cpp 
b/myserver/src/protocol/http/http_data_handler.cpp
index dd05b5b..97daa19 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -26,7 +26,7 @@ HttpDataHandler::send (HttpThreadContext* td,
                        const char* /*filenamePath*/, const char* /*exec*/,
                        bool /*execute*/, bool /*onlyHeader*/)
 {
-  td->connection->host->warningsLogWrite ("HttpDataHandler: using the base 
interface!");
+  td->connection->host->warningsLogWrite (_("HttpDataHandler: using the base 
interface!"));
   return td->http->raiseHTTPError (500);
 }
 
@@ -99,14 +99,14 @@ int HttpDataHandler::appendDataToHTTPChannel 
(HttpThreadContext* td,
 
   if (chain->write (buffer, size, &nbw))
     {
-      td->connection->host->warningsLogWrite ("HTTP<DATA HANDLER ERROR>: 
unable to write data in the buffer.");
+      td->connection->host->warningsLogWrite (_("Http: internal error"));
       return 1;
     }
 
 
   if (tmpStream->read (buffer, realBufferSize, &nbr))
     {
-      td->connection->host->warningsLogWrite ("HTTP<DATA HANDLER ERROR>: 
unable to read data from the buffer.");
+      td->connection->host->warningsLogWrite (_("Http: internal error"));
       return 1;
     }
 
@@ -132,19 +132,15 @@ int HttpDataHandler::appendDataToHTTPChannel 
(HttpThreadContext* td,
  * \param useChunks Can we use HTTP chunks to send data?
  */
 int
-HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext* td,
-                                          char* buffer,
-                                          u_long size,
-                                          File* appendFile,
-                                          FiltersChain* chain,
-                                          bool append,
-                                          bool useChunks)
+HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext* td, char* buffer,
+                           u_long size, File* appendFile, FiltersChain* chain,
+                                          bool append, bool useChunks)
 {
   u_long nbw;
 
   if (chain->hasModifiersFilters ())
     {
-      td->connection->host->warningsLogWrite ("HTTP<DATA HANDLER ERROR>: 
Filter chain has modifiers filters.");
+      td->connection->host->warningsLogWrite (_("Http: internal error"));
       return 1;
     }
 
@@ -160,27 +156,27 @@ HttpDataHandler::appendDataToHTTPChannel 
(HttpThreadContext* td,
 
           if (chain->flush (&flushNbw))
             {
-              td->connection->host->warningsLogWrite ("HTTP<DATA HANDLER 
ERROR>: unable to flush data.");
+              td->connection->host->warningsLogWrite (_("Http: internal 
error"));
               return 1;
             }
 
           if (chain->getStream ()->write (chunkHeader.str ().c_str (),
                                           chunkHeader.str ().length (), &nbw))
             {
-              td->connection->host->warningsLogWrite ("HTTP<DATA HANDLER 
ERROR>: unable to write data in the filters chain.");
+              td->connection->host->warningsLogWrite (_("Http: internal 
error"));
               return 1;
             }
         }
 
       if (size && chain->write (buffer, size, &nbw))
         {
-          td->connection->host->warningsLogWrite ("HTTP<DATA HANDLER ERROR>: 
unable to write data in the filters chain.");
+          td->connection->host->warningsLogWrite (_("Http: internal error"));
           return 1;
         }
 
       if (useChunks && chain->getStream ()->write ("\r\n", 2, &nbw))
         {
-          td->connection->host->warningsLogWrite ("HTTP<DATA HANDLER ERROR>: 
unable to write data in the filters chain.");
+          td->connection->host->warningsLogWrite (_("Http: internal error"));
           return 1;
         }
 



commit 2eb4cb4c7413a9e4006d49899fe2fefde02d2f20
Author: Giuseppe Scrivano <address@hidden>
Date:   Fri Aug 14 21:09:42 2009 +0200

    Don't specify the log location when a format string is used.

diff --git a/myserver/include/log/log_manager.h 
b/myserver/include/log/log_manager.h
index f90f336..b5250b7 100644
--- a/myserver/include/log/log_manager.h
+++ b/myserver/include/log/log_manager.h
@@ -48,11 +48,10 @@ public:
   int log (const void* owner, const string & type, const string & location,
            string & message, bool appendNL = false,
            LoggingLevel level = MYSERVER_LOG_MSG_INFO);
-  int log (const void* owner, const string & type, const string & location,
-           LoggingLevel level, bool ts, bool appendNL, const char *fmt, ...);
-  int log (const void* owner, const string & type, const string & location,
-           LoggingLevel level, bool ts, bool appendNL, const char *fmt,
-           va_list args);
+  int log (const void* owner, const string & type, LoggingLevel level,
+           bool ts, bool appendNL, const char *fmt, ...);
+  int log (const void* owner, const string & type, LoggingLevel level,
+           bool ts, bool appendNL, const char *fmt, va_list args);
 
   int close (const void *owner);
   int close (const void *owner, string type);
diff --git a/myserver/src/log/log_manager.cpp b/myserver/src/log/log_manager.cpp
index c6ba1bf..ceb0dca 100644
--- a/myserver/src/log/log_manager.cpp
+++ b/myserver/src/log/log_manager.cpp
@@ -532,9 +532,8 @@ LogManager::log (const void* owner, const string & type, 
const string & location
 
   try
     {
-      failure = notify (owner, type, location, MYSERVER_LOG_EVT_SET_MODE,
-                        &level) || notify (owner, type, location,
-                                           MYSERVER_LOG_EVT_LOG, &message);
+      failure = notify (owner, type, MYSERVER_LOG_EVT_SET_MODE, &level)
+        || notify (owner, type, MYSERVER_LOG_EVT_LOG, &message);
 
       if (appendNL)
         {
@@ -558,14 +557,12 @@ LogManager::log (const void* owner, const string & type, 
const string & location
 /*!
  * Write a message on a single LogStream specifying a formatting string.
  *
- * \see LogManager#log (void*, string, string, LoggingLevel, bool, bool,
- * va_list)
+ * \see LogManager#log (void*, string, LoggingLevel, bool, bool, va_list)
  * \return 0 on success, 1 on error.
  */
 int
-LogManager::log (const void* owner, const string & type, const string & 
location,
-                 LoggingLevel level, bool ts, bool appendNL, const char *fmt,
-                 ...)
+LogManager::log (const void* owner, const string & type, LoggingLevel level,
+                 bool ts, bool appendNL, const char *fmt, ...)
 {
   int failure = 0;
 
@@ -576,7 +573,7 @@ LogManager::log (const void* owner, const string & type, 
const string & location
 
   va_start (argptr, fmt);
 
-  failure = log (owner, type, location, level, ts, appendNL, fmt, argptr);
+  failure = log (owner, type, level, ts, appendNL, fmt, argptr);
 
   va_end (argptr);
 
@@ -588,7 +585,6 @@ LogManager::log (const void* owner, const string & type, 
const string & location
  *
  * \param owner The object that owns the LogStream.
  * \param type The log category where we want to write.
- * \param location The target LogStream.
  * \param message The message we want to write.
  * \param level The level of logging of this message. If it is less than
  * the LogManager's level of logging, the message will be discarded.
@@ -607,9 +603,8 @@ LogManager::log (const void* owner, const string & type, 
const string & location
  * \return 0 on success, 1 on error.
  */
 int
-LogManager::log (const void* owner, const string & type, const string &
-                 location, LoggingLevel level, bool ts, bool appendNL,
-                 const char *fmt, va_list args)
+LogManager::log (const void* owner, const string & type, LoggingLevel level,
+                 bool ts, bool appendNL, const char *fmt, va_list args)
 {
   int failure = 0;
 
@@ -627,7 +622,7 @@ LogManager::log (const void* owner, const string & type, 
const string &
           char time[38];
           int len;
           time[0] = '[';
-          getRFC822GMTTime(&time[1], 32);
+          getRFC822GMTTime (&time[1], 32);
           len = strlen(time);
           time[len + 0] = ']';
           time[len + 1] = ' ';
@@ -674,9 +669,9 @@ LogManager::log (const void* owner, const string & type, 
const string &
 
       string message = oss.str ();
 
-      failure = notify (owner, type, location, MYSERVER_LOG_EVT_SET_MODE,
-                        static_cast<void*>(&level)) || notify (owner, type,
-                                 location, MYSERVER_LOG_EVT_LOG, &message);
+      failure = notify (owner, type, MYSERVER_LOG_EVT_SET_MODE,
+                        static_cast<void*>(&level))
+             || notify (owner, type, MYSERVER_LOG_EVT_LOG, &message);
 
       if (appendNL)
         failure |= notify (owner, MYSERVER_LOG_EVT_LOG, &newline);
diff --git a/myserver/src/server/server.cpp b/myserver/src/server/server.cpp
index 957cc8d..99f1f96 100644
--- a/myserver/src/server/server.cpp
+++ b/myserver/src/server/server.cpp
@@ -1930,8 +1930,7 @@ int Server::logWriteln (LoggingLevel level, const char 
*fmt, ...)
 
   bool ts = (logLocation.find ("console://") == string::npos);
 
-  failure = logManager->log (this, "MAINLOG", logLocation, level, ts, true, 
fmt,
-                             argptr);
+  failure = logManager->log (this, "MAINLOG", level, ts, true, fmt, argptr);
 
   va_end (argptr);
 

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

Summary of changes:
 myserver/include/conf/vhost/vhost.h                |  130 ++--
 myserver/include/conf/vhost/vhost_manager.h        |   51 +-
 myserver/include/log/log_manager.h                 |    9 +-
 .../include/protocol/control/control_protocol.h    |    7 +-
 myserver/src/conf/vhost/vhost.cpp                  |  216 +++---
 myserver/src/conf/vhost/vhost_manager.cpp          |  123 ++--
 .../src/connections_scheduler/listen_threads.cpp   |   10 +-
 myserver/src/http_handler/cgi/cgi.cpp              |   50 +-
 myserver/src/http_handler/fastcgi/fastcgi.cpp      |  155 ++---
 myserver/src/http_handler/http_dir/http_dir.cpp    |   86 +--
 myserver/src/http_handler/http_file/http_file.cpp  |   12 +-
 myserver/src/http_handler/isapi/isapi.cpp          |  451 +++++------
 myserver/src/http_handler/mscgi/mscgi.cpp          |   13 +-
 myserver/src/http_handler/proxy/proxy.cpp          |    4 +-
 myserver/src/http_handler/scgi/scgi.cpp            |  233 +++---
 myserver/src/http_handler/wincgi/wincgi.cpp        |  528 +++++++-------
 myserver/src/log/log_manager.cpp                   |   29 +-
 myserver/src/protocol/control/control_protocol.cpp |  788 +++++++++-----------
 myserver/src/protocol/ftp/ftp.cpp                  |   18 +-
 myserver/src/protocol/http/http.cpp                |   90 +--
 myserver/src/protocol/http/http_data_handler.cpp   |   26 +-
 myserver/src/server/server.cpp                     |    3 +-
 22 files changed, 1354 insertions(+), 1678 deletions(-)


hooks/post-receive
-- 
GNU MyServer




reply via email to

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