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


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. d7643643172ad3f5985c2a2d1a6cf9101a8b3617
Date: Sun, 09 Aug 2009 11:33:38 +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  d7643643172ad3f5985c2a2d1a6cf9101a8b3617 (commit)
       via  228016520d88c39710737474d5d7b235f9427dc4 (commit)
      from  40159f18d6d81acded8f0e875075105aa0a68b63 (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 d7643643172ad3f5985c2a2d1a6cf9101a8b3617
Author: Giuseppe Scrivano <address@hidden>
Date:   Sun Aug 9 13:30:35 2009 +0200

    MSCGI is used if (WIN32 | HAVE_DL), not when DO_NOT_USE_MSCGI is defined.

diff --git a/myserver/include/http_handler/mscgi/mscgi.h 
b/myserver/include/http_handler/mscgi/mscgi.h
index b8d4f2a..fb408ca 100644
--- a/myserver/include/http_handler/mscgi/mscgi.h
+++ b/myserver/include/http_handler/mscgi/mscgi.h
@@ -1,19 +1,19 @@
 /* -*- mode: c++ -*- */
 /*
-MyServer
-Copyright (C) 2002, 2003, 2004, 2006, 2007, 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
-(at your option) any later version.
+  MyServer
+  Copyright (C) 2002, 2003, 2004, 2006, 2007, 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
+  (at your option) any later version.
 
-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.
+  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.
 
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #ifndef MSCGI_H
@@ -48,26 +48,21 @@ struct MsCgiData
 
 };
 
-typedef int (*CGIMAIN)(const char*, MsCgiData*); 
+typedef int (*CGIMAIN)(const char*, MsCgiData*);
 
 class MsCgi : public HttpDataHandler
 {
 public:
        virtual int load();
        virtual int unLoad();
-       /*!
-       *Use this to send a MSCGI file through the HTTP protocol.
-       */
        virtual int send(HttpThreadContext*, const char* exec,
                    const char* cmdLine = 0, bool execute = false,
                    bool onlyHeader = false);
 
        int write(const char*, u_long, MsCgiData*);
        int sendHeader(MsCgiData*);
+
 private:
-       /*!
-        *Store the MSCGI library module handle.
-        */
        static DynamicLibrary mscgiModule;
        MsCgiData data;
 };
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp 
b/myserver/src/http_handler/mscgi/mscgi.cpp
index 1177d54..e479b0b 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -1,18 +1,18 @@
 /*
-MyServer
-Copyright (C) 2002, 2003, 2004, 2006, 2007, 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
-(at your option) any later version.
-
-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.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  MyServer
+  Copyright (C) 2002, 2003, 2004, 2006, 2007, 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
+  (at your option) any later version.
+
+  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.
+
+  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 "stdafx.h"
@@ -27,55 +27,47 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 #include <include/base/utility.h>
 #include <include/filter/filters_chain.h>
 #include <sstream>
-using namespace std; 
+using namespace std;
 
 DynamicLibrary MsCgi::mscgiModule;
 
 /*!
- *Sends the MyServer CGI; differently from standard CGI this doesn't 
- *need a new process to run making it faster.
- *\param td The HTTP thread context.
- *\param exec The script path.
- *\param cmdLine The command line.
- *\param execute Specify if the script has to be executed.
- *\param onlyHeader Specify if send only the HTTP header.
+ * Entry-point for the MyServer CGI; differently from standard CGI this doesn't
+ * need a new process to run making it faster.
+ * \param td The HTTP thread context.
+ * \param exec The script path.
+ * \param cmdLine The command line.
+ * \param execute Specify if the script has to be executed.
+ * \param onlyHeader Specify if send only the HTTP header.
  */
-int MsCgi::send(HttpThreadContext* td, const char* exec, const char* cmdLine,
-                bool /*execute*/, bool onlyHeader)
-
+int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
+                 bool /*execute*/, bool onlyHeader)
 {
   /*
-   *This is the code for manage a .mscgi file.
-   *This files differently from standard CGI don't need a new process to run
-   *but are allocated in the caller process virtual space.
-   *Usually these files are faster than standard CGI.
-   *Actually myServerCGI(.mscgi) is only at an alpha status.
+   * This is the code for manage a .mscgi file.
+   * This files differently from standard CGI don't need a new process to run
+   * but are allocated in the caller process virtual space.
+   * Usually these files are faster than standard CGI.
+   * Actually myServerCGI(.mscgi) is only at an alpha status.
    */
   ostringstream tmpStream;
   string outDataPath;
   FiltersChain chain;
   u_long nbw;
-#ifndef WIN32
-#ifdef DO_NOT_USE_MSCGI
-  /*!
-   *On the platforms where is not available the MSCGI support send a 
-   *non implemented error.
-   */
-  return td->http->raiseHTTPError(501);
-#endif
-#endif
-
-#ifndef DO_NOT_USE_MSCGI 
-  DynamicLibrary hinstLib; 
+  DynamicLibrary hinstLib;
   CGIMAIN ProcMain = 0;
   int ret = 0;
 
-   data.envString = td->request.uriOptsPtr ?
-                    td->request.uriOptsPtr : (char*) td->buffer->getBuffer();
-  
+#if !(WIN32 | HAVE_DL)
+  return td->http->raiseHTTPError (501);
+#endif
+
+  data.envString = td->request.uriOptsPtr ?
+    td->request.uriOptsPtr : (char*) td->buffer->getBuffer();
+
   data.td = td;
   data.errorPage = 0;
-  data.server = Server::getInstance();
+  data.server = Server::getInstance ();
   data.mscgi = this;
   data.useChunks = false;
   data.onlyHeader = onlyHeader ? true : false;
@@ -86,162 +78,156 @@ int MsCgi::send(HttpThreadContext* td, const char* exec, 
const char* cmdLine,
   data.useChunks = false;
 
   if (!(td->permissions & MYSERVER_PERMISSION_EXECUTE))
-    return td->http->sendAuth();
+    return td->http->sendAuth ();
 
-  td->scriptPath.assign(exec);
+  td->scriptPath.assign (exec);
 
   {
     string tmp;
-    tmp.assign(exec);
-    FilesUtility::splitPath(tmp, td->cgiRoot, td->cgiFile);
-    FilesUtility::splitPath(exec, td->scriptDir, td->scriptFile);
+    tmp.assign (exec);
+    FilesUtility::splitPath (tmp, td->cgiRoot, td->cgiFile);
+    FilesUtility::splitPath (exec, td->scriptDir, td->scriptFile);
   }
 
-  Env::buildEnvironmentString(td,data.envString);
-  
-  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, 
-                                                                   1))
-  {
-    td->connection->host->warningsLogWrite("MSCGI: Error loading filters");
-    chain.clearAllFilters(); 
-    return td->http->raiseHTTPError(500);
-  }
+  Env::buildEnvironmentString (td,data.envString);
 
-  checkDataChunks(td, &(data.keepAlive), &(data.useChunks));
+  chain.setProtocol (td->http);
+  chain.setProtocolData (td);
+  chain.setStream (td->connection->socket);
 
-  ret = hinstLib.loadLibrary(exec, 0);
+  if (td->mime && Server::getInstance ()->getFiltersFactory ()->chain(&chain,
+                                                                      
td->mime->filters,
+                                                                      
td->connection->socket,
+                                                                      &nbw,
+                                                                      1))
+    {
+      td->connection->host->warningsLogWrite ("MSCGI: Error loading filters");
+      chain.clearAllFilters ();
+      return td->http->raiseHTTPError (500);
+    }
+
+  checkDataChunks (td, &(data.keepAlive), &(data.useChunks));
+
+  ret = hinstLib.loadLibrary (exec, 0);
 
   if (ret)
-  {
-    string msg;
-    msg.assign ("MSCGI: cannot load ");
-    msg.append (exec);
-    td->connection->host->warningsLogWrite (msg.c_str ());
-    chain.clearAllFilters ();
-
-    /* Internal server error.  */
-    return td->http->raiseHTTPError(500);
-  }
+    {
+      string msg;
+      msg.assign ("MSCGI: cannot load ");
+      msg.append (exec);
+      td->connection->host->warningsLogWrite (msg.c_str ());
+      chain.clearAllFilters ();
 
-  td->secondaryBuffer->getAt(0) = '\0';
+      /* Internal server error.  */
+      return td->http->raiseHTTPError (500);
+    }
+
+  td->secondaryBuffer->getAt (0) = '\0';
 
   ProcMain = (CGIMAIN) hinstLib.getProc( "myserver_main");
-  if(ProcMain)
+  if (ProcMain)
     (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());
-      return td->http->raiseHTTPError(500);
+      msg.assign ("MSCGI: error accessing entrypoint for ");
+      msg.append (exec);
+      td->connection->host->warningsLogWrite (msg.c_str ());
+      return td->http->raiseHTTPError (500);
     }
-  hinstLib.close();
+  hinstLib.close ();
 
 
-  if(data.errorPage)
-  {
-    chain.clearAllFilters(); 
-    return td->http->raiseHTTPError(data.errorPage);
-  }
+  if (data.errorPage)
+    {
+      chain.clearAllFilters ();
+      return td->http->raiseHTTPError (data.errorPage);
+    }
 
-  if(!td->appendOutputs && data.useChunks && !data.error)
-  {
-    if(chain.getStream ()->write("0\r\n\r\n", 5, &nbw))
-      return 0;
-  }
+  if (!td->appendOutputs && data.useChunks && !data.error
+      && chain.getStream ()->write ("0\r\n\r\n", 5, &nbw))
+    return 0;
 
   if(!data.error)
     return 0;
 
-  {
-    ostringstream tmp;
-    tmp << td->sentData;
-    td->response.contentLength.assign(tmp.str()); 
-  }
-  chain.clearAllFilters(); 
-  return 1;
+  ostringstream tmp;
+  tmp << td->sentData;
+  td->response.contentLength.assign(tmp.str());
 
-#endif
+  chain.clearAllFilters ();
+  return 1;
 }
 
 /*!
- *Send a chunk of data to the client.
+ * Send a chunk of data to the client.
  */
