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. 0_9-380-g4


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. 0_9-380-g4aaf51b
Date: Sat, 07 Nov 2009 14:23:10 +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  4aaf51b6ef376b9ee6fa24280a7efe7bf7a9a435 (commit)
       via  bf96684668e208e5b9d2c2b441180e756230a2a4 (commit)
      from  6cb5a344f7ef0a0442c0f971e7604b8c2eb21052 (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 4aaf51b6ef376b9ee6fa24280a7efe7bf7a9a435
Author: Giuseppe Scrivano <address@hidden>
Date:   Sat Nov 7 15:21:47 2009 +0100

    Remove any dependency to the Protocol class from FiltersChain.

diff --git a/myserver/include/filter/filters_chain.h 
b/myserver/include/filter/filters_chain.h
index 02552ad..588f4f4 100644
--- a/myserver/include/filter/filters_chain.h
+++ b/myserver/include/filter/filters_chain.h
@@ -22,7 +22,6 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 # include "stdafx.h"
 # include <include/filter/stream.h>
 # include <include/filter/filter.h>
-# include <include/protocol/protocol.h>
 # include <list>
 
 using namespace std;
@@ -30,22 +29,6 @@ using namespace std;
 class FiltersChain : public Stream
 {
 public:
-  Protocol* getProtocol ()
-  {
-    return protocol;
-  }
-  void setProtocol (Protocol* pr)
-  {
-    protocol = pr;
-  }
-  void* getProtocolData ()
-  {
-    return protocolData;
-  }
-  void setProtocolData (void* prd)
-  {
-    protocolData = prd;
-  }
   void setAcceptDuplicates (int);
   int getAcceptDuplicates ();
   void setStream (Stream*);
@@ -67,8 +50,6 @@ public:
   FiltersChain ();
   ~FiltersChain ();
 protected:
-  Protocol *protocol;
-  void *protocolData;
   list <Filter*> filters;
   Filter* firstFilter;
   Stream *stream;
diff --git a/myserver/src/filter/filters_chain.cpp 
b/myserver/src/filter/filters_chain.cpp
index da447eb..1bf7fbe 100644
--- a/myserver/src/filter/filters_chain.cpp
+++ b/myserver/src/filter/filters_chain.cpp
@@ -83,7 +83,6 @@ FiltersChain::FiltersChain ()
   acceptDuplicates = 1;
   stream = NULL;
   firstFilter = NULL;
-  protocol = NULL;
 }
 
 /*!
@@ -131,7 +130,8 @@ int FiltersChain::addFilter (Filter* f, u_long *nbw, int 
sendData)
     f->setParent (firstFilter);
   }
 
-  /*! If the chain doesn't support duplicates check if the filter is already 
present.*/
+  /* If the chain doesn't support duplicates check if the filter is already
+     present.  */
   if (!acceptDuplicates)
   {
     if (isFilterPresent (f))
@@ -159,8 +159,6 @@ int FiltersChain::addFilter (Filter* f, u_long *nbw, int 
sendData)
    */
   firstFilter = f;
 
-  f->setProtocol (protocol);
-
   /*! Add the filters in the list in the same order they are used. */
   filters.push_front (f);
   return ret;
diff --git a/myserver/src/http_handler/cgi/cgi.cpp 
b/myserver/src/http_handler/cgi/cgi.cpp
index 79dbe14..0e3db3c 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -125,8 +125,6 @@ int Cgi::send (HttpThreadContext* td, const char* 
scriptpath,
   tmpScriptPath.assign (scriptpath);
   FilesUtility::splitPath (tmpScriptPath, td->scriptDir, td->scriptFile);
 
-  chain.setProtocol (td->http);
-  chain.setProtocolData (td);
   chain.setStream (td->connection->socket);
 
   if (execute)
diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp 
b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index 194bd71..9a882f7 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -96,9 +96,6 @@ int FastCgi::send (HttpThreadContext* td, const char* 
scriptpath,
   FilesUtility::splitPath (tmp, td->cgiRoot, td->cgiFile);
   tmp.assign (scriptpath);
   FilesUtility::splitPath (tmp, td->scriptDir, td->scriptFile);
-
-  chain.setProtocol (td->http);
-  chain.setProtocolData (td);
   chain.setStream (td->connection->socket);
 
   if (td->mime
diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp 
b/myserver/src/http_handler/http_dir/http_dir.cpp
index 9a53ee1..26d5331 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -317,11 +317,7 @@ int HttpDir::send (HttpThreadContext* td,
 
   HttpRequestHeader::Entry *host = td->request.other.get ("Host");
 
-
-  chain.setProtocol (td->http);
-  chain.setProtocolData (td);
   chain.setStream (td->connection->socket);
-
   if ( !(td->permissions & MYSERVER_PERMISSION_BROWSE))
     return td->http->sendAuth ();
 
diff --git a/myserver/src/http_handler/http_file/http_file.cpp 
b/myserver/src/http_handler/http_file/http_file.cpp
index 0488ab6..ee56185 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -342,8 +342,6 @@ int HttpFile::send (HttpThreadContext* td, const char 
*filenamePath,
 
         useChunks = true;
       }
-    chain.setProtocol (td->http);
-    chain.setProtocolData (td);
     chain.setStream (&memStream);
     if (td->mime)
       {
diff --git a/myserver/src/http_handler/isapi/isapi.cpp 
b/myserver/src/http_handler/isapi/isapi.cpp
index 6a12702..14355a7 100644
--- a/myserver/src/http_handler/isapi/isapi.cpp
+++ b/myserver/src/http_handler/isapi/isapi.cpp
@@ -792,8 +792,6 @@ int Isapi::send (HttpThreadContext* td,
       return td->http->raiseHTTPError (500);
     }
 
-  connTable[connIndex].chain.setProtocol (td->http);
-  connTable[connIndex].chain.setProtocolData (td);
   connTable[connIndex].chain.setStream (td->connection->socket);
   if (td->mime)
     {
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp 
b/myserver/src/http_handler/mscgi/mscgi.cpp
index 5bfeb6f..95d22fe 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -90,9 +90,6 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, 
const char* cmdLine,
   }
 
   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,
diff --git a/myserver/src/http_handler/proxy/proxy.cpp 
b/myserver/src/http_handler/proxy/proxy.cpp
index 48a4816..bb4cc54 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -105,8 +105,6 @@ int Proxy::send (HttpThreadContext *td,
       return td->http->raiseHTTPError (500);
     }
 
-  chain.setProtocol (td->http);
-  chain.setProtocolData (td);
   chain.setStream (td->connection->socket);
 
   if (td->mime && Server::getInstance ()->getFiltersFactory ()->chain (&chain,
diff --git a/myserver/src/http_handler/scgi/scgi.cpp 
b/myserver/src/http_handler/scgi/scgi.cpp
index 0a14904..65feed9 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -70,8 +70,6 @@ int Scgi::send (HttpThreadContext* td, const char* scriptpath,
     FilesUtility::splitPath (tmp, td->scriptDir, td->scriptFile);
   }
 
-  chain.setProtocol (td->http);
-  chain.setProtocolData (td);
   chain.setStream (td->connection->socket);
   if (td->mime)
   {
diff --git a/myserver/src/http_handler/wincgi/wincgi.cpp 
b/myserver/src/http_handler/wincgi/wincgi.cpp
index 3e1e5ef..b806d31 100644
--- a/myserver/src/http_handler/wincgi/wincgi.cpp
+++ b/myserver/src/http_handler/wincgi/wincgi.cpp
@@ -100,9 +100,6 @@ int WinCgi::send (HttpThreadContext* td, const char* 
scriptpath,
   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)
     {
diff --git a/myserver/tests/test_filter_chain.cpp 
b/myserver/tests/test_filter_chain.cpp
index 6d039f6..e5eb923 100644
--- a/myserver/tests/test_filter_chain.cpp
+++ b/myserver/tests/test_filter_chain.cpp
@@ -24,21 +24,13 @@
 #include <cppunit/extensions/TestFactoryRegistry.h>
 #include <cppunit/ui/text/TestRunner.h>
 #include <cppunit/extensions/HelperMacros.h>
-#include <include/protocol/protocol.h>
 #include <include/filter/memory_stream.h>
 
-class MyProtocol : public Protocol
-{
-
-};
-
 class TestFilterChain : public CppUnit::TestFixture
 {
   CPPUNIT_TEST_SUITE ( TestFilterChain );
   CPPUNIT_TEST ( testGzipChain );
-  CPPUNIT_TEST ( testProtocol );
   CPPUNIT_TEST ( testIsEmpty );
-  CPPUNIT_TEST ( testProtocolData );
   CPPUNIT_TEST ( testAcceptDuplicates );
   CPPUNIT_TEST ( testStream );
   CPPUNIT_TEST ( testIsFilterPresent );
@@ -87,14 +79,6 @@ public:
     CPPUNIT_ASSERT (strncmp (szTest, szExpected, nbw) == 0);
   }
 
-
-  void testProtocol ()
-  {
-    MyProtocol mp;
-    fc->setProtocol (&mp);
-    CPPUNIT_ASSERT_EQUAL ((Protocol*)&mp, fc->getProtocol ());
-  }
-
   void testAcceptDuplicates ()
   {
     fc->setAcceptDuplicates (0);
@@ -115,14 +99,6 @@ public:
     CPPUNIT_ASSERT_EQUAL ((Stream*)&ms, fc->getStream ());
   }
 
-  void testProtocolData ()
-  {
-    char *data = new char[2];
-    fc->setProtocolData (data);
-    CPPUNIT_ASSERT_EQUAL (data, (char*)fc->getProtocolData ());
-    delete [] data;
-  }
-
   void testIsEmpty ()
   {
     u_long nbw;



commit bf96684668e208e5b9d2c2b441180e756230a2a4
Author: Giuseppe Scrivano <address@hidden>
Date:   Sat Nov 7 15:20:30 2009 +0100

    Make the Protocol::controlConnection a pure virtual method.

diff --git a/myserver/include/protocol/protocol.h 
b/myserver/include/protocol/protocol.h
index 6be5ce0..bb00f47 100644
--- a/myserver/include/protocol/protocol.h
+++ b/myserver/include/protocol/protocol.h
@@ -40,10 +40,24 @@ public:
   virtual ~Protocol ();
   virtual const char* getName ();
 
+  /*!
+    Entry point to check new data available from a client.
+
+    \param con Connection structure with all data relative to the connection.
+    \param request Request body ready from the client (it may be incomplete and
+    it is protocol responsibility to check if it is complete or not.  This 
buffer
+    can be used for other purposes too by the protocol, it is not required to 
be
+    unchanged.
+    \param auxBuf Auxiliary buffer available to the current thread.
+    \param reqBufLen Length in bytes of the buffer containing the request.
+    \param auxBufLen Length in bytes of the auxiliary buffer.
+    \param reqLen Number of bytes read from the client in REQUEST.
+    \param tid current thread id.
+  */
   virtual int controlConnection (ConnectionPtr con, char *request,
                                  char *auxBuf, u_long reqBufLen,
                                  u_long auxBufLen, u_long reqLen,
-                                 u_long tid);
+                                 u_long tid) = 0;
 
   virtual int loadProtocol ();
   virtual int unLoadProtocol ();
diff --git a/myserver/src/protocol/protocol.cpp 
b/myserver/src/protocol/protocol.cpp
index f03ec3b..fac51e5 100644
--- a/myserver/src/protocol/protocol.cpp
+++ b/myserver/src/protocol/protocol.cpp
@@ -37,30 +37,6 @@ int Protocol::unLoadProtocol ()
 }
 
 /*!
- * Entry point to check new data available from a client.
- *
- * \param con Connection structure with all data relative to the connection.
- * \param request Request body ready from the client (it may be incomplete and
- * it is protocol responsibility to check if it is complete or not.  This 
buffer
- * can be used for other purposes too by the protocol, it is not required to be
- * unchanged.
- * \param auxBuf Auxiliary buffer available to the current thread.
- * \param reqBufLen Length in bytes of the buffer containing the request.
- * \param auxBufLen Length in bytes of the auxiliary buffer.
- * \param reqLen Number of bytes read from the client in REQUEST.
- * \param tid current thread id.
- */
-int Protocol::controlConnection (ConnectionPtr con, char *request,
-                                 char *auxBuf, u_long reqBufLen,
-                                 u_long auxBufLen, u_long reqLen,
-                                 u_long tid)
-{
-  Server::getInstance ()->log (MYSERVER_LOG_MSG_ERROR,
-                               _("Using Protocol::controlConnection"));
-  return ClientsThread::DELETE_CONNECTION;
-}
-
-/*!
  * Returns the name of the protocol. If an out buffer is
  * defined fullfill it with the name too.
  */

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

Summary of changes:
 myserver/include/filter/filters_chain.h           |   19 ----------------
 myserver/include/protocol/protocol.h              |   16 +++++++++++++-
 myserver/src/filter/filters_chain.cpp             |    6 +---
 myserver/src/http_handler/cgi/cgi.cpp             |    2 -
 myserver/src/http_handler/fastcgi/fastcgi.cpp     |    3 --
 myserver/src/http_handler/http_dir/http_dir.cpp   |    4 ---
 myserver/src/http_handler/http_file/http_file.cpp |    2 -
 myserver/src/http_handler/isapi/isapi.cpp         |    2 -
 myserver/src/http_handler/mscgi/mscgi.cpp         |    3 --
 myserver/src/http_handler/proxy/proxy.cpp         |    2 -
 myserver/src/http_handler/scgi/scgi.cpp           |    2 -
 myserver/src/http_handler/wincgi/wincgi.cpp       |    3 --
 myserver/src/protocol/protocol.cpp                |   24 ---------------------
 myserver/tests/test_filter_chain.cpp              |   24 ---------------------
 14 files changed, 17 insertions(+), 95 deletions(-)


hooks/post-receive
-- 
GNU MyServer




reply via email to

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