From MAILER-DAEMON Sun Feb 01 09:58:36 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LTdmO-0002Vi-Ca
	for mharc-myserver-commit@gnu.org; Sun, 01 Feb 2009 09:58:36 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LTdmM-0002VR-8v
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 09:58:34 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LTdmL-0002VB-24
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 09:58:33 -0500
Received: from [199.232.76.173] (port=34587 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LTdmK-0002V8-UH
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 09:58:32 -0500
Received: from savannah.gnu.org ([199.232.41.3]:37684 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LTdmK-0006sF-HF
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 09:58:32 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LTdmJ-0006ZE-UK
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 14:58:32 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1LTdmJ-0006Yx-Fv
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 14:58:31 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1LTdmJ-0006Yx-Fv@cvs.savannah.gnu.org>
Date: Sun, 01 Feb 2009 14:58:31 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [2990] Fixed test failure.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 01 Feb 2009 14:58:34 -0000

Revision: 2990
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2990
Author:   gscrivano
Date:     2009-02-01 14:58:30 +0000 (Sun, 01 Feb 2009)

Log Message:
-----------
Fixed test failure.  Don't dup stderr file to the stdout descriptor.

Modified Paths:
--------------
    trunk/myserver/src/base/process/process.cpp
    trunk/myserver/src/http_handler/cgi/cgi.cpp
    trunk/myserver/tests/test_fork_server.cpp

Modified: trunk/myserver/src/base/process/process.cpp
===================================================================
--- trunk/myserver/src/base/process/process.cpp	2009-01-31 23:00:24 UTC (rev 2989)
+++ trunk/myserver/src/base/process/process.cpp	2009-02-01 14:58:30 UTC (rev 2990)
@@ -219,7 +219,6 @@
       if (spi->uid)
         Process::setuid (spi->uid);
 
-
       if (generateArgList (args, spi->cmd.c_str (), spi->arg))
         exit (1);
 
@@ -239,29 +238,24 @@
       if ((long)spi->stdError == -1)
         spi->stdError = (FileHandle)open ("/dev/null", O_WRONLY);
 
-      // map stdio to files
-      if (close(0) == -1) // close stdin
-        exit (1);
+      close(0);
 
       if (spi->stdIn != -1)
         {
           if (dup2 (spi->stdIn, 0) == -1)
             exit (1);
-          
-          if (close (spi->stdIn) == -1)
-            exit (1);
+          close (spi->stdIn);
         }
 
-      if (close (1) == -1) // close stdout
-        exit (1);
+      close (1);
 
       if (dup2 (spi->stdOut, 1) == -1)
         exit (1);
 
-      if (close (2) == -1) // close stderr
-        exit (1);
 
-      if (dup2 (spi->stdError, 1) == -1)
+      close (2);
+
+      if (dup2 (spi->stdError, 2) == -1)
         exit (1);
       
       if (spi->handlesToClose)
@@ -269,12 +263,11 @@
           FileHandle* h = spi->handlesToClose;
           while (*h)
             {
-              if (close (*h) == -1)
-                exit (1);
+              close (*h);
               h++;
             }
         }
-      // Run the script
+
       execve ((const char*)args[0], 
               (char* const*)args, (char* const*) envp);
 

Modified: trunk/myserver/src/http_handler/cgi/cgi.cpp
===================================================================
--- trunk/myserver/src/http_handler/cgi/cgi.cpp	2009-01-31 23:00:24 UTC (rev 2989)
+++ trunk/myserver/src/http_handler/cgi/cgi.cpp	2009-02-01 14:58:30 UTC (rev 2990)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+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

Modified: trunk/myserver/tests/test_fork_server.cpp
===================================================================
--- trunk/myserver/tests/test_fork_server.cpp	2009-01-31 23:00:24 UTC (rev 2989)
+++ trunk/myserver/tests/test_fork_server.cpp	2009-02-01 14:58:30 UTC (rev 2990)
@@ -71,7 +71,7 @@
         int pid = 0;
         int port = 0;
         StartProcInfo spi;
-        char buffer [32];
+        char buffer [32] = {'\0'};
         const char *msg = "ForkServer";
         u_long nbr;
         int ret = fs->startForkServer ();
@@ -79,7 +79,8 @@
         Pipe pipe;
         pipe.create();
     
-        spi.stdIn = spi.stdError = -1;
+        spi.stdIn = -1;
+        spi.stdError = -1;
         spi.stdOut =  pipe.getWriteHandle();
 
         spi.cmd.assign ("/bin/echo");
@@ -88,9 +89,9 @@
         spi.envString = NULL;
 
         ret = fs->executeProcess (&spi, ForkServer::FLAG_USE_OUT, &pid, &port);
+        pipe.closeWrite ();
 
         CPPUNIT_ASSERT_EQUAL (ret, 0);
-        pipe.closeWrite ();
 
         ret = pipe.read (buffer, 32, &nbr);
 





From MAILER-DAEMON Sun Feb 01 09:59:24 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LTdnA-0002id-2h
	for mharc-myserver-commit@gnu.org; Sun, 01 Feb 2009 09:59:24 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LTdn9-0002hp-1S
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 09:59:23 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LTdn7-0002fD-C6
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 09:59:21 -0500
Received: from [199.232.76.173] (port=34598 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LTdn7-0002et-2r
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 09:59:21 -0500
Received: from savannah.gnu.org ([199.232.41.3]:37713 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LTdn6-000716-JC
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 09:59:20 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LTdn6-0007Dm-0u
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 14:59:20 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1LTdn5-0007DW-Pw
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 14:59:19 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1LTdn5-0007DW-Pw@cvs.savannah.gnu.org>
Date: Sun, 01 Feb 2009 14:59:19 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [2991] Allow possibiity to define values on a
	MIME type.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 01 Feb 2009 14:59:23 -0000

Revision: 2991
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2991
Author:   gscrivano
Date:     2009-02-01 14:59:19 +0000 (Sun, 01 Feb 2009)

Log Message:
-----------
Allow possibiity to define values on a MIME type.

Modified Paths:
--------------
    trunk/myserver/documentation/mime_types.texi
    trunk/myserver/include/conf/mime/mime_manager.h
    trunk/myserver/include/conf/security/security_token.h
    trunk/myserver/src/conf/mime/mime_manager.cpp
    trunk/myserver/src/conf/security/security_token.cpp

Modified: trunk/myserver/documentation/mime_types.texi
===================================================================
--- trunk/myserver/documentation/mime_types.texi	2009-02-01 14:58:30 UTC (rev 2990)
+++ trunk/myserver/documentation/mime_types.texi	2009-02-01 14:59:19 UTC (rev 2991)
@@ -11,6 +11,7 @@
 <MIME mime="text/html" handler="RUNCGI" param="/usr/bin/perl" selfExecuted="NO">
 <FILTER value="gzip"/>
 <EXTENSION value="pl"/>
+<DEFINE name="http.error.file.404" value="404.html"/>
 </MIME>
 @end example
 
@@ -47,6 +48,10 @@
 It is possible to specify multiple filters for the same MIME type,
 they will be applied in the specified order.
 
+@code{<DEFINE>} It defines a new value for a variable, take a look
+here @xref{Security files} for more details on the @code{<DEFINE>}
+element.
+
 The same MIME type can have several extensions, you will need to
 specify a different @code{<EXTENSION>} element for each extension.
 

Modified: trunk/myserver/include/conf/mime/mime_manager.h
===================================================================
--- trunk/myserver/include/conf/mime/mime_manager.h	2009-02-01 14:58:30 UTC (rev 2990)
+++ trunk/myserver/include/conf/mime/mime_manager.h	2009-02-01 14:59:19 UTC (rev 2991)
@@ -1,7 +1,7 @@
 /* -*- mode: c++ -*- */
 /*
 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
@@ -62,12 +62,14 @@
 	string cgiManager;
   bool selfExecuted;
   list<Regex*> pathRegex;
+  HashMap<string, string*> hashedData;
 
 	MimeRecord ();
 	MimeRecord (MimeRecord&);
 	int addFilter (const char*, bool acceptDuplicate = true);
 	~MimeRecord ();
 	void clear ();
+  const char* getHashedData(string &name);
 };
 
 class MimeManager

Modified: trunk/myserver/include/conf/security/security_token.h
===================================================================
--- trunk/myserver/include/conf/security/security_token.h	2009-02-01 14:58:30 UTC (rev 2990)
+++ trunk/myserver/include/conf/security/security_token.h	2009-02-01 14:59:19 UTC (rev 2991)
@@ -1,7 +1,7 @@
 /* -*- mode: c++ -*- */
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 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,17 +28,21 @@
 
 class Server;
 class Vhost;
+struct MimeRecord;
 
 enum SECURITY_RING
 {
   /*! Security file configuration.  */
-  MYSERVER_SECURITY_CONF     =	(1<<0),
+  MYSERVER_SECURITY_CONF = (1 << 0),
 
   /*! Virtual host configuration.  */
-  MYSERVER_VHOST_CONF	  = (1<<1),
+  MYSERVER_VHOST_CONF = (1 << 1),
 
+  /*! Mime type.  */
+  MYSERVER_MIME_CONF = (1 << 2),
+
   /*! Global server configuration. */
-  MYSERVER_SERVER_CONF  = (1<<2),
+  MYSERVER_SERVER_CONF = (1 << 3),
 };
 
 class SecurityToken
@@ -175,6 +179,16 @@
     vhost = v;
   }
 
+  MimeRecord *getMime ()
+  {
+    return mimeRecord;
+  }
+
+  void setMime (MimeRecord *mr)
+  {
+    mimeRecord = mr;
+  }
+
 private:
   /*! User to check for.  */
   string user;
@@ -214,10 +228,13 @@
   bool done;
 
   /*! Server instance.  */
-  Server* server;
+  Server *server;
 
   /*! VHost.  */
-  Vhost* vhost;
+  Vhost *vhost;
+
+  MimeRecord *mimeRecord;
+
 };
 
 #endif

Modified: trunk/myserver/src/conf/mime/mime_manager.cpp
===================================================================
--- trunk/myserver/src/conf/mime/mime_manager.cpp	2009-02-01 14:58:30 UTC (rev 2990)
+++ trunk/myserver/src/conf/mime/mime_manager.cpp	2009-02-01 14:59:19 UTC (rev 2991)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+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
@@ -115,10 +115,30 @@
     delete *it;
   }
 
+  HashMap<string, string*>::Iterator it = hashedData.begin();
+  for (;it != hashedData.end(); it++)
+  {
+    delete (*it);
+  }
+  hashedData.clear();
+
+
   pathRegex.clear ();
 }  
 
 /*!
+ *Get the value stored in the hash dictionary for the `name' key.
+ */
+const char* MimeRecord::getHashedData(string &name)
+{
+  string *str = hashedData.get (name);
+  if (str)
+    return str->c_str ();
+
+  return NULL;
+}
+
+/*!
  *Get the name of the file opened by the class.
  */
 const char *MimeManager::getFilename ()
@@ -153,6 +173,8 @@
   }
 
 
+ 
+
   for ( ;lcur; lcur = lcur->next)
   {
     if (lcur->name && !xmlStrcmp(lcur->name, (const xmlChar *)"EXTENSION"))
@@ -168,6 +190,31 @@
       }
     }
 
+    if (lcur->name && !xmlStrcmp(lcur->name, (const xmlChar *)"DEFINE"))
+    {
+      const char *name = NULL;
+      const char *value = NULL;
+
+      for (attrs = lcur->properties; attrs; attrs = attrs->next)
+      {
+        if (!xmlStrcmp (attrs->name, (const xmlChar *)"name") && 
+            attrs->children && attrs->children->content)
+          name = (const char*)attrs->children->content;
+
+        if (!xmlStrcmp (attrs->name, (const xmlChar *)"value") && 
+            attrs->children && attrs->children->content)
+          value = (const char*)attrs->children->content;
+      }
+
+      if (name && value)
+      {
+        string key (name);
+        string *v = new string (value);
+        rc->hashedData.put(key, v);
+      }
+
+    }
+
     if (lcur->name && !xmlStrcmp(lcur->name, (const xmlChar *)"PATH"))
     {
       for (attrs = lcur->properties; attrs; attrs = attrs->next)

Modified: trunk/myserver/src/conf/security/security_token.cpp
===================================================================
--- trunk/myserver/src/conf/security/security_token.cpp	2009-02-01 14:58:30 UTC (rev 2990)
+++ trunk/myserver/src/conf/security/security_token.cpp	2009-02-01 14:59:19 UTC (rev 2991)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002-2008 Free Software Foundation, Inc.
+Copyright (C) 2002-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
@@ -43,7 +43,7 @@
   done = false;
   server = NULL;
   vhost = NULL;
-
+  mimeRecord = NULL;
   directory = NULL;
   sysdirectory = NULL;
   resource = NULL;
@@ -69,7 +69,15 @@
 
     if (ret)
       return ret->c_str ();
+  }
 
+  if (mimeRecord && (domains & MYSERVER_MIME_CONF))
+  {
+    string strName (name);
+    const char *ret = mimeRecord->getHashedData (strName);
+
+    if (ret)
+      return ret;
   }
 
   if (vhost && (domains & MYSERVER_VHOST_CONF))