-int MsCgi::write(const char* data, u_long len, MsCgiData* mcd)
+int MsCgi::write (const char* data, u_long len, MsCgiData* mcd)
 {
-  if(mcd->error)
+  if (mcd->error)
     return 1;
 
-  if(!mcd->headerSent)
-  {
-    if(sendHeader(mcd))
-       return 1;
-  }
+  if (!mcd->headerSent)
+    {
+      if (sendHeader (mcd))
+        return 1;
+    }
 
-  if(mcd->onlyHeader)
+  if (mcd->onlyHeader)
     return 0;
 
-  if(HttpDataHandler::appendDataToHTTPChannel(mcd->td, 
-                                              (char*) data,
-                                              len,
-                                              &(mcd->td->outputData), 
-                                              mcd->filtersChain,
-                                              mcd->td->appendOutputs, 
-                                              mcd->useChunks))
+  if (HttpDataHandler::appendDataToHTTPChannel (mcd->td,
+                                                (char*) data,
+                                                len,
+                                                &(mcd->td->outputData),
+                                                mcd->filtersChain,
+                                                mcd->td->appendOutputs,
+                                                mcd->useChunks))
     return 1;
 
   mcd->td->sentData +=len;
   return 0;
-
 }
 
 /*!
- *Send the HTTP header.
+ * Send the HTTP header.
  */
-int MsCgi::sendHeader(MsCgiData* mcd)
+int MsCgi::sendHeader (MsCgiData* mcd)
 {
-  if(mcd->error)
+  if (mcd->error)
     return 1;
 
-  if(mcd->headerSent)
+  if (mcd->headerSent)
     return 0;
 
-  if(!mcd->td->appendOutputs)
-  {
-    HttpThreadContext* td = mcd->td;
-    char *buffer = td->secondaryBuffer->getBuffer();
-    ConnectionPtr s = td->connection;
+  if (!mcd->td->appendOutputs)
+    {
+      HttpThreadContext* td = mcd->td;
+      char *buffer = td->secondaryBuffer->getBuffer();
+      ConnectionPtr s = td->connection;
 
-    u_long hdrLen = HttpHeaders::buildHTTPResponseHeader(buffer, 
&(td->response));
-    if(td->connection->socket->send(buffer, hdrLen, 0) == SOCKET_ERROR)
-      return 1;
-  }
+      u_long hdrLen = HttpHeaders::buildHTTPResponseHeader (buffer, 
&(td->response));
+      if(td->connection->socket->send (buffer, hdrLen, 0) == SOCKET_ERROR)
+        return 1;
+    }
 
   mcd->headerSent = true;
   return 0;
 }
 
 /*!
- *Map the library in the application address space.
- *\param confFile The xml parser with configuration.
+ * Map the library in the application address space.
+ * \param confFile The xml parser with configuration.
  */
-int MsCgi::load()
+int MsCgi::load ()
 {
   return 1;
 }
 
 /*!
- *Free the memory allocated by the MSCGI library.
+ * Free the memory allocated by the MSCGI library.
  */
-int MsCgi::unLoad()
- {
-  return mscgiModule.close();
+int MsCgi::unLoad ()
+{
+  return mscgiModule.close ();
 }



commit 228016520d88c39710737474d5d7b235f9427dc4
Author: Giuseppe Scrivano <address@hidden>
Date:   Sun Aug 9 13:20:37 2009 +0200

    Define HAVE_ZLIB when zlib is present instead of DO_NOT_USE_GZIP when it is 
not.

diff --git a/myserver/SConstruct b/myserver/SConstruct
index 828284e..bb7f16f 100644
--- a/myserver/SConstruct
+++ b/myserver/SConstruct
@@ -125,11 +125,11 @@ if  not env.GetOption('clean'):
         Exit(1)
 
     if not conf.CheckLib("ssl"):
-        conf.Define('DO_NOT_USE_SSL', 1)
-
+        print "gnutls is required by MyServer"
+        Exit(1)
 
-    if not conf.CheckLib("z"):
-        conf.Define('DO_NOT_USE_GZIP', 1)
+    if conf.CheckLib("z"):
+        conf.Define('HAVE_ZLIB', 1)
 
     conf.CheckLib("event")
         
diff --git a/myserver/configure.in b/myserver/configure.in
index 7f170d2..8120b75 100644
--- a/myserver/configure.in
+++ b/myserver/configure.in
@@ -225,17 +225,10 @@ fi
 
 dnl Looking for zlib
 AC_CHECK_LIB(z, uncompress, have_libz=yes)
-if test x$have_libz != xyes; then
-    AC_MSG_WARN([
-*** Cannot find Zlib (http://www.gzip.org/zlib/)
-*** gzip file transfer will not be enabled
-])
-    AC_DEFINE(DO_NOT_USE_GZIP, 1, [Zlib compression, define to 1 to disable])
-    ZLIB_LIB=""
-else
+if test x$have_libz = xyes; then
+   AC_DEFINE(HAVE_ZLIB, 1, [Define if the ZLIB library is present])
     ZLIB_LIB="-lz"
 
-
     dnl Be sure that it is a good vr
     AC_CHECK_LIB(z, compressBound, have_libz=yes)
     if test x$have_libz != xyes; then
@@ -244,8 +237,14 @@ else
 *** compressBound checking will not be enabled
 ])
     else
-        AC_DEFINE(GZIP_CHECK_BOUNDS, 1, [Memory checking for Zlib, not defined 
in older vrs])
+        AC_DEFINE(GZIP_COMPRESS_BOUNDS, 1, [Memory checking for Zlib, not 
defined in older vrs])
     fi
+else
+    AC_MSG_WARN([
+*** Cannot find Zlib (http://www.gzip.org/zlib/)
+*** gzip file transfer will not be enabled
+])
+    ZLIB_LIB=""
 fi
 
 AC_SUBST(ZLIB_LIB)
diff --git a/myserver/include/base/string/stringutils.h 
b/myserver/include/base/string/stringutils.h
index f5ece8a..8b777d0 100644
--- a/myserver/include/base/string/stringutils.h
+++ b/myserver/include/base/string/stringutils.h
@@ -58,8 +58,8 @@ int hexVal (char c);
 void translateEscapeString (char *TargetStr);
 void translateEscapeString (string& TargetStr);
 
-int hexToInt(const char *str);
-inline time_t hexToInt(string const& str){ return hexToInt(str.c_str ()); }
+int hexToInt (const char *str);
+inline time_t hexToInt (string const& str){ return hexToInt(str.c_str ()); }
 
 int getEndLine (const char* str, int max);
 inline int getEndLine (string const& str, int max)
@@ -67,7 +67,7 @@ inline int getEndLine (string const& str, int max)
 
 string trim (string const& s, string const&t = " ");
 string trimLeft ( string const &s , string const &t = " " );
-string trimRight ( string const &s , string const &t = " " );
+string trimRight (string const &s , string const &t = " " );
 
 int stringcmpi (string const &a, string const &b);
 int stringcmp (string const &a, string const &b);
@@ -78,7 +78,7 @@ int stringcmp (string const &a, const char* b);
 #ifndef WIN32
 extern "C"
 {
-char* strupr(char * string);
+char* strupr (char * string);
 # include <string.h>
 }
 #endif
diff --git a/myserver/include/filter/gzip/gzip.h 
b/myserver/include/filter/gzip/gzip.h
index 69c881e..6fbd377 100755
--- a/myserver/include/filter/gzip/gzip.h
+++ b/myserver/include/filter/gzip/gzip.h
@@ -1,19 +1,19 @@
 /* -*- mode: c++ -*- */
 /*
-MyServer
-Copyright (C) 2002, 2003, 2004 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
-(at your option) any later version.
-
-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.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  MyServer
+  Copyright (C) 2002, 2003, 2004, 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
+  (at your option) any later version.
+
+  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.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #ifndef GZIP_H
@@ -21,14 +21,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 #include "stdafx.h"
 #include <include/filter/filter.h>
 
-/*! If is defined DO_NOT_USE_GZIP don't use the zlib library. */
-#ifndef DO_NOT_USE_GZIP        
-/*! Include the ZLIB library header file. */
-#include "zlib.h"              
-#endif
-
-#ifdef DO_NOT_USE_GZIP 
-#define z_stream (void*)
+#ifdef HAVE_ZLIB
+# include "zlib.h"
+#else
+# define z_stream (void*)
 #endif
 
 #define GZIP_HEADER_LENGTH             10
@@ -46,37 +42,35 @@ public:
                u_long data_size;
                u_long initialized;
        };
-       
 
-#ifdef GZIP_CHECK_BOUNDS       
-       static u_long compressBound(int size);
-#endif
 
-  Gzip();
-  ~Gzip();
+       static u_long compressBound (int size);
+
+  Gzip ();
+  ~Gzip ();
+
+       static u_long headerSize ();
+       static u_long footerSize ();
 
-       static u_long headerSize();
-       static u_long footerSize();
+       u_long updateCRC (char* buffer,int size);
+       u_long getFooter (char *str,int size);
+       u_long initialize ();
+       u_long compress (const char* in, u_long sizeIn,
+                   char *out,u_long sizeOut);
+       u_long free ();
+       u_long flush (char *out,u_long sizeOut);
+       u_long getHeader (char *buffer,u_long buffersize);
 
-       u_long updateCRC(char* buffer,int size);
-       u_long getFooter(char *str,int size);
-       u_long initialize();
-       u_long compress(const char* in, u_long sizeIn, 
-                  char *out,u_long sizeOut);
-       u_long free();
-       u_long flush(char *out,u_long sizeOut);
-       u_long getHeader(char *buffer,u_long buffersize);
+  static Filter* factory (const char* name);
 
-  static Filter* factory(const char* name);
- 
   /*! From Filter*/
-  virtual int getHeader(char* buffer, u_long len, u_long* nbw);
-  virtual int getFooter(char* buffer, u_long len, u_long* nbw);
-  virtual int read(char* buffer, u_long len, u_long*);
-  virtual int write(const char* buffer, u_long len, u_long*);
-       virtual int flush(u_long*);
-       virtual int modifyData();
-  virtual const char* getName(char* name, u_long len);
+  virtual int getHeader (char* buffer, u_long len, u_long* nbw);
+  virtual int getFooter (char* buffer, u_long len, u_long* nbw);
+  virtual int read (char* buffer, u_long len, u_long*);
+  virtual int write (const char* buffer, u_long len, u_long*);
+       virtual int flush (u_long*);
+       virtual int modifyData ();
+  virtual const char* getName (char* name, u_long len);
 private:
        int active;
        GzipData data;
diff --git a/myserver/include/filter/gzip/gzip_decompress.h 
b/myserver/include/filter/gzip/gzip_decompress.h
index b34ef48..e6f2fbf 100755
--- a/myserver/include/filter/gzip/gzip_decompress.h
+++ b/myserver/include/filter/gzip/gzip_decompress.h
@@ -1,7 +1,7 @@
 /* -*- mode: c++ -*- */
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 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
@@ -18,18 +18,15 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 
 #ifndef GZIP_DECOMPRESS_H
 #define GZIP_DECOMPRESS_H
+
 #include "stdafx.h"
 #include <include/filter/filter.h>
 #include <include/filter/gzip/gzip.h>
 
-/*! If is defined DO_NOT_USE_GZIP don't use the zlib library. */
-#ifndef DO_NOT_USE_GZIP        
-/*! Include the ZLIB library header file. */
-#include "zlib.h"              
-#endif
-
-#ifdef DO_NOT_USE_GZIP 
-#define z_stream (void*)
+#ifdef HAVE_ZLIB
+# include "zlib.h"
+#else
+# define z_stream (void*)
 #endif
 
 
@@ -43,7 +40,7 @@ public:
                u_long data_size;
                u_long initialized;
        };
-       
+
 
   GzipDecompress();
   ~GzipDecompress();
@@ -51,7 +48,7 @@ public:
        u_long updateCRC(char* buffer,int size);
        u_long getFooter(char *str,int size);
        u_long initialize();