From MAILER-DAEMON Sun Feb 01 14:08:52 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LThga-0005Cc-29
	for mharc-myserver-commit@gnu.org; Sun, 01 Feb 2009 14:08:52 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LThgZ-0005Bk-2W
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 14:08:51 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LThgW-0005AH-Qc
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 14:08:49 -0500
Received: from [199.232.76.173] (port=33291 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LThgW-0005A4-If
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 14:08:48 -0500
Received: from savannah.gnu.org ([199.232.41.3]:46674 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LThgW-00071d-9L
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 14:08:48 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LThgV-0005GY-Q2
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 19:08:47 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1LThgV-0005GI-JH
	for myserver-commit@gnu.org; Sun, 01 Feb 2009 19:08:47 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1LThgV-0005GI-JH@cvs.savannah.gnu.org>
Date: Sun, 01 Feb 2009 19:08:47 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [2992] Added possibility to define a different
 uid/ gid for every CGI process.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 01 Feb 2009 19:08:51 -0000

Revision: 2992
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2992
Author:   gscrivano
Date:     2009-02-01 19:08:46 +0000 (Sun, 01 Feb 2009)

Log Message:
-----------
Added possibility to define a different uid/gid for every CGI process.

Modified Paths:
--------------
    trunk/myserver/src/http_handler/cgi/cgi.cpp

Modified: trunk/myserver/src/http_handler/cgi/cgi.cpp
===================================================================
--- trunk/myserver/src/http_handler/cgi/cgi.cpp	2009-02-01 14:59:19 UTC (rev 2991)
+++ trunk/myserver/src/http_handler/cgi/cgi.cpp	2009-02-01 19:08:46 UTC (rev 2992)
@@ -252,6 +252,17 @@
   spi.cmdLine = cmdLine.str();
   spi.cwd.assign(td->scriptDir);
 
+  spi.gid =  atoi (td->securityToken.getHashedData ("cgi.gid", MYSERVER_VHOST_CONF |
+                                                    MYSERVER_MIME_CONF |
+                                                    MYSERVER_SECURITY_CONF |
+                                                    MYSERVER_SERVER_CONF, "0"));
+
+  spi.uid =  atoi (td->securityToken.getHashedData ("cgi.uid", MYSERVER_VHOST_CONF |
+                                                    MYSERVER_MIME_CONF |
+                                                    MYSERVER_SECURITY_CONF |
+                                                    MYSERVER_SERVER_CONF, "0"));
+
+
   spi.stdError = (FileHandle) stdOutFile.getWriteHandle();
   spi.stdIn = (FileHandle) stdInFile.getHandle();
   spi.stdOut = (FileHandle) stdOutFile.getWriteHandle();





From MAILER-DAEMON Mon Feb 02 14:29:16 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LU4Ts-0001uE-3B
	for mharc-myserver-commit@gnu.org; Mon, 02 Feb 2009 14:29:16 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LU4Tq-0001u6-LY
	for myserver-commit@gnu.org; Mon, 02 Feb 2009 14:29:14 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LU4Tp-0001tq-Bd
	for myserver-commit@gnu.org; Mon, 02 Feb 2009 14:29:14 -0500
Received: from [199.232.76.173] (port=45789 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LU4Tp-0001tn-5z
	for myserver-commit@gnu.org; Mon, 02 Feb 2009 14:29:13 -0500
Received: from savannah.gnu.org ([199.232.41.3]:60069 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LU4To-0004UB-Ra
	for myserver-commit@gnu.org; Mon, 02 Feb 2009 14:29:13 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LU4To-0004Mw-A3
	for myserver-commit@gnu.org; Mon, 02 Feb 2009 19:29:12 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1LU4To-0004Mi-1d
	for myserver-commit@gnu.org; Mon, 02 Feb 2009 19:29:12 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1LU4To-0004Mi-1d@cvs.savannah.gnu.org>
Date: Mon, 02 Feb 2009 19:29:12 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [2993] Added examples to the documentation.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 02 Feb 2009 19:29:14 -0000

Revision: 2993
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2993
Author:   gscrivano
Date:     2009-02-02 19:29:11 +0000 (Mon, 02 Feb 2009)

Log Message:
-----------
Added examples to the documentation.

Modified Paths:
--------------
    trunk/myserver/documentation/basic_configuration.texi
    trunk/myserver/documentation/mime_types.texi
    trunk/myserver/documentation/process_security.texi
    trunk/myserver/documentation/security.texi
    trunk/myserver/documentation/virtual_hosts.texi

Modified: trunk/myserver/documentation/basic_configuration.texi
===================================================================
--- trunk/myserver/documentation/basic_configuration.texi	2009-02-01 19:08:46 UTC (rev 2992)
+++ trunk/myserver/documentation/basic_configuration.texi	2009-02-02 19:29:11 UTC (rev 2993)
@@ -52,7 +52,7 @@
 <USE_ERROR_FILE>YES</USE_ERROR_FILE>
 @end example
 
-So, if you set the value to NO, like in the line below,
+So, if you set the value to @code{NO}, like in the line below,
 
 @example
 <USE_ERROR_FILE>NO</USE_ERROR_FILE>

Modified: trunk/myserver/documentation/mime_types.texi
===================================================================
--- trunk/myserver/documentation/mime_types.texi	2009-02-01 19:08:46 UTC (rev 2992)
+++ trunk/myserver/documentation/mime_types.texi	2009-02-02 19:29:11 UTC (rev 2993)
@@ -22,13 +22,18 @@
 the MIME attribute specifies the MIME name.
 
 @item extension
-the MIME type will be used by any file with this extension.
+the MIME type will be used by any file with this extension.  More
+@code{extension} items can be specified for the same MIME type.
 
 @item filter
-this directive registers a filter to use with MIME type.
+this directive registers a filter to use on the MIME type.  It depends
+from the protocol how it will be handled, a protocol may ignore this
+directive.  For example HTTP will use a modifier filter only if it is
+accepted by the client.
 
 @item handler
-specifies the way the file is handled by the server.
+specifies how the server will manage this file.  It is protocol
+specific, for example, FTP doesn't support it.
 
 @item param
 specifies additional params for the handler.
@@ -38,8 +43,8 @@
 server.
 For example, there is need to use selfExecuted on the CGI protocol if
 the accessed resource can be used as a process.  Differently if it is
-not specified the resource mapped by the URI will be used as an
-argument to @code{param}.
+not specified, the resource mapped by the URI will be used as an
+additional argument to @code{param}.
 @end itemize
 
 @code{<FILTER>} defines a filter for the MIME type.  The data will

Modified: trunk/myserver/documentation/process_security.texi
===================================================================
--- trunk/myserver/documentation/process_security.texi	2009-02-01 19:08:46 UTC (rev 2992)
+++ trunk/myserver/documentation/process_security.texi	2009-02-02 19:29:11 UTC (rev 2993)
@@ -21,6 +21,18 @@
 auto-reboot because it will not be possible to get back old
 permissions.
 
+@section CGI processes.
+It is possible to run CGI processes using a different uid/gid.  It can
+be done defining the ``cgi.uid'' and ``cgi.gid'' values in a
+configuration file.  It can be specified at any configuration level.
+
+These directives can be used in a security file to force the execution
+of the new process with both uid and gid to 1000.
+@example
+<DEFINE name="cgi.uid" value="1000" />
+<DEFINE name="cgi.gid" value="1000" />
+@end example
+
 @section Fork Server
 In a POSIX environment the @code{fork} syscall is used to execute new
 processes.  It clones the caller process keeping any open file or
@@ -38,6 +50,10 @@
 
 It is enabled passing the @code{-f} switch to the myserver process.
 
+If the MyServer main process is configured to change its uid/gid after
+its initialization, it is the only way to spawn new processes with
+uid/gid different than the MyServer process.
+
 @section FastCGI/SCGI servers
 By default, FastCGI and SCGI servers are lazily initialized by
 MyServer on the first request to a resource that is handled trought
@@ -50,7 +66,6 @@
 A @code{PROCESS_SERVER} entry makes it possible to access a specific
 FastCGI/SCGI configuration inside MIME types by its name.
 
-
 @example
 <PROCESS_SERVER>
         <NAME>/opt/bin/fastcgi_server</NAME>
@@ -61,10 +76,31 @@
 </PROCESS_SERVER>
 @end example
 
-In the previous example a FastCGI server
+In the previous example the FastCGI server
 @code{/opt/bin/fastcgi_server} is created.  The @code{domain} must be
-"fastcgi" or "scgi", depending on the protocol to use.
+"fastcgi" or "scgi", depending on the specific protocol to use.
 @code{LOCAL} specifies if the server is handled by myserver or it is
-already running, thus myserver will simply access and use it.  In this
-case @code{name} can be anything without any specific meaning.
+already running; in the former case, myserver will simply access and
+use it.
+If the server is not local then the @code{name} is a simple label that
+can be used by a MIME type trought @code{param} to access it.
 
+
+The following code, declare an already running FastCGI server and
+registers it on the @code{fcgi} extension:
+
+@example
+<!-- Inside myserver.xml.  -->
+<PROCESS_SERVER>
+        <NAME>a_remote_server</NAME>
+        <DOMAIN>fastcgi</DOMAIN>
+        <HOST>foo</HOST>
+        <PORT>2010</PORT>
+        <LOCAL>NO</LOCAL>
+</PROCESS_SERVER>
+
+<!-- Inside MIMEtypes.xml.  -->
+<MIME mime="text/html" handler="RUNFASTCGI" param="a_remote_server">
+      <EXTENSION value="fcgi"/>
+</MIME>
+@end example

Modified: trunk/myserver/documentation/security.texi
===================================================================
--- trunk/myserver/documentation/security.texi	2009-02-01 19:08:46 UTC (rev 2992)
+++ trunk/myserver/documentation/security.texi	2009-02-02 19:29:11 UTC (rev 2993)
@@ -14,6 +14,7 @@
 @item Local @file{.security.xml}.
 @item Parent directories @file{.security.xml}.
 @item System vhost directory @file{.security.xml}.
+@item MIME type configuration @file{MIMEtypes.xml}.
 @item Virtual host configuration.
 @item Global server configuration.
 @end enumerate

Modified: trunk/myserver/documentation/virtual_hosts.texi
===================================================================
--- trunk/myserver/documentation/virtual_hosts.texi	2009-02-01 19:08:46 UTC (rev 2992)
+++ trunk/myserver/documentation/virtual_hosts.texi	2009-02-02 19:29:11 UTC (rev 2993)
@@ -86,14 +86,15 @@
 Although FTP is used for public file sharing, restrictions may be
 imposed using security file.
 
+@subsection HTTP specific configuration
 MyServer gives you the option to enable the HTTP TRACE command for
 each virtual host. All you need to do is edit the @file{security.xml}
 file of the root of your virtual host (not a subdirectory!  If the
 file doesn't exist, you may create a new one), and add the parameter:
 
 @example
-<HTTP TRACE="ON" />
+<DEFINE name="http.allow_trace" value="YES" />
 @end example
 
-Once you do that, you enable HTTP TRACE command. By default, it's
-disabled (so, simply delete the line, if you want to disable it)
+Once you do that, you enable the HTTP TRACE command. By default, it's
+disabled.





From MAILER-DAEMON Mon Feb 02 15:47:30 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LU5ha-0005n3-D2
	for mharc-myserver-commit@gnu.org; Mon, 02 Feb 2009 15:47:30 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LU5hZ-0005mc-6u
	for myserver-commit@gnu.org; Mon, 02 Feb 2009 15:47:29 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LU5hY-0005mI-IY
	for myserver-commit@gnu.org; Mon, 02 Feb 2009 15:47:28 -0500
Received: from [199.232.76.173] (port=42167 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LU5hY-0005mE-Cy
	for myserver-commit@gnu.org; Mon, 02 Feb 2009 15:47:28 -0500
Received: from savannah.gnu.org ([199.232.41.3]:60966 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LU5hY-0004pY-0y
	for myserver-commit@gnu.org; Mon, 02 Feb 2009 15:47:28 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LU5hX-0002UJ-7c
	for myserver-commit@gnu.org; Mon, 02 Feb 2009 20:47:27 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1LU5hV-0002Pe-Lj
	for myserver-commit@gnu.org; Mon, 02 Feb 2009 20:47:27 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1LU5hV-0002Pe-Lj@cvs.savannah.gnu.org>
Date: Mon, 02 Feb 2009 20:47:25 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [2994] Added possibility to use different uid/
 gid for spawned server processes.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 02 Feb 2009 20:47:29 -0000

Revision: 2994
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2994
Author:   gscrivano
Date:     2009-02-02 20:47:19 +0000 (Mon, 02 Feb 2009)

Log Message:
-----------
Added possibility to use different uid/gid for spawned server processes.

Modified Paths:
--------------
    trunk/myserver/documentation/process_security.texi
    trunk/myserver/include/base/process/process_server_manager.h
    trunk/myserver/src/base/process/process_server_manager.cpp

Modified: trunk/myserver/documentation/process_security.texi
===================================================================
--- trunk/myserver/documentation/process_security.texi	2009-02-02 19:29:11 UTC (rev 2993)
+++ trunk/myserver/documentation/process_security.texi	2009-02-02 20:47:19 UTC (rev 2994)
@@ -73,6 +73,8 @@
         <HOST>localhost</HOST>
         <PORT>2010</PORT>
         <LOCAL>yes</LOCAL>
+        <UID>1000</UID>
+        <GID>1000</GID>
 </PROCESS_SERVER>
 @end example
 
@@ -85,7 +87,11 @@
 If the server is not local then the @code{name} is a simple label that
 can be used by a MIME type trought @code{param} to access it.
 
+It is possible to specify a different uid/gid for the local server
+process and don't maintain the original myserver process privileges.
+It can be done using the @code{uid} and @code{gid} elements.
 
+
 The following code, declare an already running FastCGI server and
 registers it on the @code{fcgi} extension:
 

Modified: trunk/myserver/include/base/process/process_server_manager.h
===================================================================
--- trunk/myserver/include/base/process/process_server_manager.h	2009-02-02 19:29:11 UTC (rev 2993)
+++ trunk/myserver/include/base/process/process_server_manager.h	2009-02-02 20:47:19 UTC (rev 2994)
@@ -1,7 +1,7 @@
 /* -*- mode: c++ -*- */
 /*
 MyServer
-Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 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
@@ -88,7 +88,7 @@
 	int domainServers(const char* domain);
 	void load();
 	Server* runAndAddServer(const char* domain, const char* name, 
-													u_short port = 0);
+                          int uid = 0, int gid = 0, u_short port = 0);
 	Server* addRemoteServer(const char* domain, const char* name, 
 													const char* host, u_short port);
 private:
@@ -96,7 +96,8 @@
 	int nServers;
   Mutex mutex;
 	HashMap<string, ServerDomain*> domains;
-  int runServer(Server* server, const char* path, int port = 0);
+  int runServer(Server* server, const char* path, int uid = 0, 
+                int gid = 0, u_short port = 0);
 	void addServer(Server* server, const char* domain, const char* name);
 };
 

Modified: trunk/myserver/src/base/process/process_server_manager.cpp
===================================================================
--- trunk/myserver/src/base/process/process_server_manager.cpp	2009-02-02 19:29:11 UTC (rev 2993)
+++ trunk/myserver/src/base/process/process_server_manager.cpp	2009-02-02 20:47:19 UTC (rev 2994)
@@ -54,55 +54,63 @@
     string port;
     string local;
     bool localBool = true;
+    int uid = 0;
+    int gid = 0;
     xmlNodePtr node2;
-    if(strcmpi((const char*)node->name, "PROCESS_SERVER"))
+    if (strcmpi((const char*)node->name, "PROCESS_SERVER"))
       continue;
     node2 = node->children;
-    for(;node2; node2 = node2->next)
+    for (;node2; node2 = node2->next)
     {
-      if(!node2->children || !node2->children->content)
+      if (!node2->children || !node2->children->content)
         continue;
       
-      if(!strcmpi((const char*)node2->name, "NAME"))
-        name.assign((const char*) node2->children->content);
+      if (!strcmpi ((const char*)node2->name, "NAME"))
+        name.assign ((const char*) node2->children->content);
 
-      if(!strcmpi((const char*)node2->name, "HOST"))
-        host.assign((const char*) node2->children->content);
+      if (!strcmpi ((const char*)node2->name, "HOST"))
+        host.assign ((const char*) node2->children->content);
 
-      if(!strcmpi((const char*)node2->name, "DOMAIN"))
-        domain.assign((const char*) node2->children->content);
+      if (!strcmpi ((const char*)node2->name, "DOMAIN"))
+        domain.assign ((const char*) node2->children->content);
 
-      if(!strcmpi((const char*)node2->name, "PORT"))
-        port.assign((const char*) node2->children->content);
+      if (!strcmpi ((const char*)node2->name, "PORT"))
+        port.assign ((const char*) node2->children->content);
 
-      if(!strcmpi((const char*)node2->name, "LOCAL"))
-        local.assign((const char*) node2->children->content);
+      if (!strcmpi ((const char*)node2->name, "LOCAL"))
+        local.assign ((const char*) node2->children->content);
+
+      if (!strcmpi ((const char*)node2->name, "UID"))
+        uid = atoi ((const char*) node2->children->content);
+
+      if (!strcmpi ((const char*)node2->name, "GID"))
+        gid = atoi ((const char*) node2->children->content);
     }
     
-    if(!local.compare("YES") || !local.compare("yes"))
+    if (!local.compare("YES") || !local.compare("yes"))
       localBool = true;
     else
       localBool = false;
 
-    if(name.size() && domain.size())
+    if (name.size () && domain.size ())
     {
       u_short portN = 0;
 
-      if(port.size())
-        portN = atoi(port.c_str());
+      if(port.size ())
+        portN = atoi (port.c_str());
 
-      if(localBool)
-        runAndAddServer(domain.c_str(), name.c_str(), portN);
+      if (localBool)
+        runAndAddServer (domain.c_str(), name.c_str(), uid, gid, portN);
       else
       {
-        if(portN)
-          addRemoteServer(domain.c_str(), name.c_str(), host.c_str(), portN);
+        if (portN)
+          addRemoteServer (domain.c_str(), name.c_str(), host.c_str(), portN);
         else
         {
           ostringstream msg;
           msg << "Error: incomplete remote PROCESS_SERVER block, " 
               << domain  << ":" << name << " needs a port";
-          ::Server::getInstance()->logWriteln(msg.str().c_str(), MYSERVER_LOG_MSG_ERROR);
+          ::Server::getInstance ()->logWriteln(msg.str().c_str(), MYSERVER_LOG_MSG_ERROR);
         }
       }
 
@@ -110,7 +118,7 @@
     else
     {
       const char *msg = "Error: incomplete PROCESS_SERVER block";
-      ::Server::getInstance()->logWriteln(msg, MYSERVER_LOG_MSG_ERROR);
+      ::Server::getInstance ()->logWriteln(msg, MYSERVER_LOG_MSG_ERROR);
     }
 
   }
@@ -350,14 +358,16 @@
  *Run and add a server to the collection.
  *\param domain The server's domain.
  *\param path The path to the executable.
+ *\param uid User id to use for the new process.
+ *\param gid Group id to use for the new process.
  *\param port Port to use for the server.
  */
 ProcessServerManager::Server* 
 ProcessServerManager::runAndAddServer(const char* domain,  const char* path,
-                                      u_short port)
+                                      int uid, int gid, u_short port)
 {
   Server* server = new Server;
-  if(runServer(server, path, port))
+  if(runServer(server, path, uid, gid, port))
   {
     delete server;
     return 0;
@@ -370,10 +380,13 @@
  *Run a new server.
  *\param server The server object.
  *\param path The path to the executable.
+ *\param uid User id to use for the new process.
+ *\param gid Group id to use for the new process.
  *\param port The listening port.
  */
 int ProcessServerManager::runServer(ProcessServerManager::Server* server, 
-                                    const char* path, int port)
+                                    const char* path, int uid, int gid, 
+                                    u_short port)
 {
   StartProcInfo spi;
   MYSERVER_SOCKADDRIN serverSockAddrIn;
@@ -435,6 +448,9 @@
   spi.cmdLine.assign(path);
   server->path.assign(path);
 
+  spi.uid = uid;
+  spi.gid = gid;
+
   if (Process::getForkServer ()->isInitialized ())
     {
       int ret, port, pid;





From MAILER-DAEMON Tue Feb 03 12:25:53 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LUP21-0005iZ-04
	for mharc-myserver-commit@gnu.org; Tue, 03 Feb 2009 12:25:53 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LUP1z-0005gz-AX
	for myserver-commit@gnu.org; Tue, 03 Feb 2009 12:25:51 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LUP1y-0005ga-Tb
	for myserver-commit@gnu.org; Tue, 03 Feb 2009 12:25:51 -0500
Received: from [199.232.76.173] (port=34037 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LUP1y-0005gT-M6
	for myserver-commit@gnu.org; Tue, 03 Feb 2009 12:25:50 -0500
Received: from savannah.gnu.org ([199.232.41.3]:49252 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LUP1y-00041x-CS
	for myserver-commit@gnu.org; Tue, 03 Feb 2009 12:25:50 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LUP1x-0001kT-LB
	for myserver-commit@gnu.org; Tue, 03 Feb 2009 17:25:49 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1LUP1x-0001kP-9p
	for myserver-commit@gnu.org; Tue, 03 Feb 2009 17:25:49 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1LUP1x-0001kP-9p@cvs.savannah.gnu.org>
Date: Tue, 03 Feb 2009 17:25:49 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [2995] Fixed problems when executed as a daemon.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 03 Feb 2009 17:25:51 -0000

Revision: 2995
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2995
Author:   gscrivano
Date:     2009-02-03 17:25:48 +0000 (Tue, 03 Feb 2009)

Log Message:
-----------
Fixed problems when executed as a daemon.

Modified Paths:
--------------
    trunk/myserver/binaries/myserver-daemon
    trunk/myserver/src/myserver.cpp

Modified: trunk/myserver/binaries/myserver-daemon
===================================================================
--- trunk/myserver/binaries/myserver-daemon	2009-02-02 20:47:19 UTC (rev 2994)
+++ trunk/myserver/binaries/myserver-daemon	2009-02-03 17:25:48 UTC (rev 2995)
@@ -1,5 +1,5 @@
 # MyServer
-# Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2006, 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 2 of the License, or
@@ -19,9 +19,8 @@
 #
 # This file should be placed in /etc/init.d
 #
-# please do a chmod a+x on the file
+# please do a chmod +x on the file
 #
-
 set -e
 
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
@@ -41,14 +40,14 @@
 d_start()
 {
 	start-stop-daemon --start --pidfile $PIDFILE \
-	--exec $DAEMON -- -rSERVICE --logfile=$LOGFILE --pidfile=$PIDFILE
+	--exec $DAEMON -- -rSERVICE --log="file://$LOGFILE" --pidfile=$PIDFILE
 }
 
 
 d_stop()
 {
 	start-stop-daemon --stop --pidfile $PIDFILE \
-	--exec $DAEMON -- -rSERVICE --logfile=$LOGFILE --pidfile=$PIDFILE
+	--exec $DAEMON -- -rSERVICE --log="file://$LOGFILE" --pidfile=$PIDFILE
 
 }
 
@@ -56,7 +55,7 @@
 d_reload()
 {
 	start-stop-daemon --stop  --signal 1  --pidfile $PIDFILE \
-	--exec $DAEMON -- -rSERVICE --logfile=$LOGFILE --pidfile=$PIDFILE
+	--exec $DAEMON -- -rSERVICE --log="file://$LOGFILE" --pidfile=$PIDFILE
 }
 
 d_restart()

Modified: trunk/myserver/src/myserver.cpp
===================================================================
--- trunk/myserver/src/myserver.cpp	2009-02-02 20:47:19 UTC (rev 2994)
+++ trunk/myserver/src/myserver.cpp	2009-02-03 17:25:48 UTC (rev 2995)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002-2008 Free Software Foundation, Inc.
+Copyright (C) 2002-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
@@ -556,11 +556,6 @@
 #endif
 
 #ifdef ARGP
-
-#ifdef NOT_WIN
-  setpgid (0, 0);
-#endif
-
   if (input.useForkServer)
     Process::getForkServer ()->startForkServer ();
 #endif
@@ -594,38 +589,36 @@
           */
          if (pid < 0)
          {
-           return 1;
+	   return 1;
          }
-         /*
-          *A good process id, return with success.
-          */
-         if (pid > 0)
-         {
-           return 0;
-         }
-         /*
-          *Store the PID.
-          */
+
+	 if (pid)
+	 {
+	   /*
+	    *Store the PID.
+	    */
 #ifdef ARGP
-         if(input.pidFileName)
-           writePidfile(input.pidFileName);
-         else
-           writePidfile("/var/run/myserver.pid");
+	   if(input.pidFileName)
+	     writePidfile(input.pidFileName);
+	   else
+	     writePidfile("/var/run/myserver.pid");
 #else
-         writePidfile("/var/run/myserver.pid");
+	   writePidfile("/var/run/myserver.pid");
 #endif
+	   return 0;
+	 }
+
          /*
           *Create a SID for the new process.
           */
-         sid = setsid();
+	 sid = setsid();
 
          /*
           *Error in setting a new sid, return the error.
           */
-         if (sid < 0)
-         {
-           return 1;
-         }
+	 if (sid < 0)
+	   return 1;
+         
 
          /*
           *Finally run the server from the forked process.
@@ -645,7 +638,7 @@
     Process::getForkServer ()->killServer ();
 #endif
 
-   return 0;
+  return 0;
 }
 
 #ifndef WIN32





From MAILER-DAEMON Tue Feb 03 15:43:40 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LUS7Q-0001S2-LY
	for mharc-myserver-commit@gnu.org; Tue, 03 Feb 2009 15:43:40 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LUS7O-0001RX-NB
	for myserver-commit@gnu.org; Tue, 03 Feb 2009 15:43:38 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LUS7M-0001Qw-FF
	for myserver-commit@gnu.org; Tue, 03 Feb 2009 15:43:38 -0500
Received: from [199.232.76.173] (port=41821 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LUS7M-0001Qt-9I
	for myserver-commit@gnu.org; Tue, 03 Feb 2009 15:43:36 -0500
Received: from savannah.gnu.org ([199.232.41.3]:44889 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LUS7L-0003MS-Ne
	for myserver-commit@gnu.org; Tue, 03 Feb 2009 15:43:36 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LUS7L-0004pP-2V
	for myserver-commit@gnu.org; Tue, 03 Feb 2009 20:43:35 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1LUS7K-0004pJ-JN
	for myserver-commit@gnu.org; Tue, 03 Feb 2009 20:43:34 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1LUS7K-0004pJ-JN@cvs.savannah.gnu.org>
Date: Tue, 03 Feb 2009 20:43:34 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [2996] Fixed some doxygen tags that were causing
	warnings.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 03 Feb 2009 20:43:39 -0000

Revision: 2996
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2996
Author:   gscrivano
Date:     2009-02-03 20:43:34 +0000 (Tue, 03 Feb 2009)

Log Message:
-----------
Fixed some doxygen tags that were causing warnings.

Modified Paths:
--------------
    trunk/myserver/src/base/file/file.cpp
    trunk/myserver/src/base/file/files_utility.cpp
    trunk/myserver/src/base/files_cache/cached_file.cpp
    trunk/myserver/src/base/files_cache/cached_file_factory.cpp
    trunk/myserver/src/base/pipe/pipe.cpp
    trunk/myserver/src/base/process/fork_server.cpp
    trunk/myserver/src/base/process/process.cpp
    trunk/myserver/src/base/socket_pair/socket_pair.cpp
    trunk/myserver/src/base/string/stringutils.cpp
    trunk/myserver/src/base/xml/xml_parser.cpp
    trunk/myserver/src/conf/security/security_manager.cpp
    trunk/myserver/src/conf/vhost/vhost.cpp
    trunk/myserver/src/conf/vhost/vhost_manager.cpp
    trunk/myserver/src/connections_scheduler/connections_scheduler.cpp
    trunk/myserver/src/filter/console.cpp
    trunk/myserver/src/filter/filter.cpp
    trunk/myserver/src/http_handler/http_dir/http_dir.cpp
    trunk/myserver/src/http_handler/http_file/http_file.cpp
    trunk/myserver/src/http_handler/mscgi/mscgi.cpp
    trunk/myserver/src/plugin/plugin.cpp
    trunk/myserver/src/plugin/plugin_info.cpp
    trunk/myserver/src/plugin/plugins_manager.cpp
    trunk/myserver/src/protocol/control/control_header.cpp
    trunk/myserver/src/protocol/ftp/ftp.cpp
    trunk/myserver/src/protocol/http/dyn_http_command_manager.cpp
    trunk/myserver/src/protocol/http/http.cpp
    trunk/myserver/src/protocol/http/http_data_read.cpp
    trunk/myserver/src/protocol/http/http_headers.cpp

Modified: trunk/myserver/src/base/file/file.cpp
===================================================================
--- trunk/myserver/src/base/file/file.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/base/file/file.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
+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
@@ -103,7 +103,7 @@
 /*!
  *Constructor for the class.
  *\param nfilename Filename to open.
- *\agument opt Specify how open the file.
+ *\param opt Specify how open the file.
  */
 File::File(char *nfilename, int opt) 
   : handle(0)
@@ -112,10 +112,10 @@
 }
 
 /*!
- *Open(or create if not exists) a file.
+ *Open (or create if not exists) a file.
  *If the function have success the return value is nonzero.
  *\param nfilename Filename to open.
- *\agument opt Specify how open the file.
+ *\param opt Specify how open the file.
  *openFile returns 0 if the call was successful, any other value on errors.
  */
 int File::openFile(const char* nfilename,u_long opt)

Modified: trunk/myserver/src/base/file/files_utility.cpp
===================================================================
--- trunk/myserver/src/base/file/files_utility.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/base/file/files_utility.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2005, 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
@@ -210,7 +210,6 @@
  *Copy the file from [SRC] to [DEST]. Returns 0 on success.
  *\param src The source File.
  *\param dest The destination File.
- *\param overwrite Overwrite the dest file if already exists?
  */
 int FilesUtility::copyFile(File src, File dest)
 {
@@ -818,7 +817,8 @@
 /*!
  *Create an unique temporary file name.  This function doesn't create the
  *file or open it but generates only its name.
- *\param
+ *\param tid Caller thread id.
+ *\param out Output string.
  */
 void FilesUtility::temporaryFileName(u_long tid, string &out)
 {

Modified: trunk/myserver/src/base/files_cache/cached_file.cpp
===================================================================
--- trunk/myserver/src/base/files_cache/cached_file.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/base/files_cache/cached_file.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+Copyright (C) 2006, 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
@@ -57,13 +57,7 @@
 /*!
  *Write data to a file is not supported by a CachedFile, return immediately -1.
  *Inherithed by File.
- *buffer is the pointer to the data to write
- *buffersize is the number of byte to write
- *nbw is a pointer to an unsigned long that receive the number of the
- *bytes written correctly.
- *\param buffer The buffer where write.
- *\param buffersize The length of the buffer in bytes.
- *\param nbw How many bytes were written to the file.
+ *\see File#writeToFile.
  */
 int CachedFile::writeToFile(const char* buffer, u_long buffersize, u_long* nbw)
 {
@@ -74,10 +68,10 @@
  *A CachedFile can't be opened directly, use a factory instead.
  *If the function have success the return value is nonzero.
  *\param nfilename Filename to open.
- *\agument opt Specify how open the file.
- *openFile returns 0 if the call was successfull, any other value on errors.
+ *\param opt Specify how open the file.
+ *\return 0 if the call was successfull, any other value on errors.
  */
-int CachedFile::openFile(const char* nfilename,u_long opt)
+int CachedFile::openFile(const char* nfilename, u_long opt)
 {
   return -1;
 }

Modified: trunk/myserver/src/base/files_cache/cached_file_factory.cpp
===================================================================
--- trunk/myserver/src/base/files_cache/cached_file_factory.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/base/files_cache/cached_file_factory.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 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
@@ -56,7 +56,7 @@
 
 /*!
  *Class constructor.
- *\param m Max size to use for the cache.
+ *\param size Max size to use for the cache.
  */
 CachedFileFactory::CachedFileFactory(u_long size)
 {
@@ -131,10 +131,11 @@
   created = getTicks();
   mutex.init();
 }
+
 /*!
  *Open a new file in read-only mode, if the file is present in the cache then
  *use the cache instead of a real file.
- *\param file The file name.
+ *\param filename The file name.
  */
 File* CachedFileFactory::open(const char* filename)
 {

Modified: trunk/myserver/src/base/pipe/pipe.cpp
===================================================================
--- trunk/myserver/src/base/pipe/pipe.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/base/pipe/pipe.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
+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
@@ -144,7 +144,7 @@
  *Write from the pipe.
  *\param buffer What write.
  *\param len Buffer size.
- *\param nbr Get how many bytes were really written.
+ *\param nbw Get how many bytes were written.
  */
 int Pipe::write(const char* buffer, u_long len, u_long *nbw)
 {
@@ -276,7 +276,7 @@
  *Wait until new data is ready.  Do not wait more 
  *than the specified timeout.
  *\param sec Seconds part of the timeout.
- *\param sec Micro seconds part of the timeout.
+ *\param usec Micro seconds part of the timeout.
  */
 int Pipe::waitForData (int sec, int usec)
 {

Modified: trunk/myserver/src/base/process/fork_server.cpp
===================================================================
--- trunk/myserver/src/base/process/fork_server.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/base/process/fork_server.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -29,7 +29,7 @@
 /*!
  *Read a file descriptor from the specified socket.
  *\param socket Socket to use.
- *\param num Integer to write.
+ *\param fd File handle to write.
  */
 int ForkServer::writeFd (SocketPair *socket, FileHandle fd)
 {
@@ -42,7 +42,7 @@
 /*!
  *Write a file descriptor on the specified socket.
  *\param socket Socket to use.
- *\param num Integer to write.
+ *\param fd Pointer to the file handle that is read.
  */
 int ForkServer::readFd (SocketPair *socket, FileHandle *fd)
 {

Modified: trunk/myserver/src/base/process/process.cpp
===================================================================
--- trunk/myserver/src/base/process/process.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/base/process/process.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -116,7 +116,7 @@
 /*!
  *Generate the env array for execve.
  *\param envp Enviroment variables array.
- *\param envString Enviroment values separed by '\0'.
+ *\param envString Enviroment values separed by the NULL character.
  */
 int Process::generateEnvString (const char **envp, char *envString)
 {
@@ -147,7 +147,6 @@
  *
  *\param spi new process information.
  *\param waitEnd Specify if wait until the process finishes.
- *\param timeout The maximum amount to wait for the process.
  *
  *\return -1 on failure.
  *\return the new process identifier on success.

Modified: trunk/myserver/src/base/socket_pair/socket_pair.cpp
===================================================================
--- trunk/myserver/src/base/socket_pair/socket_pair.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/base/socket_pair/socket_pair.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -201,7 +201,7 @@
 
 /*!
  *Configure the server socket blocking or not blocking.
- *\param blocking The new blocking status.
+ *\param notBlocking The new non-blocking status.
  */
 void SocketPair::setNonBlocking (bool notBlocking)
 {

Modified: trunk/myserver/src/base/string/stringutils.cpp
===================================================================
--- trunk/myserver/src/base/string/stringutils.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/base/string/stringutils.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+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
@@ -823,7 +823,7 @@
 }
 
 /*!
- *Get the offset from string start of the first \r or \n.
+ *Get the offset to the first '\\r' or '\\n'.
  *Returns -1 on errors.
  */
 int getEndLine(const char* str, int max)

Modified: trunk/myserver/src/base/xml/xml_parser.cpp
===================================================================
--- trunk/myserver/src/base/xml/xml_parser.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/base/xml/xml_parser.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+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
@@ -28,7 +28,7 @@
  * Internal call back functions for saveMemBuf
  * \param context Context
  * \param buffer Buffer
- * \param length Length
+ * \param len Length
  * \return Returns the length
  */
 static int MemBufWriteCallback(void * context, const char * buffer, int len)
@@ -331,7 +331,7 @@
 
 /**
  *Evaluate an XPath expression.
- *\param query The xpath expression.
+ *\param expr The xpath expression.
  *\return NULL on errors.
  *\return The XmlXPathResult containing the result.
  */

Modified: trunk/myserver/src/conf/security/security_manager.cpp
===================================================================
--- trunk/myserver/src/conf/security/security_manager.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/conf/security/security_manager.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002-2008 Free Software Foundation, Inc.
+Copyright (C) 2002-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
@@ -80,7 +80,7 @@
  *\param validatorName The validator name to find.
  *\param authMethodName The auth method name to find.
  *\param validator Pointer to the Validator to initialize. 
- *\param validator Pointer to the AuthMethod initialize.
+ *\param authMethod Pointer to the AuthMethod initialize.
  *\return 0 if the pointers were successfully initialized.
  */
 int SecurityManager::getValidatorAndAuthMethod (string &validatorName,

Modified: trunk/myserver/src/conf/vhost/vhost.cpp
===================================================================
--- trunk/myserver/src/conf/vhost/vhost.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/conf/vhost/vhost.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
   MyServer
-  Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+  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
@@ -193,6 +193,7 @@
 /*!
  *Add an IP address to the list.
  *\param ip The ip to add.
+ *\param isRegex Specify if the ip is specified as a regex.
  */
 void Vhost::addIP(const char *ip, int isRegex)
 {

Modified: trunk/myserver/src/conf/vhost/vhost_manager.cpp
===================================================================
--- trunk/myserver/src/conf/vhost/vhost_manager.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/conf/vhost/vhost_manager.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
   MyServer
-  Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+  Copyright (C) 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
@@ -122,6 +122,7 @@
 /*!
  *VhostManager costructor.
  *\param lt A ListenThreads object to use to create new threads.
+ *\param lm The log manager to use.
  */
 VhostManager::VhostManager(ListenThreads* lt, LogManager* lm)
 {
@@ -315,7 +316,6 @@
  *Load the virtual hosts from a XML configuration file
  *Returns non-null on errors.
  *\param filename The XML file to open.
- *\param maxlogSize The maximum dimension for the log file.
  */
 int VhostManager::loadXMLConfigurationFile(const char *filename)
 {

Modified: trunk/myserver/src/connections_scheduler/connections_scheduler.cpp
===================================================================
--- trunk/myserver/src/connections_scheduler/connections_scheduler.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/connections_scheduler/connections_scheduler.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -166,7 +166,6 @@
  *Add a listener socket to the event queue.
  *This is used to renew the event after the listener thread is notified.
  *
- *\param sock Listening socket.
  *\param la Structure containing an Event to be notified on new data.
  */
 void ConnectionsScheduler::listener(ConnectionsScheduler::ListenerArg *la)

Modified: trunk/myserver/src/filter/console.cpp
===================================================================
--- trunk/myserver/src/filter/console.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/filter/console.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
   MyServer
-  Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+  Copyright (C) 2006, 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
@@ -152,7 +152,7 @@
 
 /*!
  * Set the attributes for the console text.
- * \param c[0] holds the foreground color, c[1] the background one.
+ * \param c c[0] holds the foreground color, c[1] the background one.
  * \return 0 on success, 1 on error.
  */
 int

Modified: trunk/myserver/src/filter/filter.cpp
===================================================================
--- trunk/myserver/src/filter/filter.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/filter/filter.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+Copyright (C) 2005, 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,7 +26,7 @@
 
 /*!
  *Read [len] characters using the filter. Returns -1 on errors.
- *\argument buffer The buffer where receive read data.
+ *\param buffer The buffer where receive read data.
  *\param len The buffer length in bytes.
  *\param nbr A pointer to receive the number of read bytes.
  */

Modified: trunk/myserver/src/http_handler/http_dir/http_dir.cpp
===================================================================
--- trunk/myserver/src/http_handler/http_dir/http_dir.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/http_handler/http_dir/http_dir.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2005, 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
@@ -217,8 +217,7 @@
  *Generate the HTML code for an element in the result table.
  *\param out Buffer where write the HTML.
  *\param file Structure with information on the element.
- *\param uriEndWithSlash Specify if the requested resource 
- *ends with a slash.
+ *\param linkPrefix Prefix to use for the generated links.
  *\param formatString Specify which element show.
  */
 void HttpDir::generateElement (MemBuf &out, 
@@ -287,12 +286,13 @@
  *\param td The current thread context.
  *\param s The current connection structure.
  *\param directory Directory to show.
- *\param cgi non used.
+ *\param cgi not used.
+ *\param execute not used.
  *\param onlyHeader Specify if send only the HTTP header.
 */
 int HttpDir::send(HttpThreadContext* td, ConnectionPtr s, 
-                  const char* directory, const char* /*cgi*/, 
-                  int /*execute*/, int onlyHeader)
+                  const char* directory, const char* cgi, 
+                  int execute, int onlyHeader)
 {
   u_long nbw;
   string filename;
@@ -648,7 +648,7 @@
 
 /*!
  *Format a string to html.
- *\param name String to convert.
+ *\param in String to convert.
  *\param out HTML converted string.
  */
 void HttpDir::formatHtml(string& in, string& out)

Modified: trunk/myserver/src/http_handler/http_file/http_file.cpp
===================================================================
--- trunk/myserver/src/http_handler/http_file/http_file.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/http_handler/http_file/http_file.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2005, 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
@@ -46,11 +46,12 @@
  *\param s A pointer to the connection.
  *\param filenamePath The path of the static file to send.
  *\param exec Not used.
+ *\param execute Not used.
  *\param onlyHeader Specify if send only the HTTP header.
   */
 int HttpFile::send(HttpThreadContext* td, ConnectionPtr s, 
-                   const char *filenamePath, const char* /*exec*/,
-                   int /*execute*/, int onlyHeader)
+                   const char *filenamePath, const char* exec,
+                   int execute, int onlyHeader)
 {
   /*
    *With this routine we send a file through the HTTP protocol.
@@ -559,7 +560,7 @@
  *Load the static elements.
  *\param confFile Not used.
  */
-int HttpFile::load(XmlParser* /*confFile*/)
+int HttpFile::load(XmlParser* confFile)
 {
   return 0;
 }

Modified: trunk/myserver/src/http_handler/mscgi/mscgi.cpp
===================================================================
--- trunk/myserver/src/http_handler/mscgi/mscgi.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/http_handler/mscgi/mscgi.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+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
@@ -233,7 +233,7 @@
  *Map the library in the application address space.
  *\param confFile The xml parser with configuration.
  */
-int MsCgi::load(XmlParser* /*confFile*/)
+int MsCgi::load(XmlParser* confFile)
 {
   return 1;
 }

Modified: trunk/myserver/src/plugin/plugin.cpp
===================================================================
--- trunk/myserver/src/plugin/plugin.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/plugin/plugin.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 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
@@ -76,7 +76,6 @@
 
 /*!
  *Post load initialization.  This is called once all the plugins are loaded.
- *\param file The filename to load.
  *\param server The server instance to use.
  *\param languageFile The language file to use to retrieve warnings/errors 
  *messages.

Modified: trunk/myserver/src/plugin/plugin_info.cpp
===================================================================
--- trunk/myserver/src/plugin/plugin_info.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/plugin/plugin_info.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 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
@@ -67,8 +67,10 @@
 }
 	
 /*!
- * Adds a dependece to the plugin.
+ * Adds a dependence to the plugin.
  *\param name plugin name
+ *\param minVersion min version for the dependence.
+ *\param maxVersion max version for the dependence.
 */
 void PluginInfo::addDependence(string name, int minVersion, int maxVersion)
 {	
@@ -193,4 +195,4 @@
   }
 
   return (n1<<24) + (n2<<16) + (n3<<8) + n4;
-}
\ No newline at end of file
+}

Modified: trunk/myserver/src/plugin/plugins_manager.cpp
===================================================================
--- trunk/myserver/src/plugin/plugins_manager.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/plugin/plugins_manager.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 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
@@ -500,7 +500,7 @@
 /*!
  *Add a plugin option structure.
  *\param plugin The plugin name.
- *\param po The options for the plugin.
+ *\param pi The options for the plugin.
  */
 int PluginsManager::addPluginInfo(string& plugin, PluginInfo* pi)
 {
@@ -514,7 +514,7 @@
 
 /*!
  *Return a pluginOption.
- *\param name The plugin name.
+ *\param plugin The plugin name.
  */
 PluginInfo* PluginsManager::getPluginInfo(string& plugin)
 {

Modified: trunk/myserver/src/protocol/control/control_header.cpp
===================================================================
--- trunk/myserver/src/protocol/control/control_header.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/protocol/control/control_header.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2004, 2005, 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
@@ -124,14 +124,16 @@
  *Parse the header in buffer. Put the effective length of the header in len.
  *Return a control_error. See protocol/control/control_errors.h to have a list of all errors.
  *Return -1 on an incomplete header.
- *The header has this form:
- *_/CMD VERSION more_options\r\n
- *_/AUTH name:password\r\n
- *_/LEN length of data\r\n
+ *
+ *The header has this form (where CR is carriage return and NL a newline):
+ *
+ *"_/CMD VERSION more_optionsCRNL"
+ *"_/AUTH name:passwordCRNL"
+ *"_/LEN length of dataCRNL"
  *_***
  *_Additional fields.(Not used now)
  *_***
- *_\r\n        -> Header ends with a \r\n.
+ *_"CRNL"        -> Header ends with a "CRNL".
  *_Data...
  */
 int ControlHeader::parse_header(char *buffer, int bufferlen, int *len)

Modified: trunk/myserver/src/protocol/ftp/ftp.cpp
===================================================================
--- trunk/myserver/src/protocol/ftp/ftp.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/protocol/ftp/ftp.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2002, 2003, 2004, 2005, 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 2 of the License, or
@@ -1976,8 +1976,8 @@
  * WONTx    -> ignore
  * IACx     -> ignore
  * IACIAC   -> IAC
- *\param szIn client's requests
- *\param szOut client's requests without telnet codes
+ *\param In client's requests
+ *\param Out client's requests without telnet codes
  */
 void Ftp::EscapeTelnet(MemBuf &In, MemBuf &Out)
 {
@@ -2028,8 +2028,8 @@
 
 /*!
  *Let only first cmd to be handled.
- *\param szIn client's requests
- *\param szOut client's requests without telnet codes
+ *\param In client's requests
+ *\param Out client's requests without telnet codes
  */
 void Ftp::RemovePipelinedCmds(MemBuf &In, MemBuf &Out)
 {

Modified: trunk/myserver/src/protocol/http/dyn_http_command_manager.cpp
===================================================================
--- trunk/myserver/src/protocol/http/dyn_http_command_manager.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/protocol/http/dyn_http_command_manager.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+Copyright (C) 2005, 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
@@ -50,9 +50,9 @@
 /*!
  *Add the DynamicHttpCommand.
  *\param name http command name.
- *\param httpManager http command to add.
+ *\param httpCommand http command to add.
  */
 void DynHttpCommandManager::addHttpCommand(string& name, DynamicHttpCommand* httpCommand)
 {
   dynamicHttpCommands.put(name,httpCommand);
-}
\ No newline at end of file
+}

Modified: trunk/myserver/src/protocol/http/http.cpp
===================================================================
--- trunk/myserver/src/protocol/http/http.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/protocol/http/http.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002-2008 Free Software Foundation, Inc.
+Copyright (C) 2002-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
@@ -367,6 +367,9 @@
 /*!
  *Get the file permissions mask.
  *\param filename Resource to access.
+ *\param directory Directory where the resource is.
+ *\param file The file specified by the resource.
+ *\param filenamePath Complete path to the file.
  *\param yetmapped Is the resource mapped to the localfilesystem?
  *\param permissions Permission mask for this resource.
  *\return Return 200 on success.

Modified: trunk/myserver/src/protocol/http/http_data_read.cpp
===================================================================
--- trunk/myserver/src/protocol/http/http_data_read.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/protocol/http/http_data_read.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002-2008 Free Software Foundation, Inc.
+Copyright (C) 2002-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
@@ -113,6 +113,7 @@
  *\param outBufferSize outBuffer size.
  *\param outNbr Number of bytes read.
  *\param timeout Timeout value to use on the socket.
+ *\param out Output file.
  *\return Return 0 on success.
  *\return -1 on internal error.
  *\return Any other value is the HTTP error code.

Modified: trunk/myserver/src/protocol/http/http_headers.cpp
===================================================================
--- trunk/myserver/src/protocol/http/http_headers.cpp	2009-02-03 17:25:48 UTC (rev 2995)
+++ trunk/myserver/src/protocol/http/http_headers.cpp	2009-02-03 20:43:34 UTC (rev 2996)
@@ -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
@@ -409,7 +409,7 @@
  *\param inputSize Size of the buffer
  *\param nHeaderChars Real size of the header.
  *\param request HTTP request structure to fullfill with data.
- *\param td the current executing thread context.
+ *\param connection The current connection.
  */
 int HttpHeaders::buildHTTPRequestHeaderStruct(const char* input,
                                               u_long inputSize,





From MAILER-DAEMON Wed Feb 04 16:29:42 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LUpJW-0003N6-N5
	for mharc-myserver-commit@gnu.org; Wed, 04 Feb 2009 16:29:42 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LUpF1-00024x-1t
	for myserver-commit@gnu.org; Wed, 04 Feb 2009 16:25:03 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LUpF0-00024j-9F
	for myserver-commit@gnu.org; Wed, 04 Feb 2009 16:25:02 -0500
Received: from [199.232.76.173] (port=41092 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LUpF0-00024g-1J
	for myserver-commit@gnu.org; Wed, 04 Feb 2009 16:25:02 -0500
Received: from savannah.gnu.org ([199.232.41.3]:57541 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LUpEz-0004EB-QM
	for myserver-commit@gnu.org; Wed, 04 Feb 2009 16:25:01 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LUpEz-0007Vt-4F
	for myserver-commit@gnu.org; Wed, 04 Feb 2009 21:25:01 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1LUpEy-0007Vo-O6
	for myserver-commit@gnu.org; Wed, 04 Feb 2009 21:25:00 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1LUpEy-0007Vo-O6@cvs.savannah.gnu.org>
Date: Wed, 04 Feb 2009 21:25:00 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [2997] Added documentation for the `LOCATION'
	element.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 04 Feb 2009 21:25:03 -0000

Revision: 2997
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2997
Author:   gscrivano
Date:     2009-02-04 21:24:59 +0000 (Wed, 04 Feb 2009)

Log Message:
-----------
Added documentation for the `LOCATION' element.

Modified Paths:
--------------
    trunk/myserver/documentation/virtual_hosts.texi

Modified: trunk/myserver/documentation/virtual_hosts.texi
===================================================================
--- trunk/myserver/documentation/virtual_hosts.texi	2009-02-03 20:43:34 UTC (rev 2996)
+++ trunk/myserver/documentation/virtual_hosts.texi	2009-02-04 21:24:59 UTC (rev 2997)
@@ -87,6 +87,24 @@
 imposed using security file.
 
 @subsection HTTP specific configuration
+
+@subsubsection The LOCATION element
+It may be necessary to register an entire location with a single
+handler and it is done trought @code{LOCATION}.
+Any other element passed after the location will be part of the
+@code{PATH_INFO} variable.
+
+@example
+    <LOCATION path="foo/bar" mime="text/html" handler="CGI" param="/usr/local/bin/handler" />
+@end example
+
+In the previous example, the CGI process @file{/usr/local/bin/handler}
+is used to manage any request to the location @file{foo/bar}, this
+location includes for example: @file{foo/bar}, @file{foo/bar/baz},
+@file{foo/bar/a/file}, everything that follows @file{foo/bar} will be
+part of @code{PATH_INFO}.
+
+@subsubsection HTTP trace command
 MyServer gives you the option to enable the HTTP TRACE command for
 each virtual host. All you need to do is edit the @file{security.xml}
 file of the root of your virtual host (not a subdirectory!  If the





From MAILER-DAEMON Fri Feb 06 13:57:11 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LVVt1-0001CS-7e
	for mharc-myserver-commit@gnu.org; Fri, 06 Feb 2009 13:57:11 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LVVsz-0001Ba-Iy
	for myserver-commit@gnu.org; Fri, 06 Feb 2009 13:57:09 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LVVsy-0001An-Fs
	for myserver-commit@gnu.org; Fri, 06 Feb 2009 13:57:08 -0500
Received: from [199.232.76.173] (port=40058 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LVVsy-0001Ad-2N
	for myserver-commit@gnu.org; Fri, 06 Feb 2009 13:57:08 -0500
Received: from savannah.gnu.org ([199.232.41.3]:33774 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LVVsx-0003gy-Lt
	for myserver-commit@gnu.org; Fri, 06 Feb 2009 13:57:07 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LVVsv-0004Xg-5Q
	for myserver-commit@gnu.org; Fri, 06 Feb 2009 18:57:05 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1LVVsu-0004Xc-RK
	for myserver-commit@gnu.org; Fri, 06 Feb 2009 18:57:05 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1LVVsu-0004Xc-RK@cvs.savannah.gnu.org>
Date: Fri, 06 Feb 2009 18:57:04 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [2998] Don't check twice if `manager' is NULL.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 06 Feb 2009 18:57:09 -0000

Revision: 2998
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2998
Author:   gscrivano
Date:     2009-02-06 18:57:04 +0000 (Fri, 06 Feb 2009)

Log Message:
-----------
Don't check twice if `manager' is NULL.

Modified Paths:
--------------
    trunk/myserver/src/protocol/http/http.cpp

Modified: trunk/myserver/src/protocol/http/http.cpp
===================================================================
--- trunk/myserver/src/protocol/http/http.cpp	2009-02-04 21:24:59 UTC (rev 2997)
+++ trunk/myserver/src/protocol/http/http.cpp	2009-02-06 18:57:04 UTC (rev 2998)
@@ -845,8 +845,6 @@
 
 
     if (td->mime && (manager = staticHttp.dynManagerList.getHttpManager (td->mime->cmdName)))
-    {
-      if (manager)
       {
         return manager->send (td,
                               td->connection,
@@ -854,7 +852,6 @@
                               cgiManager,
                               td->mime->selfExecuted,
                               onlyHeader);
-      }
     }
 
 





From MAILER-DAEMON Fri Feb 06 15:17:07 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LVX8N-0004Nr-Ee
	for mharc-myserver-commit@gnu.org; Fri, 06 Feb 2009 15:17:07 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LVX8M-0004LX-8x
	for myserver-commit@gnu.org; Fri, 06 Feb 2009 15:17:06 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LVX8L-0004KO-Kv
	for myserver-commit@gnu.org; Fri, 06 Feb 2009 15:17:05 -0500
Received: from [199.232.76.173] (port=50247 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LVX8L-0004KE-3e
	for myserver-commit@gnu.org; Fri, 06 Feb 2009 15:17:05 -0500
Received: from savannah.gnu.org ([199.232.41.3]:43988 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LVX8K-0008Nz-PL
	for myserver-commit@gnu.org; Fri, 06 Feb 2009 15:17:04 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LVX8K-0003Hm-6r
	for myserver-commit@gnu.org; Fri, 06 Feb 2009 20:17:04 +0000
Received: from dperrone by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <dperrone@savannah.gnu.org>) id 1LVX8J-0003HX-OP
	for myserver-commit@gnu.org; Fri, 06 Feb 2009 20:17:04 +0000
MIME-Version: 1.0
Errors-To: dperrone
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Daniele Perrone <dperrone@it.gnu.org>
Message-Id: <E1LVX8J-0003HX-OP@cvs.savannah.gnu.org>
Date: Fri, 06 Feb 2009 20:17:03 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [2999] refactoring and fixed dependences checking
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 06 Feb 2009 20:17:06 -0000

Revision: 2999
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=2999
Author:   dperrone
Date:     2009-02-06 20:17:01 +0000 (Fri, 06 Feb 2009)

Log Message:
-----------
refactoring and fixed dependences checking

Modified Paths:
--------------
    trunk/myserver/include/plugin/plugin_info.h
    trunk/myserver/include/plugin/plugins_manager.h
    trunk/myserver/src/plugin/plugin_info.cpp
    trunk/myserver/src/plugin/plugins_manager.cpp
    trunk/myserver/src/server/server.cpp

Modified: trunk/myserver/include/plugin/plugin_info.h
===================================================================
--- trunk/myserver/include/plugin/plugin_info.h	2009-02-06 18:57:04 UTC (rev 2998)
+++ trunk/myserver/include/plugin/plugin_info.h	2009-02-06 20:17:01 UTC (rev 2999)
@@ -60,9 +60,16 @@
 	int setMyServerMaxVersion(int v);
 	
 	HashMap<string, pair<int,int>* >::Iterator begin(){return dependences.begin();}
-	HashMap<string, pair<int,int>* > ::Iterator end(){return dependences.end();}
+	HashMap<string, pair<int,int>* >::Iterator end(){return dependences.end();}
 	
+	void setPlugin(Plugin* plugin);
+	Plugin* getPlugin();
+	Plugin* removePlugin();
 	
+	void setEnabled(bool enabled);
+	
+	pair<int,int>* getDependence(string name);
+	
 	static int convertVersion(string* s);
 	
 	
@@ -76,6 +83,7 @@
     int version;
     int msMinVersion;
     int msMaxVersion;
+    Plugin* plugin;
     HashMap<string, pair<int,int>* > dependences;
     static Regex* regex;
 };

Modified: trunk/myserver/include/plugin/plugins_manager.h
===================================================================
--- trunk/myserver/include/plugin/plugins_manager.h	2009-02-06 18:57:04 UTC (rev 2998)
+++ trunk/myserver/include/plugin/plugins_manager.h	2009-02-06 20:17:01 UTC (rev 2999)
@@ -33,8 +33,8 @@
 class PluginsManager
 {
 public:
-	HashMap<string, Plugin*>::Iterator begin(){return plugins.begin();}
-	HashMap<string, Plugin*>::Iterator end(){return plugins.end();}
+	HashMap<string, PluginInfo*>::Iterator begin(){return pluginsInfos.begin();}
+	HashMap<string, PluginInfo*>::Iterator end(){return pluginsInfos.end();}
 	
 	Plugin* getPlugin(string& name);
 	
@@ -55,12 +55,12 @@
 	
 private:
 	HashMap<string, PluginInfo*> pluginsInfos;
-	HashMap<string, Plugin*> plugins;
 	int loadOptions(Server *server, XmlParser* languageFile);
-	int addPlugin(string& file, Server* server, 
+	void recursiveDependencesFallDown(Server* server, string name, HashMap<string,bool> remove,  HashMap<string,list<string>*> dependsOn);
+	Plugin* preLoadPlugin(string& file, Server* server, 
                 XmlParser* languageFile, bool global);
                 
-    int loadInfo(string& name, string& path);
+    PluginInfo* loadInfo(Server* server, string& name, string& path);
 };
 
 #endif

Modified: trunk/myserver/src/plugin/plugin_info.cpp
===================================================================
--- trunk/myserver/src/plugin/plugin_info.cpp	2009-02-06 18:57:04 UTC (rev 2998)
+++ trunk/myserver/src/plugin/plugin_info.cpp	2009-02-06 20:17:01 UTC (rev 2999)
@@ -37,6 +37,7 @@
   this->version = 0;
   this->msMinVersion = 0;
   this->msMaxVersion = 0;
+  this->plugin = NULL;
 }
 
 
@@ -47,7 +48,8 @@
 */	
 PluginInfo::~PluginInfo()
 {
-
+  if (this->plugin)
+  	delete this->plugin;
 }
 
 /*!
@@ -136,6 +138,56 @@
 }
 
 /*!
+ * Returns the plugin object.
+*/
+Plugin* PluginInfo::getPlugin()
+{
+  return this->plugin;
+}
+
+/*!
+ * Sets the state of the plugin.
+*/
+void PluginInfo::setEnabled(bool enabled)
+{
+  this->enabled = enabled;	
+}
+
+/*!
+ * Returns the depandence, if any exists, with a plugin with the specified name.
+*/
+pair<int,int>* PluginInfo::getDependence(string name)
+{   
+	if(dependences.empty())
+	  return NULL;
+	if (!this->dependences.containsKey(name))
+	  return NULL;
+  	pair<int,int>* p =  this->dependences.get(name);
+  	if (p)
+  	  return p;
+  	return NULL;
+}
+/*!
+ * Sets the plugin object.
+*/
+void PluginInfo::setPlugin(Plugin* plugin)
+{
+  //if(this->plugin)
+  //	delete this->plugin;
+  this->plugin = plugin;
+}
+
+/*!
+ * Removes the plugin object.
+*/
+Plugin* PluginInfo::removePlugin()
+{
+  if(this->plugin)
+  	delete this->plugin;
+  this->plugin = NULL;
+}
+
+/*!
  * Converts a string in the format "a.b.c.d" in an int in the format abcd where each number takes 8 bit.
 */
 int PluginInfo::convertVersion(string* s)

Modified: trunk/myserver/src/plugin/plugins_manager.cpp
===================================================================
--- trunk/myserver/src/plugin/plugins_manager.cpp	2009-02-06 18:57:04 UTC (rev 2998)
+++ trunk/myserver/src/plugin/plugins_manager.cpp	2009-02-06 20:17:01 UTC (rev 2999)
@@ -46,7 +46,10 @@
  */
 Plugin* PluginsManager::getPlugin(string& name)
 {
-  return plugins.get(name);
+  PluginInfo* info = pluginsInfos.get(name);
+  if (info)
+  	return info->getPlugin();
+  return NULL;
 }
   
 /*!
@@ -100,7 +103,7 @@
             if(!pluginName.length())
             {
               string error;
-              error.assign("Warning: invalid plugin name in PLUGIN block");
+              error.assign("PLUGINS MANAGER: Warning: invalid plugin name in PLUGIN block");
               server->logWriteln(error.c_str(), MYSERVER_LOG_MSG_ERROR);
               ret = -1;  
             }
@@ -170,15 +173,8 @@
       if(flib.name[0]=='.')
       	continue;
 
-          /*!
-     *Do not consider file other than dynamic libraries.
-     */
-#ifdef WIN32
-      if(!strstr(flib.name,".dll") && !strstr(flib.name,"plugin.xml"))
-#endif
-#ifdef NOT_WIN
-      if(!strstr(flib.name,".so") && !strstr(flib.name,"plugin.xml"))
-#endif    
+          
+      if(!strstr(flib.name,"plugin.xml"))
         continue;
       completeFileName.assign(filename);
       
@@ -190,23 +186,38 @@
         completeFileName.append("/");
       completeFileName.append(flib.name);
 
-	  if(strstr(flib.name,"plugin.xml"))
-	  {
-	  	string pname(fdir.name);
-        ret |= loadInfo(pname, completeFileName);
+	  string pname(fdir.name);
+      PluginInfo* pinfo = loadInfo(server,pname, completeFileName);
+      if(!pinfo)
+      {
+        ret|=1;
         continue;
-	  }
+      }
+      string libname;
+      libname.assign(dirname);
+         
+      libname.append("/");
+      libname.append(pinfo->getName());
 #ifdef WIN32
-      name = name.substr(0, name.length() - 4);
+      libname.append(".dll");
 #endif
 #ifdef NOT_WIN
-      name = name.substr(0, name.length() - 3);
+      libname.append(".so");
 #endif
-      PluginInfo* pinfo = getPluginInfo(name);
-    	
-       if(!pinfo || pinfo->isEnabled())
-         ret |= addPlugin(completeFileName, server, languageFile, pinfo && pinfo->isGlobal());
-	   
+       if(pinfo->isEnabled())
+       {
+         Plugin* plugin = preLoadPlugin(libname, server, languageFile, pinfo->isGlobal());
+         if (!plugin)
+         {
+           ret|=1;
+           string logBuf;
+  	       logBuf.append("PLUGINS MANAGER: Error!! Unable to enable plugin ");
+  	       logBuf.append(name);
+  	       server->logWriteln( logBuf.c_str() );
+         }else
+           pinfo->setPlugin(plugin);
+       }
+       addPluginInfo(pname,pinfo);
      }while(!flib.findnext());
    }while(!fdir.findnext());
   fdir.findclose();
@@ -227,18 +238,27 @@
  *\param name The plugin name.
  *\param path the plugin xml descriptor path.
  */
-int PluginsManager::loadInfo(string& name, string& path)
+PluginInfo* PluginsManager::loadInfo(Server* server, string& name, string& path)
 {
   PluginInfo* pinfo;
   
   pinfo = getPluginInfo(name);
   if (!pinfo)
     pinfo = new PluginInfo(name);
-    
+  else
+  	if (pinfo->getVersion()!=0)
+  	{
+  	  string logBuf;
+  	  logBuf.append("PLUGINS MANAGER: Error!!! a version of plugin ");
+  	  logBuf.append(name);
+  	  logBuf.append(" is already loading!");
+  	  server->logWriteln( logBuf.c_str() );
+  	  return NULL;
+  	}  
   XmlParser xml;
   
   if (xml.open(path,true))
-    return 1;
+    return NULL;
   
   XmlXPathResult* xpathRes = xml.evaluateXpath("/PLUGIN");
   
@@ -247,7 +267,7 @@
   int size = (nodes) ? nodes->nodeNr : 0;
   
   if (size!=1)
-    return 1;
+    return NULL;
   
   const char* mSMinVersion = (const char*)xmlGetProp(nodes->nodeTab[0],(const xmlChar*)"min-version");
   
@@ -264,12 +284,12 @@
   
   
   if (size!=1)
-    return 1;
+    return NULL;
   const char* cname = (const char*)nodes->nodeTab[0]->content;
 
   
   if (strcmp(name.c_str(),cname))
-    return 1;
+    return NULL;
   
   delete xpathRes;
   
@@ -280,7 +300,7 @@
   
   
   if (size!=1)
-    return 1;
+    return NULL;
   const char* version = (const char*)nodes->nodeTab[0]->content;
   
   
@@ -309,11 +329,8 @@
   }
 
   delete xpathRes;
-  
-  addPluginInfo(name,pinfo);
-  
-  
-  return 0;
+
+  return pinfo;
 }
 
 /*!
@@ -324,7 +341,7 @@
  *messages.
  *\param global Specify if the library should be loaded globally.
  */
-int PluginsManager::addPlugin(string& file, Server* server, 
+Plugin* PluginsManager::preLoadPlugin(string& file, Server* server, 
                                        XmlParser* languageFile, bool global)
 {
   Plugin *plugin = createPluginObject();
@@ -335,7 +352,7 @@
   if(plugin->preLoad(file, server, languageFile, global))
   {
     delete plugin;
-    return 1;
+    return NULL;
   }
   namePtr = plugin->getName(0, 0);
 
@@ -344,14 +361,33 @@
   else
   {
     delete plugin;
-    return 1;
+    return NULL;
   }
-    
-  plugins.put(name, plugin);
+ 
+  return plugin;
+}
 
+void PluginsManager::recursiveDependencesFallDown(Server* server, string name, HashMap<string,bool> remove,  HashMap<string,list<string>*> dependsOn)
+{
+  remove.put(name,true);
+  list<string>* dependsList = dependsOn.get(name);
+  if (!dependsList || dependsList->empty())
+    return;
   
-  
-  return 0;
+  list<string>::iterator lit = dependsList->begin();
+
+  for (;lit!=dependsList->end();lit++)
+  {
+  	
+  	string logBuf;
+  	logBuf.append("PLUGINS MANAGER: missing dependence: ");
+  	logBuf.append(*lit);
+  	logBuf.append(" --> ");
+  	logBuf.append(name);
+  	recursiveDependencesFallDown(server,*lit,remove,dependsOn);
+  	server->logWriteln( logBuf.c_str() );
+  }
+  	
 }
 
 /*!
@@ -367,15 +403,17 @@
 	
   
   list<string*> toRemove;
-  HashMap<string, Plugin*>::Iterator it = plugins.begin();
-  while(it != plugins.end())
+  HashMap<string,list<string>*> dependsOn;
+  HashMap<string, PluginInfo*>::Iterator it = pluginsInfos.begin();
+  HashMap<string,bool> remove;
+  while(it != pluginsInfos.end())
   {
-  	string logBuf;
   	
+  	
   	string name(it.getKey());
   	
   	
-  	PluginInfo* pinfo = getPluginInfo(name);
+  	PluginInfo* pinfo = *it;
     
     
   	HashMap<string, pair<int,int>* >::Iterator depIt = pinfo->begin();
@@ -389,55 +427,103 @@
   	int msVersion = PluginInfo::convertVersion(&msversion);
   	if (msVersion < pinfo->getMyServerMinVersion() || msVersion > pinfo->getMyServerMaxVersion())
   	{
-  	  logBuf.append("myserver version not compatible --> ");
-  	  goodVersions = false;
+	  string logBuf;
+  	  logBuf.append("PLUGINS MANAGER: ");
+  	  logBuf.append(name);
+  	  logBuf.append(" not compatible with this myserver version! ");
+  	  server->logWriteln( logBuf.c_str() );
+  	  toRemove.push_front(&name);
   	}
   	else
+  	  remove.put(name,false);
   	  for (;depIt != pinfo->end(); depIt++)
   	  {
   	  	string dname = depIt.getKey();
   	  	
-  	  	PluginInfo* dep = getPluginInfo(dname);
+  	  	list<string>* deps = dependsOn.get(dname);
+  	  	if (!deps)
+  	  	{
+  	  	  deps = new list<string>();
+  	  	  dependsOn.put(dname,deps);
+  	  	}
   	  	
-  	  	if (!dep)
+  	  	deps->push_front(name);
+  	  }
+  	  
+  	
+    it++;
+  }
+
+  list<string*>::iterator tRIt = toRemove.begin();
+  for (;tRIt != toRemove.end(); tRIt++)
+    removePlugin(**tRIt);
+  toRemove.clear();
+  
+  
+  
+  HashMap<string,list<string>*>::Iterator dIt = dependsOn.begin();
+  for(;dIt!=dependsOn.end();dIt++)
+  {
+  	string logBuf;
+  	string dname = dIt.getKey();
+  	
+  	PluginInfo* pinfo = getPluginInfo(dname);
+  	
+  	if (!pinfo || pinfo->getVersion()==0)
+  	  	remove.put(dname,true);
+  	  	
+  	list<string>* dependsList = (*dIt);
+  	if (!dependsList)
+  	  continue;
+  	if(dependsList->empty())
+  	  continue;
+  	
+  	bool rem = remove.get(dname);
+  	if (rem)
+  	{
+  	  recursiveDependencesFallDown(server,dname,remove,dependsOn);
+  	  continue;
+  	}
+  	
+  	HashMap<string, pair<int,int>* >::Iterator lit = pinfo->begin();
+  	for (;lit!=pinfo->end();lit++)
+  	{
+  		string depN = lit.getKey();
+  		PluginInfo* dep = getPluginInfo(depN);
+  		if (!dep || remove.get(depN))
   	  	{
-  	  	  logBuf.append("missing dependence: ");
+  	  	  logBuf.append("PLUGINS MANAGER: missing dependence: ");
   	  	  logBuf.append(dname);
   	  	  logBuf.append(" --> ");
-  	  	  logBuf.append(name);
-  	  	  goodVersions = false;
+  	  	  logBuf.append(depN);
+  	  	  recursiveDependencesFallDown(server,dname,remove,dependsOn);
+  	  	  server->logWriteln( logBuf.c_str() );
   	  	  break;
   	  	}
-  	  	  
-  	  	if (dep->getVersion() < (*depIt)->first || dep->getVersion() > (*depIt)->second)
+  	  	
+
+  	  	pair<int,int>* pdep = *lit;
+  	  	if (dep->getVersion() < pdep->first || dep->getVersion() > pdep->second)
   	  	{
-  	  	  logBuf.append("plugin version not compatible: ");
+  	  	  logBuf.append("PLUGINS MANAGER: plugin version not compatible: ");
   	  	  logBuf.append(dname);
   	  	  logBuf.append(" --> ");
-  	  	  logBuf.append(name);
-  	  	  goodVersions = false;
+  	  	  logBuf.append(depN);
+  	  	  recursiveDependencesFallDown(server,dname,remove,dependsOn);
+  	  	  server->logWriteln( logBuf.c_str() );
   	  	  break;
   	  	}
-  	  }
-  	
-  	
-  	if (goodVersions)
-  	{
-  	  logBuf.assign(languageFile->getValue("MSG_LOADED"));
-  	  logBuf.append(" -plugin- ");
-      logBuf.append(name);
-      (*it)->load(resource, server, languageFile);
-  	} 
-  	else
-  	  toRemove.push_front(&name);
-  	server->logWriteln( logBuf.c_str() );
-    it++;
+  	}
   }
-
-  list<string*>::iterator tRIt = toRemove.begin();
-  for (;tRIt != toRemove.end(); tRIt++)
-    removePlugin(**tRIt);
   
+  
+  HashMap<string,bool>::Iterator rIt = remove.begin();
+  for(;rIt!=remove.end();rIt++)
+  {
+  	string name(rIt.getKey());
+  	if (*rIt)
+  	  removePlugin(name);
+  }
   return 0;
   
 }
@@ -450,10 +536,19 @@
  */
 int PluginsManager::postLoad(Server *server, XmlParser* languageFile)
 {
-  HashMap<string, Plugin*>::Iterator it = plugins.begin();
-  while(it != plugins.end())
+  HashMap<string, PluginInfo*>::Iterator it = pluginsInfos.begin();
+  while(it != pluginsInfos.end())
   {
-    (*it)->postLoad(server, languageFile);
+    Plugin* plugin = (*it)->getPlugin();
+    if (plugin)
+    {
+      plugin->postLoad(server, languageFile);
+      string logBuf;
+      logBuf.append("PLUGINS MANAGER: plugin ");
+  	  logBuf.append((*it)->getName());
+  	  logBuf.append(" loaded! ");
+  	  server->logWriteln( logBuf.c_str() );
+    }
     it++;
   }
   return 0;
@@ -467,23 +562,15 @@
  */
 int PluginsManager::unLoad(Server *server, XmlParser* languageFile)
 {
-  HashMap<string, Plugin*>::Iterator it = plugins.begin();
+
   HashMap<string, PluginInfo*>::Iterator poit = pluginsInfos.begin();
 
-  while(it != plugins.end())
-  {
-    (*it)->unLoad(languageFile);
-    delete *it;
-    it++;
-  }
-
   while(poit != pluginsInfos.end())
   {
     delete *poit;
     poit++;
   }
 
-  plugins.clear();
   pluginsInfos.clear();
   return 0;
 }
@@ -494,7 +581,9 @@
  */
 void PluginsManager::removePlugin(string& name)
 {
-  plugins.remove(name);
+  PluginInfo* info = pluginsInfos.remove(name);
+  
+  delete info;
 }
 
 /*!

Modified: trunk/myserver/src/server/server.cpp
===================================================================
--- trunk/myserver/src/server/server.cpp	2009-02-06 18:57:04 UTC (rev 2998)
+++ trunk/myserver/src/server/server.cpp	2009-02-06 20:17:01 UTC (rev 2999)
@@ -526,11 +526,7 @@
   }
 
 
-  //getPluginsManager()->addNamespace(&executors);
-  //getPluginsManager()->addNamespace(&protocols);
-  //getPluginsManager()->addNamespace(&filters);
-  //getPluginsManager()->addNamespace(&genericPluginsManager);
-
+  
   getPluginsManager()->preLoad(this, &languageParser, *externalPath);
   getPluginsManager()->load(this, &languageParser, *externalPath);
   getPluginsManager()->postLoad(this, &languageParser);





From MAILER-DAEMON Sat Feb 07 05:16:00 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LVkEC-0007i6-05
	for mharc-myserver-commit@gnu.org; Sat, 07 Feb 2009 05:16:00 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LVkEA-0007gN-1u
	for myserver-commit@gnu.org; Sat, 07 Feb 2009 05:15:58 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LVkE8-0007eY-JM
	for myserver-commit@gnu.org; Sat, 07 Feb 2009 05:15:57 -0500
Received: from [199.232.76.173] (port=42911 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LVkE8-0007eK-Bm
	for myserver-commit@gnu.org; Sat, 07 Feb 2009 05:15:56 -0500
Received: from savannah.gnu.org ([199.232.41.3]:52009 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LVkE8-0005Yy-0N
	for myserver-commit@gnu.org; Sat, 07 Feb 2009 05:15:56 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LVkE6-0004NT-L1
	for myserver-commit@gnu.org; Sat, 07 Feb 2009 10:15:55 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1LVkE5-0004NL-Px
	for myserver-commit@gnu.org; Sat, 07 Feb 2009 10:15:54 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1LVkE5-0004NL-Px@cvs.savannah.gnu.org>
Date: Sat, 07 Feb 2009 10:15:53 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3000] Improved MIME types documentation.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 07 Feb 2009 10:15:58 -0000

Revision: 3000
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3000
Author:   gscrivano
Date:     2009-02-07 10:15:52 +0000 (Sat, 07 Feb 2009)

Log Message:
-----------
Improved MIME types documentation.  `SEND' is used to specify static files.

Modified Paths:
--------------
    trunk/myserver/documentation/mime_types.texi
    trunk/myserver/src/protocol/http/http.cpp

Modified: trunk/myserver/documentation/mime_types.texi
===================================================================
--- trunk/myserver/documentation/mime_types.texi	2009-02-06 20:17:01 UTC (rev 2999)
+++ trunk/myserver/documentation/mime_types.texi	2009-02-07 10:15:52 UTC (rev 3000)
@@ -1,22 +1,38 @@
 @c -*-texinfo-*-
-You can modify the MIME types used by MyServer by modifying the file
-@file{MIMEtypes.xml}. The following is an example of this file: 
+MIME types are used to specify the type of information a resource
+transmitted to or from the server contains.
+Some standard MIME types are already defined in the
+@file{MIMEtypes.xml} file.
+Using the same syntax you can define new MIME types or modify existing
+ones.  For each MIME type it is possible to specify how the server
+will handle the files and which actions take before it can be sent to
+the client.
 
+In this example two MIME types are defined:
+
 @example
-<?xml version ="1.0"?>
 <MIME mime="text/html" handler="SEND" param="">
 <EXTENSION value="html"/>
+<FILTER value="gzip"/>
 </MIME>
 
-<MIME mime="text/html" handler="RUNCGI" param="/usr/bin/perl" selfExecuted="NO">
-<FILTER value="gzip"/>
+<MIME mime="text/html" handler="CGI" param="/usr/bin/perl" selfExecuted="NO">
 <EXTENSION value="pl"/>
 <DEFINE name="http.error.file.404" value="404.html"/>
 </MIME>
 @end example
 
+The former defines to send any file with a @code{.html} extension as
+it is, in case it is supported by the client then the file content is
+compressed using the gzip.
+The latter specifies that every file with a @code{pl} extension are
+handled by the @file{/usr/bin/perl} CGI and the new process standard
+output is redirected to the client.  In addition, it defines which
+resource use when a 404 HTTP file not found error happens.
+
+Every MIME type is made of:
+
 @itemize
-Each block describes a different MIME type.
 
 @item mime
 the MIME attribute specifies the MIME name.
@@ -54,34 +70,43 @@
 they will be applied in the specified order.
 
 @code{<DEFINE>} It defines a new value for a variable, take a look
-here @xref{Security files} for more details on the @code{<DEFINE>}
+here @ref{Security files} for more details on the @code{<DEFINE>}
 element.
 
 The same MIME type can have several extensions, you will need to
 specify a different @code{<EXTENSION>} element for each extension.
 
 These are valid HTTP handlers:
+
 @enumerate
 @item SEND
-Send the file statically as is.  This command is used for files
+Send the file statically as it is.  This command is used for files
 extensions such as .html and .jpg that don't need any external
 intervention from the web server.
 @item CGI
-Run the CGI script indicated in the path.  It is used for file
+Run the CGI script indicated in the handler.  It is used for file
 extensions such as .php and .pl that need to be processed before
-sending any data to the client.
+sending any data to the client.  Every request requires the execution
+of a new process.
 @item FASTCGI
-Run the Fastcgi script.  This type will need a fastcgi parser
-downloaded (see the PHP page).  It is also used for file extensions
-such as .php and .pl.
+Run the script using the FastCGI server specified in the handler.
+Differently than CGI, a new process is not spawned on every request
+but it is done opening a connection to the specified FastCGI server.
 @item SCGI
-Handle a specified mime type with this SCGI server.
+Like FastCGI, it is designed as a replacement for the CGI protocol.
 @item MSCGI
 Run the MSCGI script. This library is only available for MyServer. It
 is used to build fast and efficient CGIs that needs to access MyServer
-internal data.
+internal data.  It is not portable, don't use unless you are going to
+write something that can be used only for MyServer.
 @item ISAPI
-Run the ISAPI script.  
+Run the ISAPI module.  It is available only under the Microsoft
+Windows operating system thus it is not portable or can be used on a
+Free operating system.
+@item WINCGI
+This protocol is obsoleted by ISAPI.  As CGI it needs a new process
+for every request and it uses files to communicate with the web
+server.  It is very inefficient.
 @end enumerate
 
 It is possible to match the file name against a regular expression

Modified: trunk/myserver/src/protocol/http/http.cpp
===================================================================
--- trunk/myserver/src/protocol/http/http.cpp	2009-02-06 20:17:01 UTC (rev 2999)
+++ trunk/myserver/src/protocol/http/http.cpp	2009-02-07 10:15:52 UTC (rev 3000)
@@ -858,7 +858,7 @@
     if (!(td->permissions & MYSERVER_PERMISSION_READ))
       return sendAuth ();
 
-    manager = staticHttp.dynManagerList.getHttpManager ("FILE");
+    manager = staticHttp.dynManagerList.getHttpManager ("SEND");
 
     if (!manager)
       return raiseHTTPError (500);
@@ -2036,7 +2036,7 @@
   HttpFile::load (configurationFileManager);
   HttpDir::load (configurationFileManager);
 
-  staticHttp.dynManagerList.addHttpManager ("FILE", staticHttp.httpFile);
+  staticHttp.dynManagerList.addHttpManager ("SEND", staticHttp.httpFile);
   staticHttp.dynManagerList.addHttpManager ("DIR", staticHttp.httpDir);
   staticHttp.dynManagerList.addHttpManager ("CGI", staticHttp.cgi);
   staticHttp.dynManagerList.addHttpManager ("MSCGI", staticHttp.mscgi);





From MAILER-DAEMON Fri Feb 13 18:01:39 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LY72R-0002RW-KP
	for mharc-myserver-commit@gnu.org; Fri, 13 Feb 2009 18:01:39 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LY72P-0002NA-1t
	for myserver-commit@gnu.org; Fri, 13 Feb 2009 18:01:37 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LY72N-0002Kd-1O
	for myserver-commit@gnu.org; Fri, 13 Feb 2009 18:01:35 -0500
Received: from [199.232.76.173] (port=39554 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LY72M-0002KG-LC
	for myserver-commit@gnu.org; Fri, 13 Feb 2009 18:01:34 -0500
Received: from savannah.gnu.org ([199.232.41.3]:52836 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LY72M-0001Oi-6y
	for myserver-commit@gnu.org; Fri, 13 Feb 2009 18:01:34 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LY72L-0004Bv-P9
	for myserver-commit@gnu.org; Fri, 13 Feb 2009 23:01:33 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1LY72L-0004Bq-It
	for myserver-commit@gnu.org; Fri, 13 Feb 2009 23:01:33 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1LY72L-0004Bq-It@cvs.savannah.gnu.org>
Date: Fri, 13 Feb 2009 23:01:33 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3001] Added external dependencies list to the
	INSTALL file.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 13 Feb 2009 23:01:38 -0000

Revision: 3001
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3001
Author:   gscrivano
Date:     2009-02-13 23:01:33 +0000 (Fri, 13 Feb 2009)

Log Message:
-----------
Added external dependencies list to the INSTALL file.

Modified Paths:
--------------
    trunk/myserver/INSTALL

Modified: trunk/myserver/INSTALL
===================================================================
--- trunk/myserver/INSTALL	2009-02-07 10:15:52 UTC (rev 3000)
+++ trunk/myserver/INSTALL	2009-02-13 23:01:33 UTC (rev 3001)
@@ -1,24 +1,50 @@
                      GNU MyServer
 
-I. Compiling from Source
+Copyright (C) 2002-2009 Free Software Foundation, Inc.
 
-MyServer can be compiled from source with:
+This file contains generic information describing how build and
+install MyServer, please refer to your operating system manual for
+more detailed information about how source packages should be
+installed.
 
-./configure
+BULD MYSERVER FROM SOURCE CODE
 
-You can pass special environment and specific options 
-to configure.  To view them type "./configure --help" 
-instead.
+MyServer can be compiled from its source code using the `configure'
+shell script which attempts to guess the correct configuration for
+various system dependent variables.
 
-To compile the sources type:
+After the configure script has checked if MyServer can be compiled on
+your system and have setted some variables, you can build it using the
+`make' utility.
 
-make
+To compile MyServer from source code then you will need:
 
-Finally to install the sources type:
+   1. `cd' to the directory where the source code is contained.
+   2. ./configure
+   3. make
 
-make install (as root user)
+It is possible to install the obtained binaries invoking:
 
-II. Binary Version
+make install
 
-Binary versions can be always downloaded from:
-http://savannah.gnu.org/projects/myserver/
\ No newline at end of file
+
+EXTERNAL DEPENDENCIES
+
+In order to build MyServer you will need the following external
+libraries:
+
+- libxml2
+- GNU libidn
+- GNU tls
+- libevent
+- libz
+
+Be sure to have all of them before build MyServer.
+
+
+BINARIES
+
+It may be possible to find precompiled binaries for your platform
+here:
+
+http://savannah.gnu.org/projects/myserver/





From MAILER-DAEMON Sun Feb 15 07:49:54 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LYgRW-0001Tn-JX
	for mharc-myserver-commit@gnu.org; Sun, 15 Feb 2009 07:49:54 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LYgRV-0001Rk-0Z
	for myserver-commit@gnu.org; Sun, 15 Feb 2009 07:49:53 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LYgRU-0001RF-Ca
	for myserver-commit@gnu.org; Sun, 15 Feb 2009 07:49:52 -0500
Received: from [199.232.76.173] (port=40487 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LYgRU-0001Qy-6v
	for myserver-commit@gnu.org; Sun, 15 Feb 2009 07:49:52 -0500
Received: from savannah.gnu.org ([199.232.41.3]:33462 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LYgRT-0005ki-OJ
	for myserver-commit@gnu.org; Sun, 15 Feb 2009 07:49:51 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LYgRT-0001W5-0C
	for myserver-commit@gnu.org; Sun, 15 Feb 2009 12:49:51 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1LYgRS-0001W1-Ld
	for myserver-commit@gnu.org; Sun, 15 Feb 2009 12:49:50 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1LYgRS-0001W1-Ld@cvs.savannah.gnu.org>
Date: Sun, 15 Feb 2009 12:49:50 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3002] Refactoring for the socket assignment
	operator.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Feb 2009 12:49:53 -0000

Revision: 3002
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3002
Author:   gscrivano
Date:     2009-02-15 12:49:50 +0000 (Sun, 15 Feb 2009)

Log Message:
-----------
Refactoring for the socket assignment operator.

Modified Paths:
--------------
    trunk/myserver/include/base/socket/socket.h
    trunk/myserver/src/base/socket/socket.cpp

Modified: trunk/myserver/include/base/socket/socket.h
===================================================================
--- trunk/myserver/include/base/socket/socket.h	2009-02-13 23:01:33 UTC (rev 3001)
+++ trunk/myserver/include/base/socket/socket.h	2009-02-15 12:49:50 UTC (rev 3002)
@@ -1,7 +1,7 @@
 /* -*- mode: c++ -*- */
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+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
@@ -52,9 +52,9 @@
 #endif
 
 #ifdef INET6_ADDRSTRLEN
-#define MAX_IP_STRING_LEN	INET6_ADDRSTRLEN
+#define MAX_IP_STRING_LEN  INET6_ADDRSTRLEN
 #else
-#define MAX_IP_STRING_LEN	32
+#define MAX_IP_STRING_LEN  32
 #endif
 
 typedef struct sockaddr_storage MYSERVER_SOCKADDR_STORAGE;
@@ -67,39 +67,39 @@
 public:
   static int startupSocketLib ();
 
-	void setServerSocket(Socket*);
-	Socket* getServerSocket();
+  void setServerSocket(Socket*);
+  Socket* getServerSocket();
 
-	static void stopBlockingOperations(bool);
-	virtual FileHandle getHandle();
-	void setHandle(FileHandle);
-	static MYSERVER_HOSTENT *gethostbyaddr(char* addr, int len, int type);
-	static MYSERVER_HOSTENT *gethostbyname(const char*);
-	static int gethostname(char*, int);
-	int socket(int, int, int);
-	int bind(MYSERVER_SOCKADDR*, int);
-	int listen(int);
-	Socket();
-	Socket(Socket*);
-	Socket(FileHandle);
-	Socket accept(MYSERVER_SOCKADDR*, int*);
-	int setsockopt(int,int, const char*,int);
+  static void stopBlockingOperations(bool);
+  virtual FileHandle getHandle();
+  void setHandle(FileHandle);
+  static MYSERVER_HOSTENT *gethostbyaddr(char* addr, int len, int type);
+  static MYSERVER_HOSTENT *gethostbyname(const char*);
+  static int gethostname(char*, int);
+  int socket(int, int, int);
+  int bind(MYSERVER_SOCKADDR*, int);
+  int listen(int);
+  Socket();
+  Socket(Socket*);
+  Socket(FileHandle);
+  Socket accept(MYSERVER_SOCKADDR*, int*);
+  int setsockopt(int,int, const char*,int);
 
-	virtual int connect(MYSERVER_SOCKADDR*, int);
-	virtual int close();
-	virtual int shutdown(int how);
-	virtual int recv(char*, int, int, u_long);
-	virtual int recv(char*, int, int);
-	virtual u_long bytesToRead();
+  virtual int connect(MYSERVER_SOCKADDR*, int);
+  virtual int close();
+  virtual int shutdown(int how);
+  virtual int recv(char*, int, int, u_long);
+  virtual int recv(char*, int, int);
+  virtual u_long bytesToRead();
 
-	int ioctlsocket(long, unsigned long*);
-	int send(const char*, int, int);
-	int connect(const char* host, u_short port);
-	int operator==(Socket);
-	int operator=(Socket);
-	int getsockname(MYSERVER_SOCKADDR*,int*);
+  int ioctlsocket(long, unsigned long*);
+  int send(const char*, int, int);
+  int connect(const char* host, u_short port);
+  int operator==(Socket);
+  int operator=(Socket);
+  int getsockname(MYSERVER_SOCKADDR*,int*);
   int setNonBlocking(int);
-	virtual int dataOnRead(int sec = 0, int usec = 500);
+  virtual int dataOnRead(int sec = 0, int usec = 500);
 
   u_long getThrottling();
   void setThrottling(u_long);
@@ -110,19 +110,19 @@
 
 protected:
 #ifdef WIN32
-	SOCKET socketHandle;
+  SOCKET socketHandle;
 #else
-	FileHandle socketHandle;
+  FileHandle socketHandle;
 #endif
 
-	/*! Pointer to the socket that has accepted this connection.  */
-	Socket *serverSocket;
+  /*! Pointer to the socket that has accepted this connection.  */
+  Socket *serverSocket;
 
   /*! Send throttling rate.  */
   u_long throttlingRate;
 
-	/*! Stop the sockets system.  */
-	static bool denyBlockingOperations;
+  /*! Stop the sockets system.  */
+  static bool denyBlockingOperations;
 
   virtual int rawSend(const char* buffer, int len, int flags);
 };

Modified: trunk/myserver/src/base/socket/socket.cpp
===================================================================
--- trunk/myserver/src/base/socket/socket.cpp	2009-02-13 23:01:33 UTC (rev 3001)
+++ trunk/myserver/src/base/socket/socket.cpp	2009-02-15 12:49:50 UTC (rev 3002)
@@ -1,6 +1,6 @@
 /*
 MyServer
-Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008 Free Software Foundation, Inc.
+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
@@ -88,9 +88,10 @@
  */
 int Socket::operator=(Socket s)
 {
-  /*! Do a raw memory copy.  */
-  memcpy(this, &s, sizeof(s));
-  return 1;
+  socketHandle = s.socketHandle;
+  serverSocket = s.serverSocket;
+  throttlingRate = s.throttlingRate;
+  return 0;
 }
 /*!
  *Create the socket.





From MAILER-DAEMON Mon Feb 16 08:32:27 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LZ3aF-00087A-P4
	for mharc-myserver-commit@gnu.org; Mon, 16 Feb 2009 08:32:27 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LZ3aE-00086z-9A
	for myserver-commit@gnu.org; Mon, 16 Feb 2009 08:32:26 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LZ3aC-00086E-NP
	for myserver-commit@gnu.org; Mon, 16 Feb 2009 08:32:25 -0500
Received: from [199.232.76.173] (port=50896 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LZ3aC-000865-Fb
	for myserver-commit@gnu.org; Mon, 16 Feb 2009 08:32:24 -0500
Received: from savannah.gnu.org ([199.232.41.3]:33787 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LZ3aB-0002GP-5g
	for myserver-commit@gnu.org; Mon, 16 Feb 2009 08:32:24 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LZ3a8-0003Go-05
	for myserver-commit@gnu.org; Mon, 16 Feb 2009 13:32:20 +0000
Received: from dperrone by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <dperrone@savannah.gnu.org>) id 1LZ3a7-0003Gk-Ps
	for myserver-commit@gnu.org; Mon, 16 Feb 2009 13:32:19 +0000
MIME-Version: 1.0
Errors-To: dperrone
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Daniele Perrone <dperrone@it.gnu.org>
Message-Id: <E1LZ3a7-0003Gk-Ps@cvs.savannah.gnu.org>
Date: Mon, 16 Feb 2009 13:32:19 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3003] plugins build script refactoring:
 razionalization and architecture name added in plugin tar.gz file
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Feb 2009 13:32:26 -0000

Revision: 3003
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3003
Author:   dperrone
Date:     2009-02-16 13:32:19 +0000 (Mon, 16 Feb 2009)

Log Message:
-----------
plugins build script refactoring: razionalization and architecture name added in plugin tar.gz file

Modified Paths:
--------------
    trunk/plugins/SConstruct

Modified: trunk/plugins/SConstruct
===================================================================
--- trunk/plugins/SConstruct	2009-02-15 12:49:50 UTC (rev 3002)
+++ trunk/plugins/SConstruct	2009-02-16 13:32:19 UTC (rev 3003)
@@ -27,7 +27,7 @@
 import string
 
 def print_help():
-    print "usage: scons [package|release] plugin=<plugin1>,<plugin2>,...,<pluginN>"
+    print "usage: scons [command=build|package] plugin=<plugin1>,<plugin2>,...,<pluginN>"
 
 src_dir = "src/"
 bin_dir = "bin/"
@@ -37,6 +37,19 @@
 command = ARGUMENTS.get('command', "build")
 
 
+arch = ""
+import os
+if os.name=="nt":
+    arch = "win32"
+else:
+    import string
+    arch = string.lower(os.uname()[0])
+    if string.find(os.uname()[4],"64")==-1:
+        arch = arch + "32"
+    else:
+        arch = arch + "64"
+
+
 if plugin=="":
     print_help()
     Exit(1)
@@ -56,6 +69,7 @@
       ]
     
 
+
 def tar_package(src_dir, name, filename):
     import tarfile
     tarf = tarfile.open(filename.encode("ascii"),"w|gz")
@@ -68,38 +82,22 @@
     Command(dest_dir + "/plugin.xml",src_dir + name + "/plugin.xml", Copy("$TARGET", "$SOURCE"))
     
 def build_plugins(plugins):
-	for name in plugins:
+    for name in plugins:
 		build_plugin(name)
-		
 
 def pack_plugin(name):
     doc = xml.dom.minidom.parse(bin_dir + name + "/plugin.xml")
     version = doc.getElementsByTagName("VERSION")
-    filename = name + "-" + version[0].firstChild.data + ".tar.gz"
+    filename = name + "-" + version[0].firstChild.data + "-" + arch + ".tar.gz"
     tar_package(bin_dir, name, release_dir + filename)	
+    
 
 
-
 def pack_plugins(plugins):
-	for name in plugins:
+    for name in plugins:
 		pack_plugin(name)
 
 
-build = True
-package = False
-release = False
-
-  
-
-if command=='package':
-	build = False
-	package = True
-	
-if command=='release':
-	package = True
-	release = True
-
-
 env = Environment(CPPPATH=listinc,CXXFLAGS="-fPIC -DPIC  -DHAVE_CONFIG_H",
                       LINKFLAGS="-rdynamic")
 
@@ -113,12 +111,17 @@
 
 env = conf.Finish()
 
-if build:
+if command=='build':
 	build_plugins(plugins)
 
-if package:
-	pack_plugins(plugins)
 
+
+if command=='package':
+    pack_plugins(plugins)
+
+    
+
+
 #TODO: test compile and run.
 #if command == "build":
 #    testsFiles = glob.glob('tests/*.cpp') + files





From MAILER-DAEMON Wed Feb 18 06:07:01 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LZkGb-0005tc-Eh
	for mharc-myserver-commit@gnu.org; Wed, 18 Feb 2009 06:07:01 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LZkGZ-0005tG-Jr
	for myserver-commit@gnu.org; Wed, 18 Feb 2009 06:06:59 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LZkGY-0005t4-P4
	for myserver-commit@gnu.org; Wed, 18 Feb 2009 06:06:59 -0500
Received: from [199.232.76.173] (port=55026 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LZkGY-0005t1-GH
	for myserver-commit@gnu.org; Wed, 18 Feb 2009 06:06:58 -0500
Received: from savannah.gnu.org ([199.232.41.3]:48939 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LZkGX-0007AL-RM
	for myserver-commit@gnu.org; Wed, 18 Feb 2009 06:06:58 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LZkGX-0008CL-Cl
	for myserver-commit@gnu.org; Wed, 18 Feb 2009 11:06:57 +0000
Received: from francesco_pipita by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <francesco_pipita@savannah.gnu.org>)
	id 1LZkGX-0008CG-2v
	for myserver-commit@gnu.org; Wed, 18 Feb 2009 11:06:57 +0000
MIME-Version: 1.0
Errors-To: francesco_pipita
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Francesco Pipita <francesco.pipita@gmail.com>
Message-Id: <E1LZkGX-0008CG-2v@cvs.savannah.gnu.org>
Date: Wed, 18 Feb 2009 11:06:57 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3004] Set up console colors through the
	`myserver.xml' configuration file.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 18 Feb 2009 11:07:00 -0000

Revision: 3004
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3004
Author:   francesco_pipita
Date:     2009-02-18 11:06:56 +0000 (Wed, 18 Feb 2009)

Log Message:
-----------
Set up console colors through the `myserver.xml' configuration file.

Modified Paths:
--------------
    trunk/myserver/binaries/myserver.xml.default
    trunk/myserver/binaries/myserver.xml.unix.default
    trunk/myserver/documentation/log_management.texi
    trunk/myserver/include/filter/console.h
    trunk/myserver/include/log/log_manager.h
    trunk/myserver/include/log/stream/console_stream.h
    trunk/myserver/include/server/server.h
    trunk/myserver/src/filter/console.cpp
    trunk/myserver/src/log/log_manager.cpp
    trunk/myserver/src/log/stream/console_stream.cpp
    trunk/myserver/src/server/server.cpp

Modified: trunk/myserver/binaries/myserver.xml.default
===================================================================
--- trunk/myserver/binaries/myserver.xml.default	2009-02-16 13:32:19 UTC (rev 3003)
+++ trunk/myserver/binaries/myserver.xml.default	2009-02-18 11:06:56 UTC (rev 3004)
@@ -50,6 +50,10 @@
 	<!--DEFINE THE MAX NUMBER OF CONNECTIONS TO ACCEPT.-->
 	<MAX_CONNECTIONS_TO_ACCEPT>0</MAX_CONNECTIONS_TO_ACCEPT>
 
+        <!-- TEXT AND BACKGROUND ATTRIBUTES FOR CONSOLE LOG MESSAGES. -->
+        <CONSOLE_COLORS info_fg="white" info_bg="black" warning_fg="yellow" 
+                        warning_bg="black" error_fg="red" error_bg="black"/>
+        
 	<!--MAX SIZE OF THE LOG FILE IN BYTES	-->
 	<MAX_LOG_FILE_SIZE>1048576</MAX_LOG_FILE_SIZE>
 

Modified: trunk/myserver/binaries/myserver.xml.unix.default
===================================================================
--- trunk/myserver/binaries/myserver.xml.unix.default	2009-02-16 13:32:19 UTC (rev 3003)
+++ trunk/myserver/binaries/myserver.xml.unix.default	2009-02-18 11:06:56 UTC (rev 3004)
@@ -50,6 +50,10 @@
 	<!--DEFINE THE MAX NUMBER OF CONNECTIONS TO ACCEPT.-->
 	<MAX_CONNECTIONS_TO_ACCEPT>0</MAX_CONNECTIONS_TO_ACCEPT>
 
+        <!-- TEXT AND BACKGROUND ATTRIBUTES FOR CONSOLE LOG MESSAGES. -->
+        <CONSOLE_COLORS info_fg="white" info_bg="black" warning_fg="yellow" 
+                        warning_bg="black" error_fg="red" error_bg="black"/>
+
 	<!--MAX SIZE OF THE LOG FILE IN BYTES	-->
 	<MAX_LOG_FILE_SIZE>1048576</MAX_LOG_FILE_SIZE>
 

Modified: trunk/myserver/documentation/log_management.texi
===================================================================
--- trunk/myserver/documentation/log_management.texi	2009-02-16 13:32:19 UTC (rev 3003)
+++ trunk/myserver/documentation/log_management.texi	2009-02-18 11:06:56 UTC (rev 3004)
@@ -13,17 +13,17 @@
 features.
 
 @subsection Location strings
-A location string must be provided in the form
-@code{protocol://resource}, where @code{protocol} can ben choosen
-between :
+A location string can be provided as an URI; the basic schema is in
+the form @code{protocol://resource}. @code{protocol} can be chosen
+between
 @enumerate
 @item @code{console}
 @item @code{file}
 @item @code{socket}
 @end enumerate
-while @code{resource} must be a valid filename or URL according to its
-@code{protocol}. The @code{console} protocol, can take as its
-@code{resource} argument, either @code{stdout} or @code{stderr}. 
+and @code{resource} can be either a valid filename or an hostname according
+to its @code{protocol}. The @code{console} protocol, can take as its
+@code{resource} argument, either @code{stdout} or @code{stderr}.
 
 @subsubsection Location string examples
 @enumerate
@@ -62,7 +62,7 @@
 the accesses log configuration, contains some @code{STREAM} nodes, and
 each @code{STREAM} contains two attributes, the mandatory
 @code{location} and the optional @code{cycle}. A @code{STREAM} node, can
-also contain optional @code{FILTER} subnodes, one for each filter that
+also contain optional @code{FILTER} sub-nodes, one for each filter that
 we want to add to the @code{STREAM}.
 @example
 <ACCESSLOG type="combined">
@@ -90,5 +90,28 @@
   <STREAM location="file://MyServerHTTP.err"/>
 </WARNINGLOG>
 @end example
-If a wrong filter is specified, its relative @code{STREAM} willn't 
+If a wrong filter is specified, its relative @code{STREAM} will not
 be added.
+
+@subsection Console colors
+It is possible to set color attributes for the text written over the
+console. In this way, messages can look different according to the
+logging level which they belong to.
+For example, you may wish to write error messages with a red text over a
+black background, info messages with a white text over a black
+background and warning messages with a yellow text over a black
+background. You can easily tell MyServer about that information by
+editing the @file{myserver.xml} configuration file and adding the
+following code:
+@example
+<CONSOLE_COLORS info_fg="white" info_bg="black" warning_fg="yellow" 
+                warning_bg="black" error_fg="red" error_bg="black"/>
+@end example
+Allowed values for colors are @code{black}, @code{red}, @code{green},
+@code{yellow}, @code{blue}, @code{magenta}, @code{cyan} and
+@code{white}. The two common suffixes @code{fg} and @code{bg} represent
+respectively the foreground attribute and the background one, while the
+three prefixes, @code{info}, @code{warning} and @code{error} represent
+kinds of logging messages managed by MyServer.
+If the @code{CONSOLE_COLORS} information is missing or it is partially
+provided, MyServer will use default values.

Modified: trunk/myserver/include/filter/console.h
===================================================================
--- trunk/myserver/include/filter/console.h	2009-02-16 13:32:19 UTC (rev 3003)
+++ trunk/myserver/include/filter/console.h	2009-02-18 11:06:56 UTC (rev 3004)
@@ -20,44 +20,12 @@
 #define CONSOLE_H
 
 #include <iostream>
+#include <map>
 
 #include <include/filter/stream.h>
 
 using namespace std;
 
-enum MyServerColor
-  {
-    /* Foreground colors. */
-    MYSERVER_FG_COLOR_BLACK,
-    MYSERVER_FG_COLOR_RED,
-    MYSERVER_FG_COLOR_GREEN,
-    MYSERVER_FG_COLOR_YELLOW,
-    MYSERVER_FG_COLOR_BLUE,
-    MYSERVER_FG_COLOR_MAGENTA,
-    MYSERVER_FG_COLOR_CYAN,
-    MYSERVER_FG_COLOR_WHITE,
-    MYSERVER_FG_COLOR_RESET,
-    MYSERVER_FG_COLOR_NONE,
-    /* Background colors */
-    MYSERVER_BG_COLOR_BLACK,
-    MYSERVER_BG_COLOR_RED,
-    MYSERVER_BG_COLOR_GREEN,
-    MYSERVER_BG_COLOR_YELLOW,
-    MYSERVER_BG_COLOR_BLUE,
-    MYSERVER_BG_COLOR_MAGENTA,
-    MYSERVER_BG_COLOR_CYAN,
-    MYSERVER_BG_COLOR_WHITE,
-    MYSERVER_BG_COLOR_RESET,
-    MYSERVER_BG_COLOR_NONE
-  };
-
-#ifdef WIN32
-extern WORD colors[];
-#endif
-#ifdef NOT_WIN
-extern char const* colors[];
-#endif
-
 class Console : public Stream
 {
 public:
@@ -67,11 +35,18 @@
   virtual int read (char* buffer, u_long len, u_long* nbr);
   virtual int write (const char* buffer, u_long len, u_long* nbw);
   virtual int openConsole (string fd);
-  int setColor (MyServerColor color[]);
+  int setColor (string fg_color, string bg_color);
   int reset ();
 protected:
-  int checkColors (MyServerColor c[]);
   ostream* fd;
+#ifdef WIN32
+  map<string, WORD> fg_colors;
+  map<string, WORD> bg_colors;
+#endif
+#ifdef NOT_WIN
+  map<string, string> fg_colors;
+  map<string, string> bg_colors;
+#endif
 };
 
 #endif

Modified: trunk/myserver/include/log/log_manager.h
===================================================================
--- trunk/myserver/include/log/log_manager.h	2009-02-16 13:32:19 UTC (rev 3003)
+++ trunk/myserver/include/log/log_manager.h	2009-02-18 11:06:56 UTC (rev 3004)
@@ -72,7 +72,9 @@
   int count (void* owner, string type, string location);
   int clear ();
   int getOwnersList (string, list<void*>*);
-protected:
+  list<string> getLoggingLevelsByNames ();
+  map<LoggingLevel, string>& getLoggingLevels () { return loggingLevels; }
+private:
   int notify (void* owner, string type, string location, LogStreamEvent evt, 
               void* msg = 0, void* reply = 0);
   int notify (void* owner, string type, LogStreamEvent evt, void* msg = 0, 
@@ -82,8 +84,9 @@
   int add (void* owner, string type);
   int add (void* owner, string type, string location, LogStream* ls);
   int computeNewLine ();
+  void associateLoggingLevelsWithNames ();
   int logWriteln (string, LoggingLevel);
-private:
+
   LoggingLevel level;
   Mutex* mutex;
   LogStreamFactory* lsf;
@@ -110,6 +113,11 @@
    * Store the newline string for the host operating system.
    */
   string newline;
+  
+  /*!
+   * Associate each LoggingLevel with its string representation.
+   */
+  map<LoggingLevel, string> loggingLevels;
 };
 
 #endif

Modified: trunk/myserver/include/log/stream/console_stream.h
===================================================================
--- trunk/myserver/include/log/stream/console_stream.h	2009-02-16 13:32:19 UTC (rev 3003)
+++ trunk/myserver/include/log/stream/console_stream.h	2009-02-18 11:06:56 UTC (rev 3004)
@@ -20,13 +20,12 @@
 #define CONSOLE_STREAM_H
 
 #include <list>
+#include <map>
 #include <string>
 
 #include <include/log/stream/log_stream.h>
 #include <include/filter/console.h>
 
-extern MyServerColor defaultColors[][2];
-
 class ConsoleStream : public LogStream
 {
 public:

Modified: trunk/myserver/include/server/server.h
===================================================================
--- trunk/myserver/include/server/server.h	2009-02-16 13:32:19 UTC (rev 3003)
+++ trunk/myserver/include/server/server.h	2009-02-18 11:06:56 UTC (rev 3004)
@@ -160,7 +160,10 @@
   AuthMethodFactory *getAuthMethodFactory () {return &authMethodFactory;}
   ValidatorFactory *getValidatorFactory (){return &validatorFactory;}
 
+  map<string, string>& getConsoleColors () { return consoleColors; }
 
+  LogManager* getLogManager () { return logManager; }
+
 private:
   friend class ClientsThread;
 #ifdef WIN32
@@ -262,6 +265,7 @@
   AuthMethodFactory authMethodFactory;
   ValidatorFactory validatorFactory;
   SecurityManager securityManager;
+  map<string, string> consoleColors;
 };
 
 #endif

Modified: trunk/myserver/src/filter/console.cpp
===================================================================
--- trunk/myserver/src/filter/console.cpp	2009-02-16 13:32:19 UTC (rev 3003)
+++ trunk/myserver/src/filter/console.cpp	2009-02-18 11:06:56 UTC (rev 3004)
@@ -17,64 +17,51 @@
 
 #include <include/filter/console.h>
 
+Console::Console () : Stream ()
+{
+  fd = 0;
 #ifdef WIN32
-WORD colors[] =
-  {
-    /* Foreground colors */
-    0, // Black
-    FOREGROUND_RED, // Red
-    FOREGROUND_GREEN, // Green
-    FOREGROUND_RED | FOREGROUND_GREEN, // Yellow
-    FOREGROUND_BLUE, // Blue
-    FOREGROUND_RED | FOREGROUND_BLUE, // Magenta
-    FOREGROUND_BLUE | FOREGROUND_GREEN, // Cyan
-    FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE, // White
-    FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE, // Reset
-    -1, // None
-    /* Background colors */
-    0, // Black
-    BACKGROUND_RED, // Red
-    BACKGROUND_GREEN, // Green
-    BACKGROUND_RED | BACKGROUND_GREEN, // Yellow
-    BACKGROUND_BLUE, // Blue
-    BACKGROUND_RED | BACKGROUND_BLUE, // Magenta
-    BACKGROUND_BLUE | BACKGROUND_GREEN, // Cyan
-    BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE, // White
-    0, // Reset
-    -1 // None
-  };
+  fg_colors["black"] = 0;
+  fg_colors["red"] = FOREGROUND_RED;
+  fg_colors["green"] = FOREGROUND_GREEN;
+  fg_colors["yellow"] = FOREGROUND_RED | FOREGROUND_GREEN;
+  fg_colors["blue"] = FOREGROUND_BLUE;
+  fg_colors["magenta"] = FOREGROUND_RED | FOREGROUND_BLUE;
+  fg_colors["cyan"] = FOREGROUND_BLUE | FOREGROUND_GREEN;
+  fg_colors["white"] = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
+  fg_colors["reset"] = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
+
+  bg_colors["black"] = 0;
+  bg_colors["red"] = BACKGROUND_RED;
+  bg_colors["green"] = BACKGROUND_GREEN;
+  bg_colors["yellow"] = BACKGROUND_RED | BACKGROUND_GREEN;
+  bg_colors["blue"] = BACKGROUND_BLUE;
+  bg_colors["magenta"] = BACKGROUND_RED | BACKGROUND_BLUE;
+  bg_colors["cyan"] = BACKGROUND_BLUE | BACKGROUND_GREEN;
+  bg_colors["white"] = BACKGROUND_RED | BACKGROUND_GREEN | BACKGROUND_BLUE;
+  bg_colors["reset"] = 0;
 #endif
 #ifdef NOT_WIN
-char const* colors[] =
-  {
-    /* Foreground colors */
-    "\033[30m", // Black
-    "\033[31m", // Red
-    "\033[32m", // Green
-    "\033[33m", // Yellow
-    "\033[34m", // Blue
-    "\033[35m", // Magenta
-    "\033[36m", // Cyan
-    "\033[37m", // White
-    "\033[0m", // Reset
-    "NO_COLOR", // None
-    /* Background colors */
-    "\033[40m", // Black
-    "\033[41m", // Red
-    "\033[42m", // Green
-    "\033[43m", // Yellow
-    "\033[44m", // Blue
-    "\033[45m", // Magenta
-    "\033[46m", // Cyan
-    "\033[47m", // White
-    "\033[0m", // Reset
-    "NO_COLOR" // None
-  };
-#endif
+  fg_colors["black"] = "\033[30m";
+  fg_colors["red"] = "\033[31m";
+  fg_colors["green"] = "\033[32m";
+  fg_colors["yellow"] = "\033[33m";
+  fg_colors["blue"] = "\033[34m";
+  fg_colors["magenta"] = "\033[35m";
+  fg_colors["cyan"] = "\033[36m";
+  fg_colors["white"] = "\033[37m";
+  fg_colors["reset"] = "\033[0m";
 
-Console::Console () : Stream ()
-{
-  fd = 0;
+  bg_colors["black"] = "\033[40m";
+  bg_colors["red"] = "\033[41m";
+  bg_colors["green"] = "\033[42m";
+  bg_colors["yellow"] = "\033[43m";
+  bg_colors["blue"] = "\033[44m";
+  bg_colors["magenta"] = "\033[45m";
+  bg_colors["cyan"] = "033[46m";
+  bg_colors["white"] = "\033[47m";
+  bg_colors["reset"] = "\033[0m";
+#endif
 }
 
 Console::~Console ()
@@ -135,52 +122,50 @@
 }
 
 /*!
- * Check that only allowed values are provided for background and 
- * foreground colors.
- * \param c the array to validate.
- * \return 0 if c is a valid array, 1 else.
- */
-int
-Console::checkColors (MyServerColor c[])
-{
-  return 
-    c[0] < MYSERVER_FG_COLOR_BLACK || 
-    c[0] > MYSERVER_FG_COLOR_NONE ||
-    c[1] < MYSERVER_BG_COLOR_BLACK || 
-    c[1] > MYSERVER_BG_COLOR_NONE;
-}
-
-/*!
- * Set the attributes for the console text.
- * \param c c[0] holds the foreground color, c[1] the background one.
+ * Set the attributes for the console text. If a not valid color is provided,
+ * the console attribute for both background and foreground text will be
+ * reset.
+ * \param fg_color the foreground text attribute.
+ * \param bg_color the background text attribute.
  * \return 0 on success, 1 on error.
  */
 int
-Console::setColor (MyServerColor c[])
+Console::setColor (string fg_color, string bg_color)
 {
-  if (!checkColors (c))
-    {
 #ifdef WIN32
-      WORD attrs =
-        ((c[0] != MYSERVER_FG_COLOR_NONE) ? colors[c[0]] : 0) |
-        ((c[1] != MYSERVER_BG_COLOR_NONE) ? colors[c[1]] : 0);
-      DWORD nStdHandle = (fd == &cout) ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE;
-      HANDLE h = GetStdHandle (nStdHandle);
-      SetConsoleTextAttribute (attrs, h);
+  WORD attrs;
+  DWORD nStdHandle;
+  HANDLE h;
+  if (fg_colors.count (fg_color) && bg_colors.count (bg_color))
+    {
+      attrs = fg_colors[fg_color] | bg_colors[bg_color];
+    }
+  else
+    {
+      attrs = fg_colors["reset"] | bg_colors["reset"];
+    }
+  if (fd == &cout)
+    {
+      nStdHandle = STD_OUTPUT_HANDLE;
+    }
+  else
+    {
+      nStdHandle = STD_ERROR_HANDLE;
+    }
+  h = GetStdHandle (nStdHandle);
+  SetConsoleTextAttribute (attrs, h);
 #endif
 #ifdef NOT_WIN
-      if (c[0] != MYSERVER_FG_COLOR_NONE)
-        {
-          *fd << colors[c[0]];
-        }
-      if (c[1] != MYSERVER_BG_COLOR_NONE)
-        {
-          *fd << colors[c[1]];
-        }
+  if (fg_colors.count (fg_color) && bg_colors.count (bg_color))
+    {
+      *fd << fg_colors[fg_color].c_str () << bg_colors[bg_color].c_str ();
+    }
+  else
+    {
+      *fd << fg_colors["reset"].c_str () << bg_colors["reset"].c_str ();
+    }
 #endif
       return 0;
-    }
-  return 1;
 }
 
 /*!
@@ -191,6 +176,5 @@
 int
 Console::reset ()
 {
-  MyServerColor c[] = { MYSERVER_FG_COLOR_RESET, MYSERVER_BG_COLOR_RESET };
-  return setColor (c);
+  return setColor ("reset", "reset");
 }

Modified: trunk/myserver/src/log/log_manager.cpp
===================================================================
--- trunk/myserver/src/log/log_manager.cpp	2009-02-16 13:32:19 UTC (rev 3003)
+++ trunk/myserver/src/log/log_manager.cpp	2009-02-18 11:06:56 UTC (rev 3004)
@@ -32,6 +32,7 @@
   mutex = new Mutex ();
   mutex->init ();
   computeNewLine ();
+  associateLoggingLevelsWithNames ();
 }
 
 /*!
@@ -957,3 +958,27 @@
     }
   return 1;
 }
+
+/*!
+ * \return a list of strings each representing one of logging levels that
+ * MyServer understands.
+ */
+list<string>
+LogManager::getLoggingLevelsByNames ()
+{
+  list<string> l; 
+  for (map<LoggingLevel, string>::iterator it = loggingLevels.begin ();
+       it != loggingLevels.end (); it++)
+    {
+      l.push_back (it->second);
+    }
+  return l;
+}
+
+void
+LogManager::associateLoggingLevelsWithNames ()
+{
+  loggingLevels[MYSERVER_LOG_MSG_INFO] = "info";
+  loggingLevels[MYSERVER_LOG_MSG_WARNING] = "warning";
+  loggingLevels[MYSERVER_LOG_MSG_ERROR] = "error";
+}

Modified: trunk/myserver/src/log/stream/console_stream.cpp
===================================================================
--- trunk/myserver/src/log/stream/console_stream.cpp	2009-02-16 13:32:19 UTC (rev 3003)
+++ trunk/myserver/src/log/stream/console_stream.cpp	2009-02-18 11:06:56 UTC (rev 3004)
@@ -16,34 +16,8 @@
 */
 
 #include <include/log/stream/console_stream.h>
+#include <include/server/server.h>
 
-/*!
- * Default color values to use when outputting log messages over the
- * console. Change them according to your tastes :)
- *
- * defaultColors[i][0] = Foreground color for the LoggingLevel `i'
- * defaultColors[i][1] = Background color for the LoggingLevel `i'
- */
-MyServerColor defaultColors[][2] =
-  {
-    {
-      MYSERVER_FG_COLOR_RESET, // } MYSERVER_LOG_MSG_PLAIN
-      MYSERVER_BG_COLOR_RESET  // } Don't modify this
-    },
-    {
-      MYSERVER_FG_COLOR_WHITE, // } MYSERVER_LOG_MSG_INFO
-      MYSERVER_BG_COLOR_NONE  // }
-    },
-    {
-      MYSERVER_FG_COLOR_YELLOW, // } MYSERVER_LOG_MSG_WARNING
-      MYSERVER_BG_COLOR_NONE   // }
-    },
-    {
-      MYSERVER_FG_COLOR_RED,   // } MYSERVER_LOG_MSG_ERROR
-      MYSERVER_BG_COLOR_NONE  // }
-    }
-  };
-
 ConsoleStream::ConsoleStream (FiltersFactory* ff, u_long cycle, Stream* out,
                               FiltersChain* fc) :  
   LogStream (ff, cycle, out, fc)
@@ -59,7 +33,22 @@
 ConsoleStream::setMode (LoggingLevel level)
 {
   mutex->lock ();
-  int success = dynamic_cast<Console*>(out)->setColor (defaultColors[level]);
+  int success = 1;
+  Console* c = dynamic_cast<Console*>(out);
+  if (level == MYSERVER_LOG_MSG_PLAIN)
+    {
+      success = c->setColor ("reset", "reset");
+    }
+  else
+    {
+      Server* server = Server::getInstance ();
+      LogManager* lm = server->getLogManager ();
+      map<string, string> userColors = server->getConsoleColors ();
+      map<LoggingLevel, string> levels = lm->getLoggingLevels ();
+      string fg_color = userColors[levels[level] + "_fg"];
+      string bg_color = userColors[levels[level] + "_bg"];
+      success = c->setColor (fg_color, bg_color);
+    }
   mutex->unlock ();
   return success;
 }

Modified: trunk/myserver/src/server/server.cpp
===================================================================
--- trunk/myserver/src/server/server.cpp	2009-02-16 13:32:19 UTC (rev 3003)
+++ trunk/myserver/src/server/server.cpp	2009-02-18 11:06:56 UTC (rev 3004)
@@ -983,7 +983,6 @@
  */
 int Server::initialize()
 {
-  initLogManager ();
   char *data;
 #ifdef WIN32
   envString = GetEnvironmentStrings();
@@ -1011,6 +1010,28 @@
   if(configurationFileManager.open(mainConfigurationFile->c_str()))
     return -1;
 
+  /*
+   * Process console colors information.
+   */
+  list<string> levels = logManager->getLoggingLevelsByNames ();
+  for (list<string>::iterator it = levels.begin (); it != levels.end (); it++)
+    {
+      string fg (*it + "_fg");
+      string bg (*it + "_bg");
+      data = configurationFileManager.getAttr ("CONSOLE_COLORS", fg.c_str ());
+      if (data)
+        {
+          consoleColors[fg] = string (data);
+        }
+      data = configurationFileManager.getAttr ("CONSOLE_COLORS", bg.c_str ());
+      if (data)
+        {
+          consoleColors[bg] = string (data);
+        }
+    }
+
+  initLogManager ();
+
   data = configurationFileManager.getValue("LANGUAGE");
   if(languageFile)
     delete languageFile;





From MAILER-DAEMON Thu Feb 19 16:42:18 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LaGev-0007BL-V7
	for mharc-myserver-commit@gnu.org; Thu, 19 Feb 2009 16:42:18 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LaGeu-0007Af-45
	for myserver-commit@gnu.org; Thu, 19 Feb 2009 16:42:16 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LaGet-0007AK-NB
	for myserver-commit@gnu.org; Thu, 19 Feb 2009 16:42:15 -0500
Received: from [199.232.76.173] (port=55590 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LaGet-0007AF-Cb
	for myserver-commit@gnu.org; Thu, 19 Feb 2009 16:42:15 -0500
Received: from savannah.gnu.org ([199.232.41.3]:60348 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LaGet-0005ed-0v
	for myserver-commit@gnu.org; Thu, 19 Feb 2009 16:42:15 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LaGes-0004s0-GO
	for myserver-commit@gnu.org; Thu, 19 Feb 2009 21:42:14 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1LaGes-0004rw-9a
	for myserver-commit@gnu.org; Thu, 19 Feb 2009 21:42:14 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1LaGes-0004rw-9a@cvs.savannah.gnu.org>
Date: Thu, 19 Feb 2009 21:42:14 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3005] Added note in the manual about GNU TLS to
	create new certificates.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 19 Feb 2009 21:42:16 -0000

Revision: 3005
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3005
Author:   gscrivano
Date:     2009-02-19 21:42:13 +0000 (Thu, 19 Feb 2009)

Log Message:
-----------
Added note in the manual about GNU TLS to create new certificates.

Modified Paths:
--------------
    trunk/myserver/binaries/certificates/how_create_certificates.txt
    trunk/myserver/documentation/ssl_certificates.texi

Modified: trunk/myserver/binaries/certificates/how_create_certificates.txt
===================================================================
--- trunk/myserver/binaries/certificates/how_create_certificates.txt	2009-02-18 11:06:56 UTC (rev 3004)
+++ trunk/myserver/binaries/certificates/how_create_certificates.txt	2009-02-19 21:42:13 UTC (rev 3005)
@@ -1,14 +1,3 @@
-In order to generate a certificate you need the certtool utility
-provided by GNU TLS.
-Look here for more information: http://www.gnu.org/software/gnutls/.
-
-certtool --generate-privkey --outfile cert.key
-certtool --generate-self-signed --load-privkey privkey.key --outfile cert.pem
-
-These commands will create two files server.key and server.pem. Put
-them in this directory and configure your virtual host file to use these
-files adding the following lines under the <VHOST> section:
-
-<SSL_PRIVATEKEY>certificates/cert.key</SSL_PRIVATEKEY>
-<SSL_CERTIFICATE>certificates/privkey.pem</SSL_CERTIFICATE>
-<SSL_PASSWORD></SSL_PASSWORD>
+Take a look at the "How create SSL certificates with GNU TLS" section
+in the MyServer manual for a guide about how certificates should be
+created and used.

Modified: trunk/myserver/documentation/ssl_certificates.texi
===================================================================
--- trunk/myserver/documentation/ssl_certificates.texi	2009-02-18 11:06:56 UTC (rev 3004)
+++ trunk/myserver/documentation/ssl_certificates.texi	2009-02-19 21:42:13 UTC (rev 3005)
@@ -16,24 +16,26 @@
 In this way the key owner do not have to distribute the key only to
 know clients but he can distributes it to a large scale network.
 
-@section How create SSL certificates with OpenSSL
+@section How create SSL certificates with GNU TLS
 A certificate is needed to certify your identity through a
 CA (Certification Authority).  You can use a certificate without
 register it to third party CA, it is called self-signed certificate.
-You can find all the necessary tools to create certificates in  the
-library OpenSSL at: www.openssl.org.
+You can find all the necessary tools to create certificates in the
+GNU TLS command line tools.  Look here for more information:
+@url{http://www.gnu.org/software/gnutls/}.
 
-After OpenSSL is installed correctly, type the following commands:
+To generate a private key/self signed certificate couple you will need
+to execute these two commands:
 
 @example
-openssl genrsa -out server.key
-openssl req -new -x509 -days 730 -config openssl.cnf \
-        -key server.key -out server.pem
+certtool --generate-privkey --outfile cert.key
+certtool --generate-self-signed --load-privkey cert.key \
+         --outfile cert.pem
 @end example
 
 @section How use certificates in MyServer
 To configure certificates in MyServer you have to put the two files:
-@code{server.key}, @code{server.pem} in the MyServer certificates
+@code{cert.key}, @code{cert.pem} in the MyServer certificates
 directory.
 
 To configure a HTTPS host that will use the created certificate, add
@@ -43,8 +45,8 @@
 <VHOST>
   <NAME>Every connection</NAME>
   <PORT>443</PORT>
-  <SSL_PRIVATEKEY>certificates/server.key</SSL_PRIVATEKEY>
-  <SSL_CERTIFICATE>certificates/server.pem</SSL_CERTIFICATE>
+  <SSL_PRIVATEKEY>certificates/cert.key</SSL_PRIVATEKEY>
+  <SSL_CERTIFICATE>certificates/cert.pem</SSL_CERTIFICATE>
   <PROTOCOL>HTTPS</PROTOCOL>
   <DOCROOT>web</DOCROOT>
   <SYSFOLDER>system</SYSFOLDER>





From MAILER-DAEMON Fri Feb 20 18:23:28 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LaeiO-0001VO-AV
	for mharc-myserver-commit@gnu.org; Fri, 20 Feb 2009 18:23:28 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LaeiM-0001Ul-8j
	for myserver-commit@gnu.org; Fri, 20 Feb 2009 18:23:26 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LaeiL-0001UD-5i
	for myserver-commit@gnu.org; Fri, 20 Feb 2009 18:23:25 -0500
Received: from [199.232.76.173] (port=52760 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LaeiL-0001UA-0v
	for myserver-commit@gnu.org; Fri, 20 Feb 2009 18:23:25 -0500
Received: from savannah.gnu.org ([199.232.41.3]:51812 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LaeiK-00076C-Kd
	for myserver-commit@gnu.org; Fri, 20 Feb 2009 18:23:24 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LaeiJ-0001O2-Nq
	for myserver-commit@gnu.org; Fri, 20 Feb 2009 23:23:23 +0000
Received: from dperrone by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <dperrone@savannah.gnu.org>) id 1LaeiJ-0001Ny-D0
	for myserver-commit@gnu.org; Fri, 20 Feb 2009 23:23:23 +0000
MIME-Version: 1.0
Errors-To: dperrone
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Daniele Perrone <dperrone@it.gnu.org>
Message-Id: <E1LaeiJ-0001Ny-D0@cvs.savannah.gnu.org>
Date: Fri, 20 Feb 2009 23:23:23 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3006] first step developing myserver-get:
 implemented simple skeleton and update command.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 20 Feb 2009 23:23:26 -0000

Revision: 3006
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3006
Author:   dperrone
Date:     2009-02-20 23:23:22 +0000 (Fri, 20 Feb 2009)

Log Message:
-----------
first step developing myserver-get: implemented simple skeleton and update command.

Added Paths:
-----------
    trunk/misc/myserver-get/
    trunk/misc/myserver-get/list/
    trunk/misc/myserver-get/myserver-get.py
    trunk/misc/myserver-get/myserverGetLib/
    trunk/misc/myserver-get/myserverGetLib/__init__.py
    trunk/misc/myserver-get/myserverGetLib/config.py
    trunk/misc/myserver-get/myserverGetLib/error.py
    trunk/misc/myserver-get/myserverGetLib/general.py
    trunk/misc/myserver-get/myserverGetLib/local.py
    trunk/misc/myserver-get/myserverGetLib/remote.py
    trunk/misc/myserver-get/myserverGetLib/remoteSvn.py
    trunk/misc/myserver-get/repositories.xml

Added: trunk/misc/myserver-get/myserver-get.py
===================================================================
--- trunk/misc/myserver-get/myserver-get.py	                        (rev 0)
+++ trunk/misc/myserver-get/myserver-get.py	2009-02-20 23:23:22 UTC (rev 3006)
@@ -0,0 +1,34 @@
+from myserverGetLib.general import MyServerGet
+import sys
+import getopt
+
+def usage(arg):
+    print "usage: myserver-get update "    
+        
+def main(argv):
+    myserverGet = MyServerGet()
+    argument = "" 
+    command = ""                        
+    
+    commands = {"":usage, "update":myserverGet.update}
+        
+    try:                                
+        opts, args = getopt.getopt(argv, "h", ["help"]) 
+    except getopt.GetoptError:           
+        usage()                          
+        sys.exit(2)
+    for opt, arg in opts:                
+        if opt in ("-h", "--help"):      
+            usage("")                     
+            sys.exit()                  
+    
+    for arg in args:
+        if arg in ("update"):
+            command = arg
+        else:
+            argument = arg
+    
+    commands[command](argument)
+
+if __name__ == "__main__":
+    main(sys.argv[1:])
\ No newline at end of file


Property changes on: trunk/misc/myserver-get/myserverGetLib
___________________________________________________________________
Added: svn:mergeinfo
   + 

Added: trunk/misc/myserver-get/myserverGetLib/__init__.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/__init__.py	                        (rev 0)
+++ trunk/misc/myserver-get/myserverGetLib/__init__.py	2009-02-20 23:23:22 UTC (rev 3006)
@@ -0,0 +1,2 @@
+#
+

Added: trunk/misc/myserver-get/myserverGetLib/config.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/config.py	                        (rev 0)
+++ trunk/misc/myserver-get/myserverGetLib/config.py	2009-02-20 23:23:22 UTC (rev 3006)
@@ -0,0 +1,16 @@
+
+CNFG_FILE = "myserver-get.xml"
+
+REP_LIST_FILE = "repositories.xml"
+
+PLUGIN_LIST_FILES_DIR = "list"
+
+PLUGIN_LIST_PREFIX = "myserver-get-"
+
+PLUGIN_LIST_SUFFIX = "-plugin-list.xml"
+
+
+
+class ConfigLoader:
+    def __init__(self, configFile):
+        self.__configFile = configFile
\ No newline at end of file

Added: trunk/misc/myserver-get/myserverGetLib/error.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/error.py	                        (rev 0)
+++ trunk/misc/myserver-get/myserverGetLib/error.py	2009-02-20 23:23:22 UTC (rev 3006)
@@ -0,0 +1,24 @@
+
+
+class Error(Exception):
+    def __init__(self, value):
+        self.value = value
+    
+    def __str__(self):
+        return repr(self.value)
+
+class FatalError(Error):
+    def __init__(self, value):
+        self.value = value
+    
+    def __str__(self):
+        return repr(self.value)
+    
+class Warning(Exception):
+    def __init__(self, value):
+        self.value = value
+    
+    def __str__(self):
+        return repr(self.value)
+    
+

Added: trunk/misc/myserver-get/myserverGetLib/general.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/general.py	                        (rev 0)
+++ trunk/misc/myserver-get/myserverGetLib/general.py	2009-02-20 23:23:22 UTC (rev 3006)
@@ -0,0 +1,25 @@
+import xml.dom.minidom
+import local
+import config
+import remote
+import remoteSvn
+
+class MyServerGet:
+    def __init__(self, repositoryFile = config.REP_LIST_FILE, listDir = config.PLUGIN_LIST_FILES_DIR):
+        self.__rep = repositoryFile
+        self.__listDir = listDir
+        self.__repManager = remote.RepositoryManager()
+        self.__repManager.addSupportedRepository("svn",remoteSvn.RepositorySvn)
+        self.__list = []
+    
+    def loadRepositoryList(self):
+        list = xml.dom.minidom.parse(self.__rep)
+        repXmlList = list.getElementsByTagName("REPOSITORY")
+        self.__list = [local.ListManager(repXml.firstChild.data,self.__listDir) for repXml in repXmlList]
+        
+    def update(self, arg):
+        self.loadRepositoryList()
+        for list in self.__list:
+            rep = self.__repManager.getRepository(list.repository)
+            rep = rep(list.repository)
+            rep.synchronizeListWithRepository(list)
\ No newline at end of file

Added: trunk/misc/myserver-get/myserverGetLib/local.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/local.py	                        (rev 0)
+++ trunk/misc/myserver-get/myserverGetLib/local.py	2009-02-20 23:23:22 UTC (rev 3006)
@@ -0,0 +1,144 @@
+import xml.dom.minidom
+import error
+import config
+
+class PluginInfoElement:
+    def __init__(self,name,element, document):
+        self.name = name
+        self.element = element
+        self.document = document
+    
+    def __getitem__(self, key):
+        if key == "value":
+            return self.__element.firstChild.data
+        att = self.element.attributes[key]
+        if att!=None:
+            return att.value
+    
+    def __setitem__(self, key, item):
+        if key == "value":
+            self.document.createTextNode(item)
+            oldChild = self.__element.firstChild
+            self.element.replaceChild(newChild,oldChild)
+        self.element.setAttribute(key,item)
+
+
+class PluginInfo:
+    def __init__(self,xmlElement, manager):
+        self.__xmlElement = xmlElement
+        self.__manager = manager
+    
+    def __getitem__(self, key):
+        elementList = self.__xmlElement.getElementsByTagName(key)
+        
+        return [PluginInfoElement(key,element.childNodes[0].data, element, self.__manager) for element in elementList]
+
+    def __setitem__(self, key, item):
+        elementList = self.__xmlElement.getElementsByTagName(key) 
+        for element in elementList:
+            self.__xmlElement.removeChild(element)
+        
+        for element in item:
+            self.__xmlElement.appendChild(element.element)
+            element.document = self.__manager.listDOM
+    
+    def getMyServerMinVersion(self):
+        return self.__mxlElement.getAttribute("min-version")
+    
+    def getMyServerMaxVersion(self):
+        return self.__mxlElement.getAttribute("max-version")
+    
+    def finalize(self):
+        self.__manager.synchronizeListWithFileSystem()
+
+class ListManager:   
+    def __init__ (self,repository, listFilePath, listFile = None):
+        self.repository = repository
+        
+        if listFile != None:
+            self.FileName = listFilePath + "/" + listFile;
+        else:
+            self.FileName = listFilePath + "/" + config.PLUGIN_LIST_PREFIX + "-".join(self.repository.split("/")) + config.PLUGIN_LIST_SUFFIX;
+            
+        try:
+            self.listDOM = xml.dom.minidom.parse(self.FileName)
+        except Exception:
+            self.resetToEmptyListFile("-1")
+            self.synchronizeListWithFileSystem()
+                
+            
+
+
+    def resetToEmptyListFile(self,revision):
+        self.listDOM = xml.dom.minidom.Document()
+        plugins = self.listDOM.createElement("PLUGINS")
+        plugins.setAttribute("repository",self.repository)
+        plugins.setAttribute("revision",revision)
+        self.listDOM.appendChild(plugins)
+    
+    
+    def synchronizeListWithFileSystem (self):
+        file_object = open(self.FileName, "w")
+        self.listDOM.writexml(file_object,"","", "\n")
+        file_object.close()
+
+    
+    def getPlugin(self,name):
+        plugins = self.listDOM.getElementsByTagName("plugin")
+        
+        plugin = [elem for elem in plugins if elem.attributes["name"].value == name]
+        
+        if len(plugin)==1:
+            pluginDOM = plugin[0]
+            plugin = PluginInfo(pluginDOM,self)
+            return plugin
+        
+        raise error.Error("Plugin "+ name + "doesn't exists! in " + self.repository)
+        
+    
+    def addPlugin(self,name, minVersion, maxVersion):
+        plugin = self.listDOM.createElement("PLUGIN")
+        
+        name = self.listDOM.createElement("NAME")
+        name.appendChild(self.listDOM.createTextNode(name))
+        
+        plugin.appendChild(name)
+        plugin.setAttribute("min-version",`minVersion`)
+        plugin.setAttribute("max-version",`maxVersion`)
+        
+        plugins = self.listDOM.getElementsByTagName("PLUGINS")
+        if plugins!=None:
+            plugins[0].appendChild(plugin)
+            pluginInfo = PluginInfo(plugin,self)
+            return pluginInfo
+        
+        raise error.FatalError(self.FileName + "corrupted!")
+        
+        
+    def addPluginWithXml(self,pluginXml):
+        plugins = self.listDOM.getElementsByTagName("PLUGINS")
+        if plugins!=None:
+            plugins[0].appendChild(pluginXml)
+            pluginInfo = PluginInfo(pluginXml,self)
+            return pluginInfo
+        
+        raise error.FatalError(self.FileName + "corrupted!")
+        
+        
+    def getPluginsList(self):
+        plugins = self.listDOM.getElementsByTagName("PLUGIN")
+        
+        return [PluginInfo(plugin,self) for plugin in plugins]
+    
+    
+    def getRevision(self):
+        pluginsList = self.listDOM.getElementsByTagName("PLUGINS")
+        plugins = pluginsList[0]
+        return plugins.getAttribute("revision")
+           
+
+if __name__ == "__main__":
+    manager = ListManager("localhost.it",".","localhost.it-plugins.list")
+    plugin = manager.getPlugin("prova")
+    print plugin["description"] 
+    plugin.finalize()
\ No newline at end of file

Added: trunk/misc/myserver-get/myserverGetLib/remote.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/remote.py	                        (rev 0)
+++ trunk/misc/myserver-get/myserverGetLib/remote.py	2009-02-20 23:23:22 UTC (rev 3006)
@@ -0,0 +1,29 @@
+import string
+
+class Repository:
+    def __init__(self,url):
+        self.url = url
+        
+
+    def synchronizeListWithRepository(self, list):
+        pass
+    
+    
+    
+class RepositoryManager:
+    def __init__(self):
+        self.__reps = {}
+    
+    def addSupportedRepository(self, protocol, repository):
+        self.__reps[protocol] = repository
+    
+    def getRepository(self, url):
+        url = string.lower(url)
+        if string.find(url,"svn")!=-1:
+            return self.__reps["svn"]
+        return None
+            
+if __name__ == "__main__":
+    list = local.ListManager("localhost.it",".")
+    rep = Repository("svn://svn.savannah.gnu.org/myserver/trunk/plugins")
+    rep.synchronizeListWithRepository(list)
\ No newline at end of file

Added: trunk/misc/myserver-get/myserverGetLib/remoteSvn.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/remoteSvn.py	                        (rev 0)
+++ trunk/misc/myserver-get/myserverGetLib/remoteSvn.py	2009-02-20 23:23:22 UTC (rev 3006)
@@ -0,0 +1,50 @@
+import pysvn
+import local
+import error
+import xml.dom.minidom
+from remote import Repository
+import sys
+
+class RepositorySvn(Repository):
+    def __init__ (self,url):
+        Repository.__init__(self,url)
+        self.client = pysvn.Client()
+    
+    def __getPluginsList(self):
+        plugins = self.client.list(self.url + "/src",recurse=False)
+        import string
+        plugins = [string.split(elem[0]["repos_path"],"/")[-1] for elem in plugins]
+        return plugins[1:]
+    
+    def synchronizeListWithRepository(self, list):
+        sys.stdout.write("update: "+ list.repository + '\n')
+        sys.stdout.write("loading ")
+        sys.stdout.flush()
+        localRevision = int(list.getRevision())
+        info = self.client.info2(self.url, recurse=False)
+        sys.stdout.write(". ")
+        sys.stdout.flush()
+        remoteRevision = int(info[0][1]["rev"].number)
+        if localRevision == remoteRevision:
+            sys.stdout.write("local list already updated.\n")
+            sys.stdout.flush()
+        if localRevision > remoteRevision:
+            raise error.FatalError("Local plugins list corrupted!!")
+        
+        if localRevision < remoteRevision:
+            list.resetToEmptyListFile(`remoteRevision`)
+            sys.stdout.write(". ")
+            sys.stdout.flush()
+            plugins = self.__getPluginsList()
+            sys.stdout.write(". ")
+            sys.stdout.flush()
+            for plugin in plugins:
+                url = self.url + "/src/" + plugin + "/plugin.xml"
+                pluginXml =  xml.dom.minidom.parseString(self.client.cat(url))
+                sys.stdout.write(". ")
+                sys.stdout.flush()
+                element = pluginXml.getElementsByTagName("PLUGIN")
+                pluginInfo = list.addPluginWithXml(element[0])
+            list.synchronizeListWithFileSystem()
+            sys.stdout.write("DONE.\n")
+            sys.stdout.flush()

Added: trunk/misc/myserver-get/repositories.xml
===================================================================
--- trunk/misc/myserver-get/repositories.xml	                        (rev 0)
+++ trunk/misc/myserver-get/repositories.xml	2009-02-20 23:23:22 UTC (rev 3006)
@@ -0,0 +1,3 @@
+<REPOSITORIES>
+   <REPOSITORY>svn://svn.savannah.gnu.org/myserver/trunk/plugins</REPOSITORY>
+</REPOSITORIES>
\ No newline at end of file





From MAILER-DAEMON Sat Feb 21 12:24:14 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LavaI-0002kn-5D
	for mharc-myserver-commit@gnu.org; Sat, 21 Feb 2009 12:24:14 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LavaH-0002kZ-7r
	for myserver-commit@gnu.org; Sat, 21 Feb 2009 12:24:13 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LavaG-0002kK-7i
	for myserver-commit@gnu.org; Sat, 21 Feb 2009 12:24:12 -0500
Received: from [199.232.76.173] (port=44883 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LavaF-0002kH-Sf
	for myserver-commit@gnu.org; Sat, 21 Feb 2009 12:24:12 -0500
Received: from savannah.gnu.org ([199.232.41.3]:54835 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LavaF-0003gc-L9
	for myserver-commit@gnu.org; Sat, 21 Feb 2009 12:24:11 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LavaF-0005NA-6I
	for myserver-commit@gnu.org; Sat, 21 Feb 2009 17:24:11 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1LavaE-0005N6-SA
	for myserver-commit@gnu.org; Sat, 21 Feb 2009 17:24:11 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1LavaE-0005N6-SA@cvs.savannah.gnu.org>
Date: Sat, 21 Feb 2009 17:24:10 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3007] Removed unused #define's
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 21 Feb 2009 17:24:13 -0000

Revision: 3007
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3007
Author:   gscrivano
Date:     2009-02-21 17:24:10 +0000 (Sat, 21 Feb 2009)

Log Message:
-----------
Removed unused #define's

Modified Paths:
--------------
    trunk/myserver/src/connections_scheduler/connections_scheduler.cpp

Modified: trunk/myserver/src/connections_scheduler/connections_scheduler.cpp
===================================================================
--- trunk/myserver/src/connections_scheduler/connections_scheduler.cpp	2009-02-20 23:23:22 UTC (rev 3006)
+++ trunk/myserver/src/connections_scheduler/connections_scheduler.cpp	2009-02-21 17:24:10 UTC (rev 3007)
@@ -281,12 +281,6 @@
 
   dispatchedThreadId = 0;
 
-#ifdef WIN32
-#define LOCAL_SOCKETPAIR_AF AF_INET
-#else
-#define LOCAL_SOCKETPAIR_AF AF_UNIX
-#endif
-
   int err = dispatcherArg.socketPair.create ();
 
   if (err == -1)
@@ -524,7 +518,7 @@
 }
 
 /*!
- *Fullfill a list with all the connections.
+ *Fill a list with all the alive connections.
  *\param out A list that will receive all the connections alive on the
  *server.
  */





From MAILER-DAEMON Sat Feb 21 12:25:12 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LavbE-0002z1-4N
	for mharc-myserver-commit@gnu.org; Sat, 21 Feb 2009 12:25:12 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LavbC-0002ye-0R
	for myserver-commit@gnu.org; Sat, 21 Feb 2009 12:25:10 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LavbB-0002yI-8Z
	for myserver-commit@gnu.org; Sat, 21 Feb 2009 12:25:09 -0500
Received: from [199.232.76.173] (port=36311 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LavbB-0002yD-2p
	for myserver-commit@gnu.org; Sat, 21 Feb 2009 12:25:09 -0500
Received: from savannah.gnu.org ([199.232.41.3]:54876 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LavbA-0003u6-OL
	for myserver-commit@gnu.org; Sat, 21 Feb 2009 12:25:08 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LavbA-0005QM-6S
	for myserver-commit@gnu.org; Sat, 21 Feb 2009 17:25:08 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1Lavb9-0005QG-Mb
	for myserver-commit@gnu.org; Sat, 21 Feb 2009 17:25:08 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1Lavb9-0005QG-Mb@cvs.savannah.gnu.org>
Date: Sat, 21 Feb 2009 17:25:07 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3008] Added new contents to the user manual
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 21 Feb 2009 17:25:10 -0000

Revision: 3008
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3008
Author:   gscrivano
Date:     2009-02-21 17:25:07 +0000 (Sat, 21 Feb 2009)

Log Message:
-----------
Added new contents to the user manual

Modified Paths:
--------------
    trunk/myserver/documentation/basic_configuration.texi
    trunk/myserver/documentation/virtual_hosts.texi

Modified: trunk/myserver/documentation/basic_configuration.texi
===================================================================
--- trunk/myserver/documentation/basic_configuration.texi	2009-02-21 17:24:10 UTC (rev 3007)
+++ trunk/myserver/documentation/basic_configuration.texi	2009-02-21 17:25:07 UTC (rev 3008)
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @section Configuration files
-The configuration is done trought three different XML files:
+The MyServer configuration is done using three different XML files:
 
 @itemize
 @item @file{myserver.xml}
@@ -24,11 +24,17 @@
 @item Global scope inside /etc/myserver.
 @end enumerate
 
+@section Message localization
+It is possible to change the localization for some MyServer messages
+changing the @code{LANGUAGE} value in the @file{myserver.xml} file.
+By default the english language is used, the value specified here must
+refer to a xml file contained in the @file{languages/} directory.
+
 @section Default resource
 In the @file{myserver.xml} file it is possible to set the default page
-for the sites hosted on MyServer.
+for the HTTP/HTTPS sites hosted on MyServer.
 
-Similar lines already exist in your configuration file:
+Similar lines already exist in the default configuration file:
 
 @example
 <DEFAULT_FILENAME>default.htm</DEFAULT_FILENAME>

Modified: trunk/myserver/documentation/virtual_hosts.texi
===================================================================
--- trunk/myserver/documentation/virtual_hosts.texi	2009-02-21 17:24:10 UTC (rev 3007)
+++ trunk/myserver/documentation/virtual_hosts.texi	2009-02-21 17:25:07 UTC (rev 3008)
@@ -27,7 +27,7 @@
 @itemize
 @item <NAME>
 it gives the server administrator an idea of what the virtual host
-is such as internal Ethernet, external ethernet or every connection.
+specifying a name for it.
 @item <PORT>
 it is the port used to accept connections.
 @item <IP>
@@ -86,6 +86,20 @@
 Although FTP is used for public file sharing, restrictions may be
 imposed using security file.
 
+@subsection Data throttling
+It is possible to specify a throttling rate for the connection by the
+@code{connection.throttling} value.  It can be specified in any
+configuration file, at a global level, in the virtual host definition
+and in the local security file.
+Its value is specified in bytes/second.
+
+The following line, for example, set the maximum transfer rate to 1
+KByte/second:
+
+@example
+    <DEFINE name="connection.throttling" value="1024"/>
+@end example
+
 @subsection HTTP specific configuration
 
 @subsubsection The LOCATION element
@@ -106,13 +120,13 @@
 
 @subsubsection HTTP trace command
 MyServer gives you the option to enable the HTTP TRACE command for
-each virtual host. All you need to do is edit the @file{security.xml}
-file of the root of your virtual host (not a subdirectory!  If the
-file doesn't exist, you may create a new one), and add the parameter:
+each virtual host.
 
+This value can be specified in the global and in the virtual host
+configuration.
+
 @example
 <DEFINE name="http.allow_trace" value="YES" />
 @end example
 
-Once you do that, you enable the HTTP TRACE command. By default, it's
-disabled.
+By default, it's disabled.





From MAILER-DAEMON Sun Feb 22 13:52:30 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LbJRG-0000WT-O6
	for mharc-myserver-commit@gnu.org; Sun, 22 Feb 2009 13:52:30 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LbJRF-0000W9-J5
	for myserver-commit@gnu.org; Sun, 22 Feb 2009 13:52:29 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LbJRF-0000Vx-5x
	for myserver-commit@gnu.org; Sun, 22 Feb 2009 13:52:29 -0500
Received: from [199.232.76.173] (port=43643 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LbJRF-0000Vu-33
	for myserver-commit@gnu.org; Sun, 22 Feb 2009 13:52:29 -0500
Received: from savannah.gnu.org ([199.232.41.3]:60363 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LbJRE-0001y3-P9
	for myserver-commit@gnu.org; Sun, 22 Feb 2009 13:52:28 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LbJRE-0002Js-7V
	for myserver-commit@gnu.org; Sun, 22 Feb 2009 18:52:28 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1LbJRE-0002Jn-0S
	for myserver-commit@gnu.org; Sun, 22 Feb 2009 18:52:28 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1LbJRE-0002Jn-0S@cvs.savannah.gnu.org>
Date: Sun, 22 Feb 2009 18:52:28 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3009] Fixed compiling problem with older
	versions of gcc.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 22 Feb 2009 18:52:29 -0000

Revision: 3009
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3009
Author:   gscrivano
Date:     2009-02-22 18:52:27 +0000 (Sun, 22 Feb 2009)

Log Message:
-----------
Fixed compiling problem with older versions of gcc.

Modified Paths:
--------------
    trunk/myserver/src/base/process/fork_server.cpp

Modified: trunk/myserver/src/base/process/fork_server.cpp
===================================================================
--- trunk/myserver/src/base/process/fork_server.cpp	2009-02-21 17:25:07 UTC (rev 3008)
+++ trunk/myserver/src/base/process/fork_server.cpp	2009-02-22 18:52:27 UTC (rev 3009)
@@ -214,8 +214,10 @@
   spi.cmd.assign (exec);
   spi.arg.assign (arg);
   spi.cwd.assign (cwd);
-  spi.handlesToClose = (FileHandle[]){serverSock->getFirstHandle (), NULL};
 
+  FileHandle handlesToClose[] = {serverSock->getFirstHandle (), 0};
+  spi.handlesToClose = handlesToClose;
+
   Process pi;
   int pid = pi.exec (&spi, false);
 





From MAILER-DAEMON Sun Feb 22 18:14:14 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LbNWY-0006YG-6a
	for mharc-myserver-commit@gnu.org; Sun, 22 Feb 2009 18:14:14 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LbNWW-0006W1-AX
	for myserver-commit@gnu.org; Sun, 22 Feb 2009 18:14:12 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LbNWT-0006SR-Dq
	for myserver-commit@gnu.org; Sun, 22 Feb 2009 18:14:11 -0500
Received: from [199.232.76.173] (port=44746 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LbNWT-0006SO-AX
	for myserver-commit@gnu.org; Sun, 22 Feb 2009 18:14:09 -0500
Received: from savannah.gnu.org ([199.232.41.3]:34560 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LbNWT-0005wo-0D
	for myserver-commit@gnu.org; Sun, 22 Feb 2009 18:14:09 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LbNWS-0005UX-J5
	for myserver-commit@gnu.org; Sun, 22 Feb 2009 23:14:08 +0000
Received: from dperrone by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <dperrone@savannah.gnu.org>) id 1LbNWS-0005US-6M
	for myserver-commit@gnu.org; Sun, 22 Feb 2009 23:14:08 +0000
MIME-Version: 1.0
Errors-To: dperrone
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Daniele Perrone <dperrone@it.gnu.org>
Message-Id: <E1LbNWS-0005US-6M@cvs.savannah.gnu.org>
Date: Sun, 22 Feb 2009 23:14:08 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3010] myserver-get: refactoring and search
	command added.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 22 Feb 2009 23:14:12 -0000

Revision: 3010
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3010
Author:   dperrone
Date:     2009-02-22 23:14:07 +0000 (Sun, 22 Feb 2009)

Log Message:
-----------
myserver-get: refactoring and search command added.

Modified Paths:
--------------
    trunk/misc/myserver-get/myserver-get.py
    trunk/misc/myserver-get/myserverGetLib/config.py
    trunk/misc/myserver-get/myserverGetLib/general.py
    trunk/misc/myserver-get/myserverGetLib/local.py
    trunk/misc/myserver-get/myserverGetLib/remoteSvn.py

Added Paths:
-----------
    trunk/misc/myserver-get/myserverGetLib/console.py

Modified: trunk/misc/myserver-get/myserver-get.py
===================================================================
--- trunk/misc/myserver-get/myserver-get.py	2009-02-22 18:52:27 UTC (rev 3009)
+++ trunk/misc/myserver-get/myserver-get.py	2009-02-22 23:14:07 UTC (rev 3010)
@@ -1,34 +1,38 @@
 from myserverGetLib.general import MyServerGet
 import sys
 import getopt
+import myserverGetLib.config
 
+
 def usage(arg):
     print "usage: myserver-get update "    
         
 def main(argv):
-    myserverGet = MyServerGet()
-    argument = "" 
+    myserverGet = MyServerGet() 
     command = ""                        
     
-    commands = {"":usage, "update":myserverGet.update}
+    commands = {"":usage, "update":myserverGet.update, "search":myserverGet.search}
         
     try:                                
-        opts, args = getopt.getopt(argv, "h", ["help"]) 
+        opts, args = getopt.getopt(argv, "hv", ["help","verbose"]) 
     except getopt.GetoptError:           
         usage()                          
         sys.exit(2)
     for opt, arg in opts:                
         if opt in ("-h", "--help"):      
             usage("")                     
-            sys.exit()                  
+            sys.exit()
+        elif opt in ("-v", "--verbose"):      
+            myserverGetLib.config.VERBOSE = True   
     
+    arguments = []
     for arg in args:
-        if arg in ("update"):
+        if arg in ("update","search"):
             command = arg
         else:
-            argument = arg
+            arguments.append(arg)
     
-    commands[command](argument)
+    commands[command](arguments)
 
 if __name__ == "__main__":
     main(sys.argv[1:])
\ No newline at end of file

Modified: trunk/misc/myserver-get/myserverGetLib/config.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/config.py	2009-02-22 18:52:27 UTC (rev 3009)
+++ trunk/misc/myserver-get/myserverGetLib/config.py	2009-02-22 23:14:07 UTC (rev 3010)
@@ -9,8 +9,8 @@
 
 PLUGIN_LIST_SUFFIX = "-plugin-list.xml"
 
+VERBOSE = False
 
-
 class ConfigLoader:
     def __init__(self, configFile):
         self.__configFile = configFile
\ No newline at end of file

Added: trunk/misc/myserver-get/myserverGetLib/console.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/console.py	                        (rev 0)
+++ trunk/misc/myserver-get/myserverGetLib/console.py	2009-02-22 23:14:07 UTC (rev 3010)
@@ -0,0 +1,8 @@
+import sys
+
+def write(arg):
+    sys.stdout.write(arg)
+    sys.stdout.flush()
+    
+def writeln(arg):
+    write(arg + "\n")
\ No newline at end of file

Modified: trunk/misc/myserver-get/myserverGetLib/general.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/general.py	2009-02-22 18:52:27 UTC (rev 3009)
+++ trunk/misc/myserver-get/myserverGetLib/general.py	2009-02-22 23:14:07 UTC (rev 3010)
@@ -3,6 +3,7 @@
 import config
 import remote
 import remoteSvn
+import console
 
 class MyServerGet:
     def __init__(self, repositoryFile = config.REP_LIST_FILE, listDir = config.PLUGIN_LIST_FILES_DIR):
@@ -11,6 +12,7 @@
         self.__repManager = remote.RepositoryManager()
         self.__repManager.addSupportedRepository("svn",remoteSvn.RepositorySvn)
         self.__list = []
+        self.loadRepositoryList()
     
     def loadRepositoryList(self):
         list = xml.dom.minidom.parse(self.__rep)
@@ -18,8 +20,28 @@
         self.__list = [local.ListManager(repXml.firstChild.data,self.__listDir) for repXml in repXmlList]
         
     def update(self, arg):
-        self.loadRepositoryList()
         for list in self.__list:
             rep = self.__repManager.getRepository(list.repository)
             rep = rep(list.repository)
-            rep.synchronizeListWithRepository(list)
\ No newline at end of file
+            rep.synchronizeListWithRepository(list)
+    
+  
+    def __search(self,arg):
+        import string
+        results = []
+        for list in self.__list:
+            plugins = list.getPluginsList()
+            for plugin in plugins:
+                if string.find(plugin["name"][0]["value"],arg)!=-1:
+                    results.append(plugin)
+        return results
+        
+    def search(self,arg):
+        arg = " ".join(arg)     
+        if config.VERBOSE:
+            results = ["- " + plugin["name"][0]["value"] + " (compatible with GNU MyServer version ["+plugin.getMyServerMinVersion() + "," + plugin.getMyServerMinVersion() + "])\n    " + plugin["description"][0]["value"] + "\n    Dependences: " + " ".join(dep["value"] + "[" + dep["min-version"] + "," + dep["max-version"] + "]"  for dep in plugin["depends"]) for plugin in self.__search(arg)]
+        else: 
+            results = [plugin["name"][0]["value"] + " - " + plugin["description"][0]["value"] for plugin in self.__search(arg)]
+        console.writeln("\n".join(results))
+
+            
\ No newline at end of file

Modified: trunk/misc/myserver-get/myserverGetLib/local.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/local.py	2009-02-22 18:52:27 UTC (rev 3009)
+++ trunk/misc/myserver-get/myserverGetLib/local.py	2009-02-22 23:14:07 UTC (rev 3010)
@@ -1,6 +1,7 @@
 import xml.dom.minidom
 import error
 import config
+import string
 
 class PluginInfoElement:
     def __init__(self,name,element, document):
@@ -9,13 +10,15 @@
         self.document = document
     
     def __getitem__(self, key):
+        key = string.lower(key)
         if key == "value":
-            return self.__element.firstChild.data
+            return string.replace(self.element.firstChild.data,'\n','')
         att = self.element.attributes[key]
         if att!=None:
             return att.value
     
     def __setitem__(self, key, item):
+        key = string.lower(key)
         if key == "value":
             self.document.createTextNode(item)
             oldChild = self.__element.firstChild
@@ -29,11 +32,13 @@
         self.__manager = manager
     
     def __getitem__(self, key):
+        key = string.upper(key)
         elementList = self.__xmlElement.getElementsByTagName(key)
         
-        return [PluginInfoElement(key,element.childNodes[0].data, element, self.__manager) for element in elementList]
+        return [PluginInfoElement(key, element, self.__manager) for element in elementList]
 
     def __setitem__(self, key, item):
+        key = string.upper(key)
         elementList = self.__xmlElement.getElementsByTagName(key) 
         for element in elementList:
             self.__xmlElement.removeChild(element)
@@ -43,10 +48,10 @@
             element.document = self.__manager.listDOM
     
     def getMyServerMinVersion(self):
-        return self.__mxlElement.getAttribute("min-version")
+        return self.__xmlElement.getAttribute("min-version")
     
     def getMyServerMaxVersion(self):
-        return self.__mxlElement.getAttribute("max-version")
+        return self.__xmlElement.getAttribute("max-version")
     
     def finalize(self):
         self.__manager.synchronizeListWithFileSystem()
@@ -130,7 +135,7 @@
         
         return [PluginInfo(plugin,self) for plugin in plugins]
     
-    
+
     def getRevision(self):
         pluginsList = self.listDOM.getElementsByTagName("PLUGINS")
         plugins = pluginsList[0]

Modified: trunk/misc/myserver-get/myserverGetLib/remoteSvn.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/remoteSvn.py	2009-02-22 18:52:27 UTC (rev 3009)
+++ trunk/misc/myserver-get/myserverGetLib/remoteSvn.py	2009-02-22 23:14:07 UTC (rev 3010)
@@ -3,7 +3,7 @@
 import error
 import xml.dom.minidom
 from remote import Repository
-import sys
+import console
 
 class RepositorySvn(Repository):
     def __init__ (self,url):
@@ -17,34 +17,27 @@
         return plugins[1:]
     
     def synchronizeListWithRepository(self, list):
-        sys.stdout.write("update: "+ list.repository + '\n')
-        sys.stdout.write("loading ")
-        sys.stdout.flush()
+        console.write("update: "+ list.repository + '\n')
+        console.write("loading ")
         localRevision = int(list.getRevision())
         info = self.client.info2(self.url, recurse=False)
-        sys.stdout.write(". ")
-        sys.stdout.flush()
+        console.write(". ")
         remoteRevision = int(info[0][1]["rev"].number)
         if localRevision == remoteRevision:
-            sys.stdout.write("local list already updated.\n")
-            sys.stdout.flush()
+            console.write("local list already updated.\n")
         if localRevision > remoteRevision:
             raise error.FatalError("Local plugins list corrupted!!")
         
         if localRevision < remoteRevision:
             list.resetToEmptyListFile(`remoteRevision`)
-            sys.stdout.write(". ")
-            sys.stdout.flush()
+            console.write(". ")
             plugins = self.__getPluginsList()
-            sys.stdout.write(". ")
-            sys.stdout.flush()
+            console.write(". ")
             for plugin in plugins:
                 url = self.url + "/src/" + plugin + "/plugin.xml"
                 pluginXml =  xml.dom.minidom.parseString(self.client.cat(url))
-                sys.stdout.write(". ")
-                sys.stdout.flush()
+                console.write(". ")
                 element = pluginXml.getElementsByTagName("PLUGIN")
                 pluginInfo = list.addPluginWithXml(element[0])
             list.synchronizeListWithFileSystem()
-            sys.stdout.write("DONE.\n")
-            sys.stdout.flush()
+            console.write("DONE.\n")





From MAILER-DAEMON Mon Feb 23 17:53:47 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LbjgI-0006mK-QZ
	for mharc-myserver-commit@gnu.org; Mon, 23 Feb 2009 17:53:46 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LbjgH-0006kl-Ap
	for myserver-commit@gnu.org; Mon, 23 Feb 2009 17:53:45 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LbjgG-0006kC-Nx
	for myserver-commit@gnu.org; Mon, 23 Feb 2009 17:53:44 -0500
Received: from [199.232.76.173] (port=52718 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LbjgG-0006jx-K1
	for myserver-commit@gnu.org; Mon, 23 Feb 2009 17:53:44 -0500
Received: from savannah.gnu.org ([199.232.41.3]:57097 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LbjgG-0005eB-7N
	for myserver-commit@gnu.org; Mon, 23 Feb 2009 17:53:44 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LbjgF-00045C-M8
	for myserver-commit@gnu.org; Mon, 23 Feb 2009 22:53:43 +0000
Received: from dperrone by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <dperrone@savannah.gnu.org>) id 1LbjgF-000458-FI
	for myserver-commit@gnu.org; Mon, 23 Feb 2009 22:53:43 +0000
MIME-Version: 1.0
Errors-To: dperrone
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Daniele Perrone <dperrone@it.gnu.org>
Message-Id: <E1LbjgF-000458-FI@cvs.savannah.gnu.org>
Date: Mon, 23 Feb 2009 22:53:43 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3011] some plugin packages compiled on a 64bit
 architecture with GNU/ linux os.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 23 Feb 2009 22:53:45 -0000

Revision: 3011
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3011
Author:   dperrone
Date:     2009-02-23 22:53:42 +0000 (Mon, 23 Feb 2009)

Log Message:
-----------
some plugin packages compiled on a 64bit architecture with GNU/linux os.

Added Paths:
-----------
    trunk/plugins/pub/http_checker-0.1-linux64.tar.gz
    trunk/plugins/pub/python-0.1-linux64.tar.gz
    trunk/plugins/pub/python_http_handler-0.1-linux64.tar.gz
    trunk/plugins/pub/rules_checker-0.1-linux64.tar.gz

Added: trunk/plugins/pub/http_checker-0.1-linux64.tar.gz
===================================================================
(Binary files differ)


Property changes on: trunk/plugins/pub/http_checker-0.1-linux64.tar.gz
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: trunk/plugins/pub/python-0.1-linux64.tar.gz
===================================================================
(Binary files differ)


Property changes on: trunk/plugins/pub/python-0.1-linux64.tar.gz
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: trunk/plugins/pub/python_http_handler-0.1-linux64.tar.gz
===================================================================
(Binary files differ)


Property changes on: trunk/plugins/pub/python_http_handler-0.1-linux64.tar.gz
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream

Added: trunk/plugins/pub/rules_checker-0.1-linux64.tar.gz
===================================================================
(Binary files differ)


Property changes on: trunk/plugins/pub/rules_checker-0.1-linux64.tar.gz
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:mime-type
   + application/octet-stream





From MAILER-DAEMON Tue Feb 24 12:56:08 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Lc1Vo-00017D-RY
	for mharc-myserver-commit@gnu.org; Tue, 24 Feb 2009 12:56:08 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Lc1Vn-00016y-0s
	for myserver-commit@gnu.org; Tue, 24 Feb 2009 12:56:07 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1Lc1Vm-00016l-8n
	for myserver-commit@gnu.org; Tue, 24 Feb 2009 12:56:06 -0500
Received: from [199.232.76.173] (port=48468 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Lc1Vm-00016i-2r
	for myserver-commit@gnu.org; Tue, 24 Feb 2009 12:56:06 -0500
Received: from savannah.gnu.org ([199.232.41.3]:40570 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1Lc1Vl-0007Un-EQ
	for myserver-commit@gnu.org; Tue, 24 Feb 2009 12:56:05 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Lc1Vk-0001Hz-MY
	for myserver-commit@gnu.org; Tue, 24 Feb 2009 17:56:04 +0000
Received: from dperrone by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <dperrone@savannah.gnu.org>) id 1Lc1Vk-0001Hv-Dg
	for myserver-commit@gnu.org; Tue, 24 Feb 2009 17:56:04 +0000
MIME-Version: 1.0
Errors-To: dperrone
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Daniele Perrone <dperrone@it.gnu.org>
Message-Id: <E1Lc1Vk-0001Hv-Dg@cvs.savannah.gnu.org>
Date: Tue, 24 Feb 2009 17:56:04 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3012] myserver-get: added http and ftp protocols
	support.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 24 Feb 2009 17:56:07 -0000

Revision: 3012
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3012
Author:   dperrone
Date:     2009-02-24 17:56:03 +0000 (Tue, 24 Feb 2009)

Log Message:
-----------
myserver-get: added http and ftp protocols support. Removed binary files from svn.

Modified Paths:
--------------
    trunk/misc/myserver-get/myserverGetLib/general.py
    trunk/misc/myserver-get/myserverGetLib/remote.py
    trunk/misc/myserver-get/repositories.xml

Added Paths:
-----------
    trunk/misc/myserver-get/list.xml-example
    trunk/misc/myserver-get/myserverGetLib/remoteGenericUrl.py

Removed Paths:
-------------
    trunk/plugins/pub/http_checker-0.1-linux64.tar.gz
    trunk/plugins/pub/python-0.1-linux64.tar.gz
    trunk/plugins/pub/python_http_handler-0.1-linux64.tar.gz
    trunk/plugins/pub/rules_checker-0.1-linux64.tar.gz

Added: trunk/misc/myserver-get/list.xml-example
===================================================================
--- trunk/misc/myserver-get/list.xml-example	                        (rev 0)
+++ trunk/misc/myserver-get/list.xml-example	2009-02-24 17:56:03 UTC (rev 3012)
@@ -0,0 +1,8 @@
+<!--TO PUT INTO REPOSITORY ROOT -->
+<PLUGINS revision="1">
+    <PLUGIN>php</PLUGIN>
+    <PLUGIN>python_http_handler</PLUGIN>
+    <PLUGIN>rules_checker</PLUGIN>
+    <PLUGIN>python</PLUGIN>
+    <PLUGIN>http_checker</PLUGIN>
+</PLUGINS>

Modified: trunk/misc/myserver-get/myserverGetLib/general.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/general.py	2009-02-23 22:53:42 UTC (rev 3011)
+++ trunk/misc/myserver-get/myserverGetLib/general.py	2009-02-24 17:56:03 UTC (rev 3012)
@@ -3,6 +3,7 @@
 import config
 import remote
 import remoteSvn
+import remoteGenericUrl
 import console
 
 class MyServerGet:
@@ -11,6 +12,8 @@
         self.__listDir = listDir
         self.__repManager = remote.RepositoryManager()
         self.__repManager.addSupportedRepository("svn",remoteSvn.RepositorySvn)
+        self.__repManager.addSupportedRepository("http",remoteGenericUrl.RepositoryGenericUrl)
+        self.__repManager.addSupportedRepository("ftp",remoteGenericUrl.RepositoryGenericUrl)
         self.__list = []
         self.loadRepositoryList()
     

Modified: trunk/misc/myserver-get/myserverGetLib/remote.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/remote.py	2009-02-23 22:53:42 UTC (rev 3011)
+++ trunk/misc/myserver-get/myserverGetLib/remote.py	2009-02-24 17:56:03 UTC (rev 3012)
@@ -19,8 +19,12 @@
     
     def getRepository(self, url):
         url = string.lower(url)
-        if string.find(url,"svn")!=-1:
+        if string.find(url,"svn")==0:
             return self.__reps["svn"]
+        elif string.find(url,"http")==0:
+            return self.__reps["http"]
+        elif string.find(url,"ftp")==0:
+            return self.__reps["ftp"]
         return None
             
 if __name__ == "__main__":

Added: trunk/misc/myserver-get/myserverGetLib/remoteGenericUrl.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/remoteGenericUrl.py	                        (rev 0)
+++ trunk/misc/myserver-get/myserverGetLib/remoteGenericUrl.py	2009-02-24 17:56:03 UTC (rev 3012)
@@ -0,0 +1,48 @@
+import local
+import error
+import xml.dom.minidom
+from remote import Repository
+import console
+import urllib
+
+class RepositoryGenericUrl(Repository):
+    def __init__ (self,url):
+        Repository.__init__(self,url)
+        self.__pluginsXml = None
+
+    def __getPluginsList(self):
+        plugins = urllib.urlopen(self.url + "/list.xml")
+        self.__pluginsXml = xml.dom.minidom.parse(plugins)
+        
+    
+    def synchronizeListWithRepository(self, list):
+        console.write("update: "+ list.repository + '\n')
+        console.write("loading ")
+        localRevision = int(list.getRevision())
+        if self.__pluginsXml == None:
+            self.__getPluginsList()
+        pluginsElement = self.__pluginsXml.getElementsByTagName("PLUGINS")
+        remoteRevision = int(pluginsElement[0].getAttribute("revision"))
+        console.write(". ")
+        if localRevision == remoteRevision:
+            console.write("local list already updated.\n")
+        if localRevision > remoteRevision:
+            raise error.FatalError("Local plugins list corrupted!!")
+        
+        if localRevision < remoteRevision:
+            list.resetToEmptyListFile(`remoteRevision`)
+            console.write(". ")
+            
+            pluginElements = self.__pluginsXml.getElementsByTagName("PLUGIN")
+            plugins = [plugin.firstChild.data for plugin in pluginElements]
+
+            console.write(". ")
+            for plugin in plugins:
+                url = self.url + "/src/" + plugin + "/plugin.xml"
+                pluginXml =  xml.dom.minidom.parse(urllib.urlopen(url))
+                console.write(". ")
+                element = pluginXml.getElementsByTagName("PLUGIN")
+                pluginInfo = list.addPluginWithXml(element[0])
+            list.synchronizeListWithFileSystem()
+            console.write("DONE.\n")
+


Property changes on: trunk/misc/myserver-get/myserverGetLib/remoteGenericUrl.py
___________________________________________________________________
Added: svn:mergeinfo
   + 

Modified: trunk/misc/myserver-get/repositories.xml
===================================================================
--- trunk/misc/myserver-get/repositories.xml	2009-02-23 22:53:42 UTC (rev 3011)
+++ trunk/misc/myserver-get/repositories.xml	2009-02-24 17:56:03 UTC (rev 3012)
@@ -1,3 +1,3 @@
 <REPOSITORIES>
-   <REPOSITORY>svn://svn.savannah.gnu.org/myserver/trunk/plugins</REPOSITORY>
+   <REPOSITORY>http://localhost/plugins</REPOSITORY>
 </REPOSITORIES>
\ No newline at end of file

Deleted: trunk/plugins/pub/http_checker-0.1-linux64.tar.gz
===================================================================
(Binary files differ)

Deleted: trunk/plugins/pub/python-0.1-linux64.tar.gz
===================================================================
(Binary files differ)

Deleted: trunk/plugins/pub/python_http_handler-0.1-linux64.tar.gz
===================================================================
(Binary files differ)

Deleted: trunk/plugins/pub/rules_checker-0.1-linux64.tar.gz
===================================================================
(Binary files differ)





From MAILER-DAEMON Tue Feb 24 16:43:39 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Lc53z-0005Zh-33
	for mharc-myserver-commit@gnu.org; Tue, 24 Feb 2009 16:43:39 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Lc53w-0005X0-0z
	for myserver-commit@gnu.org; Tue, 24 Feb 2009 16:43:36 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1Lc53u-0005VP-3n
	for myserver-commit@gnu.org; Tue, 24 Feb 2009 16:43:35 -0500
Received: from [199.232.76.173] (port=52902 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Lc53t-0005V5-0h
	for myserver-commit@gnu.org; Tue, 24 Feb 2009 16:43:33 -0500
Received: from savannah.gnu.org ([199.232.41.3]:56875 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1Lc53s-0000KD-6X
	for myserver-commit@gnu.org; Tue, 24 Feb 2009 16:43:32 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Lc53r-0007kY-Lm
	for myserver-commit@gnu.org; Tue, 24 Feb 2009 21:43:31 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1Lc53r-0007kU-9H
	for myserver-commit@gnu.org; Tue, 24 Feb 2009 21:43:31 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1Lc53r-0007kU-9H@cvs.savannah.gnu.org>
Date: Tue, 24 Feb 2009 21:43:31 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3013] Removed duplicated files and cleaned
	standard files.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 24 Feb 2009 21:43:36 -0000

Revision: 3013
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3013
Author:   gscrivano
Date:     2009-02-24 21:43:30 +0000 (Tue, 24 Feb 2009)

Log Message:
-----------
Removed duplicated files and cleaned standard files.

Modified Paths:
--------------
    trunk/myserver/AUTHORS
    trunk/myserver/NEWS
    trunk/myserver/README
    trunk/myserver/binaries/NSIS installer script.nsi
    trunk/myserver/binaries/clean_copy.sh

Removed Paths:
-------------
    trunk/myserver/binaries/license.txt
    trunk/myserver/binaries/readme.txt

Modified: trunk/myserver/AUTHORS
===================================================================
--- trunk/myserver/AUTHORS	2009-02-24 17:56:03 UTC (rev 3012)
+++ trunk/myserver/AUTHORS	2009-02-24 21:43:30 UTC (rev 3013)
@@ -3,9 +3,10 @@
 People who contributed with code or documentation:
 ==================================================
 Renato Nunes Bastos <rnbastos@yahoo.com>
-Debarshi Ray <rishi@gnu.org>
 Georgy Berdyshev <codingmaster@gmail.com>
 Russ Bohnhoff <rustypaint@gmail.com>
 Alexandru Iancu <alexandru.iancu@gmail.com>
+Daniele Perrone <dperrone@it.gnu.org>
+Francesco Pipita <francesco.pipita@gmail.com>
+Debarshi Ray <rishi@gnu.org>
 Giuseppe Scrivano <gscrivano@gnu.org>
-Francesco Pipita <francesco.pipita@gmail.com>

Modified: trunk/myserver/NEWS
===================================================================
--- trunk/myserver/NEWS	2009-02-24 17:56:03 UTC (rev 3012)
+++ trunk/myserver/NEWS	2009-02-24 21:43:30 UTC (rev 3013)
@@ -1 +1,3 @@
-Use the http://savannah.gnu.org/news/atom.php?group=myserver RSS feed aggregator.
+Official news are aggregated at:
+
+http://savannah.gnu.org/news/atom.php?group=myserver

Modified: trunk/myserver/README
===================================================================
--- trunk/myserver/README	2009-02-24 17:56:03 UTC (rev 3012)
+++ trunk/myserver/README	2009-02-24 21:43:30 UTC (rev 3013)
@@ -1 +1,28 @@
-See the file readme.txt in the binaries directory.
+                          GNU MyServer
+
+MyServer is a powerful and easy to configure web server. Its multi-threaded
+architecture makes it extremely scalable and usable in large scale sites as
+well as in small networks, it has a lot of built-in features. Share your files
+in minutes!
+
+MyServer is an official GNU Project.  If you don't know about GNU take
+a look here: www.gnu.org.
+
+MyServer is Free Software and it is licensed under the GNU General Public
+License (GPL) terms.  See the license file for additional info.
+
+Our principal goal is to create a free and simple server to allow everyone to
+transform his home PC in a server and be your own webmaster with few clicks and
+share information easily with all the world!
+
+MyServer has a lot of common as well as unique features, it is under continuous
+development and new features will be made available in future releases.
+
+For more information, please visit:
+http://www.gnu.org/software/myserver/
+
+If you are a developer, MyServer needs your help, contact the project
+administrator if you are interested to work on this project, look at the TODO
+file for an indicative list of features to implement.
+
+We hope that you find this software useful.

Modified: trunk/myserver/binaries/NSIS installer script.nsi
===================================================================
--- trunk/myserver/binaries/NSIS installer script.nsi	2009-02-24 17:56:03 UTC (rev 3012)
+++ trunk/myserver/binaries/NSIS installer script.nsi	2009-02-24 21:43:30 UTC (rev 3013)
@@ -195,8 +195,8 @@
   File "MIMEtypes.xml.default"
   File "myserver.xml.default"
   File "virtualhosts.xml.default"
-  File "readme.txt"
-  File "license.txt"
+  File "../README"
+  File "../COPYING"
   CreateDirectory "$INSTDIR\logs"
   SetOutPath $INSTDIR\web
   File "web\*.html"
@@ -258,7 +258,7 @@
 
 Section "Documentation" SecDocumentation
   SetOutPath "$INSTDIR\web\documentation"
-  File "..\documentation\myserver\*.html"
+  File "..\documentation\myserver.html\*"
 SectionEnd
 
 Section "Install other languages" SecLanguages

Modified: trunk/myserver/binaries/clean_copy.sh
===================================================================
--- trunk/myserver/binaries/clean_copy.sh	2009-02-24 17:56:03 UTC (rev 3012)
+++ trunk/myserver/binaries/clean_copy.sh	2009-02-24 21:43:30 UTC (rev 3013)
@@ -7,58 +7,57 @@
 fi
 
 mkdir $1
-cp myserver $1
-cp myserver-daemon $1
-cp *.default $1
-cp readme.txt $1
-cp ../COPYING $1
-cp ../INSTALL $1
-cp ../NEWS $1
-cp ../README $1
-cp ../TODO $1
+cp -v myserver $1
+cp -v myserver-daemon $1
+cp -v *.default $1
+cp -v ../COPYING $1
+cp -v ../INSTALL $1
+cp -v ../NEWS $1
+cp -v ../README $1
+cp -v ../TODO $1
 
 mkdir $1/web
-cp web/*.html $1/web
-cp web/*.png $1/web
+cp -v web/*.html $1/web
+cp -v web/*.png $1/web
 
 mkdir $1/certificates
-cp certificates/*.txt $1/certificates
+cp -v certificates/*.txt $1/certificates
 
 mkdir $1/system
-cp system/security $1/system
+cp -v system/security $1/system
 
 mkdir $1/system/css
-cp system/css/*.css $1/system
+cp -v system/css/*.css $1/system
 
 mkdir $1/system/errors
-cp system/errors/*.html $1/system/errors
+cp -v system/errors/*.html $1/system/errors
 
 mkdir $1/system/icons
 
 mkdir $1/system/icons/codes
-cp system/icons/codes/*.png $1/system/icons/codes
+cp -v system/icons/codes/*.png $1/system/icons/codes
 
 mkdir $1/languages
-cp languages/*.xml $1/languages
+cp -v languages/*.xml $1/languages
 
 mkdir $1/languages/configure
-cp languages/configure/*.xml $1/languages/configure
+cp -v languages/configure/*.xml $1/languages/configure
 
 mkdir $1/web/cgi-bin
-cp web/cgi-bin/*.html $1/web/cgi-bin
-cp web/cgi-bin/*.readme $1/web/cgi-bin
-cp web/cgi-bin/*.mscgi $1/web/cgi-bin
+cp -v web/cgi-bin/*.html $1/web/cgi-bin
+cp -v web/cgi-bin/*.readme $1/web/cgi-bin
+cp -v web/cgi-bin/*.mscgi $1/web/cgi-bin
 
 mkdir $1/logs
 touch $1/logs/.keep_me
 
 mkdir $1/web/downloads
-cp web/downloads/*.txt $1/web/downloads
-cp web/downloads/*.php $1/web/downloads
-cp web/downloads/*.sh $1/web/downloads
+cp -v web/downloads/*.txt $1/web/downloads
+cp -v web/downloads/*.php $1/web/downloads
+cp -v web/downloads/*.sh $1/web/downloads
 
 mkdir $1/web/documentation
-cp ../documentation/myserver/*.html $1/web/documentation/
+cp -v ../documentation/myserver.html/* $1/web/documentation/
 
 if [  $# = 2 ]; then
     tar --create --bzip2 --file=$2.tar.bz2 $1

Deleted: trunk/myserver/binaries/license.txt
===================================================================
--- trunk/myserver/binaries/license.txt	2009-02-24 17:56:03 UTC (rev 3012)
+++ trunk/myserver/binaries/license.txt	2009-02-24 21:43:30 UTC (rev 3013)
@@ -1,678 +0,0 @@
-MyServer is released under the terms of the GNU General Public License (GPL)
-with the additional exception that compiling, linking and using OpenSSL is
-allowed.
-
-		    GNU GENERAL PUBLIC LICENSE
-		       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-			    Preamble
-
-  The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
-  The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works.  By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.  We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors.  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
-  To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights.  Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received.  You must make sure that they, too, receive
-or can get the source code.  And you must show them these terms so they
-know their rights.
-
-  Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
-  For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-  Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable.  Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products.  If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
-  Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary.  To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-		       TERMS AND CONDITIONS
-
-  0. Definitions.
-
-  "This License" refers to version 3 of the GNU General Public License.
-
-  "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
- 
-  "The Program" refers to any copyrightable work licensed under this
-License.  Each licensee is addressed as "you".  "Licensees" and
-"recipients" may be individuals or organizations.
-
-  To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy.  The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
-  A "covered work" means either the unmodified Program or a work based
-on the Program.
-
-  To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy.  Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-  To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies.  Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-  An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License.  If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-  1. Source Code.
-
-  The "source code" for a work means the preferred form of the work
-for making modifications to it.  "Object code" means any non-source
-form of a work.
-
-  A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
-  The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form.  A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
-  The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities.  However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work.  For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
-  The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
-  The Corresponding Source for a work in source code form is that
-same work.
-
-  2. Basic Permissions.
-
-  All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met.  This License explicitly affirms your unlimited
-permission to run the unmodified Program.  The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work.  This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-  You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force.  You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright.  Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
-  Conveying under any other circumstances is permitted solely under
-the conditions stated below.  Sublicensing is not allowed; section 10
-makes it unnecessary.
-
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
-  No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
-  When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-  4. Conveying Verbatim Copies.
-
-  You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
-  You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
-  5. Conveying Modified Source Versions.
-
-  You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
-    a) The work must carry prominent notices stating that you modified
-    it, and giving a relevant date.
-
-    b) The work must carry prominent notices stating that it is
-    released under this License and any conditions added under section
-    7.  This requirement modifies the requirement in section 4 to
-    "keep intact all notices".
-
-    c) You must license the entire work, as a whole, under this
-    License to anyone who comes into possession of a copy.  This
-    License will therefore apply, along with any applicable section 7
-    additional terms, to the whole of the work, and all its parts,
-    regardless of how they are packaged.  This License gives no
-    permission to license the work in any other way, but it does not
-    invalidate such permission if you have separately received it.
-
-    d) If the work has interactive user interfaces, each must display
-    Appropriate Legal Notices; however, if the Program has interactive
-    interfaces that do not display Appropriate Legal Notices, your
-    work need not make them do so.
-
-  A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit.  Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
-  6. Conveying Non-Source Forms.
-
-  You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
-    a) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by the
-    Corresponding Source fixed on a durable physical medium
-    customarily used for software interchange.
-
-    b) Convey the object code in, or embodied in, a physical product
-    (including a physical distribution medium), accompanied by a
-    written offer, valid for at least three years and valid for as
-    long as you offer spare parts or customer support for that product
-    model, to give anyone who possesses the object code either (1) a
-    copy of the Corresponding Source for all the software in the
-    product that is covered by this License, on a durable physical
-    medium customarily used for software interchange, for a price no
-    more than your reasonable cost of physically performing this
-    conveying of source, or (2) access to copy the
-    Corresponding Source from a network server at no charge.
-
-    c) Convey individual copies of the object code with a copy of the
-    written offer to provide the Corresponding Source.  This
-    alternative is allowed only occasionally and noncommercially, and
-    only if you received the object code with such an offer, in accord
-    with subsection 6b.
-
-    d) Convey the object code by offering access from a designated
-    place (gratis or for a charge), and offer equivalent access to the
-    Corresponding Source in the same way through the same place at no
-    further charge.  You need not require recipients to copy the
-    Corresponding Source along with the object code.  If the place to
-    copy the object code is a network server, the Corresponding Source
-    may be on a different server (operated by you or a third party)
-    that supports equivalent copying facilities, provided you maintain
-    clear directions next to the object code saying where to find the
-    Corresponding Source.  Regardless of what server hosts the
-    Corresponding Source, you remain obligated to ensure that it is
-    available for as long as needed to satisfy these requirements.
-
-    e) Convey the object code using peer-to-peer transmission, provided
-    you inform other peers where the object code and Corresponding
-    Source of the work are being offered to the general public at no
-    charge under subsection 6d.
-
-  A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
-  A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling.  In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage.  For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product.  A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-  "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source.  The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
-  If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information.  But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
-  The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed.  Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-  Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
-  7. Additional Terms.
-
-  "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law.  If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
-  When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it.  (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.)  You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
-  Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
-    a) Disclaiming warranty or limiting liability differently from the
-    terms of sections 15 and 16 of this License; or
-
-    b) Requiring preservation of specified reasonable legal notices or
-    author attributions in that material or in the Appropriate Legal
-    Notices displayed by works containing it; or
-
-    c) Prohibiting misrepresentation of the origin of that material, or
-    requiring that modified versions of such material be marked in
-    reasonable ways as different from the original version; or
-
-    d) Limiting the use for publicity purposes of names of licensors or
-    authors of the material; or
-
-    e) Declining to grant rights under trademark law for use of some
-    trade names, trademarks, or service marks; or
-
-    f) Requiring indemnification of licensors and authors of that
-    material by anyone who conveys the material (or modified versions of
-    it) with contractual assumptions of liability to the recipient, for
-    any liability that these contractual assumptions directly impose on
-    those licensors and authors.
-
-  All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10.  If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term.  If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
-  If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
-  Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
-  8. Termination.
-
-  You may not propagate or modify a covered work except as expressly
-provided under this License.  Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-  However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
-  Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-  Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License.  If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-  9. Acceptance Not Required for Having Copies.
-
-  You are not required to accept this License in order to receive or
-run a copy of the Program.  Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance.  However,
-nothing other than this License grants you permission to propagate or
-modify any covered work.  These actions infringe copyright if you do
-not accept this License.  Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
-  10. Automatic Licensing of Downstream Recipients.
-
-  Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License.  You are not responsible
-for enforcing compliance by third parties with this License.
-
-  An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations.  If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
-  You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License.  For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
-  11. Patents.
-
-  A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based.  The
-work thus licensed is called the contributor's "contributor version".
-
-  A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version.  For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
-  Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-  In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement).  To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-  If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients.  "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-  
-  If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
-  A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License.  You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
-  Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
-  12. No Surrender of Others' Freedom.
-
-  If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all.  For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
-  13. Use with the GNU Affero General Public License.
-
-  Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work.  The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
-  14. Revised Versions of this License.
-
-  The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-  Each version is given a distinguishing version number.  If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation.  If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
-  If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
-  Later license versions may give you additional or different
-permissions.  However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
-  15. Disclaimer of Warranty.
-
-  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. Limitation of Liability.
-
-  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
-  17. Interpretation of Sections 15 and 16.
-
-  If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
-		     END OF TERMS AND CONDITIONS
-
-	    How to Apply These Terms to Your New Programs
-
-  If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    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/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-  If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
-  You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
-  The GNU General Public License does not permit incorporating your program
-into proprietary programs.  If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library.  If this is what you want to do, use the GNU Lesser General
-Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
\ No newline at end of file

Deleted: trunk/myserver/binaries/readme.txt
===================================================================
--- trunk/myserver/binaries/readme.txt	2009-02-24 17:56:03 UTC (rev 3012)
+++ trunk/myserver/binaries/readme.txt	2009-02-24 21:43:30 UTC (rev 3013)
@@ -1,28 +0,0 @@
-                          GNU MyServer
-
-MyServer is a powerful and easy to configure web server. Its multi-threaded
-architecture makes it extremely scalable and usable in large scale sites as
-well as in small networks, it has a lot of built-in features. Share your files
-in minutes!
-
-MyServer is an official GNU Project.  If you don't know about GNU take
-a look here: www.gnu.org.
-
-MyServer is Free Software and it is licensed under the GNU General Public
-License (GPL) terms.  See the license file for additional info.
-
-Our principal goal is to create a free and simple server to allow everyone to
-transform his home PC in a server and be your own webmaster with few clicks and
-share information easily with all the world!
-
-MyServer has a lot of common as well as unique features, it is under continuous
-development and new features will be made available in future releases.
-
-For more information, please visit:
-http://www.gnu.org/software/myserver/
-
-If you are a developer, MyServer needs your help, contact the project
-administrator if you are interested to work on this project, look at the TODO
-file for an indicative features list to implement.
-
-We hope that you find this software useful.





From MAILER-DAEMON Wed Feb 25 16:04:00 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LcQvA-000274-LB
	for mharc-myserver-commit@gnu.org; Wed, 25 Feb 2009 16:04:00 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LcQv8-00026c-B1
	for myserver-commit@gnu.org; Wed, 25 Feb 2009 16:03:58 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LcQv7-00026D-Nu
	for myserver-commit@gnu.org; Wed, 25 Feb 2009 16:03:57 -0500
Received: from [199.232.76.173] (port=57395 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LcQv7-000264-It
	for myserver-commit@gnu.org; Wed, 25 Feb 2009 16:03:57 -0500
Received: from savannah.gnu.org ([199.232.41.3]:60344 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LcQv6-00086K-VU
	for myserver-commit@gnu.org; Wed, 25 Feb 2009 16:03:57 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LcQv6-0003nh-Gb
	for myserver-commit@gnu.org; Wed, 25 Feb 2009 21:03:56 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1LcQv6-0003nc-6R
	for myserver-commit@gnu.org; Wed, 25 Feb 2009 21:03:56 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1LcQv6-0003nc-6R@cvs.savannah.gnu.org>
Date: Wed, 25 Feb 2009 21:03:56 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3014] Fixed problems for MSCGI examples.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 25 Feb 2009 21:03:58 -0000

Revision: 3014
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3014
Author:   gscrivano
Date:     2009-02-25 21:03:55 +0000 (Wed, 25 Feb 2009)

Log Message:
-----------
Fixed problems for MSCGI examples.

Modified Paths:
--------------
    trunk/myserver/binaries/web/cgi-src/math_sum/math_sum.cpp
    trunk/myserver/binaries/web/cgi-src/post/post.cpp
    trunk/myserver/src/http_handler/mscgi/mscgi.cpp

Modified: trunk/myserver/binaries/web/cgi-src/math_sum/math_sum.cpp
===================================================================
--- trunk/myserver/binaries/web/cgi-src/math_sum/math_sum.cpp	2009-02-24 21:43:30 UTC (rev 3013)
+++ trunk/myserver/binaries/web/cgi-src/math_sum/math_sum.cpp	2009-02-25 21:03:55 UTC (rev 3014)
@@ -16,8 +16,9 @@
 extern "C" int myserver_main (char *cmd, MsCgiData* data)
 #endif
 {     
-	MscgiManager cm(data);     
-	if(strlen(cmd)==0)     
+	MscgiManager cm(data);
+
+	if(strlen (cmd) == 0)     
 	{  	
 		cm.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\r\n\
 \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\r\n\
@@ -38,7 +39,7 @@
 		char *tmp;
     int validNumbers = 1;
 		int iRes;
-		char res[22]; // a 64-bit number has a maximun of 20 digits and 1 for the sign
+		char res[22]; // a 64-bit number has a maximum of 20 digits and 1 for the sign
 		cm.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\r\n\
 \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\r\n\
 <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\r\n\

Modified: trunk/myserver/binaries/web/cgi-src/post/post.cpp
===================================================================
--- trunk/myserver/binaries/web/cgi-src/post/post.cpp	2009-02-24 21:43:30 UTC (rev 3013)
+++ trunk/myserver/binaries/web/cgi-src/post/post.cpp	2009-02-25 21:03:55 UTC (rev 3014)
@@ -3,13 +3,16 @@
 #ifdef WIN32
 extern "C" int EXPORTABLE myserver_main (char *cmd,MsCgiData* data)
 #else
-extern "C" int myserver_main (char *cmd,MsCgiData* data)
+  extern "C" int myserver_main (char *cmd,MsCgiData* data)
 #endif
 {
   MscgiManager cm(data);
-	if(strlen(cmd)==0)	
-	{	
-		cm.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\r\n\
+
+  char *post = cm.postParam("T1");
+
+  if(post == NULL)
+    {	
+      cm.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\r\n\
 \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\r\n\
 <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\r\n\
 <head>\r\n<title>MyServer</title>\r\n\
@@ -19,23 +22,19 @@
 <form action=\"post.mscgi\" method=\"post\" enctype=\"text/plain\">\r\n\
 <div>\r\n<input type=\"text\" name=\"T1\" size=\"20\" value=\"POST\" />\r\n<br /><br />\r\n<input type=\"submit\" value=\"Send\" />\r\n\
 <input type=\"reset\" value=\"Reset\" />\r\n</div>\r\n</form>\r\n<br />\r\n</div>\r\n</body>\r\n</html>");
-	}
+    }
 	else
-	{
-		cm.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\r\n\
+    {
+      cm.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\"\r\n\
 \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\r\n\
 <html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\r\n\
 <head>\r\n<title>MyServer</title>\r\n\
 <meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\r\n\
 </head>\r\n<body style=\"color: #666699;\">\r\n<div style=\"text-align: center;\">\r\n\
 <br />\r\n<img src=\"/logo.png\" alt=\"\" style=\"border: 0px;\" />\r\n<br /><br />\r\nPosted argument:&nbsp;");
-		char *post=cm.postParam("T1");
-		if(post==0)
-			post=cm.getParam("T1");
-		if(post)
-			cm.write(post);
-		cm.write("\r\n</div>\r\n</body>\r\n</html>");
-	}
+      cm.write(post);
+      cm.write("\r\n</div>\r\n</body>\r\n</html>");
+    }
 	cm.clean();
 	return 0;
 }
@@ -44,13 +43,13 @@
 BOOL APIENTRY DllMain( HANDLE,DWORD ul_reason_for_call,LPVOID)
 {
 	switch (ul_reason_for_call)	
-	{
+    {
 		case DLL_PROCESS_ATTACH:	
 		case DLL_THREAD_ATTACH:	
 		case DLL_THREAD_DETACH:	
 		case DLL_PROCESS_DETACH:
-		break;	
-	}   
+      break;	
+    }   
 	return TRUE;
 }
 #endif

Modified: trunk/myserver/src/http_handler/mscgi/mscgi.cpp
===================================================================
--- trunk/myserver/src/http_handler/mscgi/mscgi.cpp	2009-02-24 21:43:30 UTC (rev 3013)
+++ trunk/myserver/src/http_handler/mscgi/mscgi.cpp	2009-02-25 21:03:55 UTC (rev 3014)
@@ -127,7 +127,7 @@
 
     if(ProcMain)
     {
-      (ProcMain)(cmdLine, &data);
+      (ProcMain)(td->request.uriOpts.c_str (), &data);
     }
     else
     {





From MAILER-DAEMON Thu Feb 26 15:26:20 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1LcmoG-0007FB-8W
	for mharc-myserver-commit@gnu.org; Thu, 26 Feb 2009 15:26:20 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1LcmoE-0007Ec-3J
	for myserver-commit@gnu.org; Thu, 26 Feb 2009 15:26:18 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1LcmoB-0007Dw-MK
	for myserver-commit@gnu.org; Thu, 26 Feb 2009 15:26:17 -0500
Received: from [199.232.76.173] (port=49657 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1LcmoB-0007Dl-BQ
	for myserver-commit@gnu.org; Thu, 26 Feb 2009 15:26:15 -0500
Received: from savannah.gnu.org ([199.232.41.3]:59858 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1LcmoA-0000Nm-V0
	for myserver-commit@gnu.org; Thu, 26 Feb 2009 15:26:15 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1LcmoA-0000Df-GS
	for myserver-commit@gnu.org; Thu, 26 Feb 2009 20:26:14 +0000
Received: from dperrone by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <dperrone@savannah.gnu.org>) id 1LcmoA-0000Db-96
	for myserver-commit@gnu.org; Thu, 26 Feb 2009 20:26:14 +0000
MIME-Version: 1.0
Errors-To: dperrone
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Daniele Perrone <dperrone@it.gnu.org>
Message-Id: <E1LcmoA-0000Db-96@cvs.savannah.gnu.org>
Date: Thu, 26 Feb 2009 20:26:14 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3015] myserver-get: first implementation of
	install command.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 26 Feb 2009 20:26:18 -0000

Revision: 3015
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3015
Author:   dperrone
Date:     2009-02-26 20:26:13 +0000 (Thu, 26 Feb 2009)

Log Message:
-----------
myserver-get: first implementation of install command.

Modified Paths:
--------------
    trunk/misc/myserver-get/myserver-get.py
    trunk/misc/myserver-get/myserverGetLib/config.py
    trunk/misc/myserver-get/myserverGetLib/console.py
    trunk/misc/myserver-get/myserverGetLib/general.py
    trunk/misc/myserver-get/myserverGetLib/remote.py
    trunk/misc/myserver-get/myserverGetLib/remoteGenericUrl.py

Modified: trunk/misc/myserver-get/myserver-get.py
===================================================================
--- trunk/misc/myserver-get/myserver-get.py	2009-02-25 21:03:55 UTC (rev 3014)
+++ trunk/misc/myserver-get/myserver-get.py	2009-02-26 20:26:13 UTC (rev 3015)
@@ -11,7 +11,19 @@
     myserverGet = MyServerGet() 
     command = ""                        
     
-    commands = {"":usage, "update":myserverGet.update, "search":myserverGet.search}
+    commands = {"":usage, "update":myserverGet.update, "search":myserverGet.search,"install":myserverGet.install}
+    
+
+    import os
+    if os.name=="nt":
+        myserverGetLib.config.arch = "win32"
+    else:
+        import string
+        myserverGetLib.config.arch = string.lower(os.uname()[0])
+        if string.find(os.uname()[4],"64")==-1:
+            myserverGetLib.config.arch = myserverGetLib.config.arch + "32"
+        else:
+            myserverGetLib.config.arch = myserverGetLib.config.arch + "64"
         
     try:                                
         opts, args = getopt.getopt(argv, "hv", ["help","verbose"]) 
@@ -23,11 +35,11 @@
             usage("")                     
             sys.exit()
         elif opt in ("-v", "--verbose"):      
-            myserverGetLib.config.VERBOSE = True   
+            myserverGetLib.config.verbose = True   
     
     arguments = []
     for arg in args:
-        if arg in ("update","search"):
+        if arg in ("update","search","install"):
             command = arg
         else:
             arguments.append(arg)

Modified: trunk/misc/myserver-get/myserverGetLib/config.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/config.py	2009-02-25 21:03:55 UTC (rev 3014)
+++ trunk/misc/myserver-get/myserverGetLib/config.py	2009-02-26 20:26:13 UTC (rev 3015)
@@ -9,8 +9,14 @@
 
 PLUGIN_LIST_SUFFIX = "-plugin-list.xml"
 
-VERBOSE = False
+MYSERVER_PLUGIN_DIR = "../../myserver/binaries/plugins"
 
+MYSERVER_VERSION = "0.9"
+
+verbose = False
+
+arch = ""
+
 class ConfigLoader:
     def __init__(self, configFile):
         self.__configFile = configFile
\ No newline at end of file

Modified: trunk/misc/myserver-get/myserverGetLib/console.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/console.py	2009-02-25 21:03:55 UTC (rev 3014)
+++ trunk/misc/myserver-get/myserverGetLib/console.py	2009-02-26 20:26:13 UTC (rev 3015)
@@ -5,4 +5,7 @@
     sys.stdout.flush()
     
 def writeln(arg):
-    write(arg + "\n")
\ No newline at end of file
+    write(arg + "\n")
+    
+def readln():
+    return sys.stdin.readline()
\ No newline at end of file

Modified: trunk/misc/myserver-get/myserverGetLib/general.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/general.py	2009-02-25 21:03:55 UTC (rev 3014)
+++ trunk/misc/myserver-get/myserverGetLib/general.py	2009-02-26 20:26:13 UTC (rev 3015)
@@ -5,6 +5,8 @@
 import remoteSvn
 import remoteGenericUrl
 import console
+import re
+import string
 
 class MyServerGet:
     def __init__(self, repositoryFile = config.REP_LIST_FILE, listDir = config.PLUGIN_LIST_FILES_DIR):
@@ -16,7 +18,16 @@
         self.__repManager.addSupportedRepository("ftp",remoteGenericUrl.RepositoryGenericUrl)
         self.__list = []
         self.loadRepositoryList()
+        self.__versionRegex = re.compile(r'^([1-2]?[1-9]?[0-9])?(.[1-2]?[0-9]?[0-9])?(.[1-2]?[0-9]?[0-9])?(.[1-2]?[0-9]?[0-9])?$')
+        
     
+    def __versionConverter(self,versionString):
+        numbers = [int(string.replace(dirtyNumber,'.','')) for dirtyNumber in self.__versionRegex.search(versionString).groups() if dirtyNumber != None]
+        result = 0
+        for i in range(len(numbers)):
+            result = numbers[i] << 8*(4-i)
+        return result
+        
     def loadRepositoryList(self):
         list = xml.dom.minidom.parse(self.__rep)
         repXmlList = list.getElementsByTagName("REPOSITORY")
@@ -30,7 +41,6 @@
     
   
     def __search(self,arg):
-        import string
         results = []
         for list in self.__list:
             plugins = list.getPluginsList()
@@ -41,10 +51,94 @@
         
     def search(self,arg):
         arg = " ".join(arg)     
-        if config.VERBOSE:
+        if config.verbose:
             results = ["- " + plugin["name"][0]["value"] + " (compatible with GNU MyServer version ["+plugin.getMyServerMinVersion() + "," + plugin.getMyServerMinVersion() + "])\n    " + plugin["description"][0]["value"] + "\n    Dependences: " + " ".join(dep["value"] + "[" + dep["min-version"] + "," + dep["max-version"] + "]"  for dep in plugin["depends"]) for plugin in self.__search(arg)]
         else: 
             results = [plugin["name"][0]["value"] + " - " + plugin["description"][0]["value"] for plugin in self.__search(arg)]
         console.writeln("\n".join(results))
-
-            
\ No newline at end of file
+    
+    def __find(self,arg):
+        for list in self.__list:
+            plugins = list.getPluginsList()
+            for plugin in plugins:
+                if string.lower(plugin["name"][0]["value"]) == string.lower(arg):
+                    return (plugin,list)
+        return [None, None]
+    
+    def __recursiveDependencesChecker(self,pluginRoot):
+        result = []
+        errors = []
+        for dep in pluginRoot["depends"]:
+            (plugin, list) = self.__find(dep["value"])
+            if plugin == None:
+                errors.append((pluginRoot,"Missing dependence: %s" % (dep["value"])))
+                continue
+            minversion = self.__versionConverter(dep["min-version"])
+            maxversion = self.__versionConverter(dep["max-version"])
+            pluginversion = self.__versionConverter(plugin["version"][0]["value"])
+            if pluginversion < minversion or pluginversion > maxversion:
+                errors.append((pluginRoot,"%s%s is going to be installed, but %s requires version > %s and version < %s" % (dep["value"],plugin["version"][0]["value"],pluginRoot["version"][0]["value"],dep["min-version"],dep["max-version"])))
+                continue
+            result.append((plugin, list))
+            [res, er] = self.__recursiveDependencesChecker(plugin)
+            result.extend(res)
+            errors.extend(er)
+        return (result,errors)    
+    
+    def install(self,args):
+        for arg in args:
+            (plugin,list) = self.__find(arg)
+            if plugin == None:
+                console.writeln("No plugin with this name is present in the plugin database.")
+                return None
+            
+            myserverVersion = self.__versionConverter(config.MYSERVER_VERSION)
+            minversion = self.__versionConverter(plugin.getMyServerMinVersion())
+            maxversion = self.__versionConverter(plugin.getMyServerMaxVersion())
+            if myserverVersion < minversion or myserverVersion > maxversion:
+                console.writeln("Plugin incompatible with GNU MyServer installed version.")
+                return None
+            
+            
+            toInstall = [(plugin,list)]
+            (result,errors) = self.__recursiveDependencesChecker(plugin)
+            if len(errors) != 0:
+                for (plugin,msg) in errors:
+                    console.writeln("Error while install %s: %s" % (plugin["name"][0]["value"],msg))
+                return None
+            toInstall.extend(result)
+            
+            console.write ("the following plugins will be installed:\n %s\n do you want to continue?[Y|n] " % (", ".join(plugin["name"][0]["value"] for (plugin,list) in toInstall)))
+            resp = string.lower(console.readln())
+            
+            while not resp in  ("y\n","n\n","\n"):
+                console.write ("the following plugins will be installed:\n %s\n do you want to continue?[Y|n] " % (", ".join(plugin["name"][0]["value"] for (plugin,list) in toInstall)))
+                resp = string.lower(console.readln())
+            if resp == 'n\n':
+                console.writeln ("Install aborted.")
+                return None
+            
+            downloadErrors = []
+            for (plugin,list) in toInstall:
+                rep = self.__repManager.getRepository(list.repository)
+                rep = rep(list.repository)
+                if not rep.getPluginBinary(list,plugin):
+                    downloadErrors.append(plugin)
+            
+            if len(downloadErrors) != 0:
+                console.writeln ("Errors retriving the follow plugins packages: %s" % (" ".join("%s-%s-%s.tar.gz" % (plugin["name"][0]["value"],plugin["version"][0]["value"],config.arch) for plugin in downloadErrors)))
+                return None
+                
+            for (plugin,list) in toInstall:
+                filename = config.MYSERVER_PLUGIN_DIR + "/%s-%s-%s.tar.gz" % (plugin["name"][0]["value"],plugin["version"][0]["value"],config.arch)
+                import tarfile
+                console.writeln("Exctracting plugin package..")
+                try:
+                    tarf = tarfile.open(filename.encode("ascii"),"r|gz")
+                    tarf.extractall (config.MYSERVER_PLUGIN_DIR)
+                except Exception:
+                    console.writeln("Error while exctracting plugin package!")
+                    return None
+                import os
+                os.remove(filename)
+                console.writeln("plugin %s installed." % (plugin["name"][0]["value"]))
\ No newline at end of file

Modified: trunk/misc/myserver-get/myserverGetLib/remote.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/remote.py	2009-02-25 21:03:55 UTC (rev 3014)
+++ trunk/misc/myserver-get/myserverGetLib/remote.py	2009-02-26 20:26:13 UTC (rev 3015)
@@ -8,8 +8,9 @@
     def synchronizeListWithRepository(self, list):
         pass
     
+    def getPluginBinary(self,list,plugin):
+        pass
     
-    
 class RepositoryManager:
     def __init__(self):
         self.__reps = {}

Modified: trunk/misc/myserver-get/myserverGetLib/remoteGenericUrl.py
===================================================================
--- trunk/misc/myserver-get/myserverGetLib/remoteGenericUrl.py	2009-02-25 21:03:55 UTC (rev 3014)
+++ trunk/misc/myserver-get/myserverGetLib/remoteGenericUrl.py	2009-02-26 20:26:13 UTC (rev 3015)
@@ -4,6 +4,7 @@
 from remote import Repository
 import console
 import urllib
+import config
 
 class RepositoryGenericUrl(Repository):
     def __init__ (self,url):
@@ -45,4 +46,15 @@
                 pluginInfo = list.addPluginWithXml(element[0])
             list.synchronizeListWithFileSystem()
             console.write("DONE.\n")
-
+    
+    def getPluginBinary(self,list,plugin):
+        url ="%s/pub/%s-%s-%s.tar.gz" % (list.repository,plugin["name"][0]["value"],plugin["version"][0]["value"],config.arch)
+        filename = config.MYSERVER_PLUGIN_DIR + "/%s-%s-%s.tar.gz" % (plugin["name"][0]["value"],plugin["version"][0]["value"],config.arch)
+        console.writeln("Downloading %s-%s-%s.tar.gz..." % (plugin["name"][0]["value"],plugin["version"][0]["value"],config.arch))
+        try:
+            urllib.urlretrieve(url, filename)
+        except Exception:
+            console.writeln("Error while retriving remote file!")
+            return False
+        return True
+        
\ No newline at end of file





From MAILER-DAEMON Fri Feb 27 14:47:10 2009
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Ld8fu-0002jT-2g
	for mharc-myserver-commit@gnu.org; Fri, 27 Feb 2009 14:47:10 -0500
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Ld8ft-0002i9-1x
	for myserver-commit@gnu.org; Fri, 27 Feb 2009 14:47:09 -0500
Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43)
	id 1Ld8fr-0002g3-Pe
	for myserver-commit@gnu.org; Fri, 27 Feb 2009 14:47:08 -0500
Received: from [199.232.76.173] (port=55180 helo=monty-python.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Ld8fr-0002fk-FD
	for myserver-commit@gnu.org; Fri, 27 Feb 2009 14:47:07 -0500
Received: from savannah.gnu.org ([199.232.41.3]:52832 helo=sv.gnu.org)
	by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.60) (envelope-from <INVALID.NOREPLY@gnu.org>)
	id 1Ld8fr-0004tE-4p
	for myserver-commit@gnu.org; Fri, 27 Feb 2009 14:47:07 -0500
Received: from cvs.savannah.gnu.org ([199.232.41.69])
	by sv.gnu.org with esmtp (Exim 4.63)
	(envelope-from <INVALID.NOREPLY@gnu.org>) id 1Ld8fq-0007DT-I3
	for myserver-commit@gnu.org; Fri, 27 Feb 2009 19:47:06 +0000
Received: from gscrivano by cvs.savannah.gnu.org with local (Exim 4.63)
	(envelope-from <gscrivano@savannah.gnu.org>) id 1Ld8fq-0007DP-9O
	for myserver-commit@gnu.org; Fri, 27 Feb 2009 19:47:06 +0000
MIME-Version: 1.0
Errors-To: gscrivano
To: myserver-commit@gnu.org
X-Mailer: SVN::Notify 2.64: http://search.cpan.org/dist/SVN-Notify/
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From: Giuseppe Scrivano <gscrivano@gnu.org>
Message-Id: <E1Ld8fq-0007DP-9O@cvs.savannah.gnu.org>
Date: Fri, 27 Feb 2009 19:47:06 +0000
X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [3016] Added directory listing and error pages
	documentation.
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: myserver-commit.gnu.org
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 27 Feb 2009 19:47:09 -0000

Revision: 3016
          http://svn.sv.gnu.org/viewvc/?view=rev&root=myserver&revision=3016
Author:   gscrivano
Date:     2009-02-27 19:47:06 +0000 (Fri, 27 Feb 2009)

Log Message:
-----------
Added directory listing and error pages documentation.

Modified Paths:
--------------
    trunk/myserver/documentation/Makefile.am
    trunk/myserver/documentation/basic_configuration.texi
    trunk/myserver/documentation/mime_types.texi
    trunk/myserver/documentation/myserver.texi

Added Paths:
-----------
    trunk/myserver/documentation/directory_listing.texi
    trunk/myserver/documentation/error_pages.texi

Modified: trunk/myserver/documentation/Makefile.am
===================================================================
--- trunk/myserver/documentation/Makefile.am	2009-02-26 20:26:13 UTC (rev 3015)
+++ trunk/myserver/documentation/Makefile.am	2009-02-27 19:47:06 UTC (rev 3016)
@@ -1,6 +1,6 @@
 info_TEXINFOS=myserver.texi
 
 #any other .texi that is not myserver.texi
-myserver_TEXINFOS=basic_configuration.texi  doclicense.texi mime_types.texi process_security.texi virtual_hosts.texi ssl_certificates.texi
+myserver_TEXINFOS=basic_configuration.texi directory_listing.texi doclicense.texi error_pages.texi mime_types.texi process_security.texi virtual_hosts.texi ssl_certificates.texi
 
 SUBDIRS = 

Modified: trunk/myserver/documentation/basic_configuration.texi
===================================================================
--- trunk/myserver/documentation/basic_configuration.texi	2009-02-26 20:26:13 UTC (rev 3015)
+++ trunk/myserver/documentation/basic_configuration.texi	2009-02-27 19:47:06 UTC (rev 3016)
@@ -30,74 +30,12 @@
 By default the english language is used, the value specified here must
 refer to a xml file contained in the @file{languages/} directory.
 
-@section Default resource
-In the @file{myserver.xml} file it is possible to set the default page
-for the HTTP/HTTPS sites hosted on MyServer.
-
-Similar lines already exist in the default configuration file:
-
-@example
-<DEFAULT_FILENAME>default.htm</DEFAULT_FILENAME>
-<DEFAULT_FILENAME>default.php</DEFAULT_FILENAME>
-<DEFAULT_FILENAME>default.php3</DEFAULT_FILENAME>
-<DEFAULT_FILENAME>index.htm</DEFAULT_FILENAME>
-<DEFAULT_FILENAME>index.php</DEFAULT_FILENAME>
-<DEFAULT_FILENAME>index.php3</DEFAULT_FILENAME>
-<DEFAULT_FILENAME>default.htm</DEFAULT_FILENAME>
-@end example
-
-The previous line define the order of files to look for when a
-directory is requested.  If a default file is not found and the user
-has browsing access permissions then the directory contents are
-listed.
-
-It is possible to specify a page when a HTTP error happens using the
-option:
-
-@example
-<USE_ERROR_FILE>YES</USE_ERROR_FILE>
-@end example
-
-So, if you set the value to @code{NO}, like in the line below,
-
-@example
-<USE_ERROR_FILE>NO</USE_ERROR_FILE>
-@end example
-
-If an error page is not used MyServer will (by default) just send a
-header to your browser with the error code.
-You have the option to send a HTTP body included in the error, by
-adding this line:
-
-@example
-<ERRORS_INCLUDE_BODY>YES</ERRORS_INCLUDE_BODY>
-@end example
-
-You can change the layout of the directory browsing page. The line
-below, in @file{myserver.xml}, points to the CSS file used to
-configure the layout for the browsing directory pages:
-
-@example
-<BROWSEFOLDER_CSS>system/folderstyle.css</BROWSEFOLDER_CSS>
-@end example
-
-CGI Scripts can get the Server Administrator E-mail and show them to
+@section Server administrator
+CGI scripts can get the server administrator e-mail and show them to
 the user (through the SERVER_ADMIN environment variable). So, it can
 be important you define this address properly, by setting the value in
 the line below, in @file{myserver.xml}:
 
 @example
-<SERVER_ADMIN>administrator@@localhost</SERVER_ADMIN>
+<SERVER_ADMIN>root@@foo.com</SERVER_ADMIN>
 @end example
-
-MyServer offers the feature to follow symlinks on Unix-like Operating
-systems (e.g.: Linux, *BSD, GNU/HURD, Solaris, etc.).
-You can add the symlink following feature for all hosts in the
-@file{myserver.xml} file.
-
-@example
-<FOLLOW_LINKS>YES</FOLLOW_LINKS>
-@end example
-
-The default value used by MyServer is:
-@code{<FOLLOW_LINKS>NO</FOLLOW_LINKS>}.

Added: trunk/myserver/documentation/directory_listing.texi
===================================================================
--- trunk/myserver/documentation/directory_listing.texi	                        (rev 0)
+++ trunk/myserver/documentation/directory_listing.texi	2009-02-27 19:47:06 UTC (rev 3016)
@@ -0,0 +1,71 @@
+@c -*-texinfo-*-
+
+@section Directory Listing
+When a resource mapped to a local directory is requested, MyServer
+shows its content like an usual file manager does.
+
+
+@subsection Default files
+In the @file{myserver.xml} file it is possible to set the default file
+to send instead of the directory content.
+
+Default files are defined using the @code{DEFAULT_FILENAME} element
+and they are checked in the specified order until one is found.
+If a default file can't be found in the directory then its content is
+listed.
+
+@example
+<DEFAULT_FILENAME>default.htm</DEFAULT_FILENAME>
+<DEFAULT_FILENAME>index.htm</DEFAULT_FILENAME>
+<DEFAULT_FILENAME>default.html</DEFAULT_FILENAME>
+<DEFAULT_FILENAME>index.html</DEFAULT_FILENAME>
+@end example
+
+The previous lines define the order of files that are checked by the
+web server when a directory is requested.
+For example, given the previous configuration and a request to the
+@file{http://foo/bar/} resource, where @file{bar/} is mapped to a
+local directory, the server will look for these files in order:
+
+@example
+http://foo/bar/default.htm
+http://foo/bar/index.htm
+http://foo/bar/default.html
+http://foo/bar/index.html
+@end example
+
+If that resources don't exist then the content of @file{bar/} is
+listed.
+
+@subsection Directory listing columns
+When the directory content is listed, by default MyServer shows the
+file name, last modified time and file size.  This default bahaviour
+can be changed redefining the @code{http.dir.format} value.
+
+It can be redefined in the local security file, in the virtual host or
+in the global server configuration.
+Its value is a formatting string, columns are showed in the same order
+that they are specified.
+
+@itemize
+@item %f
+specifies the file name.
+@item %t
+specifies the file last modified time.
+@item %s
+specifies the file size.
+@end itemize
+
+For example, the @code{%f%s} value displays the file name followed
+by its size, while @code{%f%t} displays the file name and its last
+modified time.
+
+@subsection Directory listing layout
+
+You can change the layout of the directory browsing page. The line
+below, in @file{myserver.xml}, points to the CSS file used to
+configure the layout for the browsing directory pages:
+
+@example
+<BROWSEFOLDER_CSS>system/folderstyle.css</BROWSEFOLDER_CSS>
+@end example

Added: trunk/myserver/documentation/error_pages.texi
===================================================================
--- trunk/myserver/documentation/error_pages.texi	                        (rev 0)
+++ trunk/myserver/documentation/error_pages.texi	2009-02-27 19:47:06 UTC (rev 3016)
@@ -0,0 +1,23 @@
+@c -*-texinfo-*-
+
+@section Error pages
+It is possible to specify a page when a HTTP error happens using the
+option:
+
+@example
+<USE_ERROR_FILE>YES</USE_ERROR_FILE>
+@end example
+
+So, if you set the value to @code{NO}, like in the line below,
+
+@example
+<USE_ERROR_FILE>NO</USE_ERROR_FILE>
+@end example
+
+If an error page is not used MyServer will (by default) just send a
+header to your browser with the error code.
+It is possible to include a HTTP body in the error page, using:
+
+@example
+<ERRORS_INCLUDE_BODY>YES</ERRORS_INCLUDE_BODY>
+@end example

Modified: trunk/myserver/documentation/mime_types.texi
===================================================================
--- trunk/myserver/documentation/mime_types.texi	2009-02-26 20:26:13 UTC (rev 3015)
+++ trunk/myserver/documentation/mime_types.texi	2009-02-27 19:47:06 UTC (rev 3016)
@@ -123,3 +123,15 @@
 
 The @code{PATH} regular expressions are checked before the file
 extension, in the order they are specified in the configuration file.
+
+@section Symbolic links
+MyServer offers the feature to follow symlinks where they are
+supported.
+You can configure MyServer to follow symbolic links specifying this
+line in the @file{myserver.xml} file.
+
+@example
+<FOLLOW_LINKS>YES</FOLLOW_LINKS>
+@end example
+
+By default MyServer doesn't follow symbolic links.

Modified: trunk/myserver/documentation/myserver.texi
===================================================================
--- trunk/myserver/documentation/myserver.texi	2009-02-26 20:26:13 UTC (rev 3015)
+++ trunk/myserver/documentation/myserver.texi	2009-02-27 19:47:06 UTC (rev 3016)
@@ -69,8 +69,10 @@
 * Process security:: Process security.
 * Security files:: Describe how to use security files.
 * SSL certificates:: Show how to use SSL certificates.
+* Error pages:: How configure error pages.
+* Directory listing:: Show how directories are handled.
 * Log management:: Describe how to use the log management features.
-* Concept index::       An item for each concept.
+* Concept index:: An item for each concept.
 * GNU Free Documentation License:: The license for this documentation.
 @end menu
 
@@ -94,12 +96,22 @@
 @cindex Process security
 @include process_security.texi
 
-@node Security files, SSL certificates, Process security, Top
+@node Security files, Error pages, Process security, Top
 @chapter Process security
 @cindex Process security
 @include security.texi
 
-@node SSL certificates, Log management, Security files, Top
+@node Error pages, Directory listing, Security files, Top
+@chapter Error pages
+@cindex Error pages
+@include error_pages.texi
+
+@node Directory listing, SSL certificates, Error pages, Top
+@chapter Directory listing
+@cindex Directory listing
+@include directory_listing.texi
+
+@node SSL certificates, Log management, Directory listing, Top
 @chapter SSL certificates
 @cindex SSL certificates
 @include ssl_certificates.texi