-       u_long decompress(const char* in, u_long sizeIn, 
+       u_long decompress(const char* in, u_long sizeIn,
                                                                                
char *out,u_long sizeOut);
        u_long free();
        u_long flush(char *out,u_long sizeOut);
@@ -61,7 +58,7 @@ public:
 
        static u_long headerSize();
        static u_long footerSize();
- 
+
   /*! From Filter*/
   virtual int getHeader(char* buffer, u_long len, u_long* nbw);
   virtual int getFooter(char* buffer, u_long len, u_long* nbw);
diff --git a/myserver/src/base/pipe/pipe.cpp b/myserver/src/base/pipe/pipe.cpp
index 3171019..5dc9180 100644
--- a/myserver/src/base/pipe/pipe.cpp
+++ b/myserver/src/base/pipe/pipe.cpp
@@ -1,18 +1,18 @@
 /*
-MyServer
-Copyright (C) 2002, 2003, 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
-(at your option) any later version.
-
-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.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  MyServer
+  Copyright (C) 2002, 2003, 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
+  (at your option) any later version.
+
+  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.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 
@@ -50,38 +50,38 @@ using namespace std;
  *\param len Buffer size.
  *\param nbr Get how many bytes were read.
  */
-int Pipe::read(char* buffer, u_long len, u_long *nbr)
+int Pipe::read (char* buffer, u_long len, u_long *nbr)
 {
   *nbr = 0;
 #ifndef WIN32
   int ret = ::read(handles[0], buffer, len);
   if(ret == -1)
-  {
-    terminated = true;
-    return 1;
-  }
+    {
+      terminated = true;
+      return 1;
+    }
   else if(!ret)
-  {
-    terminated = true;
-    return 0;
-  }
+    {
+      terminated = true;
+      return 0;
+    }
   else
-  {
-    *nbr = (u_long)ret;
-  }
+    {
+      *nbr = (u_long)ret;
+    }
   return 0;
 #else
   if( !ReadFile(readHandle, buffer, len, nbr, NULL) || !nbr)
-  {
-    *nbr = 0;
-    if(GetLastError() != ERROR_BROKEN_PIPE)
-      return 1;
-    else
     {
-      terminated = true;
-      return 0;
+      *nbr = 0;
+      if(GetLastError() != ERROR_BROKEN_PIPE)
+        return 1;
+      else
+        {
+          terminated = true;
+          return 0;
+        }
     }
-  }
   return 0;
 #endif
 
@@ -94,7 +94,7 @@ int Pipe::read(char* buffer, u_long len, u_long *nbr)
  *\param readPipe Specify if the current process uses it for read.  A false
  *value means the process uses it to write.
  */
-int Pipe::create(bool readPipe)
+int Pipe::create (bool readPipe)
 {
 #ifndef WIN32
 
@@ -110,33 +110,33 @@ int Pipe::create(bool readPipe)
   sa.nLength = sizeof(SECURITY_ATTRIBUTES);
   sa.bInheritHandle = TRUE;
   sa.lpSecurityDescriptor = NULL;
-  if(!CreatePipe(&readHandle, &writeHandle, &sa, 0))
+  if (!CreatePipe (&readHandle, &writeHandle, &sa, 0))
     return 1;
-    
-  if(readPipe)
-  {
-    if(!DuplicateHandle(GetCurrentProcess(), readHandle, 
-                        GetCurrentProcess(), &tmp, 0, 
-                        FALSE, DUPLICATE_SAME_ACCESS))
+
+  if (readPipe)
     {
-      close();
-      return 1;                    
+      if (!DuplicateHandle (GetCurrentProcess (), readHandle,
+                            GetCurrentProcess (), &tmp, 0,
+                            FALSE, DUPLICATE_SAME_ACCESS))
+        {
+          close ();
+          return 1;
+        }
+      CloseHandle (readHandle);
+      readHandle = tmp;
     }
-    CloseHandle(readHandle);
-    readHandle = tmp;
-  }
   else
-  {
-    if(!DuplicateHandle(GetCurrentProcess(), writeHandle, 
-                        GetCurrentProcess(), &tmp, 0, 
-                        FALSE, DUPLICATE_SAME_ACCESS))
     {
-      close();
-      return 1;                    
+      if (!DuplicateHandle (GetCurrentProcess (), writeHandle,
+                            GetCurrentProcess (), &tmp, 0,
+                            FALSE, DUPLICATE_SAME_ACCESS))
+        {
+          close ();
+          return 1;
+        }
+      CloseHandle (writeHandle);
+      writeHandle = tmp;
     }
-    CloseHandle(writeHandle);
-    writeHandle = tmp;
-  }
   return 0;
 #endif
 }
@@ -147,20 +147,20 @@ int Pipe::create(bool readPipe)
  *\param len Buffer size.
  *\param nbw Get how many bytes were written.
  */
-int Pipe::write(const char* buffer, u_long len, u_long *nbw)
+int Pipe::write (const char* buffer, u_long len, u_long *nbw)
 {
   *nbw = 0;
 #ifndef WIN32
-  int ret = ::write(handles[1], buffer, len);
-  if(ret == -1)
-  {
-    terminated = true;
-    return 1;
-  }
+  int ret = ::write (handles[1], buffer, len);
+  if (ret == -1)
+    {
+      terminated = true;
+      return 1;
+    }
   else
     *nbw = (u_long) ret;
 #else
-  return !WriteFile(writeHandle, buffer, len, nbw, NULL);
+  return !WriteFile (writeHandle, buffer, len, nbw, NULL);
 #endif
   return 0;
 }
@@ -168,7 +168,7 @@ int Pipe::write(const char* buffer, u_long len, u_long *nbw)
 /*!
  *Get the handle to use to read from the pipe.
  */
-long Pipe::getReadHandle()
+long Pipe::getReadHandle ()
 {
 #ifndef WIN32
   return handles[0];
@@ -180,7 +180,7 @@ long Pipe::getReadHandle()
 /*!
  *Get the handle used to write to the pipe.
  */
-long Pipe::getWriteHandle()
+long Pipe::getWriteHandle ()
 {
 #ifndef WIN32
   return handles[1];
@@ -193,31 +193,31 @@ long Pipe::getWriteHandle()
 /*!
  *Close the pipe.
  */
-int Pipe::close()
+int Pipe::close ()
 {
   terminated = true;
 #ifndef WIN32
-  if(handles[0])
-    ::close(handles[0]);
-  if(handles[1])
-    ::close(handles[1]);
+  if (handles[0])
+    ::close (handles[0]);
+  if (handles[1])
+    ::close (handles[1]);
   handles[0] = handles[1] = 0;
 #else
-  if(readHandle)
-    CloseHandle(readHandle);
-  if(writeHandle)
-    CloseHandle(writeHandle);
+  if (readHandle)
+    CloseHandle (readHandle);
+  if (writeHandle)
+    CloseHandle (writeHandle);
   readHandle = writeHandle = 0;
 #endif
   return 0;
 }
 
 /*!
- *Invert the current pipe on another instance of the class.
- *The input will be used as output and viceversa.
- *\param pipe The pipe where write.
+ * Invert the current pipe on another instance of the class.
+ * The input will be used as output and viceversa.
+ * \param pipe The pipe where write.
  */
-void Pipe::inverted(Pipe& pipe)
+void Pipe::inverted (Pipe& pipe)
 {
 #ifndef WIN32
   handles[0] = pipe.handles[1];
@@ -228,7 +228,7 @@ void Pipe::inverted(Pipe& pipe)
 #endif
 }
 
-Pipe::Pipe()
+Pipe::Pipe ()
 {
   terminated = false;
 #ifndef WIN32
@@ -241,43 +241,42 @@ Pipe::Pipe()
 /*!
  *Close the read stream of the pipe.
  */
-void Pipe::closeRead()
+void Pipe::closeRead ()
 {
   terminated = true;
 #ifndef WIN32
-  if(handles[0])
-    ::close(handles[0]);
+  if (handles[0])
+    ::close (handles[0]);
   handles[0] = 0;
 #else
   if(readHandle)
     CloseHandle(readHandle);
   readHandle = 0;
 #endif
-
 }
 
 /*!
- *Close the write stream of the pipe.
+ * Close the write stream of the pipe.
  */
-void Pipe::closeWrite()
+void Pipe::closeWrite ()
 {
   terminated = true;
 #ifndef WIN32
-  if(handles[1])
-    ::close(handles[1]);
+  if (handles[1])
+    ::close (handles[1]);
   handles[1] = 0;
 #else
-  if(writeHandle)
-    CloseHandle(writeHandle);
-    writeHandle = 0;
+  if (writeHandle)
+    CloseHandle (writeHandle);
+  writeHandle = 0;
 #endif
 }
 
 /*!
- *Wait until new data is ready.  Do not wait more 
- *than the specified timeout.
- *\param sec Seconds part of the timeout.
- *\param usec Micro seconds part of the timeout.
+ * Wait until new data is ready.  Do not wait more
+ * than the specified timeout.
+ * \param sec Seconds part of the timeout.
+ * \param usec Micro seconds part of the timeout.
  */
 int Pipe::waitForData (int sec, int usec)
 {
@@ -309,22 +308,19 @@ int Pipe::waitForData (int sec, int usec)
   tv.tv_sec = sec;
   tv.tv_usec = usec;
 
-  FD_ZERO(&readfds);
+  FD_ZERO (&readfds);
 
-  FD_SET(handles[0], &readfds);
+  FD_SET (handles[0], &readfds);
 
-  ret = ::select(handles[0] + 1, &readfds, NULL, NULL, &tv);
+  ret = ::select (handles[0] + 1, &readfds, NULL, NULL, &tv);
 
-  if(ret == -1 || ret == 0)
-  {
+  if (ret == -1 || ret == 0)
     return 0;
-  }
 
-  if (FD_ISSET(handles[0], &readfds))
+  if (FD_ISSET (handles[0], &readfds))
     return 1;
 
   return 0;
 #endif
-
   return 0;
 }
diff --git a/myserver/src/filter/gzip/gzip.cpp 
b/myserver/src/filter/gzip/gzip.cpp
index 503f160..ec524c8 100755
--- a/myserver/src/filter/gzip/gzip.cpp
+++ b/myserver/src/filter/gzip/gzip.cpp
@@ -19,45 +19,45 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 #include <include/base/string/securestr.h>
 #include <include/protocol/http/http.h>
 
-extern "C" {
+extern "C"
+{
 #ifdef WIN32
-#include <direct.h>
-#include <errno.h>
+# include <direct.h>
+# include <errno.h>
 #endif
 #ifndef WIN32
-#include <string.h>
-#include <errno.h>
+# include <string.h>
+# include <errno.h>
 #endif
 }
+
 #ifdef WIN32
-#include <algorithm>
+# include <algorithm>
 #endif
 
-char GZIP_HEADER[] = {(char)0x1f, (char)0x8b, Z_DEFLATED, 
-                      0, 0, 0, 0, 0, 0, 0x03};
+char GZIP_HEADER[] = {(char)0x1f, (char)0x8b, Z_DEFLATED,
+                                 0, 0, 0, 0, 0, 0, 0x03};
 
 
 /*!
- *Initialize the gzip structure value.
+ * Initialize the gzip structure value.
  */
-u_long Gzip::initialize()
+u_long Gzip::initialize ()
 {
-#ifndef DO_NOT_USE_GZIP    
+#ifdef HAVE_ZLIB
   long level = Z_DEFAULT_COMPRESSION;
 
   if(protocol && protocolData)
-  {
-    if(!strstr(protocol->registerName(0,0), "HTTP"))
     {
-      HttpRequestHeader::Entry* e = 
((HttpThreadContext*)protocolData)->request.other.get("Accept-Encoding");
-      if(e)
-      {
-        active &= (e->value->find("gzip") != string::npos);
-      }
-      else
-        active = false;
+      if(!strstr(protocol->registerName(0,0), "HTTP"))
+        {
+          HttpRequestHeader::Entry* e = 
((HttpThreadContext*)protocolData)->request.other.get ("Accept-Encoding");
+          if (e)
+            active &= (e->value->find("gzip") != string::npos);
+          else
+            active = false;
+        }
     }
-  }
   data.initialized = 1;
   data.data_size = 0;
   data.crc = crc32(0L, Z_NULL, 0);
@@ -65,42 +65,41 @@ u_long Gzip::initialize()
   data.stream.zfree = Z_NULL;
   data.stream.opaque = Z_NULL;
   data.stream.data_type = Z_BINARY;
-  return deflateInit2(&(data.stream), level, Z_DEFLATED,-MAX_WBITS, 
MAX_MEM_LEVEL,0);
-#else 
+  return deflateInit2 (&(data.stream), level, Z_DEFLATED, -MAX_WBITS, 
MAX_MEM_LEVEL, 0);
+#else
   return 0;
 #endif
 
 }
 
-#ifdef GZIP_CHECK_BOUNDS  
-u_long Gzip::compressBound(int size)
+u_long Gzip::compressBound (int size)
 {
-#ifdef compressBound 
-  return compressBound(size);
+#ifdef GZIP_COMPRESS_BOUNDS
+# ifdef GZIP_CHECK_BOUNDS
+  return ::compressBound (size);
+# endif
 #else
-  return 0;
-#endif  
-}
+  return -1;
 #endif
+}
 
 /*!
- *Compress the in buffer to the out buffer using the gzip compression.
- *\param in Buffer to compress.
- *\param sizeIn The dimension of the buffer to compress.
- *\param out Buffer where compress.
- *\param sizeOut The dimension of the buffer where compress.
+ * Compress the in buffer to the out buffer using the gzip compression.
+ * \param in Buffer to compress.
+ * \param sizeIn The dimension of the buffer to compress.
+ * \param out Buffer where compress.
+ * \param sizeOut The dimension of the buffer where compress.
  */
-u_long Gzip::compress(const char* in, u_long sizeIn, 
-                      char *out, u_long sizeOut)
+u_long Gzip::compress (const char* in, u_long sizeIn,
+                       char *out, u_long sizeOut)
 {
-#ifndef DO_NOT_USE_GZIP
+#ifdef HAVE_ZLIB
   u_long old_total_out = data.stream.total_out;
   u_long ret;
 
-#ifdef GZIP_CHECK_BOUNDS
-  if(compressBound(sizeIn) > (u_long)sizeOut)
+  if (compressBound (sizeIn) > (u_long)sizeOut)
     return 0;
-#endif
+
   data.stream.data_type = Z_BINARY;
   data.stream.next_in = (Bytef*) in;
   data.stream.avail_in = sizeIn;
@@ -111,64 +110,60 @@ u_long Gzip::compress(const char* in, u_long sizeIn,
   data.data_size += data.stream.total_out - old_total_out;
   data.crc = crc32(data.crc, (const Bytef *) in, sizeIn);
   return data.stream.total_out - old_total_out;
-#else 
-  /*!
-   *If is specified DO_NOT_USE_GZIP copy the input buffer 
-   *to the output one as it is.
-   */
-  memcpy(out, in, std::min(sizeIn, sizeOut));
-  return std::min(sizeIn, sizeOut);
+#else
+  memcpy (out, in, std::min (sizeIn, sizeOut));
+  return std::min (sizeIn, sizeOut);
 #endif
 }
 
 /*!
- *Close the gzip compression.
+ * Close the gzip compression.
  */
-u_long Gzip::free()
+u_long Gzip::free ()
 {
   u_long ret = 0;
-#ifndef DO_NOT_USE_GZIP
-  
-  if(data.initialized == 0)
+#ifdef HAVE_ZLIB
+  if (!data.initialized)
     return 0;
+
   data.initialized = 0;
-  ret = deflateEnd(&(data.stream));
+  ret = deflateEnd (&(data.stream));
 #endif
   return ret;
 }
 
-/*! 
- *Inherited from Filter.
- *\param buffer Buffer where write.
- *\param len Buffer length.
- *\param nbw Numbers of written bytes.
+/*!
+ * Inherited from Filter.
+ * \param buffer Buffer where write.
+ * \param len Buffer length.
+ * \param nbw Numbers of written bytes.
  */
-int Gzip::getHeader(char* buffer, u_long len, u_long* nbw)
+int Gzip::getHeader (char* buffer, u_long len, u_long* nbw)
 {
-  *nbw = getHeader(buffer, len);
+  *nbw = getHeader (buffer, len);
   return !(*nbw);
 }
 
-/*! 
- *Inherited from Filter.
- *\param buffer Buffer where write.
- *\param len Buffer length.
- *\param nbw Numbers of written bytes.
+/*!
+ * Inherited from Filter.
+ * \param buffer Buffer where write.
+ * \param len Buffer length.
+ * \param nbw Numbers of written bytes.
  */
-int Gzip::getFooter(char* buffer, u_long len, u_long* nbw)
+int Gzip::getFooter (char* buffer, u_long len, u_long* nbw)
 {
-  if(len < GZIP_FOOTER_LENGTH)
+  if (len < GZIP_FOOTER_LENGTH)
     return -1;
-  getFooter(buffer, GZIP_FOOTER_LENGTH);
+  getFooter (buffer, GZIP_FOOTER_LENGTH);
   *nbw = GZIP_FOOTER_LENGTH;
   return 0;
 
 }
 
 /*!
- *The Gzip filter modifies the data. 
+ *The Gzip filter modifies the data.
  */
-int Gzip::modifyData()
+int Gzip::modifyData ()
 {
   return 1;
 }
@@ -178,9 +173,9 @@ int Gzip::modifyData()
  *\param out Buffer where write.
  *\param sizeOut Buffer length.
  */
-u_long Gzip::flush(char *out, u_long sizeOut)
+u_long Gzip::flush (char *out, u_long sizeOut)
 {
-#ifndef DO_NOT_USE_GZIP  
+#ifdef HAVE_ZLIB
   u_long old_total_out = data.stream.total_out;
   uLongf destLen = sizeOut;
 
@@ -189,42 +184,42 @@ u_long Gzip::flush(char *out, u_long sizeOut)
   data.stream.avail_in = 0;
   data.stream.next_out = (Bytef*) out;
   data.stream.avail_out = destLen;
-  deflate(&(data.stream), Z_FINISH);
+  deflate (&(data.stream), Z_FINISH);
 
   data.data_size += data.stream.total_out - old_total_out;
   return data.stream.total_out - old_total_out;
-#else 
+#else
   return 0;
 #endif
 }
 
-/*! 
- *Constructor for the class. 
+/*!
+ * Constructor for the class.
  */
-Gzip::Gzip()
+Gzip::Gzip ()
 {
   active = 1;
-  initialize();
+  initialize ();
 }
 
 /*!
- *Destructor for the class. 
+ * Destructor for the class.
  */
-Gzip::~Gzip()
+Gzip::~Gzip ()
 {
-  free();
+  free ();
 }
 
 /*!
- *Update the existent CRC.
- *\param buffer Buffer to look.
- *\param size Number of bytes to look.
+ * Update the existent CRC.
+ * \param buffer Buffer to look.
+ * \param size Number of bytes to look.
  */
-u_long Gzip::updateCRC(char* buffer, int size)
+u_long Gzip::updateCRC (char* buffer, int size)
 {
-#ifndef DO_NOT_USE_GZIP    
-  data.crc = crc32(data.crc, (const Bytef *) buffer, 
-                   (u_long)size);
+#ifdef HAVE_ZLIB
+  data.crc = crc32 (data.crc, (const Bytef *) buffer,
+                    (u_long)size);
   return data.crc;
 #else
   return 0;
@@ -236,9 +231,9 @@ u_long Gzip::updateCRC(char* buffer, int size)
  *\param footer Buffer where write.
  *\param size Buffer length.
  */
-u_long Gzip::getFooter(char *footer, int /*size*/)
+u_long Gzip::getFooter (char *footer, int /*size*/)
 {
-#ifndef DO_NOT_USE_GZIP    
+#ifdef HAVE_ZLIB
   footer[0] = (char) (data.crc) & 0xFF;
   footer[1] = (char) ((data.crc) >> 8) & 0xFF;
   footer[2] = (char) ((data.crc) >> 16) & 0xFF;
@@ -255,145 +250,144 @@ u_long Gzip::getFooter(char *footer, int /*size*/)
 }
 
 /*!
- *Copy the GZIP header in the buffer.
- *\param buffer Buffer where write.
- *\param buffersize Buffer length.
+ * Copy the GZIP header in the buffer.
+ * \param buffer Buffer where write.
+ * \param buffersize Buffer length.
  */
-u_long Gzip::getHeader(char *buffer,u_long buffersize)
+u_long Gzip::getHeader (char *buffer,u_long buffersize)
 {
-  if(buffersize < GZIP_HEADER_LENGTH)
+  if (buffersize < GZIP_HEADER_LENGTH)
     return 0;
-  memcpy(buffer, GZIP_HEADER, GZIP_HEADER_LENGTH);
+  memcpy (buffer, GZIP_HEADER, GZIP_HEADER_LENGTH);
   return GZIP_HEADER_LENGTH;
 }
 
-/*! 
+/*!
  *Inherited from Filter.
- *This function uses an internal buffer slowing it. 
+ *This function uses an internal buffer slowing it.
  *It is better to use directly the Gzip::compress routine where possible.
  *\param buffer Buffer where write.
  *\param len Buffer length.
  *\param nbr Number of read bytes.
  */
-int Gzip::read(char* buffer, u_long len, u_long *nbr)
+int Gzip::read (char* buffer, u_long len, u_long *nbr)
 {
   char *tmp_buff;
   int ret;
   u_long nbr_parent;
-  if(!parent)
+  if (!parent)
     return -1;
   tmp_buff = new char[len/2];
-  if(!tmp_buff)
-    return -1; 
-  
-  if(!active)
-    return parent->read(buffer, len, nbr);
+  if (!tmp_buff)
+    return -1;
 
-  ret = parent->read(tmp_buff, len/2, &nbr_parent);
+  if (!active)
+    return parent->read (buffer, len, nbr);
 
-  if(ret == -1)
-  {
-    delete [] tmp_buff;
-    return -1;
-  }
-  *nbr = compress(tmp_buff, nbr_parent, buffer, len);
+  ret = parent->read (tmp_buff, len/2, &nbr_parent);
+
+  if (ret == -1)
+    {
+      delete [] tmp_buff;
+      return -1;
+    }
+
+  *nbr = compress (tmp_buff, nbr_parent, buffer, len);
   delete [] tmp_buff;
   return 0;
 }
 
-/*! 
- *Inherited from Filter.
- *\param buffer Buffer where write.
- *\param len Buffer length.
- *\param nbw Number of written bytes.
+/*!
+ * Inherited from Filter.
+ * \param buffer Buffer where write.
+ * \param len Buffer length.
+ * \param nbw Number of written bytes.
  */
-int Gzip::write(const char* buffer, u_long len, u_long *nbw)
+int Gzip::write (const char* buffer, u_long len, u_long *nbw)
 {
   char tmpBuffer[1024];
   u_long written = 0;
   *nbw = 0;
 
-  /*! No stream to write to.  */
-  if(!parent)
+  /* No stream to write to.  */
+  if (!parent)
     return -1;
 
-  if(!active)
-    return parent->write(buffer, len, nbw);
+  if (!active)
+    return parent->write (buffer, len, nbw);
 
-  while(len)
-  {
-    u_long nbw_parent;
-    u_long size=std::min(len, 512UL);
-    u_long ret=compress(buffer, size, tmpBuffer, 1024);
+  while (len)
+    {
+      u_long nbw_parent;
+      u_long size=std::min (len, 512UL);
+      u_long ret=compress (buffer, size, tmpBuffer, 1024);
 
-    if(ret)
-      if(parent->write(tmpBuffer, ret, &nbw_parent) == -1 )
+      if(ret && parent->write(tmpBuffer, ret, &nbw_parent) == -1)
         return -1;
 
-    written += ret;
-    buffer += size;
-    len -= size;
-    *nbw += nbw_parent;
-  }
+      written += ret;
+      buffer += size;
+      len -= size;
+      *nbw += nbw_parent;
+    }
   return 0;
 }
 
-/*! 
- *Inherited from Filter.
- *\param nbw Number of flushed bytes.
+/*!
+ * Inherited from Filter.
+ * \param nbw Number of flushed bytes.
  */
-int Gzip::flush(u_long *nbw)
+int Gzip::flush (u_long *nbw)
 {
   char buffer[512];
 
-  if(!active)
+  if (!active)
     return 0;
 
-  *nbw = flush(buffer, 512);
-  if(*nbw)
-  {
-    u_long nbwParent;
-    u_long nbwParentFlush;
-    if(!parent)
-      return -1;
-    if(parent->write(buffer, *nbw, &nbwParent) != 0)
-      return -1;
-    if(parent->flush(&nbwParentFlush) != 0)
-      return -1;  
-    *nbw = nbwParentFlush + nbwParent;
-   }
+  *nbw = flush (buffer, 512);
+  if (*nbw)
+    {
+      u_long nbwParent;
+      u_long nbwParentFlush;
+      if (!parent)
+        return -1;
+      if (parent->write (buffer, *nbw, &nbwParent) != 0)
+        return -1;
+      if (parent->flush (&nbwParentFlush) != 0)
+        return -1;
+      *nbw = nbwParentFlush + nbwParent;
+    }
   return 0;
 }
 
 /*!
- *Returns a new Gzip object.
- *\param name Filter name.
+ * Returns a new Gzip object.
+ * \param name Filter name.
  */
-Filter* Gzip::factory(const char* name)
+Filter* Gzip::factory (const char* name)
 {
-  return new Gzip();
+  return new Gzip ();
 }
 
 /*!
- *Return a string with the filter name. 
- *If an external buffer is provided write the name there too.
- *\param name Buffer where write the filter name.
- *\param len Buffer size.
-*/
-const char* Gzip::getName(char* name, u_long len)
+ * Return a string with the filter name.
+ * If an external buffer is provided write the name there too.
+ * \param name Buffer where write the filter name.
+ * \param len Buffer size.
+ */
+const char* Gzip::getName (char* name, u_long len)
 {
   /*! No name by default. */
-  if(name)
-  {
-    myserver_strlcpy(name, "gzip", len);
-  }
+  if (name)
+    myserver_strlcpy (name, "gzip", len);
+
   return "gzip";
 }
 
 /*!
- *Get the GZIP header size.
+ * Get the GZIP header size.
  */
-u_long Gzip::headerSize()
+u_long Gzip::headerSize ()
 {
   return GZIP_HEADER_LENGTH;
 }
@@ -401,7 +395,7 @@ u_long Gzip::headerSize()
 /*!
  *Get the GZIP footer size.
  */
-u_long Gzip::footerSize()
+u_long Gzip::footerSize ()
 {
   return GZIP_FOOTER_LENGTH;
 }
diff --git a/myserver/src/filter/gzip/gzip_decompress.cpp 
b/myserver/src/filter/gzip/gzip_decompress.cpp
index 69cf25c..004766b 100755
--- a/myserver/src/filter/gzip/gzip_decompress.cpp
+++ b/myserver/src/filter/gzip/gzip_decompress.cpp
@@ -1,44 +1,43 @@
 /*
-MyServer
-Copyright (C) 2002, 2003, 2004, 2007, 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
-(at your option) any later version.
-
-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.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
+  MyServer
+  Copyright (C) 2002, 2003, 2004, 2007, 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
+  (at your option) any later version.
+
+  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.
+
+  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/filter/gzip/gzip_decompress.h>
 #include <include/base/string/securestr.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
 }
 #ifdef WIN32
-#include <algorithm>
+# include <algorithm>
 #endif
 
 /*!
- *Initialize the gzip structure value.
+ * Initialize the gzip structure value.
  */
-u_long GzipDecompress::initialize()
+u_long GzipDecompress::initialize ()
 {
-#ifndef DO_NOT_USE_GZIP    
-
+#ifdef HAVE_ZLIB
   data.initialized = 1;
   data.data_size = 0;
   data.stream.zalloc = Z_NULL;
@@ -47,24 +46,24 @@ u_long GzipDecompress::initialize()
   data.stream.avail_in = 0;
   data.stream.next_in = Z_NULL;
 
-  return inflateInit2(&(data.stream), -MAX_WBITS);
-#else 
+  return inflateInit2 (&(data.stream), -MAX_WBITS);
+#else
   return 0;
 #endif
 
 }
 
 /*!
- *Decompress the in buffer to the out buffer using the gzip compression.
- *\param in Buffer to decompress.
- *\param sizeIn The dimension of the buffer to decompress.
- *\param out Buffer where decompress.
- *\param sizeOut The dimension of the buffer where decompress.
+ * Decompress the in buffer to the out buffer using the gzip compression.
+ * \param in Buffer to decompress.
+ * \param sizeIn The dimension of the buffer to decompress.
+ * \param out Buffer where decompress.
+ * \param sizeOut The dimension of the buffer where decompress.
  */
-u_long GzipDecompress::decompress(const char* in, u_long sizeIn, 
-                                  char *out, u_long sizeOut)
+u_long GzipDecompress::decompress (const char* in, u_long sizeIn,
+                                   char *out, u_long sizeOut)
 {
-#ifndef DO_NOT_USE_GZIP
+#ifdef HAVE_ZLIB
   u_long old_total_out = data.stream.total_out;
   u_long ret;
   data.stream.data_type = Z_BINARY;
@@ -77,25 +76,21 @@ u_long GzipDecompress::decompress(const char* in, u_long 
sizeIn,
 
   data.data_size += data.stream.total_out - old_total_out;
   return data.stream.total_out - old_total_out;
-#else 
-  /*!
-   *If is specified DO_NOT_USE_GZIP copy the input buffer 
-   *to the output one as it is.
-   */
-  memcpy(out, in, std::min(sizeIn, sizeOut));
-  return std::min(sizeIn, sizeOut);
+#else
+  memcpy (out, in, std::min (sizeIn, sizeOut));
+  return std::min (sizeIn, sizeOut);
 #endif
 }
 
 /*!
- *Close the gzip compression.
+ * Close the gzip compression.
  */
-u_long GzipDecompress::free()
+u_long GzipDecompress::free ()
 {
   u_long ret = 0;
-#ifndef DO_NOT_USE_GZIP
-  
-  if(data.initialized == 0)
+#ifdef HAVE_ZLIB
+
+  if (data.initialized == 0)
     return 0;
   data.initialized = 0;
   ret = inflateEnd(&(data.stream));
@@ -103,36 +98,35 @@ u_long GzipDecompress::free()
   return ret;
 }
 
-/*! 
- *Inherited from Filter.
- *\param buffer Buffer where write.
- *\param len Buffer length.
- *\param nbw Numbers of written bytes.
+/*!
+ * Inherited from Filter.
+ * \param buffer Buffer where write.
+ * \param len Buffer length.
+ * \param nbw Numbers of written bytes.
  */
-int GzipDecompress::getHeader(char* buffer, u_long len, u_long* nbw)
+int GzipDecompress::getHeader (char* buffer, u_long len, u_long* nbw)
 {
-  *nbw = getHeader(buffer, len);
+  *nbw = getHeader (buffer, len);
   return !(*nbw);
 }
 
-/*! 
- *Inherited from Filter.
- *\param buffer Buffer where write.
- *\param len Buffer length.
- *\param nbw Numbers of written bytes.
+/*!
+ * Inherited from Filter.
+ * \param buffer Buffer where write.
+ * \param len Buffer length.
+ * \param nbw Numbers of written bytes.
  */
-int GzipDecompress::getFooter(char* buffer, u_long len, u_long* nbw)
+int GzipDecompress::getFooter (char* buffer, u_long len, u_long* nbw)
 {
-  if(len < GZIP_FOOTER_LENGTH)
+  if (len < GZIP_FOOTER_LENGTH)
     return -1;
-  getFooter(buffer, GZIP_FOOTER_LENGTH);
+  getFooter (buffer, GZIP_FOOTER_LENGTH);
   *nbw = GZIP_FOOTER_LENGTH;
   return 0;
-
 }
 
 /*!
- *The GzipDecompress filter modifies the data. 
+ * The GzipDecompress filter modifies the data.
  */
 int GzipDecompress::modifyData()
 {
@@ -140,13 +134,13 @@ int GzipDecompress::modifyData()
 }
 
 /*!
- *Flush all the remaining data.
- *\param out Buffer where write.
- *\param sizeOut Buffer length.
+ * Flush all the remaining data.
+ * \param out Buffer where write.
+ * \param sizeOut Buffer length.
  */
-u_long GzipDecompress::flush(char *out, u_long sizeOut)
+u_long GzipDecompress::flush (char *out, u_long sizeOut)
 {
-#ifndef DO_NOT_USE_GZIP  
+#ifdef HAVE_ZLIB
   u_long old_total_out = data.stream.total_out;
   uLongf destLen = sizeOut;
 
@@ -159,22 +153,22 @@ u_long GzipDecompress::flush(char *out, u_long sizeOut)
 
   data.data_size += data.stream.total_out - old_total_out;
   return data.stream.total_out - old_total_out;
-#else 
+#else
   return 0;
 #endif
 }
 
-/*! 
- *Constructor for the class. 
+/*!
+ * Constructor for the class.
  */
-GzipDecompress::GzipDecompress()
+GzipDecompress::GzipDecompress ()
 {
   active = 1;
-  initialize();
+  initialize ();
 }
 
 /*!
- *Destructor for the class. 
+ * Destructor for the class.
  */
 GzipDecompress::~GzipDecompress()
 {
@@ -182,13 +176,13 @@ GzipDecompress::~GzipDecompress()
 }
 
 /*!
- *Get the GZIP footer.
- *\param str Buffer where write.
- *\param size Buffer length.
+ * Get the GZIP footer.
+ * \param str Buffer where write.
+ * \param size Buffer length.
  */
-u_long GzipDecompress::getFooter(char *str,int /*size*/)
+u_long GzipDecompress::getFooter(char *str, int /*size*/)
 {
-#ifndef DO_NOT_USE_GZIP    
+#ifdef HAVE_ZLIB
   return GZIP_FOOTER_LENGTH;
 #else
   return 0;
@@ -196,27 +190,27 @@ u_long GzipDecompress::getFooter(char *str,int /*size*/)
 }
 
 /*!
- *Copy the GZIP header in the buffer.
- *\param buffer Buffer where write.
- *\param buffersize Buffer length.
+ * Copy the GZIP header in the buffer.
+ * \param buffer Buffer where write.
+ * \param buffersize Buffer length.
  */
-u_long GzipDecompress::getHeader(char *buffer,u_long buffersize)
+u_long GzipDecompress::getHeader (char *buffer, u_long buffersize)
 {
-  if(buffersize < GZIP_HEADER_LENGTH)
+  if (buffersize < GZIP_HEADER_LENGTH)
     return 0;
-  memcpy(buffer, GZIP_HEADER, GZIP_HEADER_LENGTH);
+  memcpy (buffer, GZIP_HEADER, GZIP_HEADER_LENGTH);
   return GZIP_HEADER_LENGTH;
 }
 
-/*! 
- *Inherited from Filter.
- *This function uses an internal buffer slowing it. 
- *It is better to use directly the GzipDecompress::compress routine where 
possible.
- *\param buffer Buffer where write.
- *\param len Buffer length.
- *\param nbr Number of read bytes.
+/*!
+ * Inherited from Filter.
+ * This function uses an internal buffer slowing it.
+ * It is better to use directly the GzipDecompress::compress routine where 
possible.
+ * \param buffer Buffer where write.
+ * \param len Buffer length.
+ * \param nbr Number of read bytes.
  */
-int GzipDecompress::read(char* buffer, u_long len, u_long *nbr)
+int GzipDecompress::read (char* buffer, u_long len, u_long *nbr)
 {
   char *tmp_buff;
   int ret;
@@ -224,117 +218,115 @@ int GzipDecompress::read(char* buffer, u_long len, 
u_long *nbr)
   if(!parent)
     return -1;
   tmp_buff = new char[len/2];
-  if(!tmp_buff)
-    return -1; 
-  
-  if(!active)
-    return parent->read(buffer, len, nbr);
+  if (!tmp_buff)
+    return -1;
 
-  ret = parent->read(tmp_buff, len/2, &nbr_parent);
+  if (!active)
+    return parent->read (buffer, len, nbr);
 
-  if(ret == -1)
-  {
-    delete [] tmp_buff;
-    return -1;
-  }
+  ret = parent->read (tmp_buff, len/2, &nbr_parent);
+
+  if (ret == -1)
+    {
+      delete [] tmp_buff;
+      return -1;
+    }
 
-  *nbr = decompress(tmp_buff, nbr_parent, buffer, len);
+  *nbr = decompress (tmp_buff, nbr_parent, buffer, len);
 
   delete [] tmp_buff;
   return 0;
 }
 
-/*! 
- *Inherited from Filter.
- *\param buffer Buffer where write.
- *\param len Buffer length.
- *\param nbw Number of written bytes.
+/*!
+ * Inherited from Filter.
+ * \param buffer Buffer where write.
+ * \param len Buffer length.
+ * \param nbw Number of written bytes.
  */
-int GzipDecompress::write(const char* buffer, u_long len, u_long *nbw)
+int GzipDecompress::write (const char* buffer, u_long len, u_long *nbw)
 {
   char tmpBuffer[1024];
   u_long written = 0;
   *nbw = 0;
 
   /*! No stream to write to.  */
-  if(!parent)
+  if (!parent)
     return -1;
 
-  if(!active)
-    return parent->write(buffer, len, nbw);
+  if (!active)
+    return parent->write (buffer, len, nbw);
 
-  while(len)
-  {
-    u_long nbw_parent;
-    u_long size = std::min(len, 512UL);
-    u_long ret = decompress(buffer, size, tmpBuffer, 1024);
+  while (len)
+    {
+      u_long nbw_parent;
+      u_long size = std::min (len, 512UL);
+      u_long ret = decompress (buffer, size, tmpBuffer, 1024);
 
-    if(ret)
-      if(parent->write(tmpBuffer, ret, &nbw_parent) == -1 )
+      if (ret && parent->write (tmpBuffer, ret, &nbw_parent) == -1)
         return -1;
 
-    written += ret;
-    buffer += size;
-    len -= size;
-    *nbw += nbw_parent;
-  }
+      written += ret;
+      buffer += size;
+      len -= size;
+      *nbw += nbw_parent;
+    }
   return 0;
 }
 
-/*! 
- *Inherited from Filter.
- *\param nbw Number of flushed bytes.
+/*!
+ * Inherited from Filter.
+ * \param nbw Number of flushed bytes.
  */
-int GzipDecompress::flush(u_long *nbw)
+int GzipDecompress::flush (u_long *nbw)
 {
   char buffer[512];
 
   if(!active)
     return 0;
 
-  *nbw = flush(buffer, 512);
-  if(*nbw)
-  {
-    u_long nbwParent;
-    u_long nbwParentFlush;
-    if(!parent)
-      return -1;
-    if(parent->write(buffer, *nbw, &nbwParent) != 0)
-      return -1;
-    if(parent->flush(&nbwParentFlush) != 0)
-      return -1;  
-    *nbw = nbwParentFlush + nbwParent;
-   }
+  *nbw = flush (buffer, 512);
+  if (*nbw)
+    {
+      u_long nbwParent;
+      u_long nbwParentFlush;
+      if (!parent)
+        return -1;
+      if (parent->write (buffer, *nbw, &nbwParent) != 0)
+        return -1;
+      if (parent->flush (&nbwParentFlush) != 0)
+        return -1;
+      *nbw = nbwParentFlush + nbwParent;
+    }
   return 0;
 }
 
 /*!
- *Returns a new GzipDecompress object.
- *\param name Filter name.
+ * Returns a new GzipDecompress object.
+ * \param name Filter name.
  */
-Filter* GzipDecompress::factory(const char* name)
+Filter* GzipDecompress::factory (const char* name)
 {
-  return new GzipDecompress();
+  return new GzipDecompress ();
 }
 
 /*!
- *Return a string with the filter name. 
- *If an external buffer is provided write the name there too.
- *\param name Buffer where write the filter name.
- *\param len Buffer size.
-*/
-const char* GzipDecompress::getName(char* name, u_long len)
+ * Return a string with the filter name.
+ * If an external buffer is provided write the name there too.
+ * \param name Buffer where write the filter name.
+ * \param len Buffer size.
+ */
+const char* GzipDecompress::getName (char* name, u_long len)
 {
   /*! No name by default. */
-  if(name)
-  {
+  if (name)
     myserver_strlcpy(name, "gzip", len);
-  }
+
   return "gzip";
 }
 
 /*!
- *Get the GZIP header size.
+ * Get the GZIP header size.
  */
 u_long GzipDecompress::headerSize()
 {
@@ -342,7 +334,7 @@ u_long GzipDecompress::headerSize()
 }
 
 /*!
- *Get the GZIP footer size.
+ * Get the GZIP footer size.
  */
 u_long GzipDecompress::footerSize()
 {
diff --git a/myserver/src/http_handler/http_file/http_file.cpp 
b/myserver/src/http_handler/http_file/http_file.cpp
index 539d951..631f180 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -309,7 +309,7 @@ int HttpFile::send (HttpThreadContext* td,
 
     keepalive = td->request.isKeepAlive ();
 
-#ifndef DO_NOT_USEGZIP
+#ifdef HAVE_ZLIB
     /*
      * Be sure that the client accept GZIP compressed data.
      */
diff --git a/myserver/src/protocol/http/http_data_handler.cpp 
b/myserver/src/protocol/http/http_data_handler.cpp
index 8a5f534..dd05b5b 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -19,7 +19,7 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 #include <include/protocol/http/http_data_handler.h>
 
 /*!
- *Send a file to the client using the HTTP protocol.
+ * Send a file to the client using the HTTP protocol.
  */
 int
 HttpDataHandler::send (HttpThreadContext* td,
@@ -31,77 +31,69 @@ HttpDataHandler::send (HttpThreadContext* td,
 }
 
 /*!
- *Constructor for the class.
+ * Constructor for the class.
  */
 HttpDataHandler::HttpDataHandler () { }
 
 /*!
- *Destroy the object.
+ * Destroy the object.
  */
 HttpDataHandler::~HttpDataHandler () { }
 
 /*!
- *Load the static elements.
+ * Load the static elements.
  */
-int
-HttpDataHandler::load ()
+int HttpDataHandler::load ()
 {
   return 0;
 }
 
 /*!
- *Unload the static elements.
+ * Unload the static elements.
  */
-int
-HttpDataHandler::unLoad ()
+int HttpDataHandler::unLoad ()
 {
   return 0;
 }
 
 /*!
- *Send data over the HTTP channel.  This method considers modifier filters.
- *in the filters chain.
- *\param td The HTTP thread context.
- *\param buffer Data to send.
- *\param size Size of the buffer.
- *\param appendFile The file where append if in append mode.
- *\param chain Where send data if not append.
- *\param append Append to the file?
- *\param useChunks Can we use HTTP chunks to send data?
- *\param realBufferSize The real dimension of the buffer that can be
- *used by this method.
- *\param tmpStream A support on memory read/write stream used
- *internally by the function.
+ * Send data over the HTTP channel.  This method considers modifier filters.
+ * in the filters chain.
+ * \param td The HTTP thread context.
+ * \param buffer Data to send.
+ * \param size Size of the buffer.
+ * \param appendFile The file where append if in append mode.
+ * \param chain Where send data if not append.
+ * \param append Append to the file?
+ * \param useChunks Can we use HTTP chunks to send data?
+ * \param realBufferSize The real dimension of the buffer that can be
+ * used by this method.
+ * \param tmpStream A support on memory read/write stream used
+ * internally by the function.
  */
-int
-HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext* td,
-                                          char* buffer,
-                                          u_long size,
-                                          File* appendFile,
-                                          FiltersChain* chain,
-                                          bool append,
-                                          bool useChunks,
-                                          u_long realBufferSize,
-                                          MemoryStream *tmpStream)
+int HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext* td,
+                                              char* buffer,
+                                              u_long size,
+                                              File* appendFile,
+                                              FiltersChain* chain,
+                                              bool append,
+                                              bool useChunks,
+                                              u_long realBufferSize,
+                                              MemoryStream *tmpStream)
 {
   u_long nbr, nbw;
   Stream *oldStream = chain->getStream ();
 
   if (!chain->hasModifiersFilters ())
-    return appendDataToHTTPChannel (td,
-                                    buffer,
-                                    size,
-                                    appendFile,
-                                    chain,
-                                    append,
+    return appendDataToHTTPChannel (td, buffer, size, appendFile, chain, 
append,
                                     useChunks);
 
   /*
-   *This function can't append directly to the chain because we can't
-   *know in advance the data chunk size.  Therefore we replace the
-   *final stream with a memory buffer and write there the final data
-   *chunk content, finally we read from it and send directly to the
-   *original stream.
+   * This function can't append directly to the chain because we can't
+   * know in advance the data chunk size.  Therefore we replace the
+   * final stream with a memory buffer and write there the final data
+   * chunk content, finally we read from it and send directly to the
+   * original stream.
    */
   chain->setStream (tmpStream);
 
@@ -124,25 +116,20 @@ HttpDataHandler::appendDataToHTTPChannel 
(HttpThreadContext* td,
    *Use of chain->getStream() is needed to write directly on the
    *final stream.
    */
-  return appendDataToHTTPChannel (td,
-                                  buffer,
-                                  nbr,
-                                  appendFile,
-                                  chain,
-                                  append,
+  return appendDataToHTTPChannel (td, buffer, nbr, appendFile, chain, append,
                                   useChunks);
 }
 
 /*!
- *Send raw data over the HTTP channel.  It doesn't consider modifier filters.
- *Return zero on success.
- *\param td The HTTP thread context.
- *\param buffer Data to send.
- *\param size Size of the buffer.
- *\param appendFile The file where append if in append mode.
- *\param chain Where send data if not append.
- *\param append Append to the file?
- *\param useChunks Can we use HTTP chunks to send data?
+ * Send raw data over the HTTP channel.  It doesn't consider modifier filters.
+ * Return zero on success.
+ * \param td The HTTP thread context.
+ * \param buffer Data to send.
+ * \param size Size of the buffer.
+ * \param appendFile The file where append if in append mode.
+ * \param chain Where send data if not append.
+ * \param append Append to the file?
+ * \param useChunks Can we use HTTP chunks to send data?
  */
 int
 HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext* td,
@@ -203,8 +190,8 @@ HttpDataHandler::appendDataToHTTPChannel 
(HttpThreadContext* td,
 }
 
 /*!
- *Check if the server can use the chunked transfer encoding and if the client
- *supports keep-alive connections.
+ * Check if the server can use the chunked transfer encoding and if the client
+ * supports keep-alive connections.
  */
 void
 HttpDataHandler::checkDataChunks (HttpThreadContext* td, bool* keepalive,
diff --git a/myserver/src/protocol/http/http_errors.cpp 
b/myserver/src/protocol/http/http_errors.cpp
index cbea256..a685e6b 100644
--- a/myserver/src/protocol/http/http_errors.cpp
+++ b/myserver/src/protocol/http/http_errors.cpp
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2007, 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
@@ -28,15 +28,15 @@ bool HttpErrors::loaded = false;
 
 
 /*!
- *Get an error page from its error code.
- *\param statusCode The HTTP error.
- *\param out Output string where write the error page name.
+ * Get an error page from its error code.
+ * \param statusCode The HTTP error.
+ * \param out Output string where write the error page name.
  */
-void HttpErrors::getErrorPage(int statusCode, string& out)
+void HttpErrors::getErrorPage (int statusCode, string& out)
 {
   ostringstream os;
   os << "/errors/" << statusCode << ".html";
-  out.assign(os.str());
+  out.assign (os.str ());
 }
 
 /*!
@@ -44,104 +44,103 @@ void HttpErrors::getErrorPage(int statusCode, string& out)
  *\param statusCode The HTTP error.
  *\param out Output string where write the error message.
  */
-void HttpErrors::getErrorMessage(int statusCode, string& out)
+void HttpErrors::getErrorMessage (int statusCode, string& out)
 {
-  const char* msg;
-  msg = messagesMap.get(statusCode);
-  
-  if(msg)
-    out.assign(msg);
+  const char* msg = messagesMap.get (statusCode);
+
+  if (msg)
+    out.assign (msg);
   else
-    out.assign("");
+    out.assign ("");
 }
 
 /*!
- *Unload the allocated resources.
+ * Unload the allocated resources.
  */
-void HttpErrors::unLoad()
+void HttpErrors::unLoad ()
 {
   messagesMap.clear();
 }
 
 /*!
- *Put a new message in the map.
- *\param id The HTTP error code.
- *\param msg The message associated to the error code.
+ * Put a new message in the map.
+ * \param id The HTTP error code.
+ * \param msg The message associated to the error code.
  */
-void HttpErrors::putMessage(int id, const char* msg)
+void HttpErrors::putMessage (int id, const char* msg)
 {
-  messagesMap.put(id, msg);
+  messagesMap.put (id, msg);
 }
 
 /*!
- *Load the HTTP errors.
+ * Load the HTTP errors.
  */
-void HttpErrors::load()
+void HttpErrors::load ()
 {
-  if(loaded)
+  if (loaded)
     return;
 
   loaded = true;
 
   /* INFORMATIONAL.  */
-  putMessage(100, "Continue");  
-  putMessage(101, "Switching Protocols");
-  putMessage(102, "Processing");
+  putMessage (100, "Continue");
+  putMessage (101, "Switching Protocols");
+  putMessage (102, "Processing");
 
   /* SUCCESS.  */
-  putMessage(200, "OK");
-  putMessage(201, "Created");
-  putMessage(202, "Accepted");
-  putMessage(203, "Non-Authoritative Information");
-  putMessage(204, "No Content");
-  putMessage(205, "Reset Content");
-  putMessage(206, "Partial Content");
-  putMessage(207, "Multi-Status");
+  putMessage (200, "OK");
+  putMessage (201, "Created");
+  putMessage (202, "Accepted");
+  putMessage (203, "Non-Authoritative Information");
+  putMessage (204, "No Content");
+  putMessage (205, "Reset Content");
+  putMessage (206, "Partial Content");
+  putMessage (207, "Multi-Status");
 
   /* REDIRECTION.  */
-  putMessage(300, "Multiple Choices");
-  putMessage(301, "Moved Permanently");
-  putMessage(302, "Found");
-  putMessage(303, "See Other");
-  putMessage(304, "Not Modified");
-  putMessage(305, "Use proxy");
-  putMessage(306, "Switch proxy");
-  putMessage(307, "Temporary redirect");
+  putMessage (300, "Multiple Choices");
+  putMessage (301, "Moved Permanently");
+  putMessage (302, "Found");
+  putMessage (303, "See Other");
+  putMessage (304, "Not Modified");
+  putMessage (305, "Use proxy");
+  putMessage (306, "Switch proxy");
+  putMessage (307, "Temporary redirect");
 
   /* CLIENT ERROR.  */
-  putMessage(400, "Bad Request");
-  putMessage(401, "Unauthorized");
-  putMessage(402, "Payment required");
-  putMessage(403, "Forbidden");
-  putMessage(404, "Not Found");
-  putMessage(405, "Method Not Allowed");
-  putMessage(406, "Not Acceptable");
-  putMessage(407, "Proxy Authentication Required");
-  putMessage(408, "Request timeout");
-  putMessage(409, "Conflict");
-  putMessage(411, "Length Required");
-  putMessage(412, "Precondition Failed");
-  putMessage(413, "Request Entity Too Large");
-  putMessage(414, "Request URI Too Long");
-  putMessage(415, "Unsupported Media Type");
-  putMessage(416, "Requested Range Not Satisfiable");
-  putMessage(417, "Expectation Failed");
-  putMessage(422, "Unprocessable Entity");
-  putMessage(423, "Locked");
-  putMessage(424, "Failed Dependency");
-  putMessage(425, "Unordered Collection");
-  putMessage(426, "Upgrade Required");
-  putMessage(412, "Precondition Failed");
+  putMessage (400, "Bad Request");
+  putMessage (401, "Unauthorized");
+  putMessage (402, "Payment required");
+  putMessage (403, "Forbidden");
+  putMessage (404, "Not Found");
+  putMessage (405, "Method Not Allowed");
+  putMessage (406, "Not Acceptable");
+  putMessage (407, "Proxy Authentication Required");
+  putMessage (408, "Request timeout");
+  putMessage (409, "Conflict");
+  putMessage (411, "Length Required");
+  putMessage (412, "Precondition Failed");
+  putMessage (413, "Request Entity Too Large");
+  putMessage (414, "Request URI Too Long");
+  putMessage (415, "Unsupported Media Type");
+  putMessage (416, "Requested Range Not Satisfiable");
+  putMessage (417, "Expectation Failed");
+  putMessage (422, "Unprocessable Entity");
+  putMessage (423, "Locked");
+  putMessage (424, "Failed Dependency");
+  putMessage (425, "Unordered Collection");
+  putMessage (426, "Upgrade Required");
+  putMessage (412, "Precondition Failed");
 
   /* SERVER ERROR.  */
-  putMessage(500, "Internal Server Error");
-  putMessage(501, "Not Implemented");
-  putMessage(502, "Bad Gateway");
-  putMessage(503, "Service Unavailable");
-  putMessage(504, "Gateway Timeout");
-  putMessage(505, "HTTP Version Not Supported");
-  putMessage(506, "Variant Also Negotiates");
-  putMessage(507, "Insufficient Storage");
-  putMessage(509, "Bandwidth Limit Exceeded");
-  putMessage(510, "Not Extended");
+  putMessage (500, "Internal Server Error");
+  putMessage (501, "Not Implemented");
+  putMessage (502, "Bad Gateway");
+  putMessage (503, "Service Unavailable");
+  putMessage (504, "Gateway Timeout");
+  putMessage (505, "HTTP Version Not Supported");
+  putMessage (506, "Variant Also Negotiates");
+  putMessage (507, "Insufficient Storage");
+  putMessage (509, "Bandwidth Limit Exceeded");
+  putMessage (510, "Not Extended");
 }
diff --git a/myserver/src/protocol/http/http_thread_context.cpp 
b/myserver/src/protocol/http/http_thread_context.cpp
index 36c6b81..6701d08 100755
--- a/myserver/src/protocol/http/http_thread_context.cpp
+++ b/myserver/src/protocol/http/http_thread_context.cpp
@@ -35,7 +35,7 @@ const char* HttpThreadContext::getHashedData (const char 
*name)
   if (ret)
     return ret->c_str ();
   else
-    return vh ? vh->getHashedData (name) : 0;
+    return vh ? vh->getHashedData (name) : NULL;
 }
 
 /*!
@@ -43,11 +43,11 @@ const char* HttpThreadContext::getHashedData (const char 
*name)
  */
 const char *HttpThreadContext::getVhostDir ()
 {
-  if(vhostDir.length() > 1)
-    return vhostDir.c_str();
+  if (vhostDir.length () > 1)
+    return vhostDir.c_str ();
 
-  if(connection && connection->host)
-    return connection->host->getDocumentRoot().c_str();
+  if (connection && connection->host)
+    return connection->host->getDocumentRoot ().c_str ();
 
   return "";
 }
@@ -55,13 +55,13 @@ const char *HttpThreadContext::getVhostDir ()
 /*!
  *Get the current vhost sys directory for the environvment.
  */
-const char *HttpThreadContext::getVhostSys()
+const char *HttpThreadContext::getVhostSys ()
 {
-  if(vhostSys.length() > 1)
-    return vhostSys.c_str();
+  if (vhostSys.length() > 1)
+    return vhostSys.c_str ();
 
-  if(connection && connection->host)
-    return connection->host->getSystemRoot().c_str();
+  if (connection && connection->host)
+    return connection->host->getSystemRoot ().c_str ();
 
   return "";
 }

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

Summary of changes:
 myserver/SConstruct                                |    8 +-
 myserver/configure.in                              |   19 +-
 myserver/include/base/string/stringutils.h         |    8 +-
 myserver/include/filter/gzip/gzip.h                |   88 +++---
 myserver/include/filter/gzip/gzip_decompress.h     |   21 +-
 myserver/include/http_handler/mscgi/mscgi.h        |   33 +--
 myserver/src/base/pipe/pipe.cpp                    |  202 ++++++------
 myserver/src/filter/gzip/gzip.cpp                  |  334 ++++++++++----------
 myserver/src/filter/gzip/gzip_decompress.cpp       |  312 +++++++++----------
 myserver/src/http_handler/http_file/http_file.cpp  |    2 +-
 myserver/src/http_handler/mscgi/mscgi.cpp          |  268 ++++++++--------
 myserver/src/protocol/http/http_data_handler.cpp   |  107 +++----
 myserver/src/protocol/http/http_errors.cpp         |  149 +++++-----
 myserver/src/protocol/http/http_thread_context.cpp |   20 +-
 14 files changed, 755 insertions(+), 816 deletions(-)


hooks/post-receive
-- 
GNU MyServer




reply via email to

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