From MAILER-DAEMON Thu Apr 01 12:19:42 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NxN7O-00078I-CS
	for mharc-myserver-commit@gnu.org; Thu, 01 Apr 2010 12:19:42 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NxN7N-000780-1A
	for myserver-commit@gnu.org; Thu, 01 Apr 2010 12:19:41 -0400
Received: from [140.186.70.92] (port=56210 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NxN7L-00077c-QY
	for myserver-commit@gnu.org; Thu, 01 Apr 2010 12:19:40 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NxN7K-0001d4-HG
	for myserver-commit@gnu.org; Thu, 01 Apr 2010 12:19:39 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:40218
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NxN7K-0001d0-EE
	for myserver-commit@gnu.org; Thu, 01 Apr 2010 12:19:38 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NxN7K-0000bT-6t
	for myserver-commit@gnu.org; Thu, 01 Apr 2010 16:19:38 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1NxN7J-0006HU-SF
	for myserver-commit@gnu.org; Thu, 01 Apr 2010 16:19:38 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 29af15248e35381f71ca7f0467d94852ff1718d1
X-Git-Newrev: 4e50f5755c50760553267cac6f45740519f1ab91
Message-Id: <E1NxN7J-0006HU-SF@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Thu, 01 Apr 2010 16:19:38 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-95-g4e50f57
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, 01 Apr 2010 16:19:41 -0000

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

The branch, master has been updated
       via  4e50f5755c50760553267cac6f45740519f1ab91 (commit)
      from  29af15248e35381f71ca7f0467d94852ff1718d1 (commit)

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

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


commit 4e50f5755c50760553267cac6f45740519f1ab91
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 1 18:15:02 2010 +0200

    Fix inline comment

diff --git a/myserver/src/base/mem_buff/mem_buff.cpp b/myserver/src/base/mem_buff/mem_buff.cpp
index 44e1e43..f4dfeba 100644
--- a/myserver/src/base/mem_buff/mem_buff.cpp
+++ b/myserver/src/base/mem_buff/mem_buff.cpp
@@ -126,7 +126,7 @@ MemBuf::MemBuf (const void* pAdr, u_int size)
 
 /*!
  * Direct copy constructor (should only be used by the operators to
- * avoid gnulib::reallocations).
+ * avoid reallocations).
  */
 MemBuf::MemBuf (const MemBuf& srcBuf)
 {
@@ -202,9 +202,9 @@ void MemBuf::replace (char what, char by)
 
 /*!
  * Add a buffer at the end of the internal buffer.
- * If the internal buffer isn't large enough, a gnulib::reallocation is done
+ * If the internal buffer isn't large enough, a reallocation is done
  * until nSizeLimit is reached.
- * If nSizeLimit is equal to 0, gnulib::reallocation are always done.
+ * If nSizeLimit is equal to 0, reallocation are always done.
  */
 void MemBuf::addBuffer (const void* pAdr, u_int size)
 {
@@ -330,8 +330,8 @@ int MemBuf::getPartAsString (u_int nStart, u_int nEnd, MemBuf& result)
  * at least newSize bytes, if this value is bigger than nSizeLimit
  * then the latter is used.
  *
- * If the length is smallest than the existing one, no gnulib::reallocation is done.
- * if it's biggest, a gnulib::reallocation is done until nSizeLimit is reached.
+ * If the length is smallest than the existing one, no reallocation is done.
+ * if it's biggest, a reallocation is done until nSizeLimit is reached.
  */
 void MemBuf::setRealLength (u_int newSize)
 {
@@ -361,7 +361,7 @@ void MemBuf::setRealLength (u_int newSize)
 
 /*!
  * Set the cursor in the internal buffer.
- * If the specified position is bigger than the buffer size then a gnulib::reallocation
+ * If the specified position is bigger than the buffer size then a reallocation
  * is done.
  */
 void MemBuf::setLength (u_int newSize)

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

Summary of changes:
 myserver/src/base/mem_buff/mem_buff.cpp |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Sat Apr 03 17:46:29 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NyBAj-0005dR-3Q
	for mharc-myserver-commit@gnu.org; Sat, 03 Apr 2010 17:46:29 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NyBAh-0005bY-5H
	for myserver-commit@gnu.org; Sat, 03 Apr 2010 17:46:27 -0400
Received: from [140.186.70.92] (port=56896 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NyBAe-0005bQ-OR
	for myserver-commit@gnu.org; Sat, 03 Apr 2010 17:46:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NyBAd-00084K-0C
	for myserver-commit@gnu.org; Sat, 03 Apr 2010 17:46:24 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:48626
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NyBAc-00084F-Uj
	for myserver-commit@gnu.org; Sat, 03 Apr 2010 17:46:22 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NyBAb-0005aS-W7
	for myserver-commit@gnu.org; Sat, 03 Apr 2010 21:46:22 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1NyBAb-0001Dc-9x
	for myserver-commit@gnu.org; Sat, 03 Apr 2010 21:46:21 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 4e50f5755c50760553267cac6f45740519f1ab91
X-Git-Newrev: 5d2014f9c5d0957a46845214153e860bffd70c63
Message-Id: <E1NyBAb-0001Dc-9x@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Sat, 03 Apr 2010 21:46:21 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-101-g5d2014f
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, 03 Apr 2010 21:46:27 -0000

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

The branch, master has been updated
       via  5d2014f9c5d0957a46845214153e860bffd70c63 (commit)
       via  f214e159c68a713d08c369fe0cdbf500c661ede7 (commit)
       via  fb53c7c35e33ba0896ecaffb2d7bf164e2a00122 (commit)
       via  dd4554370c836fe29c0bc537536df9e7cf0809da (commit)
       via  2e314e5d9280c55c4a87cd1c844f060fb43498d0 (commit)
       via  0735df71c3b49a387a7e1a9e4db50df97ac8b7fd (commit)
      from  4e50f5755c50760553267cac6f45740519f1ab91 (commit)

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

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


commit 5d2014f9c5d0957a46845214153e860bffd70c63
Merge: f214e15 4e50f57
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 3 23:47:15 2010 +0200

    Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/myserver




commit f214e159c68a713d08c369fe0cdbf500c661ede7
Merge: dd45543 fb53c7c
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 3 23:41:43 2010 +0200

    Merge branch 'master' of git://github.com/rupinder/GNU-MyServer




commit fb53c7c35e33ba0896ecaffb2d7bf164e2a00122
Author: Rupinder Singh <rupinder.singh@nsitonline.in>
Date:   Sun Apr 4 02:58:35 2010 +0530

    Set Default values while adding to tree_model, adding attributes and mime

diff --git a/myserver/src/GUI/MyServer/GUI/DefinitionWidgets.py b/myserver/src/GUI/MyServer/GUI/DefinitionWidgets.py
index e855ba9..778ed80 100644
--- a/myserver/src/GUI/MyServer/GUI/DefinitionWidgets.py
+++ b/myserver/src/GUI/MyServer/GUI/DefinitionWidgets.py
@@ -86,7 +86,7 @@ class DefinitionTable(gtk.Table):
         button_table = gtk.Table(1, 3)
         add_attribute_button.connect(
             'clicked',
-            lambda button: attributes_model.append(('', '', )))
+            lambda button: attributes_model.append(('var', '0', )))
         def remove_attribute(button):
             model, selected = attributes_list.get_selection().get_selected()
             if selected is not None:
diff --git a/myserver/src/GUI/MyServer/GUI/GUIConfig.py b/myserver/src/GUI/MyServer/GUI/GUIConfig.py
index fc14f6e..38d4ee0 100644
--- a/myserver/src/GUI/MyServer/GUI/GUIConfig.py
+++ b/myserver/src/GUI/MyServer/GUI/GUIConfig.py
@@ -80,11 +80,11 @@ vhost_name = 'name'
 vhost_attributes = ['port', 'protocol', 'doc_root', 'sys_root', 'private_key', 'certificate']
 vhost_lists = [
     ('ip', (
-            ('ip', TYPE_STRING, '', ),
+            ('ip', TYPE_STRING, 'IP', ),
             ),
      ),
      ('host', (
-            ('host name', TYPE_STRING, '', ),
+            ('host name', TYPE_STRING, 'HOST', ),
             ('use regexp', TYPE_BOOLEAN, False, ),
             ),
       ),
diff --git a/myserver/src/GUI/MyServer/GUI/MIMEWidgets.py b/myserver/src/GUI/MyServer/GUI/MIMEWidgets.py
index 2f3ed7e..cee3171 100644
--- a/myserver/src/GUI/MyServer/GUI/MIMEWidgets.py
+++ b/myserver/src/GUI/MyServer/GUI/MIMEWidgets.py
@@ -109,7 +109,7 @@ class MimeTable(gtk.Table):
             tree_scroll.add(tree)
 
             def add_to_tree(button, model):
-                model.append(('', ))
+                model.append(('ext', ))
             add_button = gtk.Button('Add')
             add_button.connect('clicked', add_to_tree, tree_model)
             def remove_from_tree(button, tree):
diff --git a/myserver/src/GUI/MyServer/GUI/VHostWidgets.py b/myserver/src/GUI/MyServer/GUI/VHostWidgets.py
index 165b1df..da6bf9f 100644
--- a/myserver/src/GUI/MyServer/GUI/VHostWidgets.py
+++ b/myserver/src/GUI/MyServer/GUI/VHostWidgets.py
@@ -372,13 +372,14 @@ class VHostTable(gtk.Table):
         self.log_model = self.log_tree.get_model()
 
         def add_stream(button, model):
-            model.append(('', [], (0, False, ), False, [], {}, ))
-        add_stream_button = gtk.Button('Add stream')
+            model.append(('stream', [], (0, False, ), False, [], {}, ))
+        add_stream_button = gtk.Button('Add Stream')
         add_stream_button.connect(
             'clicked', add_stream, stream_tree.get_model())
+
         def add_filter(button, model):
-            model.append(('', ))
-        add_filter_button = gtk.Button('Add filter')
+            model.append(('ext', ))
+        add_filter_button = gtk.Button('Add Filter')
         add_filter_button.connect(
             'clicked', add_filter, filter_tree.get_model())
 
@@ -387,9 +388,9 @@ class VHostTable(gtk.Table):
             if selected is not None:
                 model.remove(selected)
                 tree.last_selected = None
-        remove_stream_button = gtk.Button('Remove stream')
+        remove_stream_button = gtk.Button('Remove Stream')
         remove_stream_button.connect('clicked', remove_selected, stream_tree)
-        remove_filter_button = gtk.Button('Remove filter')
+        remove_filter_button = gtk.Button('Remove Filter')
         remove_filter_button.connect('clicked', remove_selected, filter_tree)
 
         button_grid = gtk.Table(2, 2)



commit dd4554370c836fe29c0bc537536df9e7cf0809da
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 3 22:19:18 2010 +0200

    Use = to compare strings, not ==

diff --git a/myserver/configure.ac b/myserver/configure.ac
index a0df4b7..7b0e2cd 100644
--- a/myserver/configure.ac
+++ b/myserver/configure.ac
@@ -128,7 +128,7 @@ case "${host}" in
     dnl Looking for dl
     AC_SEARCH_LIBS([dlopen], [dl c], have_dl=yes)
 
-    if test x$have_dl == xyes; then
+    if test "x$have_dl" = xyes; then
         AC_DEFINE(HAVE_DL, 1, [LibDL support, define to 1 to enable])
         MAKE_MSCGI=yes
     else
@@ -278,7 +278,7 @@ else
     AC_DEFINE(HAVE_IPV6, 0, [Disable IPv6 support])
 fi
 
-if test x$enable_tests == xyes; then
+if test "x$enable_tests" = xyes; then
   dnl Looking for cppunit
   AM_PATH_CPPUNIT(1.12.0, have_cppunit=yes)
   if test x$have_cppunit != xyes; then
@@ -296,7 +296,7 @@ else
   MAKE_TESTS=no
 fi
 
-if test x$enable_gui == xyes; then
+if test "x$enable_gui" = xyes; then
   dnl Checking Python version
   AM_PYTHON(2.6.0, have_python=yes)
   if test x$have_python != xyes; then



commit 2e314e5d9280c55c4a87cd1c844f060fb43498d0
Merge: 29af152 0735df7
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 3 22:15:38 2010 +0200

    Merge branch 'master' of git://github.com/rupinder/GNU-MyServer




commit 0735df71c3b49a387a7e1a9e4db50df97ac8b7fd
Author: Rupinder Singh <rupinder.singh@nsitonline.in>
Date:   Sun Apr 4 01:22:55 2010 +0530

    Fix wobbling of TreeViewColumn in DefinitionTable
    and DefinitionTreeView
    Resize window to Adjust relative width of 'Tag'
    TreeViewColumn

diff --git a/myserver/src/GUI/MyServer/GUI/BrowserWidgets.py b/myserver/src/GUI/MyServer/GUI/BrowserWidgets.py
index 219ef16..cef5bd6 100644
--- a/myserver/src/GUI/MyServer/GUI/BrowserWidgets.py
+++ b/myserver/src/GUI/MyServer/GUI/BrowserWidgets.py
@@ -73,7 +73,7 @@ class BrowserTable(gtk.Table):
         def set_show_hidden(button):
             self.browser_tree.browser.show_hidden(button.get_active())
             self.browser_tree.update()
-        hide_check = gtk.CheckButton('Show hidden directories.')
+        hide_check = gtk.CheckButton ('Show Hidden Directories')
         hide_check.connect('toggled', set_show_hidden)
 
         self.attach(hide_check, 0, 1, 0, 1, yoptions = gtk.FILL)
diff --git a/myserver/src/GUI/MyServer/GUI/DefinitionWidgets.py b/myserver/src/GUI/MyServer/GUI/DefinitionWidgets.py
index e95f172..e855ba9 100644
--- a/myserver/src/GUI/MyServer/GUI/DefinitionWidgets.py
+++ b/myserver/src/GUI/MyServer/GUI/DefinitionWidgets.py
@@ -57,7 +57,7 @@ class DefinitionTable(gtk.Table):
         value_checkbutton.set_active(True)
 
         self.attach(value_label, 0, 1, 1, 2, gtk.FILL, gtk.FILL)
-        self.attach(value_box, 1, 2, 1, 2, yoptions = gtk.FILL)
+        self.attach(value_box, 1, 2, 1, 2, gtk.FILL, gtk.FILL)
         self.attach(value_checkbutton, 2, 3, 1, 2, gtk.FILL, gtk.FILL)
 
         # Add Sub-Definition button
@@ -111,6 +111,7 @@ class DefinitionTable(gtk.Table):
             model, col = data
             model[path][col] = text
         variable_column = gtk.TreeViewColumn('Variable')
+        variable_column.set_min_width(gtk.gdk.Screen().get_width() / 11)
         variable_renderer = gtk.CellRendererText()
         variable_renderer.set_property('editable', True)
         variable_renderer.connect('edited', edited_handler,
@@ -237,6 +238,7 @@ class DefinitionTreeView(gtk.TreeView):
 
         name_renderer = gtk.CellRendererText()
         name_column = gtk.TreeViewColumn('Name')
+        name_column.set_min_width(gtk.gdk.Screen().get_width() / 5)
         name_column.pack_start(name_renderer)
         name_column.add_attribute(name_renderer, 'text', 0)
         self.append_column(name_column)
diff --git a/myserver/src/GUI/MyServer/GUI/SecurityWidgets.py b/myserver/src/GUI/MyServer/GUI/SecurityWidgets.py
index 9f52219..67647cc 100644
--- a/myserver/src/GUI/MyServer/GUI/SecurityWidgets.py
+++ b/myserver/src/GUI/MyServer/GUI/SecurityWidgets.py
@@ -38,7 +38,7 @@ class SecurityTree(gtk.TreeView):
 
         self.last_selected = None
         self.connect('cursor-changed', self.cursor_changed)
-        
+
         self.enable_model_drag_source(gtk.gdk.BUTTON1_MASK,
                                       [('text/plain', 0, 0)],
                                       gtk.gdk.ACTION_MOVE)
@@ -472,7 +472,7 @@ class ConditionTable(gtk.Table):
         def add_sub_element(button, combo, tree):
             tag = combo.get_model()[combo.get_active()][0]
             tree.add_sub_element(tag)
-        self.add_sub_element_button = gtk.Button('Add sub-element')
+        self.add_sub_element_button = gtk.Button('Add Sub-Element')
         self.attach(self.add_sub_element_button, 0, 1, 5, 6, gtk.FILL, gtk.FILL)
         self.add_sub_element_combo = gtk.combo_box_new_text()
         self.add_sub_element_combo.append_text('USER')
@@ -550,14 +550,14 @@ class DefinitionTable(gtk.Table):
 
         def remove_element(button, tree):
             tree.remove_element()
-        button = gtk.Button('Remove this element')
+        button = gtk.Button('Remove This Element')
         button.connect('clicked', remove_element, security_tree)
         self.attach(button, 0, 2, 0, 1, yoptions = gtk.FILL)
 
         def add_sub_element(button, combo, tree):
             tag = combo.get_model()[combo.get_active()][0]
             tree.add_sub_element(tag)
-        self.add_sub_element_button = gtk.Button('Add sub-element')
+        self.add_sub_element_button = gtk.Button('Add Sub-Element')
         self.attach(self.add_sub_element_button, 0, 1, 1, 2, gtk.FILL, gtk.FILL)
         self.add_sub_element_combo = gtk.combo_box_new_text()
         self.add_sub_element_combo.append_text('DEFINE element')
@@ -568,13 +568,13 @@ class DefinitionTable(gtk.Table):
                                             self.add_sub_element_combo,
                                             security_tree)
 
-        self.attach(gtk.Label('name'), 0, 1, 2, 3, gtk.FILL, gtk.FILL)
+        self.attach(gtk.Label('Name'), 0, 1, 2, 3, gtk.SHRINK, gtk.SHRINK)
         self.name_entry = gtk.Entry()
         self.attach(self.name_entry, 1, 2, 2, 3, yoptions = gtk.FILL)
         self.name_check = gtk.CheckButton()
         self.attach(self.name_check, 2, 3, 2, 3, gtk.FILL, gtk.FILL)
 
-        self.value_label = gtk.Label('value')
+        self.value_label = gtk.Label('Value')
         self.attach(self.value_label, 0, 1, 3, 4, gtk.FILL, gtk.FILL)
         self.value_entry = gtk.Entry()
         self.attach(self.value_entry, 1, 2, 3, 4, yoptions = gtk.FILL)
@@ -641,15 +641,15 @@ class EmptyTable(gtk.Table):
     def __init__(self, security_tree):
         gtk.Table.__init__(self, 2, 2)
 
-        self.attach(gtk.Label('Use security file'), 0, 1, 0, 1, gtk.FILL, gtk.FILL)
+        self.attach(gtk.Label('Use Security File'), 0, 1, 0, 1, gtk.FILL, gtk.FILL)
         self.security_check = gtk.CheckButton()
         self.attach(self.security_check, 1, 2, 0, 1, yoptions = gtk.FILL)
 
         def add_sub_element(button, combo, tree):
             tag = combo.get_model()[combo.get_active()][0]
             tree.add_sub_element(tag)
-        self.add_sub_element_button = gtk.Button('Add sub-element')
-        self.attach(self.add_sub_element_button, 0, 1, 1, 2, gtk.FILL, gtk.FILL)
+        self.add_sub_element_button = gtk.Button('Add Sub-Element')
+        self.attach(self.add_sub_element_button, 0, 1, 2, 3, gtk.FILL, gtk.FILL)
         self.add_sub_element_combo = gtk.combo_box_new_text()
         self.add_sub_element_combo.append_text('USER')
         self.add_sub_element_combo.append_text('CONDITION')
@@ -658,7 +658,7 @@ class EmptyTable(gtk.Table):
         self.add_sub_element_combo.append_text('DEFINE element')
         self.add_sub_element_combo.append_text('DEFINE tree')
         self.add_sub_element_combo.set_active(0)
-        self.attach(self.add_sub_element_combo, 1, 2, 1, 2, gtk.FILL, gtk.FILL)
+        self.attach(self.add_sub_element_combo, 0, 1, 1, 2, gtk.FILL, gtk.FILL)
         self.add_sub_element_button.connect('clicked', add_sub_element,
                                             self.add_sub_element_combo,
                                             security_tree)
diff --git a/myserver/src/GUI/MyServerControl b/myserver/src/GUI/MyServerControl
index 839ffdf..e100cef 100755
--- a/myserver/src/GUI/MyServerControl
+++ b/myserver/src/GUI/MyServerControl
@@ -41,6 +41,7 @@ class PyGTKControl():
         self.notebook = gtk.Notebook()
         self.statusbar = gtk.Statusbar()
         self.menubar = gtk.MenuBar()
+        self.screen = gtk.gdk.Screen()
 
         # Class for Menu Item
         class MenuItemWithStockImage(gtk.ImageMenuItem):
@@ -54,7 +55,9 @@ class PyGTKControl():
 
 
         # Set logo for Main Window
-        self.window.set_icon_list(logo)
+        self.window.set_icon_list (logo)
+        # Set default size for Main Window
+        self.window.set_default_size ((67*self.screen.get_width()) / 127, -1)
 
         # Set up Menu Items
         file_menu_item = gtk.MenuItem('_File')
@@ -685,7 +688,7 @@ class PyGTKControl():
         self.browser_table = BrowserTable(self.security_table.read_from_file)
         panels.pack1(self.browser_table, True, False)
 
-        self.notebook.append_page(panels, gtk.Label('File browser'))
+        self.notebook.append_page(panels, gtk.Label('File Browser'))
 
         self.notebook.show_all()
 

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

Summary of changes:
 myserver/configure.ac                              |    6 +++---
 myserver/src/GUI/MyServer/GUI/BrowserWidgets.py    |    2 +-
 myserver/src/GUI/MyServer/GUI/DefinitionWidgets.py |    6 ++++--
 myserver/src/GUI/MyServer/GUI/GUIConfig.py         |    4 ++--
 myserver/src/GUI/MyServer/GUI/MIMEWidgets.py       |    2 +-
 myserver/src/GUI/MyServer/GUI/SecurityWidgets.py   |   20 ++++++++++----------
 myserver/src/GUI/MyServer/GUI/VHostWidgets.py      |   13 +++++++------
 myserver/src/GUI/MyServerControl                   |    7 +++++--
 8 files changed, 33 insertions(+), 27 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Wed Apr 07 10:46:30 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NzWWU-0000sw-IP
	for mharc-myserver-commit@gnu.org; Wed, 07 Apr 2010 10:46:30 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NzWWR-0000q8-To
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 10:46:27 -0400
Received: from [140.186.70.92] (port=42370 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NzWWO-0000m9-No
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 10:46:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NzWWM-0007Wo-4o
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 10:46:24 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:60559
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NzWWM-0007Wg-2H
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 10:46:22 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NzWWL-0002md-Ah
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 14:46:21 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1NzWWK-0008L2-UB
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 14:46:21 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 5d2014f9c5d0957a46845214153e860bffd70c63
X-Git-Newrev: c0ea46ae4789aa18dbe377489d5a5134f62f1cc3
Message-Id: <E1NzWWK-0008L2-UB@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Wed, 07 Apr 2010 14:46:21 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-102-gc0ea46a
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, 07 Apr 2010 14:46:28 -0000

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

The branch, master has been updated
       via  c0ea46ae4789aa18dbe377489d5a5134f62f1cc3 (commit)
      from  5d2014f9c5d0957a46845214153e860bffd70c63 (commit)

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

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


commit c0ea46ae4789aa18dbe377489d5a5134f62f1cc3
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Wed Apr 7 16:00:56 2010 +0200

    Remove extern "C" when it is not needed.
    
    Mass update using the sed script:
      '1h;1!H;${;g;s/extern "C"[ \n]\?{\n\([^}]*\)}/\1/g;p}'

diff --git a/myserver/include/base/crypt/sha1.h b/myserver/include/base/crypt/sha1.h
index ff65ee5..7bcc3b0 100644
--- a/myserver/include/base/crypt/sha1.h
+++ b/myserver/include/base/crypt/sha1.h
@@ -21,10 +21,8 @@
 #ifndef SHA1_CRYPT_H
 # define SHA1_CRYPT_H
 
-extern "C"
-{
 # include <sha1.h>
-}
+
 
 # include "myserver.h"
 
diff --git a/myserver/include/base/dynamic_lib/dynamiclib.h b/myserver/include/base/dynamic_lib/dynamiclib.h
index 973b949..44d998e 100644
--- a/myserver/include/base/dynamic_lib/dynamiclib.h
+++ b/myserver/include/base/dynamic_lib/dynamiclib.h
@@ -22,15 +22,13 @@
 
 # include <string>
 
-extern "C"
-{
 # ifdef WIN32
 #  include <direct.h>
 # endif
 # ifdef HAVE_DL
 #  include <dlfcn.h>
 # endif
-}
+
 
 using namespace std;
 
diff --git a/myserver/include/base/read_directory/read_directory.h b/myserver/include/base/read_directory/read_directory.h
index 9bdc7ef..de3c43d 100644
--- a/myserver/include/base/read_directory/read_directory.h
+++ b/myserver/include/base/read_directory/read_directory.h
@@ -21,8 +21,6 @@
 
 # include "myserver.h"
 
-extern "C"
-{
 # ifdef WIN32
 #  include <io.h>
 # endif
@@ -35,7 +33,7 @@ extern "C"
 #  include <dirent.h>
 # endif
 # include <limits.h>
-}
+
 
 # include <string>
 # include <include/base/sync/mutex.h>
diff --git a/myserver/include/base/regex/myserver_regex.h b/myserver/include/base/regex/myserver_regex.h
index 484a56b..45f49b9 100644
--- a/myserver/include/base/regex/myserver_regex.h
+++ b/myserver/include/base/regex/myserver_regex.h
@@ -22,11 +22,9 @@
 
 # include "myserver.h"
 
-extern "C"
-{
 # include <stdio.h>
 # include "regex.h"
-}
+
 
 # include <string>
 using namespace std;
diff --git a/myserver/include/base/socket/socket.h b/myserver/include/base/socket/socket.h
index 0146039..b601c7b 100644
--- a/myserver/include/base/socket/socket.h
+++ b/myserver/include/base/socket/socket.h
@@ -24,12 +24,10 @@
 
 # include "myserver.h"
 
-extern "C"
-{
 # include <sys/types.h>
 # include <sys/select.h>
 # include <sys/socket.h>
-}
+
 
 # include <include/filter/stream.h>
 
@@ -37,14 +35,12 @@ extern "C"
 using namespace std;
 
 # ifndef WIN32
-extern "C"
-{
 #  include <sys/ioctl.h>
 #  include <netinet/in.h>
 #  include <netdb.h>
 #  include <stdio.h>
 #  include <unistd.h>
-}
+
 # endif
 
 typedef int SocketHandle;
diff --git a/myserver/include/base/socket/ssl_socket.h b/myserver/include/base/socket/ssl_socket.h
index ff947de..898b1d5 100644
--- a/myserver/include/base/socket/ssl_socket.h
+++ b/myserver/include/base/socket/ssl_socket.h
@@ -22,11 +22,9 @@
 
 # include "myserver.h"
 
-extern "C"
-{
 # include <sys/types.h>
 # include <sys/socket.h>
-}
+
 
 # include <include/base/socket/socket.h>
 # include <include/base/ssl/ssl.h>
diff --git a/myserver/include/base/xml/xml_parser.h b/myserver/include/base/xml/xml_parser.h
index 17f6b11..0a04ff0 100644
--- a/myserver/include/base/xml/xml_parser.h
+++ b/myserver/include/base/xml/xml_parser.h
@@ -23,14 +23,12 @@
 # include "myserver.h"
 # include <include/base/file/file.h>
 # include <include/base/mem_buff/mem_buff.h>
-extern "C"
-{
 # include <libxml/xmlmemory.h>
 # include <libxml/parser.h>
 # include <libxml/tree.h>
 # include <libxml/xpath.h>
 # include <libxml/xpathInternals.h>
-}
+
 # include <string>
 
 using namespace std;
diff --git a/myserver/include/conf/mime/mime_manager.h b/myserver/include/conf/mime/mime_manager.h
index def7f41..72fa38d 100644
--- a/myserver/include/conf/mime/mime_manager.h
+++ b/myserver/include/conf/mime/mime_manager.h
@@ -33,8 +33,6 @@
 #  include <windows.h>
 # endif
 
-extern "C"
-{
 # include <stdio.h>
 # include <stdlib.h>
 # include <string.h>
@@ -44,7 +42,7 @@ extern "C"
 #  include <tchar.h>
 #  include <io.h>
 # endif
-}
+
 
 # include <string>
 # include <map>
diff --git a/myserver/include/conf/mime/xml_mime_handler.h b/myserver/include/conf/mime/xml_mime_handler.h
index caff7aa..3bc24b1 100644
--- a/myserver/include/conf/mime/xml_mime_handler.h
+++ b/myserver/include/conf/mime/xml_mime_handler.h
@@ -33,8 +33,6 @@
 #  include <windows.h>
 # endif
 
-extern "C"
-{
 # include <stdio.h>
 # include <stdlib.h>
 # include <string.h>
@@ -44,7 +42,7 @@ extern "C"
 #  include <tchar.h>
 #  include <io.h>
 # endif
-}
+
 
 # include <string>
 # include <map>
diff --git a/myserver/include/connection/connection.h b/myserver/include/connection/connection.h
index 2dee1c2..c18eb09 100644
--- a/myserver/include/connection/connection.h
+++ b/myserver/include/connection/connection.h
@@ -22,10 +22,8 @@
 
 # include "myserver.h"
 
-extern "C"
-{
 # include <sys/time.h>
-}
+
 
 # include <include/base/socket/socket.h>
 # include <include/protocol/protocol_buffer.h>
diff --git a/myserver/include/protocol/http/http_headers.h b/myserver/include/protocol/http/http_headers.h
index e4a3456..7684d19 100644
--- a/myserver/include/protocol/http/http_headers.h
+++ b/myserver/include/protocol/http/http_headers.h
@@ -23,8 +23,6 @@
 # include "myserver.h"
 # include <include/connection/connection.h>
 
-extern "C"
-{
 # ifdef WIN32
 #  include <direct.h>
 #  include <errno.h>
@@ -32,7 +30,7 @@ extern "C"
 #  include <string.h>
 #  include <errno.h>
 # endif
-}
+
 
 # include <string>
 using namespace std;
diff --git a/myserver/include/protocol/http/http_thread_context.h b/myserver/include/protocol/http/http_thread_context.h
index 0f5b9b8..5c2a85d 100644
--- a/myserver/include/protocol/http/http_thread_context.h
+++ b/myserver/include/protocol/http/http_thread_context.h
@@ -30,8 +30,6 @@
 # include <include/conf/mime/mime_manager.h>
 # include <include/conf/security/security_token.h>
 
-extern "C"
-{
 # ifdef WIN32
 #  include <direct.h>
 #  include <errno.h>
@@ -39,7 +37,7 @@ extern "C"
 #  include <string.h>
 #  include <errno.h>
 # endif
-}
+
 # include <string>
 using namespace std;
 
diff --git a/myserver/myserver.h b/myserver/myserver.h
index ede34f1..23dd447 100644
--- a/myserver/myserver.h
+++ b/myserver/myserver.h
@@ -19,17 +19,13 @@
 #ifndef STDAFX_H
 # define STDAFX_H
 
-extern "C"
-{
 # include "config.h"
 
 # ifdef HAVE_PTHREAD
 #  include <pthread.h>
 # endif
-}
 
-extern "C"
-{
+
 # include <stdlib.h>
 # include <stdio.h>
 # include <fcntl.h>
@@ -46,18 +42,16 @@ extern "C"
 #  include <sys/stat.h>
 #  include <limits.h>
 # endif
-}
+
 
 typedef void* HANDLE;
 
 #endif
 
-extern "C"
-{
 #ifdef HAVE_GETTEXT
 # include <libintl.h>
 # define _(X) gettext (X)
 #else
 # define _(X) X
 #endif
-}
+
diff --git a/myserver/src/base/base64/mime_utils.cpp b/myserver/src/base/base64/mime_utils.cpp
index 92701f4..bc095a3 100644
--- a/myserver/src/base/base64/mime_utils.cpp
+++ b/myserver/src/base/base64/mime_utils.cpp
@@ -19,15 +19,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "myserver.h"
 #include <include/base/base64/mime_utils.h>
 
-extern "C"
-{
 #ifndef WIN32
 # include <ctype.h>
 #endif
 
 #include <stdio.h>
 #include <stdlib.h>
-}
+
 
 #include <string.h>
 
diff --git a/myserver/src/base/file/file.cpp b/myserver/src/base/file/file.cpp
index 93fb3cf..c5382db 100644
--- a/myserver/src/base/file/file.cpp
+++ b/myserver/src/base/file/file.cpp
@@ -22,8 +22,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <include/base/string/stringutils.h>
 #include <include/base/file/files_utility.h>
 
-extern "C"
-{
 #include <fcntl.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -45,7 +43,7 @@ extern "C"
 # include <sys/types.h>
 # include <unistd.h>
 #endif
-}
+
 
 #include <string>
 #include <sstream>
diff --git a/myserver/src/base/file/files_utility.cpp b/myserver/src/base/file/files_utility.cpp
index 75b2cfc..d6a1384 100644
--- a/myserver/src/base/file/files_utility.cpp
+++ b/myserver/src/base/file/files_utility.cpp
@@ -22,14 +22,10 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <include/base/utility.h>
 #include <include/base/string/stringutils.h>
 
-extern "C"
-{
 #include <sys/stat.h>
-}
+
 
 #ifndef WIN32
-extern "C"
-{
 # include <fcntl.h>
 # include <unistd.h>
 # include <sys/types.h>
@@ -40,7 +36,7 @@ extern "C"
 # include <string.h>
 # include <math.h>
 # include <time.h>
-}
+
 #endif
 
 #include <string>
diff --git a/myserver/src/base/files_cache/cached_file.cpp b/myserver/src/base/files_cache/cached_file.cpp
index cdf4c83..fa24bfa 100644
--- a/myserver/src/base/files_cache/cached_file.cpp
+++ b/myserver/src/base/files_cache/cached_file.cpp
@@ -23,8 +23,6 @@
 #include <include/base/files_cache/cached_file.h>
 
 #ifndef WIN32
-extern "C"
-{
 # include <fcntl.h>
 # include <unistd.h>
 # include <sys/types.h>
@@ -36,7 +34,7 @@ extern "C"
 # include <string.h>
 # include <math.h>
 # include <time.h>
-}
+
 #endif
 
 #include <string>
diff --git a/myserver/src/base/files_cache/cached_file_buffer.cpp b/myserver/src/base/files_cache/cached_file_buffer.cpp
index 912ad4a..1e61b52 100644
--- a/myserver/src/base/files_cache/cached_file_buffer.cpp
+++ b/myserver/src/base/files_cache/cached_file_buffer.cpp
@@ -26,8 +26,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <include/base/files_cache/cached_file_factory.h>
 
 #ifndef WIN32
-extern "C"
-{
 # include <fcntl.h>
 # include <unistd.h>
 # include <sys/types.h>
@@ -39,7 +37,7 @@ extern "C"
 # include <string.h>
 # include <math.h>
 # include <time.h>
-}
+
 #endif
 
 #include <string>
diff --git a/myserver/src/base/files_cache/cached_file_factory.cpp b/myserver/src/base/files_cache/cached_file_factory.cpp
index ece0aa2..4f408b0 100644
--- a/myserver/src/base/files_cache/cached_file_factory.cpp
+++ b/myserver/src/base/files_cache/cached_file_factory.cpp
@@ -24,8 +24,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <include/base/files_cache/cached_file_factory.h>
 
 #ifndef WIN32
-extern "C"
-{
 # include <fcntl.h>
 # include <unistd.h>
 # include <sys/types.h>
@@ -37,7 +35,7 @@ extern "C"
 # include <string.h>
 # include <math.h>
 # include <time.h>
-}
+
 #endif
 
 /*!
diff --git a/myserver/src/base/files_cache/membuf_file.cpp b/myserver/src/base/files_cache/membuf_file.cpp
index dd2dd68..e88823b 100644
--- a/myserver/src/base/files_cache/membuf_file.cpp
+++ b/myserver/src/base/files_cache/membuf_file.cpp
@@ -23,8 +23,6 @@
 #include <include/base/files_cache/membuf_file.h>
 
 #ifndef WIN32
-extern "C"
-{
 # include <fcntl.h>
 # include <unistd.h>
 # include <sys/types.h>
@@ -36,7 +34,7 @@ extern "C"
 # include <string.h>
 # include <math.h>
 # include <time.h>
-}
+
 #endif
 
 #include <string>
diff --git a/myserver/src/base/home_dir/home_dir.cpp b/myserver/src/base/home_dir/home_dir.cpp
index b360b58..4699c00 100644
--- a/myserver/src/base/home_dir/home_dir.cpp
+++ b/myserver/src/base/home_dir/home_dir.cpp
@@ -27,8 +27,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # include <userenv.h>
 #endif
 
-extern "C"
-{
 #include <string.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -49,7 +47,7 @@ extern "C"
 
 # include <sys/wait.h>
 #endif
-}
+
 
 #ifdef WIN32
 # include <direct.h>
diff --git a/myserver/src/base/pipe/pipe.cpp b/myserver/src/base/pipe/pipe.cpp
index 62256e5..733e764 100644
--- a/myserver/src/base/pipe/pipe.cpp
+++ b/myserver/src/base/pipe/pipe.cpp
@@ -22,8 +22,6 @@
 #include <include/base/pipe/pipe.h>
 
 #ifndef WIN32
-extern "C"
-{
 # include <fcntl.h>
 # include <unistd.h>
 # include <sys/types.h>
@@ -35,7 +33,7 @@ extern "C"
 # include <string.h>
 # include <math.h>
 # include <time.h>
-}
+
 #else
 # include <windows.h>
 #endif
diff --git a/myserver/src/base/process/fork_server.cpp b/myserver/src/base/process/fork_server.cpp
index d3bd03a..f3f25cf 100644
--- a/myserver/src/base/process/fork_server.cpp
+++ b/myserver/src/base/process/fork_server.cpp
@@ -22,11 +22,9 @@
 #include <include/base/utility.h>
 
 #ifndef WIN32
-extern "C"
-{
 # include <unistd.h>
 # include <sys/wait.h>
-}
+
 #endif
 /*!
  *Write a string to the socket.
diff --git a/myserver/src/base/process/process.cpp b/myserver/src/base/process/process.cpp
index 0f8c542..2f08615 100644
--- a/myserver/src/base/process/process.cpp
+++ b/myserver/src/base/process/process.cpp
@@ -20,8 +20,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "myserver.h"
 #include <include/base/utility.h>
 
-extern "C"
-{
 #include <errno.h>
 #include <string.h>
 #include <stdlib.h>
@@ -42,7 +40,7 @@ extern "C"
 # endif
 
 #endif
-}
+
 
 #ifndef UID_T_MAX
 # define UID_T_MAX (1<<31)
diff --git a/myserver/src/base/read_directory/read_directory.cpp b/myserver/src/base/read_directory/read_directory.cpp
index 40d9e03..8e02794 100644
--- a/myserver/src/base/read_directory/read_directory.cpp
+++ b/myserver/src/base/read_directory/read_directory.cpp
@@ -20,8 +20,6 @@
 
 #include <include/base/read_directory/read_directory.h>
 
-extern "C"
-{
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
@@ -29,7 +27,7 @@ extern "C"
 #ifdef HAVE_OPENAT
 # include <fcntl.h>
 #endif
-}
+
 
 using namespace std;
 
diff --git a/myserver/src/base/safetime/safetime.cpp b/myserver/src/base/safetime/safetime.cpp
index 1d4754d..3bb1eeb 100644
--- a/myserver/src/base/safetime/safetime.cpp
+++ b/myserver/src/base/safetime/safetime.cpp
@@ -20,14 +20,13 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <include/base/safetime/safetime.h>
 #include <include/base/sync/mutex.h>
 
-extern "C" {
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
 #ifndef WIN32
 # include <stdio.h>
 #endif
-}
+
 
 #ifndef WIN32
 # if !HAVE_LOCALTIME_R
diff --git a/myserver/src/base/socket/socket.cpp b/myserver/src/base/socket/socket.cpp
index 0f1409d..f2bab81 100644
--- a/myserver/src/base/socket/socket.cpp
+++ b/myserver/src/base/socket/socket.cpp
@@ -22,8 +22,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <include/base/socket/socket.h>
 #include <include/base/utility.h>
 
-extern "C"
-{
 #include <sys/ioctl.h>
 #include <errno.h>
 
@@ -33,7 +31,7 @@ extern "C"
 # include <netinet/in.h>
 # include <arpa/inet.h>
 #endif
-}
+
 
 #include <sstream>
 
diff --git a/myserver/src/base/socket/ssl_socket.cpp b/myserver/src/base/socket/ssl_socket.cpp
index d6e25e8..9804890 100644
--- a/myserver/src/base/socket/ssl_socket.cpp
+++ b/myserver/src/base/socket/ssl_socket.cpp
@@ -21,8 +21,6 @@
 #include <include/base/utility.h>
 #include "include/base/socket/ssl_socket.h"
 
-extern "C"
-{
 #include <string.h>
 #include <stdio.h>
 #include <sys/types.h>
@@ -36,7 +34,7 @@ extern "C"
 # include <netinet/in.h>
 # include <arpa/inet.h>
 #endif
-}
+
 
 #include <sstream>
 
diff --git a/myserver/src/base/socket_pair/socket_pair.cpp b/myserver/src/base/socket_pair/socket_pair.cpp
index d2d3dbb..e3bcf2f 100644
--- a/myserver/src/base/socket_pair/socket_pair.cpp
+++ b/myserver/src/base/socket_pair/socket_pair.cpp
@@ -21,8 +21,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <include/base/socket_pair/socket_pair.h>
 
 #ifndef WIN32
-extern "C"
-{
 # include <fcntl.h>
 # include <unistd.h>
 # include <sys/types.h>
@@ -37,7 +35,7 @@ extern "C"
 
 # include <sys/socket.h>
 # include <sys/uio.h>
-}
+
 #else
 # include <windows.h>
 #endif
diff --git a/myserver/src/base/ssl/ssl.cpp b/myserver/src/base/ssl/ssl.cpp
index f3b7c43..f249b22 100644
--- a/myserver/src/base/ssl/ssl.cpp
+++ b/myserver/src/base/ssl/ssl.cpp
@@ -23,8 +23,6 @@
 
 #include <string.h>
 
-extern "C"
-{
 #if HAVE_PTHREAD
 # include <pthread.h>
 #endif
@@ -43,7 +41,7 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL;
 # undef malloc
 # endif
 #endif
-}
+
 
 SslContext::SslContext ()
 {
diff --git a/myserver/src/base/string/stringutils.cpp b/myserver/src/base/string/stringutils.cpp
index c5c3061..5a76950 100644
--- a/myserver/src/base/string/stringutils.cpp
+++ b/myserver/src/base/string/stringutils.cpp
@@ -20,15 +20,13 @@
 #include <include/base/string/stringutils.h>
 #include <include/base/safetime/safetime.h>
 
-extern "C"
-{
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
 #ifndef WIN32
 # include <stdio.h>
 #endif
-}
+
 
 #ifdef GETTIMEOFDAY
 # include <sys/time.h>
diff --git a/myserver/src/base/sync/event.cpp b/myserver/src/base/sync/event.cpp
index 1db107d..20583aa 100644
--- a/myserver/src/base/sync/event.cpp
+++ b/myserver/src/base/sync/event.cpp
@@ -20,7 +20,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "myserver.h"
 #include <include/base/sync/event.h>
 
-extern "C" {
 #include <string.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -37,7 +36,7 @@ extern "C" {
 # endif
 # include <sys/wait.h>
 #endif
-}
+
 
 #include <sys/types.h>
 
diff --git a/myserver/src/base/sync/mutex.cpp b/myserver/src/base/sync/mutex.cpp
index bc59835..f86fe18 100644
--- a/myserver/src/base/sync/mutex.cpp
+++ b/myserver/src/base/sync/mutex.cpp
@@ -21,7 +21,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <include/base/utility.h>
 #include <include/base/sync/mutex.h>
 
-extern "C" {
 #include <string.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -36,7 +35,7 @@ extern "C" {
 # endif
 # include <sys/wait.h>
 #endif
-}
+
 
 #include <sys/types.h>
 
diff --git a/myserver/src/base/sync/recursive_mutex.cpp b/myserver/src/base/sync/recursive_mutex.cpp
index c035ca8..8834dac 100644
--- a/myserver/src/base/sync/recursive_mutex.cpp
+++ b/myserver/src/base/sync/recursive_mutex.cpp
@@ -20,7 +20,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "myserver.h"
 #include <include/base/sync/recursive_mutex.h>
 
-extern "C" {
 #include <string.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -35,7 +34,7 @@ extern "C" {
 # endif
 # include <sys/wait.h>
 #endif
-}
+
 
 #include <sys/types.h>
 
diff --git a/myserver/src/base/sync/semaphore.cpp b/myserver/src/base/sync/semaphore.cpp
index f37ef3c..6219549 100644
--- a/myserver/src/base/sync/semaphore.cpp
+++ b/myserver/src/base/sync/semaphore.cpp
@@ -21,7 +21,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <include/base/utility.h>
 #include <include/base/sync/semaphore.h>
 
-extern "C" {
 #include <string.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -38,7 +37,7 @@ extern "C" {
 # endif
 # include <sys/wait.h>
 #endif
-}
+
 
 #include <sys/types.h>
 
diff --git a/myserver/src/base/thread/thread.cpp b/myserver/src/base/thread/thread.cpp
index f77e38e..7820cee 100644
--- a/myserver/src/base/thread/thread.cpp
+++ b/myserver/src/base/thread/thread.cpp
@@ -21,8 +21,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <include/base/utility.h>
 #include <include/base/thread/thread.h>
 
-extern "C"
-{
 #include <string.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -37,7 +35,7 @@ extern "C"
 # endif
 # include <sys/wait.h>
 #endif
-}
+
 
 #include <sys/types.h>
 
diff --git a/myserver/src/base/utility.cpp b/myserver/src/base/utility.cpp
index cca09f1..06ea7ff 100644
--- a/myserver/src/base/utility.cpp
+++ b/myserver/src/base/utility.cpp
@@ -23,6 +23,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 extern "C"
 {
 #include <chdir-long.h>
+}
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -39,7 +40,7 @@ extern "C"
 #  include <error.h>
 # endif
 #endif
-}
+
 
 #ifdef WIN32
 # include <direct.h>
diff --git a/myserver/src/base/xml/xml_parser.cpp b/myserver/src/base/xml/xml_parser.cpp
index efbe0f6..13b0b8f 100644
--- a/myserver/src/base/xml/xml_parser.cpp
+++ b/myserver/src/base/xml/xml_parser.cpp
@@ -22,10 +22,8 @@
 #include <include/base/utility.h>
 #include <include/base/file/files_utility.h>
 
-extern "C"
-{
 #include <string.h>
-}
+
 
 /**
  * Internal call back functions for saveMemBuf
diff --git a/myserver/src/connections_scheduler/connections_scheduler.cpp b/myserver/src/connections_scheduler/connections_scheduler.cpp
index d124807..0d34e49 100644
--- a/myserver/src/connections_scheduler/connections_scheduler.cpp
+++ b/myserver/src/connections_scheduler/connections_scheduler.cpp
@@ -20,10 +20,8 @@
 #undef remove
 
 #ifdef WIN32
-extern "C"
-{
 # include <w32sock.h>
-}
+
 #endif
 
 #include <include/connections_scheduler/connections_scheduler.h>
diff --git a/myserver/src/connections_scheduler/listen_threads.cpp b/myserver/src/connections_scheduler/listen_threads.cpp
index 0185ba6..4f94a4b 100644
--- a/myserver/src/connections_scheduler/listen_threads.cpp
+++ b/myserver/src/connections_scheduler/listen_threads.cpp
@@ -23,8 +23,6 @@
 #include <include/base/sync/semaphore.h>
 #include <include/base/sync/event.h>
 
-extern "C"
-{
 #ifdef WIN32
 # include <direct.h>
 #endif
@@ -40,7 +38,7 @@ extern "C"
 #  include <pthread.h>
 # endif
 #endif
-}
+
 
 #include <set>
 #include <algorithm>
diff --git a/myserver/src/filter/gzip/gzip.cpp b/myserver/src/filter/gzip/gzip.cpp
index 50b6d21..8f8fdc5 100644
--- a/myserver/src/filter/gzip/gzip.cpp
+++ b/myserver/src/filter/gzip/gzip.cpp
@@ -21,8 +21,6 @@
 #include <include/filter/gzip/gzip.h>
 #include <include/base/string/securestr.h>
 
-extern "C"
-{
 #ifdef WIN32
 # include <direct.h>
 # include <errno.h>
@@ -31,7 +29,7 @@ extern "C"
 # include <string.h>
 # include <errno.h>
 #endif
-}
+
 
 #ifdef WIN32
 # include <algorithm>
diff --git a/myserver/src/filter/gzip/gzip_decompress.cpp b/myserver/src/filter/gzip/gzip_decompress.cpp
index 80d6c3e..4cb69c8 100644
--- a/myserver/src/filter/gzip/gzip_decompress.cpp
+++ b/myserver/src/filter/gzip/gzip_decompress.cpp
@@ -20,8 +20,6 @@
 #include <include/filter/gzip/gzip_decompress.h>
 #include <include/base/string/securestr.h>
 
-extern "C"
-{
 #ifdef WIN32
 # include <direct.h>
 # include <errno.h>
@@ -29,7 +27,7 @@ extern "C"
 # include <string.h>
 # include <errno.h>
 #endif
-}
+
 #ifdef WIN32
 # include <algorithm>
 #endif
diff --git a/myserver/src/http_handler/cgi/cgi.cpp b/myserver/src/http_handler/cgi/cgi.cpp
index 1b887d4..45bce5a 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -36,13 +36,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <string>
 #include <sstream>
 
-extern "C"
-{
 #ifdef WIN32
 # include <direct.h>
 #endif
 #include <string.h>
-}
+
 
 using namespace std;
 
diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp b/myserver/src/http_handler/http_dir/http_dir.cpp
index 7742053..89b0060 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -24,8 +24,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <include/filter/filters_chain.h>
 #include <include/base/file/files_utility.h>
 
-extern "C"
-{
 #include <errno.h>
 
 #ifdef WIN32
@@ -33,7 +31,7 @@ extern "C"
 #else
 # include <string.h>
 #endif
-}
+
 
 #include <include/base/read_directory/read_directory.h>
 #include <include/base/string/stringutils.h>
diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 5936067..6600076 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -28,8 +28,6 @@
 #include <algorithm>
 using namespace std;
 
-extern "C"
-{
 #ifdef WIN32
 # include <direct.h>
 # include <errno.h>
@@ -37,7 +35,7 @@ extern "C"
 # include <string.h>
 # include <errno.h>
 #endif
-}
+
 
 /*!
   Main function to handle the HTTP PUT command.
diff --git a/myserver/src/http_handler/wincgi/wincgi.cpp b/myserver/src/http_handler/wincgi/wincgi.cpp
index 6f41ebb..05154d0 100644
--- a/myserver/src/http_handler/wincgi/wincgi.cpp
+++ b/myserver/src/http_handler/wincgi/wincgi.cpp
@@ -29,14 +29,12 @@
 #include <include/filter/filters_chain.h>
 #include <include/base/safetime/safetime.h>
 
-extern "C"
-{
 #ifdef WIN32
 # include <direct.h>
 #endif
 
 #include <string.h>
-}
+
 
 #include <string>
 #include <sstream>
diff --git a/myserver/src/myserver.cpp b/myserver/src/myserver.cpp
index ea51af4..59f4874 100644
--- a/myserver/src/myserver.cpp
+++ b/myserver/src/myserver.cpp
@@ -23,8 +23,6 @@
 #include <include/base/process/process.h>
 #include <include/conf/main/xml_main_configuration.h>
 
-extern "C"
-{
 #ifdef WIN32
 # include <direct.h>
 #endif
@@ -36,7 +34,7 @@ extern "C"
 # include <unistd.h>
 # include <signal.h>
 #endif
-}
+
 
 #ifdef HAVE_GETTEXT
 # include "localedir.h"
diff --git a/myserver/src/plugin/plugins_manager.cpp b/myserver/src/plugin/plugins_manager.cpp
index 935b560..9b2cf35 100644
--- a/myserver/src/plugin/plugins_manager.cpp
+++ b/myserver/src/plugin/plugins_manager.cpp
@@ -25,14 +25,12 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <string>
 #include <memory>
 
-extern "C"
-{
 #include <libxml/xmlmemory.h>
 #include <libxml/parser.h>
 #include <libxml/tree.h>
 #include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
-}
+
 
 using namespace std;
 
diff --git a/myserver/src/protocol/control/control_header.cpp b/myserver/src/protocol/control/control_header.cpp
index 883cb5a..9c873b7 100644
--- a/myserver/src/protocol/control/control_header.cpp
+++ b/myserver/src/protocol/control/control_header.cpp
@@ -23,8 +23,6 @@
 #include <include/protocol/control/control_header.h>
 #include <include/base/xml/xml_parser.h>
 #include <include/protocol/control/control_errors.h>
-extern "C"
-{
 #ifdef WIN32
 # include <direct.h>
 # include <errno.h>
@@ -33,7 +31,7 @@ extern "C"
 # include <string.h>
 # include <errno.h>
 #endif
-}
+
 
 /*!
  *Return a string containing options specified by the client.
diff --git a/myserver/src/protocol/control/control_protocol.cpp b/myserver/src/protocol/control/control_protocol.cpp
index 5be58f9..a6cc066 100644
--- a/myserver/src/protocol/control/control_protocol.cpp
+++ b/myserver/src/protocol/control/control_protocol.cpp
@@ -30,8 +30,6 @@
 #include <include/base/file/files_utility.h>
 #include <string.h>
 
-extern "C"
-{
 #include <stdio.h>
 
 #ifdef WIN32
@@ -41,7 +39,7 @@ extern "C"
 # include <string.h>
 # include <errno.h>
 #endif
-}
+
 #include <string>
 #include <sstream>
 
diff --git a/myserver/src/protocol/http/env/env.cpp b/myserver/src/protocol/http/env/env.cpp
index b506d35..fa088fd 100644
--- a/myserver/src/protocol/http/env/env.cpp
+++ b/myserver/src/protocol/http/env/env.cpp
@@ -27,13 +27,11 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <sstream>
 #include <algorithm>
 
-extern "C"
-{
 #ifdef WIN32
 # include <direct.h>
 #endif
 #include <string.h>
-}
+
 
 using namespace std;
 
diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index 51f3af0..61450f7 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -51,8 +51,6 @@
 
 using namespace std;
 
-extern "C"
-{
 #ifdef WIN32
 # include <direct.h>
 # include <errno.h>
@@ -62,7 +60,7 @@ extern "C"
 # include <string.h>
 # include <errno.h>
 #endif
-}
+
 
 int HttpProtocol::loadProtocol ()
 {
diff --git a/myserver/src/protocol/http/http_headers.cpp b/myserver/src/protocol/http/http_headers.cpp
index 05bce44..1bb07e2 100644
--- a/myserver/src/protocol/http/http_headers.cpp
+++ b/myserver/src/protocol/http/http_headers.cpp
@@ -28,8 +28,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <include/protocol/http/http_errors.h>
 #include <include/conf/vhost/vhost.h>
 
-extern "C"
-{
 #ifdef WIN32
 # include <direct.h>
 # include <errno.h>
@@ -37,7 +35,7 @@ extern "C"
 # include <string.h>
 # include <errno.h>
 #endif
-}
+
 
 /*!
  * Builds an HTTP header string starting from an HttpResponseHeader structure.
diff --git a/myserver/src/protocol/https/https.cpp b/myserver/src/protocol/https/https.cpp
index e60ae67..0dee320 100644
--- a/myserver/src/protocol/https/https.cpp
+++ b/myserver/src/protocol/https/https.cpp
@@ -21,8 +21,6 @@
 #include <include/protocol/protocol.h>
 #include <include/protocol/https/https.h>
 
-extern "C"
-{
 #ifdef WIN32
 # include <direct.h>
 # include <errno.h>
@@ -31,7 +29,7 @@ extern "C"
 # include <string.h>
 # include <errno.h>
 #endif
-}
+
 
 /*!
   Returns the name of the protocol. If an out buffer is defined
diff --git a/myserver/src/server/clients_thread.cpp b/myserver/src/server/clients_thread.cpp
index 903dfe6..da1aebc 100644
--- a/myserver/src/server/clients_thread.cpp
+++ b/myserver/src/server/clients_thread.cpp
@@ -31,8 +31,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <include/protocol/ftp/ftp.h>
 
 #ifndef WIN32
-extern "C"
-{
 # include <sys/socket.h>
 # include <netinet/in.h>
 # include <arpa/inet.h>
@@ -45,7 +43,7 @@ extern "C"
 # endif
 # include <sys/types.h>
 # include <sys/wait.h>
-}
+
 #endif
 
 /*!
diff --git a/myserver/src/server/server.cpp b/myserver/src/server/server.cpp
index ac522a7..528bf0f 100644
--- a/myserver/src/server/server.cpp
+++ b/myserver/src/server/server.cpp
@@ -41,8 +41,6 @@
 #include <cstdarg>
 
 
-extern "C"
-{
 #ifdef WIN32
 # include <direct.h>
 #else
@@ -59,7 +57,7 @@ extern "C"
 # endif
 
 #endif
-}
+
 #include <sstream>
 
 Server* Server::instance = NULL;
diff --git a/myserver/tests/test_socket.cpp b/myserver/tests/test_socket.cpp
index 385984c..5b6f18e 100644
--- a/myserver/tests/test_socket.cpp
+++ b/myserver/tests/test_socket.cpp
@@ -26,14 +26,12 @@
 #include "../include/base/thread/thread.h"
 #include "../include/base/utility.h"
 
-extern "C"
-{
 #include <string.h>
 #ifndef WIN32
 # include <errno.h>
 # include <arpa/inet.h>
 #endif
-}
+
 #include <iostream>
 
 using namespace std;
diff --git a/myserver/tests/test_ssl_socket.cpp b/myserver/tests/test_ssl_socket.cpp
index a65d618..f54d831 100644
--- a/myserver/tests/test_ssl_socket.cpp
+++ b/myserver/tests/test_ssl_socket.cpp
@@ -32,14 +32,12 @@
 #include <include/base/thread/thread.h>
 #include <include/base/utility.h>
 
-extern "C"
-{
 #include <string.h>
 #ifndef WIN32
 # include <errno.h>
 # include <arpa/inet.h>
 #endif
-}
+
 
 #include <string>
 #include <iostream>

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

Summary of changes:
 myserver/include/base/crypt/sha1.h                 |    4 +---
 myserver/include/base/dynamic_lib/dynamiclib.h     |    4 +---
 .../include/base/read_directory/read_directory.h   |    4 +---
 myserver/include/base/regex/myserver_regex.h       |    4 +---
 myserver/include/base/socket/socket.h              |    8 ++------
 myserver/include/base/socket/ssl_socket.h          |    4 +---
 myserver/include/base/xml/xml_parser.h             |    4 +---
 myserver/include/conf/mime/mime_manager.h          |    4 +---
 myserver/include/conf/mime/xml_mime_handler.h      |    4 +---
 myserver/include/connection/connection.h           |    4 +---
 myserver/include/protocol/http/http_headers.h      |    4 +---
 .../include/protocol/http/http_thread_context.h    |    4 +---
 myserver/myserver.h                                |   12 +++---------
 myserver/src/base/base64/mime_utils.cpp            |    4 +---
 myserver/src/base/file/file.cpp                    |    4 +---
 myserver/src/base/file/files_utility.cpp           |    8 ++------
 myserver/src/base/files_cache/cached_file.cpp      |    4 +---
 .../src/base/files_cache/cached_file_buffer.cpp    |    4 +---
 .../src/base/files_cache/cached_file_factory.cpp   |    4 +---
 myserver/src/base/files_cache/membuf_file.cpp      |    4 +---
 myserver/src/base/home_dir/home_dir.cpp            |    4 +---
 myserver/src/base/pipe/pipe.cpp                    |    4 +---
 myserver/src/base/process/fork_server.cpp          |    4 +---
 myserver/src/base/process/process.cpp              |    4 +---
 .../src/base/read_directory/read_directory.cpp     |    4 +---
 myserver/src/base/safetime/safetime.cpp            |    3 +--
 myserver/src/base/socket/socket.cpp                |    4 +---
 myserver/src/base/socket/ssl_socket.cpp            |    4 +---
 myserver/src/base/socket_pair/socket_pair.cpp      |    4 +---
 myserver/src/base/ssl/ssl.cpp                      |    4 +---
 myserver/src/base/string/stringutils.cpp           |    4 +---
 myserver/src/base/sync/event.cpp                   |    3 +--
 myserver/src/base/sync/mutex.cpp                   |    3 +--
 myserver/src/base/sync/recursive_mutex.cpp         |    3 +--
 myserver/src/base/sync/semaphore.cpp               |    3 +--
 myserver/src/base/thread/thread.cpp                |    4 +---
 myserver/src/base/utility.cpp                      |    3 ++-
 myserver/src/base/xml/xml_parser.cpp               |    4 +---
 .../connections_scheduler.cpp                      |    4 +---
 .../src/connections_scheduler/listen_threads.cpp   |    4 +---
 myserver/src/filter/gzip/gzip.cpp                  |    4 +---
 myserver/src/filter/gzip/gzip_decompress.cpp       |    4 +---
 myserver/src/http_handler/cgi/cgi.cpp              |    4 +---
 myserver/src/http_handler/http_dir/http_dir.cpp    |    4 +---
 myserver/src/http_handler/http_file/http_file.cpp  |    4 +---
 myserver/src/http_handler/wincgi/wincgi.cpp        |    4 +---
 myserver/src/myserver.cpp                          |    4 +---
 myserver/src/plugin/plugins_manager.cpp            |    4 +---
 myserver/src/protocol/control/control_header.cpp   |    4 +---
 myserver/src/protocol/control/control_protocol.cpp |    4 +---
 myserver/src/protocol/http/env/env.cpp             |    4 +---
 myserver/src/protocol/http/http.cpp                |    4 +---
 myserver/src/protocol/http/http_headers.cpp        |    4 +---
 myserver/src/protocol/https/https.cpp              |    4 +---
 myserver/src/server/clients_thread.cpp             |    4 +---
 myserver/src/server/server.cpp                     |    4 +---
 myserver/tests/test_socket.cpp                     |    4 +---
 myserver/tests/test_ssl_socket.cpp                 |    4 +---
 58 files changed, 63 insertions(+), 179 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Wed Apr 07 16:58:10 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NzcK9-00024Q-SC
	for mharc-myserver-commit@gnu.org; Wed, 07 Apr 2010 16:58:09 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NzcK7-00023d-MI
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 16:58:07 -0400
Received: from [140.186.70.92] (port=45277 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NzcK6-000234-CA
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 16:58:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NzcK5-0002YO-I3
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 16:58:06 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:59053
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NzcK5-0002YK-GM
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 16:58:05 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NzcK4-0007F0-Je
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 20:58:04 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1NzcK3-0006MD-Tw
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 20:58:04 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: c0ea46ae4789aa18dbe377489d5a5134f62f1cc3
X-Git-Newrev: a9728d229b5c46dd2b654325dd4dba011dd4e7cd
Message-Id: <E1NzcK3-0006MD-Tw@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Wed, 07 Apr 2010 20:58:04 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-103-ga9728d2
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, 07 Apr 2010 20:58:08 -0000

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

The branch, master has been updated
       via  a9728d229b5c46dd2b654325dd4dba011dd4e7cd (commit)
      from  c0ea46ae4789aa18dbe377489d5a5134f62f1cc3 (commit)

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

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


commit a9728d229b5c46dd2b654325dd4dba011dd4e7cd
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Wed Apr 7 23:41:22 2010 +0200

    Ensure the tested local time is after the epoch everywhere.

diff --git a/myserver/tests/test_safetime.cpp b/myserver/tests/test_safetime.cpp
index a0ba88c..e6c8af7 100644
--- a/myserver/tests/test_safetime.cpp
+++ b/myserver/tests/test_safetime.cpp
@@ -50,7 +50,7 @@ public:
   void testLocalTime ()
   {
     tm res;
-    time_t timep = 10;
+    time_t timep = 60 * 60 *4 + 10;
     tm *outRes = myserver_localtime (&timep, &res);
 
     CPPUNIT_ASSERT (outRes);

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

Summary of changes:
 myserver/tests/test_safetime.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Wed Apr 07 19:10:11 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NzeNv-0004Ec-LE
	for mharc-myserver-commit@gnu.org; Wed, 07 Apr 2010 19:10:11 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NzeNu-0004Dq-BP
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 19:10:10 -0400
Received: from [140.186.70.92] (port=35519 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NzeNs-0004Cz-Ph
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 19:10:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NzeNr-0005DU-3d
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 19:10:08 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:56705
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NzeNr-0005DK-1v
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 19:10:07 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NzeNq-0000Qz-Fx
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 23:10:06 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1NzeNn-00049j-QJ
	for myserver-commit@gnu.org; Wed, 07 Apr 2010 23:10:06 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: a9728d229b5c46dd2b654325dd4dba011dd4e7cd
X-Git-Newrev: bd9d319c5d2fb1314cf89184dc91d416523aa26e
Message-Id: <E1NzeNn-00049j-QJ@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Wed, 07 Apr 2010 23:10:05 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-105-gbd9d319
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, 07 Apr 2010 23:10:10 -0000

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

The branch, master has been updated
       via  bd9d319c5d2fb1314cf89184dc91d416523aa26e (commit)
       via  49a6ab8cf8e1d68f09c0fe883d087208d5fe3c9d (commit)
      from  a9728d229b5c46dd2b654325dd4dba011dd4e7cd (commit)

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

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


commit bd9d319c5d2fb1314cf89184dc91d416523aa26e
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 8 01:08:31 2010 +0200

    Use an union to compound messages for `sendmsg' and `recvmsg'.
    
    Add a test to exercise `readFileHandle' and `writeFileHandle'.

diff --git a/myserver/src/base/utility.cpp b/myserver/src/base/utility.cpp
index 06ea7ff..4b8464e 100644
--- a/myserver/src/base/utility.cpp
+++ b/myserver/src/base/utility.cpp
@@ -223,25 +223,29 @@ int readFileHandle (SocketHandle s, Handle* fd)
   return -1;
 #else
   struct msghdr mh;
-  struct cmsghdr cmh[2];
+  union
+  {
+    struct cmsghdr cmh;
+    char buffer[CMSG_SPACE (sizeof (int))];
+  } cmh;
+  char tbuf[4];
   struct iovec iov;
   int ret;
-  char tbuf[4];
   mh.msg_name = 0;
   mh.msg_namelen = 0;
   mh.msg_iov = &iov;
   mh.msg_iovlen = 1;
-  mh.msg_control = (caddr_t)&cmh[0];
-  mh.msg_controllen = sizeof (cmh[0]) * 2;
+  mh.msg_control = (caddr_t) &cmh;
+  mh.msg_controllen = sizeof (cmh);
   iov.iov_base = tbuf;
   iov.iov_len = 4;
-  cmh[0].cmsg_len = sizeof (cmh[0]) + sizeof (int);
-  ret = recvmsg (s, &mh, 0);
+  cmh.cmh.cmsg_len = sizeof (cmh);
 
+  ret = recvmsg (s, &mh, 0);
   if (ret < 0)
     return ret;
 
-  *fd = *(FileHandle *)&cmh[1];
+  *fd = *((int *) CMSG_DATA (CMSG_FIRSTHDR (&mh)));
 
   return 0;
 #endif
@@ -259,23 +263,28 @@ int writeFileHandle (SocketHandle s, Handle fd)
   return -1;
 #else
   struct msghdr mh;
-  struct cmsghdr cmh[2];
-  struct iovec iov;
+  union
+  {
+    struct cmsghdr cmh;
+    char buffer[CMSG_SPACE (sizeof (int))];
+  } cmh;
   char tbuf[4];
-  memset (&mh,0,sizeof (mh));
+  struct iovec iov;
+  memset (&mh, 0, sizeof (mh));
   mh.msg_name = 0;
   mh.msg_namelen = 0;
   mh.msg_iov = &iov;
   mh.msg_iovlen = 1;
-  mh.msg_control = (caddr_t)&cmh[0];
-  mh.msg_controllen = sizeof (cmh[0]) + sizeof (int);
+  mh.msg_control = (caddr_t) &cmh;
+  mh.msg_controllen = sizeof (cmh);
   mh.msg_flags = 0;
   iov.iov_base = tbuf;
   iov.iov_len = 4;
-  cmh[0].cmsg_level = SOL_SOCKET;
-  cmh[0].cmsg_type = SCM_RIGHTS;
-  cmh[0].cmsg_len = sizeof (cmh[0]) + sizeof (int);
-  *(int *)&cmh[1] = fd;
+  cmh.cmh.cmsg_level = SOL_SOCKET;
+  cmh.cmh.cmsg_type = SCM_RIGHTS;
+  cmh.cmh.cmsg_len = sizeof (cmh);
+  *((int *) CMSG_DATA (&cmh.cmh)) = fd;
+
   return sendmsg (s, &mh, 0);
 #endif
 }
diff --git a/myserver/tests/test_unix_socket.cpp b/myserver/tests/test_unix_socket.cpp
index b6ea1c9..b4e073e 100644
--- a/myserver/tests/test_unix_socket.cpp
+++ b/myserver/tests/test_unix_socket.cpp
@@ -27,6 +27,7 @@
 #include <include/base/file/files_utility.h>
 #include <include/base/unix_socket/unix_socket.h>
 #include <include/base/thread/thread.h>
+#include <include/base/pipe/pipe.h>
 #include <string.h>
 
 #ifdef AF_UNIX
@@ -70,6 +71,7 @@ class TestUnixSocket : public CppUnit::TestFixture
   CPPUNIT_TEST_SUITE ( TestUnixSocket );
   CPPUNIT_TEST ( testBind );
   CPPUNIT_TEST ( testClient );
+  CPPUNIT_TEST ( testReadWriteHandle );
   CPPUNIT_TEST_SUITE_END ();
 
   UnixSocket *sock;
@@ -136,6 +138,45 @@ public:
 
     CPPUNIT_ASSERT_EQUAL (data.result, true);
   }
+
+
+  void testReadWriteHandle ()
+  {
+# ifndef WIN32
+    const char *msg = "hello world";
+    ThreadID tid;
+    Pipe pipe;
+    u_long nbw;
+    char buffer[64];
+    string path;
+    FilesUtility::temporaryFileName (0, path);
+    sock->socket ();
+    sock->bind (path.c_str ());
+    CPPUNIT_ASSERT_EQUAL (sock->listen (1), 0);
+
+    pipe.create ();
+    CPPUNIT_ASSERT (! pipe.write (msg, strlen (msg), &nbw));
+
+    UnixSocket client;
+    client.socket ();
+    CPPUNIT_ASSERT_EQUAL (client.connect (path.c_str ()), 0);
+
+    Socket clientRecv = sock->accept ();
+    Handle fd;
+
+    CPPUNIT_ASSERT (writeFileHandle (client.getHandle (), pipe.getReadHandle ()) >= 0);
+    CPPUNIT_ASSERT (readFileHandle (clientRecv.getHandle (), &fd) >= 0);
+
+    CPPUNIT_ASSERT (read (fd, buffer, 64) > 0);
+
+    CPPUNIT_ASSERT_EQUAL (strcmp (buffer, msg), 0);
+
+    clientRecv.close ();
+    client.shutdown ();
+    client.close ();
+# endif
+  }
+
 };
 
 CPPUNIT_TEST_SUITE_REGISTRATION ( TestUnixSocket );



commit 49a6ab8cf8e1d68f09c0fe883d087208d5fe3c9d
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 8 00:43:10 2010 +0200

    Amend to the last commit

diff --git a/myserver/tests/test_safetime.cpp b/myserver/tests/test_safetime.cpp
index e6c8af7..3b458fd 100644
--- a/myserver/tests/test_safetime.cpp
+++ b/myserver/tests/test_safetime.cpp
@@ -50,7 +50,7 @@ public:
   void testLocalTime ()
   {
     tm res;
-    time_t timep = 60 * 60 *4 + 10;
+    time_t timep = 60 * 60 * 24 + 10;
     tm *outRes = myserver_localtime (&timep, &res);
 
     CPPUNIT_ASSERT (outRes);

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

Summary of changes:
 myserver/src/base/utility.cpp       |   41 +++++++++++++++++++++-------------
 myserver/tests/test_safetime.cpp    |    2 +-
 myserver/tests/test_unix_socket.cpp |   41 +++++++++++++++++++++++++++++++++++
 3 files changed, 67 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Thu Apr 08 06:27:02 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Nzowv-0000JR-LV
	for mharc-myserver-commit@gnu.org; Thu, 08 Apr 2010 06:27:01 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Nzowt-0000JK-MD
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 06:26:59 -0400
Received: from [140.186.70.92] (port=49926 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Nzows-0000J7-98
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 06:26:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1Nzowr-0004hU-1T
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 06:26:58 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:58436
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1Nzowq-0004hN-NI
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 06:26:56 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1Nzowq-00009p-3S
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 10:26:56 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1Nzowo-0004B7-C7
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 10:26:56 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: bd9d319c5d2fb1314cf89184dc91d416523aa26e
X-Git-Newrev: 219c71afaa76c282119e79a7b2c4cedc641268bd
Message-Id: <E1Nzowo-0004B7-C7@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Thu, 08 Apr 2010 10:26:55 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-107-g219c71a
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, 08 Apr 2010 10:26:59 -0000

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

The branch, master has been updated
       via  219c71afaa76c282119e79a7b2c4cedc641268bd (commit)
       via  84268d964119f39735f85a9b518b329da8495a44 (commit)
      from  bd9d319c5d2fb1314cf89184dc91d416523aa26e (commit)

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

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


commit 219c71afaa76c282119e79a7b2c4cedc641268bd
Author: User <gscrivano@gcc101.hackershells.com>
Date:   Thu Apr 8 03:22:46 2010 -0700

    Fix `writeFileHandle' and `readFileHandle' under FreeBSD 8.0 amd64

diff --git a/myserver/src/base/utility.cpp b/myserver/src/base/utility.cpp
index 4b8464e..a7b4653 100644
--- a/myserver/src/base/utility.cpp
+++ b/myserver/src/base/utility.cpp
@@ -231,22 +231,22 @@ int readFileHandle (SocketHandle s, Handle* fd)
   char tbuf[4];
   struct iovec iov;
   int ret;
-  mh.msg_name = 0;
-  mh.msg_namelen = 0;
+  struct cmsghdr *cmsg;
+
+  memset (&mh, 0, sizeof (mh));
   mh.msg_iov = &iov;
   mh.msg_iovlen = 1;
   mh.msg_control = (caddr_t) &cmh;
   mh.msg_controllen = sizeof (cmh);
   iov.iov_base = tbuf;
   iov.iov_len = 4;
-  cmh.cmh.cmsg_len = sizeof (cmh);
 
   ret = recvmsg (s, &mh, 0);
   if (ret < 0)
     return ret;
 
-  *fd = *((int *) CMSG_DATA (CMSG_FIRSTHDR (&mh)));
-
+  cmsg = CMSG_FIRSTHDR (&mh);
+  *fd = *((int *) CMSG_DATA (cmsg));
   return 0;
 #endif
 }
@@ -268,22 +268,23 @@ int writeFileHandle (SocketHandle s, Handle fd)
     struct cmsghdr cmh;
     char buffer[CMSG_SPACE (sizeof (int))];
   } cmh;
+  struct cmsghdr *cmsg;
   char tbuf[4];
   struct iovec iov;
+  iov.iov_base = tbuf;
+  iov.iov_len = 4;
+
   memset (&mh, 0, sizeof (mh));
-  mh.msg_name = 0;
-  mh.msg_namelen = 0;
   mh.msg_iov = &iov;
   mh.msg_iovlen = 1;
   mh.msg_control = (caddr_t) &cmh;
   mh.msg_controllen = sizeof (cmh);
-  mh.msg_flags = 0;
-  iov.iov_base = tbuf;
-  iov.iov_len = 4;
-  cmh.cmh.cmsg_level = SOL_SOCKET;
-  cmh.cmh.cmsg_type = SCM_RIGHTS;
-  cmh.cmh.cmsg_len = sizeof (cmh);
-  *((int *) CMSG_DATA (&cmh.cmh)) = fd;
+
+  cmsg = CMSG_FIRSTHDR (&mh);
+  cmsg->cmsg_len = CMSG_LEN (sizeof (int));
+  cmsg->cmsg_level = SOL_SOCKET;
+  cmsg->cmsg_type = SCM_RIGHTS;
+  *(int *)CMSG_DATA (cmsg) = fd;
 
   return sendmsg (s, &mh, 0);
 #endif



commit 84268d964119f39735f85a9b518b329da8495a44
Author: User <gscrivano@gcc101.hackershells.com>
Date:   Thu Apr 8 03:19:32 2010 -0700

    Include NIL in the data written to the pipe

diff --git a/myserver/tests/test_unix_socket.cpp b/myserver/tests/test_unix_socket.cpp
index b4e073e..537a60f 100644
--- a/myserver/tests/test_unix_socket.cpp
+++ b/myserver/tests/test_unix_socket.cpp
@@ -155,7 +155,7 @@ public:
     CPPUNIT_ASSERT_EQUAL (sock->listen (1), 0);
 
     pipe.create ();
-    CPPUNIT_ASSERT (! pipe.write (msg, strlen (msg), &nbw));
+    CPPUNIT_ASSERT (! pipe.write (msg, strlen (msg) + 1, &nbw));
 
     UnixSocket client;
     client.socket ();

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

Summary of changes:
 myserver/src/base/utility.cpp       |   29 +++++++++++++++--------------
 myserver/tests/test_unix_socket.cpp |    2 +-
 2 files changed, 16 insertions(+), 15 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Thu Apr 08 12:01:21 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NzuAT-0007Tt-7Q
	for mharc-myserver-commit@gnu.org; Thu, 08 Apr 2010 12:01:21 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NzuAQ-0007TB-NP
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 12:01:18 -0400
Received: from [140.186.70.92] (port=55600 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NzuAI-0007RD-M8
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 12:01:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NzuAF-0003zC-5C
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 12:01:10 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:42058
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NzuAF-0003z7-1B
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 12:01:07 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NzuAE-0004CH-LV
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 16:01:06 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1NzuAA-0005mT-IN
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 16:01:06 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 219c71afaa76c282119e79a7b2c4cedc641268bd
X-Git-Newrev: 7f7be6bb28a2f9f123d85601f9debb7101eaaa43
Message-Id: <E1NzuAA-0005mT-IN@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Thu, 08 Apr 2010 16:01:05 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-112-g7f7be6b
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, 08 Apr 2010 16:01:19 -0000

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

The branch, master has been updated
       via  7f7be6bb28a2f9f123d85601f9debb7101eaaa43 (commit)
       via  a0f649bb5861d3dd1bf05a888bbcd9f911a52d29 (commit)
       via  06307ce6567dd2068de625af4f3c003fa564345d (commit)
       via  7f8a33e420343c5b5bcd9afc95c28d6471ab621e (commit)
       via  b174a314e45e54354e357e030f21fc852edcdfbc (commit)
      from  219c71afaa76c282119e79a7b2c4cedc641268bd (commit)

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

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


commit 7f7be6bb28a2f9f123d85601f9debb7101eaaa43
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 8 17:51:58 2010 +0200

    Fix build errors under mingw32

diff --git a/myserver/configure.ac b/myserver/configure.ac
index 7b0e2cd..e38be49 100644
--- a/myserver/configure.ac
+++ b/myserver/configure.ac
@@ -52,7 +52,7 @@ AC_C_BIGENDIAN
 LT_INIT
 
 AC_DEFINE([WINVER], [0x0501], [WINVER])
-
+AC_DEFINE([DEPENDS_ON_LIBINTL], [1], [DEPENDS_ON_LIBINTL])
 AC_DEFINE([GNULIB_NAMESPACE], [gnulib], [GNULIB_NAMESPACE])
 
 LT_INIT
diff --git a/myserver/myserver.h b/myserver/myserver.h
index 23dd447..5e1dbed 100644
--- a/myserver/myserver.h
+++ b/myserver/myserver.h
@@ -25,7 +25,6 @@
 #  include <pthread.h>
 # endif
 
-
 # include <stdlib.h>
 # include <stdio.h>
 # include <fcntl.h>
@@ -54,4 +53,3 @@ typedef void* HANDLE;
 #else
 # define _(X) X
 #endif
-
diff --git a/myserver/src/base/base64/mime_utils.cpp b/myserver/src/base/base64/mime_utils.cpp
index bc095a3..3348ee9 100644
--- a/myserver/src/base/base64/mime_utils.cpp
+++ b/myserver/src/base/base64/mime_utils.cpp
@@ -26,7 +26,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <stdio.h>
 #include <stdlib.h>
 
-
 #include <string.h>
 
 #include <include/base/string/stringutils.h>
@@ -44,7 +43,6 @@ static char* myserver_strupr (char * s)
 
 static char* strustr (char *source, char *s)
 {
-
   char *csource = new char[strlen (source) + 1];
   if (csource == 0)
     return 0;
@@ -449,8 +447,6 @@ char* CQPUtils::decode (char *input)
 
 #define BufAdd 10
 
-
-
 char* CQPUtils::expandBuffer (char *buffer, int UsedSize, int *BufSize,
                              int Singlechar)
 {
@@ -493,7 +489,7 @@ char* CQPUtils::encode (char *input)
       }
       finalresult = expandBuffer (finalresult, UsedSize, &BufSize, 0);
 
-      gnulib::snprintf (mids, 3, "%X", mid);
+      snprintf (mids, 3, "%X", mid);
 
       myserver_strupr (mids);
       *(fresult++) = '=';
diff --git a/myserver/src/base/crypt/crypt_algo_manager.cpp b/myserver/src/base/crypt/crypt_algo_manager.cpp
index 3ee5759..1c561ab 100644
--- a/myserver/src/base/crypt/crypt_algo_manager.cpp
+++ b/myserver/src/base/crypt/crypt_algo_manager.cpp
@@ -106,8 +106,7 @@ CryptAlgoManager::check (const char *value, size_t valueLen, const char *result,
   CryptAlgo *f = make (algo);
   if (!f)
     {
-      gnulib::snprintf (buffer, bufferLen, _("%s is not a registered algorithm"),
-                algo);
+      snprintf (buffer, bufferLen, _("%s is not a registered algorithm"), algo);
       throw CryptAlgoManagerException (buffer);
     }
   auto_ptr<CryptAlgo> keeper (f);
diff --git a/myserver/src/base/pipe/pipe.cpp b/myserver/src/base/pipe/pipe.cpp
index d0a614e..d067ce0 100644
--- a/myserver/src/base/pipe/pipe.cpp
+++ b/myserver/src/base/pipe/pipe.cpp
@@ -73,7 +73,7 @@ int Pipe::read (char* buffer, u_long len, u_long *nbr)
  */
 int Pipe::create (bool readPipe)
 {
-  return pipe (handles);
+  return gnulib::pipe2 (handles, 0);
 }
 
 /*!
diff --git a/myserver/src/base/socket/socket.cpp b/myserver/src/base/socket/socket.cpp
index f2bab81..738c1b7 100644
--- a/myserver/src/base/socket/socket.cpp
+++ b/myserver/src/base/socket/socket.cpp
@@ -409,7 +409,7 @@ int Socket::connect (const char* host, u_short port)
     }
 
   memset (szPort, 0, sizeof (char)*10);
-  gnulib::snprintf (szPort, 10, "%d", port);
+  snprintf (szPort, 10, "%d", port);
 
   if (aiHints.ai_family != 0)
     nGetaddrinfoRet = getaddrinfo (host, NULL, &aiHints, &pHostInfo);
diff --git a/myserver/src/base/socket_pair/socket_pair.cpp b/myserver/src/base/socket_pair/socket_pair.cpp
index e3bcf2f..868b527 100644
--- a/myserver/src/base/socket_pair/socket_pair.cpp
+++ b/myserver/src/base/socket_pair/socket_pair.cpp
@@ -75,7 +75,7 @@ int SocketPair::create ()
     return -1;
 
   handles[0] = handles[1] = -1;
-  listener = ::socket (AF_INET, SOCK_STREAM, 0);
+  listener = gnulib::socket (AF_INET, SOCK_STREAM, 0);
 
   if (listener < 0)
     return -1;
@@ -85,46 +85,47 @@ int SocketPair::create ()
   addr.sin_addr.s_addr = htonl (0x7f000001);
   addr.sin_port = 0;
 
-  if (::bind (listener, (struct sockaddr*) &addr, sizeof (addr)) < 0)
+  if (gnulib::bind (listener, (struct sockaddr*) &addr, sizeof (addr)) < 0)
     {
-      ::close (listener);
+      gnulib::close (listener);
       return -1;
     }
 
-  if (::getsockname (listener, (struct sockaddr*) &addr, &addrlen) < 0)
+  if (gnulib::getsockname (listener, (struct sockaddr*) &addr, &addrlen) < 0)
     {
-      ::close (listener);
+      gnulib::close (listener);
       return -1;
     }
 
   do
     {
-      if (::listen (listener, 1) < 0)
+      if (gnulib::listen (listener, 1) < 0)
         break;
 
-      if ((handles[0] = ::socket (AF_INET, SOCK_STREAM, 0)) < 0)
+      if ((handles[0] = gnulib::socket (AF_INET, SOCK_STREAM, 0)) < 0)
         break;
 
-      if (::connect (handles[0], (struct sockaddr*) &addr, sizeof (addr)) < 0)
+      if (gnulib::connect (handles[0], (struct sockaddr*) &addr,
+                           sizeof (addr)) < 0)
         break;
 
-      if ((handles[1] = ::accept (listener, NULL, NULL)) < 0)
+      if ((handles[1] = gnulib::accept (listener, NULL, NULL)) < 0)
         break;
 
       fd = handles[0];
 
-      ::close (listener);
+      gnulib::close (listener);
       return 0;
     } while (0);
 
-  ::close (listener);
+  gnulib::close (listener);
 
   if (handles[0] != -1)
-    ::close (handles[0]);
+    gnulib::close (handles[0]);
 
 
   if (handles[1] != -1)
-    ::close (handles[1]);
+    gnulib::close (handles[1]);
 
   return -1;
 #endif
diff --git a/myserver/src/protocol/control/control_protocol.cpp b/myserver/src/protocol/control/control_protocol.cpp
index a6cc066..957fd34 100644
--- a/myserver/src/protocol/control/control_protocol.cpp
+++ b/myserver/src/protocol/control/control_protocol.cpp
@@ -541,7 +541,7 @@ int ControlProtocol::addToLog (int retCode, ConnectionPtr con, char *buffer,
 {
   string time;
   getRFC822GMTTime (time, 32);
-  gnulib::snprintf (buffer, bufferSize, "%s [%s] %s:%s:%s - %s - %i", con->getIpAddr (),
+  snprintf (buffer, bufferSize, "%s [%s] %s:%s:%s - %s - %i", con->getIpAddr (),
             time.c_str (), header.getCommand (), header.getVersion (),
             header.getOptions (), header.getAuthLogin (), retCode);
   con->host->accessesLogWrite ("%s", buffer);
@@ -565,14 +565,14 @@ int ControlProtocol::sendResponse (char *buffer, int buffersize,
     dataLength = outFile->getFileSize ();
 
   /* Build and send the first line.  */
-  gnulib::snprintf (buffer, buffersize, "/%i\r\n", errID);
+  snprintf (buffer, buffersize, "/%i\r\n", errID);
   if (a->socket->send (buffer, strlen (buffer), 0) < 0)
     {
       a->host->warningsLogWrite (_("Control: socket error"));
       return -1;
     }
 
-  gnulib::snprintf (buffer, buffersize, "/LEN %u\r\n", (u_int)dataLength);
+  snprintf (buffer, buffersize, "/LEN %u\r\n", (u_int)dataLength);
   if (a->socket->send (buffer, strlen (buffer), 0) < 0)
     {
       a->host->warningsLogWrite (_("Control: socket error"));
@@ -669,11 +669,11 @@ int ControlProtocol::visitConnection (ConnectionPtr con, void *argP)
 
   if (arg->command == ControlProtocolVisitorArg::SHOW_CONNECTIONS)
   {
-    gnulib::snprintf (arg->buffer, arg->bufferSize, "%i - %s - %i - %s - %i - %s - %s\r\n",
-             static_cast<int>(con->getID ()),  con->getIpAddr (),
-             static_cast<int>(con->getPort ()),
-             con->getLocalIpAddr (),  static_cast<int>(con->getLocalPort ()),
-             con->getLogin (), con->getPassword ());
+    snprintf (arg->buffer, arg->bufferSize, "%i - %s - %i - %s - %i - %s - %s\r\n",
+              static_cast<int>(con->getID ()),  con->getIpAddr (),
+              static_cast<int>(con->getPort ()),
+              con->getLocalIpAddr (),  static_cast<int>(con->getLocalPort ()),
+              con->getLogin (), con->getPassword ());
 
     ret = arg->out->writeToFile (arg->buffer, strlen (arg->buffer), &nbw);
 



commit a0f649bb5861d3dd1bf05a888bbcd9f911a52d29
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 8 17:51:28 2010 +0200

    Use getpeername/getsockopt/recvfrom/sendto/sigpipe modules from gnulib

diff --git a/myserver/bootstrap.conf b/myserver/bootstrap.conf
index 03f3b98..68d1a90 100644
--- a/myserver/bootstrap.conf
+++ b/myserver/bootstrap.conf
@@ -34,8 +34,10 @@ connect
 c++defs
 fsync
 getcwd
+getpeername
 gethostname
 getsockname
+getsockopt
 gettext
 gettimeofday
 ioctl
@@ -48,13 +50,16 @@ pipe
 read-file
 readlink
 recv
+recvfrom
 regex
 remove
 rename
 select
 send
+sendto
 setsockopt
 shutdown
+sigpipe
 snprintf
 socket
 sysexits



commit 06307ce6567dd2068de625af4f3c003fa564345d
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 8 17:50:36 2010 +0200

    Do not use libtool to generate the final shared object

diff --git a/myserver/binaries/web/cgi-src/math_sum/Makefile.am b/myserver/binaries/web/cgi-src/math_sum/Makefile.am
index 85d7d6d..0536ca9 100644
--- a/myserver/binaries/web/cgi-src/math_sum/Makefile.am
+++ b/myserver/binaries/web/cgi-src/math_sum/Makefile.am
@@ -19,16 +19,22 @@
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
 lib_LTLIBRARIES = libmath_sum.la
 libmath_sum_la_SOURCES = math_sum.cpp
-libmath_sum_la_LDFLAGS = -avoid-version -module -shared
+libmath_sum_la_LDFLAGS = -no-undefined -avoid-version -module -shared
 libmath_sum_la_LIBADD = ../../../../src/libmyserver.a ../../../../lib/libgnu.a
 SO_EXT=`$(LIBTOOL) --config | $(SED) -e"y/'/\"/" -e '/^shrext_cmds/ !d; s/^.*="\(.*\)"/\1/'`
 
 all: all-am math_sum.mscgi
 
 math_sum.mscgi: libmath_sum.la
-	$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) \
-		$(INSTALL_STRIP_FLAG) libmath_sum.la $(abs_builddir)
-	cp libmath_sum$(SO_EXT) ../../cgi-bin/math_sum.mscgi
+#	$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) \
+#		 $(INSTALL_STRIP_FLAG) libmath_sum.la $(abs_builddir)
+#	cp libmath_sum$(SO_EXT) ../../cgi-bin/math_sum.mscgi
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+	$(CXX) $(libmath_sum_a_OBJECTS) $(libmath_sum_la_LIBADD)  $(CXXFLAGS) \
+	$(XML_CFLAGS) $(libmath_sum_a_LIBADD) $(PTHREAD_LIB) \
+	$(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(SSL_LIB)  $(ZLIB_LIB) \
+	$(XML_LIBS) $(LDFLAGS) $(LIBINTL) -shared -o ../../cgi-bin/math_sum.mscgi
+
 
 clean-local:
 	test \! -e libmath_sum.la || \
diff --git a/myserver/binaries/web/cgi-src/post/Makefile.am b/myserver/binaries/web/cgi-src/post/Makefile.am
index dc621be..6a28e94 100644
--- a/myserver/binaries/web/cgi-src/post/Makefile.am
+++ b/myserver/binaries/web/cgi-src/post/Makefile.am
@@ -19,16 +19,22 @@
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
 lib_LTLIBRARIES = libpost.la
 libpost_la_SOURCES = post.cpp
-libpost_la_LDFLAGS = -avoid-version -module -shared
+libpost_la_LDFLAGS = -no-undefined -avoid-version -module -shared
 libpost_la_LIBADD = ../../../../src/libmyserver.a ../../../../lib/libgnu.a
 SO_EXT=`$(LIBTOOL) --config | $(SED) -e"y/'/\"/" -e '/^shrext_cmds/ !d; s/^.*="\(.*\)"/\1/'`
 
 all: all-am post.mscgi
 
 post.mscgi: libpost.la
-	$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) \
-		$(INSTALL_STRIP_FLAG) libpost.la $(abs_builddir)
-	cp libpost$(SO_EXT) ../../cgi-bin/post.mscgi
+#	$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) \
+#		 $(INSTALL_STRIP_FLAG) libpost.la $(abs_builddir)
+#	cp libpost$(SO_EXT) ../../cgi-bin/post.mscgi
+	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
+	$(CXX) $(libpost_a_OBJECTS) $(libpost_la_LIBADD)  $(CXXFLAGS) \
+	$(XML_CFLAGS) $(libpost_a_LIBADD) $(PTHREAD_LIB) \
+	$(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(SSL_LIB)  $(ZLIB_LIB) \
+	$(XML_LIBS) $(LDFLAGS) $(LIBINTL) -shared -o ../../cgi-bin/post.mscgi
+
 
 clean-local:
 	test \! -e libpost.la || \



commit 7f8a33e420343c5b5bcd9afc95c28d6471ab621e
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 8 15:03:28 2010 +0200

    Use gnulib pipe wrappers under Windows.

diff --git a/myserver/include/base/pipe/pipe.h b/myserver/include/base/pipe/pipe.h
index 7530bc0..32994fe 100644
--- a/myserver/include/base/pipe/pipe.h
+++ b/myserver/include/base/pipe/pipe.h
@@ -45,11 +45,6 @@ public:
   int waitForData (int sec, int usec);
 private:
   bool terminated;
-# ifndef WIN32
   int handles[2];
-# else
-  HANDLE readHandle;
-  HANDLE writeHandle;
-# endif
 };
 #endif
diff --git a/myserver/src/base/pipe/pipe.cpp b/myserver/src/base/pipe/pipe.cpp
index 733e764..d0a614e 100644
--- a/myserver/src/base/pipe/pipe.cpp
+++ b/myserver/src/base/pipe/pipe.cpp
@@ -21,7 +21,6 @@
 #include <include/base/utility.h>
 #include <include/base/pipe/pipe.h>
 
-#ifndef WIN32
 # include <fcntl.h>
 # include <unistd.h>
 # include <sys/types.h>
@@ -34,10 +33,6 @@
 # include <math.h>
 # include <time.h>
 
-#else
-# include <windows.h>
-#endif
-
 #include <string>
 #include <sstream>
 
@@ -52,7 +47,6 @@ using namespace std;
 int Pipe::read (char* buffer, u_long len, u_long *nbr)
 {
   *nbr = 0;
-#ifndef WIN32
   int ret = ::read (handles[0], buffer, len);
   if (ret == -1)
     {
@@ -69,22 +63,6 @@ int Pipe::read (char* buffer, u_long len, u_long *nbr)
       *nbr = (u_long)ret;
     }
   return 0;
-#else
-  if ( !ReadFile (readHandle, buffer, len, nbr, NULL) || !nbr)
-    {
-      *nbr = 0;
-      if (GetLastError () != ERROR_BROKEN_PIPE)
-        return 1;
-      else
-        {
-          terminated = true;
-          return 0;
-        }
-    }
-  return 0;
-#endif
-
-  return 0;
 }
 
 
@@ -95,43 +73,7 @@ int Pipe::read (char* buffer, u_long len, u_long *nbr)
  */
 int Pipe::create (bool readPipe)
 {
-#ifndef WIN32
   return pipe (handles);
-#else
-  HANDLE tmp;
-  SECURITY_ATTRIBUTES sa;
-  sa.nLength = sizeof (SECURITY_ATTRIBUTES);
-  sa.bInheritHandle = TRUE;
-  sa.lpSecurityDescriptor = NULL;
-  if (!CreatePipe (&readHandle, &writeHandle, &sa, 0))
-    return 1;
-
-  if (readPipe)
-    {
-      if (!DuplicateHandle (GetCurrentProcess (), readHandle,
-                            GetCurrentProcess (), &tmp, 0,
-                            FALSE, DUPLICATE_SAME_ACCESS))
-        {
-          close ();
-          return 1;
-        }
-      CloseHandle (readHandle);
-      readHandle = tmp;
-    }
-  else
-    {
-      if (!DuplicateHandle (GetCurrentProcess (), writeHandle,
-                            GetCurrentProcess (), &tmp, 0,
-                            FALSE, DUPLICATE_SAME_ACCESS))
-        {
-          close ();
-          return 1;
-        }
-      CloseHandle (writeHandle);
-      writeHandle = tmp;
-    }
-  return 0;
-#endif
 }
 
 /*!
@@ -143,7 +85,6 @@ int Pipe::create (bool readPipe)
 int Pipe::write (const char* buffer, u_long len, u_long *nbw)
 {
   *nbw = 0;
-#ifndef WIN32
   int ret = gnulib::write (handles[1], buffer, len);
   if (ret == -1)
     {
@@ -152,9 +93,7 @@ int Pipe::write (const char* buffer, u_long len, u_long *nbw)
     }
   else
     *nbw = (u_long) ret;
-#else
-  return !WriteFile (writeHandle, buffer, len, nbw, NULL);
-#endif
+
   return 0;
 }
 
@@ -163,11 +102,7 @@ int Pipe::write (const char* buffer, u_long len, u_long *nbw)
  */
 long Pipe::getReadHandle ()
 {
-#ifndef WIN32
   return handles[0];
-#else
-  return (long)readHandle;
-#endif
 }
 
 /*!
@@ -175,11 +110,7 @@ long Pipe::getReadHandle ()
  */
 long Pipe::getWriteHandle ()
 {
-#ifndef WIN32
   return handles[1];
-#else
-  return (long)writeHandle;
-#endif
 }
 
 
@@ -189,21 +120,13 @@ long Pipe::getWriteHandle ()
 int Pipe::close ()
 {
   terminated = true;
-#ifndef WIN32
   if (handles[0] >= 0)
     gnulib::close (handles[0]);
   if (handles[1] >= 0)
     gnulib::close (handles[1]);
 
   handles[0] = handles[1] = -1;
-#else
-  if (readHandle >= 0)
-    CloseHandle (readHandle);
-  if (writeHandle >= 0)
-    CloseHandle (writeHandle);
-
-  readHandle = writeHandle = 0;
-#endif
+
   return 0;
 }
 
@@ -231,7 +154,6 @@ private:
  */
 void Pipe::inverted (Pipe& pipe)
 {
-#ifndef WIN32
   pipe.handles[0] = gnulib::dup (handles[1]);
   pipe.handles[1] = gnulib::dup (handles[0]);
   if (pipe.handles[0] < 0 || pipe.handles[1] < 0)
@@ -239,27 +161,12 @@ void Pipe::inverted (Pipe& pipe)
       string err (_("Internal error"));
       throw PipeException (err);
     }
-#else
-  if ((! DuplicateHandle (GetCurrentProcess(), writeHandle, GetCurrentProcess(),
-                          &pipe.readHandle, 0, FALSE, DUPLICATE_SAME_ACCESS))
-      || (! DuplicateHandle (GetCurrentProcess(), readHandle,
-                             GetCurrentProcess(), &pipe.writeHandle, 0, FALSE,
-                             DUPLICATE_SAME_ACCESS)))
-    {
-      string err (_("Internal error"));
-      throw PipeException (err);
-    }
-#endif
 }
 
 Pipe::Pipe ()
 {
   terminated = false;
-#ifndef WIN32
   handles[0] = handles[1] = -1;
-#else
-  readHandle = writeHandle = (HANDLE) -1;
-#endif
 }
 
 Pipe::~Pipe ()
@@ -273,15 +180,9 @@ Pipe::~Pipe ()
 void Pipe::closeRead ()
 {
   terminated = true;
-#ifndef WIN32
   if (handles[0] >= 0)
     gnulib::close (handles[0]);
   handles[0] = -1;
-#else
-  if (readHandle >= 0)
-    CloseHandle (readHandle);
-  readHandle = (HANDLE) -1;
-#endif
 }
 
 /*!
@@ -290,15 +191,9 @@ void Pipe::closeRead ()
 void Pipe::closeWrite ()
 {
   terminated = true;
-#ifndef WIN32
   if (handles[1] >= 0)
     gnulib::close (handles[1]);
   handles[1] = -1;
-#else
-  if (writeHandle >= 0)
-    CloseHandle (writeHandle);
-  writeHandle = (HANDLE) -1;
-#endif
 }
 
 /*!
@@ -309,28 +204,6 @@ void Pipe::closeWrite ()
  */
 int Pipe::waitForData (int sec, int usec)
 {
-#ifdef WIN32
-  /*FIXME: avoid polling.  */
-  u_long limit = getTicks () + sec * 1000 + usec/1000;
-  char buffer[1];
-  DWORD bytesRead;
-
-  do
-    {
-      bytesRead = 0;
-      if (PeekNamedPipe (readHandle, buffer, 1, &bytesRead, NULL, NULL) == 0)
-        return 0;
-
-      if (bytesRead)
-        return 1;
-
-      Thread::wait (1000);
-    }
-  while (getTicks () < limit);
-
-  return 0;
-
-#else
   struct timeval tv;
   fd_set readfds;
   int ret;
@@ -350,6 +223,4 @@ int Pipe::waitForData (int sec, int usec)
     return 1;
 
   return 0;
-#endif
-  return 0;
 }



commit b174a314e45e54354e357e030f21fc852edcdfbc
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 8 12:36:25 2010 +0200

    Now MYSERVER_SEC converts seconds to microseconds.

diff --git a/myserver/include/base/utility.h b/myserver/include/base/utility.h
index 475cfa4..5c22658 100644
--- a/myserver/include/base/utility.h
+++ b/myserver/include/base/utility.h
@@ -32,7 +32,7 @@ using namespace std;
 
 # define MYSERVER_KB(x) (x << 10)
 # define MYSERVER_MB(x) (x << 20)
-# define MYSERVER_SEC(x) (x * 1000)
+# define MYSERVER_SEC(x) (x * 1000000)
 
 int preparePrintError ();
 int endPrintError ();

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

Summary of changes:
 myserver/binaries/web/cgi-src/math_sum/Makefile.am |   14 ++-
 myserver/binaries/web/cgi-src/post/Makefile.am     |   14 ++-
 myserver/bootstrap.conf                            |    5 +
 myserver/configure.ac                              |    2 +-
 myserver/include/base/pipe/pipe.h                  |    5 -
 myserver/include/base/utility.h                    |    2 +-
 myserver/myserver.h                                |    2 -
 myserver/src/base/base64/mime_utils.cpp            |    6 +-
 myserver/src/base/crypt/crypt_algo_manager.cpp     |    3 +-
 myserver/src/base/pipe/pipe.cpp                    |  135 +-------------------
 myserver/src/base/socket/socket.cpp                |    2 +-
 myserver/src/base/socket_pair/socket_pair.cpp      |   27 ++--
 myserver/src/protocol/control/control_protocol.cpp |   16 +-
 13 files changed, 55 insertions(+), 178 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Thu Apr 08 12:04:21 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NzuDN-0008MI-0Y
	for mharc-myserver-commit@gnu.org; Thu, 08 Apr 2010 12:04:21 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NzuDL-0008Lp-VZ
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 12:04:20 -0400
Received: from [140.186.70.92] (port=55999 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NzuDK-0008L2-4G
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 12:04:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NzuDI-0004Mm-VB
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 12:04:17 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:35170
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NzuDI-0004Mh-Qz
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 12:04:16 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1NzuDI-0004CN-Ny
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 16:04:16 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1NzuDI-0005wu-Jx
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 16:04:16 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 7f7be6bb28a2f9f123d85601f9debb7101eaaa43
X-Git-Newrev: bfb43cd632b37f389e751e182322519da6f50bf8
Message-Id: <E1NzuDI-0005wu-Jx@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Thu, 08 Apr 2010 16:04:16 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-113-gbfb43cd
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, 08 Apr 2010 16:04:20 -0000

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

The branch, master has been updated
       via  bfb43cd632b37f389e751e182322519da6f50bf8 (commit)
      from  7f7be6bb28a2f9f123d85601f9debb7101eaaa43 (commit)

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

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


commit bfb43cd632b37f389e751e182322519da6f50bf8
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 8 18:03:53 2010 +0200

    Remove unused files

diff --git a/myserver/binaries/web/cgi-src/math_sum/math_sum.dev b/myserver/binaries/web/cgi-src/math_sum/math_sum.dev
deleted file mode 100644
index 5083b4d..0000000
--- a/myserver/binaries/web/cgi-src/math_sum/math_sum.dev
+++ /dev/null
@@ -1,103 +0,0 @@
-[Project]
-FileName=math_sum.dev
-Name=math_sum
-UnitCount=1
-Type=3
-Ver=1
-IsCpp=1
-Folders=
-CommandLine=
-CompilerSettings=0000000000000000000100
-PchHead=-1
-PchSource=-1
-ProfilesCount=1
-ProfileIndex=0
-ObjFiles=
-Includes=..\..\..\..\include;..\..\..\..
-Libs=
-PrivateResource=
-ResourceIncludes=
-MakeIncludes=
-Compiler=
-CppCompiler=
-Linker=../../../../src/*.o -llibxml2 -liconv -lintl -lssl -lcrypto -lrx -lgdi32 -lwininet -lwsock32 -luserenv -levent -lz --def ../mscgi.def_@@_
-Icon=
-ExeOutput=..\..\cgi-bin
-ObjectOutput=
-OverrideOutput=1
-OverrideOutputName=math_sum.mscgi
-HostApplication=
-UseCustomMakefile=0
-CustomMakefile=
-IncludeVersionInfo=0
-SupportXPThemes=0
-CompilerSet=0
-
-[Unit1]
-FileName=math_sum.cpp
-CompileCpp=1
-Folder=Progetto1
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
-[VersionInfo]
-Major=0
-Minor=1
-Release=1
-Build=1
-LanguageID=1033
-CharsetID=1252
-CompanyName=
-FileVersion=
-FileDescription=Developed using the Dev-C++ IDE
-InternalName=
-LegalCopyright=
-LegalTrademarks=
-OriginalFilename=
-ProductName=
-ProductVersion=
-AutoIncBuildNrOnRebuild=0
-AutoIncBuildNrOnCompile=0
-AutoIncBuildNr=0
-
-[Profile1]
-ProfileName=Default Profile
-Type=3
-ObjFiles=
-Includes=
-Libs=
-PrivateResource=
-ResourceIncludes=
-MakeIncludes=
-Compiler=-DBUILDING_DLL=1_@@_
-CppCompiler=
-Linker=--no-export-all-symbols --add-stdcall-alias _@@_../../../cgi-lib/libcgi-lib.a_@@_
-PreprocDefines=
-CompilerSettings=0000000000000000000100
-Icon=
-ExeOutput=..\..\cgi-bin
-ObjectOutput=..\..\cgi-bin
-OverrideOutput=1
-OverrideOutputName=math_sum.mscgi
-HostApplication=
-CommandLine=move *.a ../binaries/cgi-lib
-UseCustomMakefile=0
-CustomMakefile=
-IncludeVersionInfo=0
-SupportXPThemes=0
-CompilerSet=0
-compilerType=0
-
-[Unit5]
-FileName=..\..\..\..\source\files_utility.cpp
-CompileCpp=1
-Folder=math_sum
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
diff --git a/myserver/binaries/web/cgi-src/post/post.dev b/myserver/binaries/web/cgi-src/post/post.dev
deleted file mode 100644
index f155647..0000000
--- a/myserver/binaries/web/cgi-src/post/post.dev
+++ /dev/null
@@ -1,103 +0,0 @@
-[Project]
-FileName=post.dev
-Name=post
-UnitCount=1
-Type=3
-Ver=1
-IsCpp=1
-Folders=
-CommandLine=
-CompilerSettings=0000000000000000000100
-PchHead=-1
-PchSource=-1
-ProfilesCount=1
-ProfileIndex=0
-ObjFiles=
-Includes=..\..\..\..
-Libs=
-PrivateResource=
-ResourceIncludes=
-MakeIncludes=
-Compiler=_@@_
-CppCompiler=_@@_
-Linker=../../../../src/*.o  -llibxml2 -liconv -lintl -lssl -lcrypto -lrx -lgdi32 -lwininet -lwsock32 -luserenv -levent -lz   _@@_
-Icon=
-ExeOutput=..\..\cgi-bin
-ObjectOutput=
-OverrideOutput=1
-OverrideOutputName=post.mscgi
-HostApplication=
-UseCustomMakefile=0
-CustomMakefile=
-IncludeVersionInfo=0
-SupportXPThemes=0
-CompilerSet=0
-
-[Unit1]
-FileName=post.cpp
-CompileCpp=1
-Folder=post
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
-[VersionInfo]
-Major=0
-Minor=1
-Release=1
-Build=1
-LanguageID=1033
-CharsetID=1252
-CompanyName=
-FileVersion=
-FileDescription=Developed using the Dev-C++ IDE
-InternalName=
-LegalCopyright=
-LegalTrademarks=
-OriginalFilename=
-ProductName=
-ProductVersion=
-AutoIncBuildNrOnRebuild=0
-AutoIncBuildNrOnCompile=0
-AutoIncBuildNr=0
-
-[Unit5]
-FileName=..\..\..\..\source\files_utility.cpp
-CompileCpp=1
-Folder=post
-Compile=1
-Link=1
-Priority=1000
-OverrideBuildCmd=0
-BuildCmd=
-
-[Profile1]
-ProfileName=Default Profile
-Type=3
-ObjFiles=
-Includes=
-Libs=
-PrivateResource=
-ResourceIncludes=
-MakeIncludes=
-Compiler=-DBUILDING_DLL=1_@@_
-CppCompiler=
-Linker=--no-export-all-symbols --add-stdcall-alias _@@_../../../cgi-lib/libcgi-lib.a_@@_
-PreprocDefines=
-CompilerSettings=0000000000000000000100
-Icon=
-ExeOutput=..\..\cgi-bin
-ObjectOutput=..\..\cgi-bin
-OverrideOutput=1
-OverrideOutputName=post.mscgi
-HostApplication=
-CommandLine=move *.a ../binaries/cgi-lib
-UseCustomMakefile=0
-CustomMakefile=
-IncludeVersionInfo=0
-SupportXPThemes=0
-CompilerSet=0
-compilerType=0
-

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

Summary of changes:
 .../binaries/web/cgi-src/math_sum/math_sum.dev     |  103 --------------------
 myserver/binaries/web/cgi-src/post/post.dev        |  103 --------------------
 2 files changed, 0 insertions(+), 206 deletions(-)
 delete mode 100644 myserver/binaries/web/cgi-src/math_sum/math_sum.dev
 delete mode 100644 myserver/binaries/web/cgi-src/post/post.dev


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Thu Apr 08 15:50:27 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1NzxkB-0000hY-6N
	for mharc-myserver-commit@gnu.org; Thu, 08 Apr 2010 15:50:27 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1Nzxk8-0000gm-N3
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 15:50:24 -0400
Received: from [140.186.70.92] (port=34310 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Nzxk7-0000gc-38
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 15:50:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1Nzxk6-0000Tb-4Q
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 15:50:22 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:37530
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1Nzxk6-0000TV-1Q
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 15:50:22 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1Nzxk4-00071p-Lq
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 19:50:21 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1Nzxk1-0003bw-Uf
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 19:50:20 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: bfb43cd632b37f389e751e182322519da6f50bf8
X-Git-Newrev: 54aeb4ce7f1bdf0cd6e53f5f037e6d0d9f757e50
Message-Id: <E1Nzxk1-0003bw-Uf@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Thu, 08 Apr 2010 19:50:19 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-114-g54aeb4c
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, 08 Apr 2010 19:50:25 -0000

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

The branch, master has been updated
       via  54aeb4ce7f1bdf0cd6e53f5f037e6d0d9f757e50 (commit)
      from  bfb43cd632b37f389e751e182322519da6f50bf8 (commit)

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

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


commit 54aeb4ce7f1bdf0cd6e53f5f037e6d0d9f757e50
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 8 21:50:13 2010 +0200

    Remove a forgotten line

diff --git a/myserver/binaries/web/cgi-src/math_sum/Makefile.am b/myserver/binaries/web/cgi-src/math_sum/Makefile.am
index 0536ca9..1e5a365 100644
--- a/myserver/binaries/web/cgi-src/math_sum/Makefile.am
+++ b/myserver/binaries/web/cgi-src/math_sum/Makefile.am
@@ -29,7 +29,6 @@ math_sum.mscgi: libmath_sum.la
 #	$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) \
 #		 $(INSTALL_STRIP_FLAG) libmath_sum.la $(abs_builddir)
 #	cp libmath_sum$(SO_EXT) ../../cgi-bin/math_sum.mscgi
-	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
 	$(CXX) $(libmath_sum_a_OBJECTS) $(libmath_sum_la_LIBADD)  $(CXXFLAGS) \
 	$(XML_CFLAGS) $(libmath_sum_a_LIBADD) $(PTHREAD_LIB) \
 	$(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(SSL_LIB)  $(ZLIB_LIB) \
diff --git a/myserver/binaries/web/cgi-src/post/Makefile.am b/myserver/binaries/web/cgi-src/post/Makefile.am
index 6a28e94..e1daffc 100644
--- a/myserver/binaries/web/cgi-src/post/Makefile.am
+++ b/myserver/binaries/web/cgi-src/post/Makefile.am
@@ -29,7 +29,6 @@ post.mscgi: libpost.la
 #	$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) \
 #		 $(INSTALL_STRIP_FLAG) libpost.la $(abs_builddir)
 #	cp libpost$(SO_EXT) ../../cgi-bin/post.mscgi
-	$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link \
 	$(CXX) $(libpost_a_OBJECTS) $(libpost_la_LIBADD)  $(CXXFLAGS) \
 	$(XML_CFLAGS) $(libpost_a_LIBADD) $(PTHREAD_LIB) \
 	$(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(SSL_LIB)  $(ZLIB_LIB) \

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

Summary of changes:
 myserver/binaries/web/cgi-src/math_sum/Makefile.am |    1 -
 myserver/binaries/web/cgi-src/post/Makefile.am     |    1 -
 2 files changed, 0 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Thu Apr 08 19:29:37 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O01AH-0004uk-8c
	for mharc-myserver-commit@gnu.org; Thu, 08 Apr 2010 19:29:37 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O01AF-0004to-Ki
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 19:29:35 -0400
Received: from [140.186.70.92] (port=54731 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O01A5-0004ns-Rh
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 19:29:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O019o-0000N4-Ps
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 19:29:25 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:44268
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O019o-0000Mk-Lp
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 19:29:08 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O019o-0001Fd-33
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 23:29:08 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O019n-0003wc-Qt
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 23:29:08 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 54aeb4ce7f1bdf0cd6e53f5f037e6d0d9f757e50
X-Git-Newrev: 69c910142b53d8e42705aa2c0147639f85104cc1
Message-Id: <E1O019n-0003wc-Qt@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Thu, 08 Apr 2010 23:29:07 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-115-g69c9101
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, 08 Apr 2010 23:29:35 -0000

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

The branch, master has been updated
       via  69c910142b53d8e42705aa2c0147639f85104cc1 (commit)
      from  54aeb4ce7f1bdf0cd6e53f5f037e6d0d9f757e50 (commit)

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

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


commit 69c910142b53d8e42705aa2c0147639f85104cc1
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 9 01:29:01 2010 +0200

    Use libtool for gnulib and libmyserver

diff --git a/myserver/binaries/web/cgi-src/math_sum/Makefile.am b/myserver/binaries/web/cgi-src/math_sum/Makefile.am
index 1e5a365..1cdce5d 100644
--- a/myserver/binaries/web/cgi-src/math_sum/Makefile.am
+++ b/myserver/binaries/web/cgi-src/math_sum/Makefile.am
@@ -19,21 +19,14 @@
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
 lib_LTLIBRARIES = libmath_sum.la
 libmath_sum_la_SOURCES = math_sum.cpp
-libmath_sum_la_LDFLAGS = -no-undefined -avoid-version -module -shared
-libmath_sum_la_LIBADD = ../../../../src/libmyserver.a ../../../../lib/libgnu.a
+libmath_sum_la_LDFLAGS = -avoid-version -module -shared
+libmath_sum_la_LIBADD = ../../../../src/libmyserver.la ../../../../lib/libgnu.la
 SO_EXT=`$(LIBTOOL) --config | $(SED) -e"y/'/\"/" -e '/^shrext_cmds/ !d; s/^.*="\(.*\)"/\1/'`
 
 all: all-am math_sum.mscgi
 
 math_sum.mscgi: libmath_sum.la
-#	$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) \
-#		 $(INSTALL_STRIP_FLAG) libmath_sum.la $(abs_builddir)
-#	cp libmath_sum$(SO_EXT) ../../cgi-bin/math_sum.mscgi
-	$(CXX) $(libmath_sum_a_OBJECTS) $(libmath_sum_la_LIBADD)  $(CXXFLAGS) \
-	$(XML_CFLAGS) $(libmath_sum_a_LIBADD) $(PTHREAD_LIB) \
-	$(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(SSL_LIB)  $(ZLIB_LIB) \
-	$(XML_LIBS) $(LDFLAGS) $(LIBINTL) -shared -o ../../cgi-bin/math_sum.mscgi
-
+	cp .libs/libmath_sum$(SO_EXT) ../../cgi-bin/math_sum.mscgi
 
 clean-local:
 	test \! -e libmath_sum.la || \
diff --git a/myserver/binaries/web/cgi-src/post/Makefile.am b/myserver/binaries/web/cgi-src/post/Makefile.am
index e1daffc..a793681 100644
--- a/myserver/binaries/web/cgi-src/post/Makefile.am
+++ b/myserver/binaries/web/cgi-src/post/Makefile.am
@@ -19,21 +19,14 @@
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
 lib_LTLIBRARIES = libpost.la
 libpost_la_SOURCES = post.cpp
-libpost_la_LDFLAGS = -no-undefined -avoid-version -module -shared
-libpost_la_LIBADD = ../../../../src/libmyserver.a ../../../../lib/libgnu.a
+libpost_la_LDFLAGS = -avoid-version -module -shared
+libpost_la_LIBADD = ../../../../src/libmyserver.la ../../../../lib/libgnu.la
 SO_EXT=`$(LIBTOOL) --config | $(SED) -e"y/'/\"/" -e '/^shrext_cmds/ !d; s/^.*="\(.*\)"/\1/'`
 
 all: all-am post.mscgi
 
 post.mscgi: libpost.la
-#	$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) \
-#		 $(INSTALL_STRIP_FLAG) libpost.la $(abs_builddir)
-#	cp libpost$(SO_EXT) ../../cgi-bin/post.mscgi
-	$(CXX) $(libpost_a_OBJECTS) $(libpost_la_LIBADD)  $(CXXFLAGS) \
-	$(XML_CFLAGS) $(libpost_a_LIBADD) $(PTHREAD_LIB) \
-	$(IDN_LIB) $(XNET_LIB) $(EVENT_LIB) $(DL_LIB) $(SSL_LIB)  $(ZLIB_LIB) \
-	$(XML_LIBS) $(LDFLAGS) $(LIBINTL) -shared -o ../../cgi-bin/post.mscgi
-
+	cp .libs/libpost$(SO_EXT) ../../cgi-bin/post.mscgi
 
 clean-local:
 	test \! -e libpost.la || \
diff --git a/myserver/bootstrap.conf b/myserver/bootstrap.conf
index 68d1a90..0bfad5d 100644
--- a/myserver/bootstrap.conf
+++ b/myserver/bootstrap.conf
@@ -18,7 +18,7 @@
 # 02110-1301, USA.
 
 gnulib_name=libgnu
-gnulib_tool_option_extras=--no-libtool
+gnulib_tool_option_extras=
 SKIP_PO=t
 
 # gnulib modules used by this package.
diff --git a/myserver/src/Makefile.am b/myserver/src/Makefile.am
index 2353991..882b5ae 100644
--- a/myserver/src/Makefile.am
+++ b/myserver/src/Makefile.am
@@ -14,28 +14,156 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
-SUBDIRS = base conf connection connections_scheduler filter http_handler \
-	log plugin protocol server GUI
+
 AM_CPPFLAGS = $(all_includes) -I$(top_builddir)/lib -I$(top_srcdir)/lib
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
+
+
+SUBDIRS = base conf connection connections_scheduler filter http_handler \
+	log plugin protocol server GUI
+
 bin_PROGRAMS = myserver
 myserver_SOURCES = myserver.cpp
-myserver_CXXFLAGS = $(CXXFLAGS) -DHOST_STR=\"$(build)\" -DPREFIX=\"$(prefix)\"
-myserver_LDFLAGS =  -rdynamic
-myserver_LDADD = libmyserver.a $(PTHREAD_LIB) $(IDN_LIB) \
-	$(XNET_LIB) $(DL_LIB) $(ZLIB_LIB) \
-	$(XML_LIBS)  ../lib/libgnu.a $(INTLLIBS) $(LDFLAGS)
 
-clean-libmyserver.a:
-	rm -f libmyserver.a
+lib_LTLIBRARIES = libmyserver.la
 
-libmyserver.a: clean-libmyserver.a
-	find . | grep .*\\.$(OBJEXT)$$ | xargs $(AR) cru libmyserver.a
-	$(RANLIB) libmyserver.a
+libmyserver_la_SOURCES = dummy.cpp
+libmyserver_la_LIBADD =  \
+    http_handler/proxy/proxy.lo  \
+    http_handler/scgi/scgi.lo  \
+    http_handler/http_dir/http_dir.lo  \
+    http_handler/wincgi/wincgi.lo  \
+    http_handler/isapi/isapi.lo  \
+    http_handler/fastcgi/fastcgi.lo  \
+    http_handler/mscgi/mscgi_manager.lo  \
+    http_handler/mscgi/mscgi.lo  \
+    http_handler/http_file/http_file.lo  \
+    http_handler/cgi/cgi.lo  \
+    log/log_manager.lo  \
+    log/stream/log_stream.lo  \
+    log/stream/file_stream.lo  \
+    log/stream/console_stream.lo  \
+    log/stream/log_stream_creator.lo  \
+    log/stream/socket_stream_creator.lo  \
+    log/stream/console_stream_creator.lo  \
+    log/stream/socket_stream.lo  \
+    log/stream/file_stream_creator.lo  \
+    log/stream/log_stream_factory.lo  \
+    connections_scheduler/connections_scheduler.lo  \
+    connections_scheduler/listen_threads.lo  \
+    dummy.lo  \
+    server/clients_thread.lo  \
+    server/server.lo  \
+    base/multicast/multicast.lo  \
+    base/home_dir/home_dir.lo  \
+    base/ssl/ssl.lo  \
+    base/slab/slab.lo  \
+    base/unix_socket/unix_socket.lo  \
+    base/mem_buff/mem_buff.lo  \
+    base/crypt/sha1.lo  \
+    base/crypt/crypt_algo_manager.lo  \
+    base/crypt/crypt_algo.lo  \
+    base/crypt/md5.lo  \
+    base/pipe/pipe.lo  \
+    base/string/stringutils.lo  \
+    base/string/securestr.lo  \
+    base/files_cache/membuf_file.lo  \
+    base/files_cache/cached_file_buffer.lo  \
+    base/files_cache/cached_file_factory.lo  \
+    base/files_cache/cached_file.lo  \
+    base/sync/mutex.lo  \
+    base/sync/read_write_lock.lo  \
+    base/sync/recursive_mutex.lo  \
+    base/sync/event.lo  \
+    base/sync/semaphore.lo  \
+    base/dynamic_lib/dynamiclib.lo  \
+    base/regex/myserver_regex.lo  \
+    base/socket_pair/socket_pair.lo  \
+    base/socket/socket.lo  \
+    base/socket/ssl_socket.lo  \
+    base/xml/xml_parser.lo  \
+    base/read_directory/read_directory.lo  \
+    base/file/file.lo  \
+    base/file/files_utility.lo  \
+    base/bitvec/bitvec.lo  \
+    base/safetime/safetime.lo  \
+    base/process/process.lo  \
+    base/process/fork_server.lo  \
+    base/process/process_server_manager.lo  \
+    base/base64/mime_utils.lo  \
+    base/thread/thread.lo  \
+    base/utility.lo  \
+    base/hash_map/hash_map.lo  \
+    conf/main/xml_main_configuration.lo  \
+    conf/main/main_configuration.lo  \
+    conf/xml_conf.lo  \
+    conf/nodetree.lo  \
+    conf/mime/xml_mime_handler.lo  \
+    conf/mime/mime_manager.lo  \
+    conf/vhost/vhost.lo  \
+    conf/vhost/xml_vhost_handler.lo  \
+    conf/vhost/ip.lo  \
+    conf/vhost/vhost_manager.lo  \
+    conf/security/security_cache.lo  \
+    conf/security/security_domain.lo  \
+    conf/security/validator.lo  \
+    conf/security/auth_method_factory.lo  \
+    conf/security/security_manager.lo  \
+    conf/security/xml_validator.lo  \
+    conf/security/auth_method.lo  \
+    conf/security/validator_factory.lo  \
+    conf/security/auth_domain.lo  \
+    conf/security/security_token.lo  \
+    protocol/protocols_manager.lo  \
+    protocol/control/control_header.lo  \
+    protocol/control/control_protocol.lo  \
+    protocol/protocol_buffer.lo  \
+    protocol/gopher/gopher_content.lo  \
+    protocol/gopher/engine.lo  \
+    protocol/gopher/gopher.lo  \
+    protocol/protocol.lo  \
+    protocol/http/http_response.lo  \
+    protocol/http/http_headers.lo  \
+    protocol/http/dyn_http_command.lo  \
+    protocol/http/http_request.lo  \
+    protocol/http/http.lo  \
+    protocol/http/http_req_security_domain.lo  \
+    protocol/http/dyn_http_manager.lo  \
+    protocol/http/dyn_http_manager_list.lo  \
+    protocol/http/http_thread_context.lo  \
+    protocol/http/dyn_http_command_manager.lo  \
+    protocol/http/http_errors.lo  \
+    protocol/http/env/env.lo  \
+    protocol/http/http_header.lo  \
+    protocol/http/http_data_handler.lo  \
+    protocol/http/http_data_read.lo  \
+    protocol/ftp/ftp_lexer.lo  \
+    protocol/ftp/ftp.lo  \
+    protocol/ftp/ftp_parser.lo  \
+    protocol/https/https.lo  \
+    protocol/url.lo  \
+    connection/connection.lo  \
+    plugin/plugin_info.lo  \
+    plugin/plugins_manager.lo  \
+    plugin/plugin.lo  \
+    filter/stream.lo  \
+    filter/console.lo  \
+    filter/filter.lo  \
+    filter/filters_factory.lo  \
+    filter/filters_chain.lo  \
+    filter/memory_stream.lo  \
+    filter/gzip/gzip.lo  \
+    filter/gzip/gzip_decompress.lo  \
+		../lib/libgnu.la  \
+		$(PTHREAD_LIB) $(IDN_LIB) $(XNET_LIB) $(DL_LIB) \
+		$(ZLIB_LIB) $(XML_LIBS) \
+		$(INTLLIBS) $(LDFLAGS)
 
-all-local: libmyserver.a myserver${EXEEXT}
-	cp myserver${EXEEXT} ../binaries
+myserver_CXXFLAGS = $(CXXFLAGS) -DHOST_STR=\"$(build)\" -DPREFIX=\"$(prefix)\"
+
+myserver_LDADD = libmyserver.la $(PTHREAD_LIB) $(IDN_LIB) \
+	$(XNET_LIB) $(DL_LIB) $(ZLIB_LIB) \
+	$(XML_LIBS) $(INTLLIBS) $(LDFLAGS)
 
-clean-local:
-	rm -f libmyserver.a
-	find . | grep .*\\.$(OBJEXT)$$ | xargs rm -f
+all-local: libmyserver.la myserver${EXEEXT}
+	cp myserver${EXEEXT} ../binaries*/
diff --git a/myserver/src/base/Makefile.am b/myserver/src/base/Makefile.am
index 020963d..abf6a79 100644
--- a/myserver/src/base/Makefile.am
+++ b/myserver/src/base/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libbase.a
-libbase_a_SOURCES = utility.cpp
+lib_LTLIBRARIES = libbase.la
+libbase_la_SOURCES = utility.cpp
 SUBDIRS = base64 bitvec crypt dynamic_lib file files_cache read_directory \
 	  hash_map home_dir mem_buff multicast pipe process regex safetime slab \
 	  socket socket_pair ssl string sync thread xml unix_socket
diff --git a/myserver/src/base/base64/Makefile.am b/myserver/src/base/base64/Makefile.am
index e35a740..3c28aec 100644
--- a/myserver/src/base/base64/Makefile.am
+++ b/myserver/src/base/base64/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libbase64.a
-libbase64_a_SOURCES = mime_utils.cpp
+lib_LTLIBRARIES = libbase64.la
+libbase64_la_SOURCES = mime_utils.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/bitvec/Makefile.am b/myserver/src/base/bitvec/Makefile.am
index 309a415..1afac54 100644
--- a/myserver/src/base/bitvec/Makefile.am
+++ b/myserver/src/base/bitvec/Makefile.am
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libbitvec.a
-libbitvec_a_SOURCES = bitvec.cpp
+lib_LTLIBRARIES = libbitvec.la
+libbitvec_la_SOURCES = bitvec.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
diff --git a/myserver/src/base/crypt/Makefile.am b/myserver/src/base/crypt/Makefile.am
index 7d78c5d..1caa52d 100644
--- a/myserver/src/base/crypt/Makefile.am
+++ b/myserver/src/base/crypt/Makefile.am
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libcrypt.a
-libcrypt_a_SOURCES = crypt_algo.cpp crypt_algo_manager.cpp md5.cpp sha1.cpp
+lib_LTLIBRARIES = libcrypt.la
+libcrypt_la_SOURCES = crypt_algo.cpp crypt_algo_manager.cpp md5.cpp sha1.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
diff --git a/myserver/src/base/dynamic_lib/Makefile.am b/myserver/src/base/dynamic_lib/Makefile.am
index 749a97f..2c2b3cc 100644
--- a/myserver/src/base/dynamic_lib/Makefile.am
+++ b/myserver/src/base/dynamic_lib/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libdynamic_lib.a
-libdynamic_lib_a_SOURCES = dynamiclib.cpp
+lib_LTLIBRARIES = libdynamic_lib.la
+libdynamic_lib_la_SOURCES = dynamiclib.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/file/Makefile.am b/myserver/src/base/file/Makefile.am
index 3e9bfe0..4a13660 100644
--- a/myserver/src/base/file/Makefile.am
+++ b/myserver/src/base/file/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libfile.a
-libfile_a_SOURCES = file.cpp files_utility.cpp
+lib_LTLIBRARIES = libfile.la
+libfile_la_SOURCES = file.cpp files_utility.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/files_cache/Makefile.am b/myserver/src/base/files_cache/Makefile.am
index ec533a3..ba62da4 100644
--- a/myserver/src/base/files_cache/Makefile.am
+++ b/myserver/src/base/files_cache/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libfiles_cache.a
-libfiles_cache_a_SOURCES = cached_file_buffer.cpp cached_file.cpp \
+lib_LTLIBRARIES = libfiles_cache.la
+libfiles_cache_la_SOURCES = cached_file_buffer.cpp cached_file.cpp \
 			   cached_file_factory.cpp membuf_file.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
diff --git a/myserver/src/base/hash_map/Makefile.am b/myserver/src/base/hash_map/Makefile.am
index 302948f..350e31f 100644
--- a/myserver/src/base/hash_map/Makefile.am
+++ b/myserver/src/base/hash_map/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libhash_map.a
-libhash_map_a_SOURCES = hash_map.cpp
+lib_LTLIBRARIES = libhash_map.la
+libhash_map_la_SOURCES = hash_map.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/home_dir/Makefile.am b/myserver/src/base/home_dir/Makefile.am
index d9bf9d3..842dc87 100644
--- a/myserver/src/base/home_dir/Makefile.am
+++ b/myserver/src/base/home_dir/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libhome_dir.a
-libhome_dir_a_SOURCES = home_dir.cpp
+lib_LTLIBRARIES = libhome_dir.la
+libhome_dir_la_SOURCES = home_dir.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/mem_buff/Makefile.am b/myserver/src/base/mem_buff/Makefile.am
index 2ca7db4..f61f17a 100644
--- a/myserver/src/base/mem_buff/Makefile.am
+++ b/myserver/src/base/mem_buff/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libmem_buff.a
-libmem_buff_a_SOURCES = mem_buff.cpp
+lib_LTLIBRARIES = libmem_buff.la
+libmem_buff_la_SOURCES = mem_buff.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/multicast/Makefile.am b/myserver/src/base/multicast/Makefile.am
index bdc0063..0632475 100644
--- a/myserver/src/base/multicast/Makefile.am
+++ b/myserver/src/base/multicast/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libmulticast.a
-libmulticast_a_SOURCES = multicast.cpp
+lib_LTLIBRARIES = libmulticast.la
+libmulticast_la_SOURCES = multicast.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/pipe/Makefile.am b/myserver/src/base/pipe/Makefile.am
index 747375e..440f949 100644
--- a/myserver/src/base/pipe/Makefile.am
+++ b/myserver/src/base/pipe/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libpipe.a
-libpipe_a_SOURCES = pipe.cpp
+lib_LTLIBRARIES = libpipe.la
+libpipe_la_SOURCES = pipe.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/process/Makefile.am b/myserver/src/base/process/Makefile.am
index e23aea3..bba48b1 100644
--- a/myserver/src/base/process/Makefile.am
+++ b/myserver/src/base/process/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libprocess.a
-libprocess_a_SOURCES = fork_server.cpp process.cpp process_server_manager.cpp
+lib_LTLIBRARIES = libprocess.la
+libprocess_la_SOURCES = fork_server.cpp process.cpp process_server_manager.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/read_directory/Makefile.am b/myserver/src/base/read_directory/Makefile.am
index 20af6ce..8d5b572 100644
--- a/myserver/src/base/read_directory/Makefile.am
+++ b/myserver/src/base/read_directory/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libread_directory.a
-libread_directory_a_SOURCES = read_directory.cpp
+lib_LTLIBRARIES = libread_directory.la
+libread_directory_la_SOURCES = read_directory.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/regex/Makefile.am b/myserver/src/base/regex/Makefile.am
index fcdf147..6776bb4 100644
--- a/myserver/src/base/regex/Makefile.am
+++ b/myserver/src/base/regex/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libregex.a
-libregex_a_SOURCES = myserver_regex.cpp
+lib_LTLIBRARIES = libregex.la
+libregex_la_SOURCES = myserver_regex.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/safetime/Makefile.am b/myserver/src/base/safetime/Makefile.am
index a683a64..90d79c7 100644
--- a/myserver/src/base/safetime/Makefile.am
+++ b/myserver/src/base/safetime/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libsafetime.a
-libsafetime_a_SOURCES = safetime.cpp
+lib_LTLIBRARIES = libsafetime.la
+libsafetime_la_SOURCES = safetime.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/slab/Makefile.am b/myserver/src/base/slab/Makefile.am
index 0d4cf17..7e1b627 100644
--- a/myserver/src/base/slab/Makefile.am
+++ b/myserver/src/base/slab/Makefile.am
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libslab.a
-libslab_a_SOURCES = slab.cpp
+lib_LTLIBRARIES = libslab.la
+libslab_la_SOURCES = slab.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
diff --git a/myserver/src/base/socket/Makefile.am b/myserver/src/base/socket/Makefile.am
index 84d34b2..90b2b68 100644
--- a/myserver/src/base/socket/Makefile.am
+++ b/myserver/src/base/socket/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libsocket.a
-libsocket_a_SOURCES = socket.cpp ssl_socket.cpp
+lib_LTLIBRARIES = libsocket.la
+libsocket_la_SOURCES = socket.cpp ssl_socket.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/socket_pair/Makefile.am b/myserver/src/base/socket_pair/Makefile.am
index f5d5e08..53540b2 100644
--- a/myserver/src/base/socket_pair/Makefile.am
+++ b/myserver/src/base/socket_pair/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libsocket_pair.a
-libsocket_pair_a_SOURCES = socket_pair.cpp
+lib_LTLIBRARIES = libsocket_pair.la
+libsocket_pair_la_SOURCES = socket_pair.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/ssl/Makefile.am b/myserver/src/base/ssl/Makefile.am
index c32fee2..0f67678 100644
--- a/myserver/src/base/ssl/Makefile.am
+++ b/myserver/src/base/ssl/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libssl.a
-libssl_a_SOURCES = ssl.cpp
+lib_LTLIBRARIES = libssl.la
+libssl_la_SOURCES = ssl.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/string/Makefile.am b/myserver/src/base/string/Makefile.am
index 1d1e32d..9d8c13d 100644
--- a/myserver/src/base/string/Makefile.am
+++ b/myserver/src/base/string/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libstring.a
-libstring_a_SOURCES = securestr.cpp stringutils.cpp
+lib_LTLIBRARIES = libstring.la
+libstring_la_SOURCES = securestr.cpp stringutils.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/sync/Makefile.am b/myserver/src/base/sync/Makefile.am
index 7671a42..711953b 100644
--- a/myserver/src/base/sync/Makefile.am
+++ b/myserver/src/base/sync/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libsync.a
-libsync_a_SOURCES = event.cpp mutex.cpp read_write_lock.cpp recursive_mutex.cpp semaphore.cpp
+lib_LTLIBRARIES = libsync.la
+libsync_la_SOURCES = event.cpp mutex.cpp read_write_lock.cpp recursive_mutex.cpp semaphore.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/thread/Makefile.am b/myserver/src/base/thread/Makefile.am
index 41327ea..5763d32 100644
--- a/myserver/src/base/thread/Makefile.am
+++ b/myserver/src/base/thread/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libthread.a
-libthread_a_SOURCES = thread.cpp
+lib_LTLIBRARIES = libthread.la
+libthread_la_SOURCES = thread.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/unix_socket/Makefile.am b/myserver/src/base/unix_socket/Makefile.am
index e9a76d6..6d3eaa2 100644
--- a/myserver/src/base/unix_socket/Makefile.am
+++ b/myserver/src/base/unix_socket/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libunix_socket.a
-libunix_socket_a_SOURCES = unix_socket.cpp
+lib_LTLIBRARIES = libunix_socket.la
+libunix_socket_la_SOURCES = unix_socket.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/base/xml/Makefile.am b/myserver/src/base/xml/Makefile.am
index b493bb4..49c9d5b 100644
--- a/myserver/src/base/xml/Makefile.am
+++ b/myserver/src/base/xml/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libxml.a
-libxml_a_SOURCES = xml_parser.cpp
+lib_LTLIBRARIES = libxml.la
+libxml_la_SOURCES = xml_parser.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/conf/Makefile.am b/myserver/src/conf/Makefile.am
index aab0d35..e224f25 100644
--- a/myserver/src/conf/Makefile.am
+++ b/myserver/src/conf/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libconf.a
-libconf_a_SOURCES = nodetree.cpp xml_conf.cpp
+lib_LTLIBRARIES = libconf.la
+libconf_la_SOURCES = nodetree.cpp xml_conf.cpp
 SUBDIRS = main mime security vhost
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/conf/main/Makefile.am b/myserver/src/conf/main/Makefile.am
index 40eecef..35d22f6 100644
--- a/myserver/src/conf/main/Makefile.am
+++ b/myserver/src/conf/main/Makefile.am
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libmain.a
-libmain_a_SOURCES = main_configuration.cpp xml_main_configuration.cpp
+lib_LTLIBRARIES = libmain.la
+libmain_la_SOURCES = main_configuration.cpp xml_main_configuration.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
diff --git a/myserver/src/conf/mime/Makefile.am b/myserver/src/conf/mime/Makefile.am
index 3eab217..85038d8 100644
--- a/myserver/src/conf/mime/Makefile.am
+++ b/myserver/src/conf/mime/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libmime.a
-libmime_a_SOURCES = mime_manager.cpp xml_mime_handler.cpp
+lib_LTLIBRARIES = libmime.la
+libmime_la_SOURCES = mime_manager.cpp xml_mime_handler.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/conf/security/Makefile.am b/myserver/src/conf/security/Makefile.am
index 2aa1bed..983647e 100644
--- a/myserver/src/conf/security/Makefile.am
+++ b/myserver/src/conf/security/Makefile.am
@@ -15,7 +15,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libsecurity.a
-libsecurity_a_SOURCES = auth_domain.cpp auth_method.cpp auth_method_factory.cpp security_cache.cpp security_domain.cpp security_manager.cpp security_token.cpp validator.cpp validator_factory.cpp xml_validator.cpp
+lib_LTLIBRARIES = libsecurity.la
+libsecurity_la_SOURCES = auth_domain.cpp auth_method.cpp auth_method_factory.cpp security_cache.cpp security_domain.cpp security_manager.cpp security_token.cpp validator.cpp validator_factory.cpp xml_validator.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
diff --git a/myserver/src/conf/vhost/Makefile.am b/myserver/src/conf/vhost/Makefile.am
index c1391e9..482a739 100644
--- a/myserver/src/conf/vhost/Makefile.am
+++ b/myserver/src/conf/vhost/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libvhost.a
-libvhost_a_SOURCES = vhost.cpp vhost_manager.cpp ip.cpp xml_vhost_handler.cpp
+lib_LTLIBRARIES = libvhost.la
+libvhost_la_SOURCES = vhost.cpp vhost_manager.cpp ip.cpp xml_vhost_handler.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/connection/Makefile.am b/myserver/src/connection/Makefile.am
index 691012a..9839ecd 100644
--- a/myserver/src/connection/Makefile.am
+++ b/myserver/src/connection/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libconnection.a
-libconnection_a_SOURCES = connection.cpp
+lib_LTLIBRARIES = libconnection.la
+libconnection_la_SOURCES = connection.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/connections_scheduler/Makefile.am b/myserver/src/connections_scheduler/Makefile.am
index 70474ec..e8f9d99 100644
--- a/myserver/src/connections_scheduler/Makefile.am
+++ b/myserver/src/connections_scheduler/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libconnections_scheduler.a
-libconnections_scheduler_a_SOURCES = connections_scheduler.cpp listen_threads.cpp
+lib_LTLIBRARIES = libconnections_scheduler.la
+libconnections_scheduler_la_SOURCES = connections_scheduler.cpp listen_threads.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/filter/Makefile.am b/myserver/src/filter/Makefile.am
index e26fd93..348c1f2 100644
--- a/myserver/src/filter/Makefile.am
+++ b/myserver/src/filter/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libfilter.a
-libfilter_a_SOURCES = filter.cpp filters_chain.cpp filters_factory.cpp memory_stream.cpp stream.cpp \
+lib_LTLIBRARIES = libfilter.la
+libfilter_la_SOURCES = filter.cpp filters_chain.cpp filters_factory.cpp memory_stream.cpp stream.cpp \
 			console.cpp
 SUBDIRS = gzip
 AM_CPPFLAGS = $(all_includes)
diff --git a/myserver/src/filter/gzip/Makefile.am b/myserver/src/filter/gzip/Makefile.am
index e4c1361..17f1597 100644
--- a/myserver/src/filter/gzip/Makefile.am
+++ b/myserver/src/filter/gzip/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libgzip.a
-libgzip_a_SOURCES = gzip.cpp gzip_decompress.cpp
+lib_LTLIBRARIES = libgzip.la
+libgzip_la_SOURCES = gzip.cpp gzip_decompress.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/http_handler/Makefile.am b/myserver/src/http_handler/Makefile.am
index 188ebb4..ab15fe8 100644
--- a/myserver/src/http_handler/Makefile.am
+++ b/myserver/src/http_handler/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libhttp_handler.a
-libhttp_handler_a_SOURCES =
+lib_LTLIBRARIES = libhttp_handler.la
+libhttp_handler_la_SOURCES =
 SUBDIRS = cgi fastcgi http_dir http_file isapi mscgi proxy scgi wincgi
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/http_handler/cgi/Makefile.am b/myserver/src/http_handler/cgi/Makefile.am
index b267203..2edb58b 100644
--- a/myserver/src/http_handler/cgi/Makefile.am
+++ b/myserver/src/http_handler/cgi/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libcgi.a
-libcgi_a_SOURCES = cgi.cpp
+lib_LTLIBRARIES = libcgi.la
+libcgi_la_SOURCES = cgi.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/http_handler/fastcgi/Makefile.am b/myserver/src/http_handler/fastcgi/Makefile.am
index 003952d..8e5ad8f 100644
--- a/myserver/src/http_handler/fastcgi/Makefile.am
+++ b/myserver/src/http_handler/fastcgi/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libfastcgi.a
-libfastcgi_a_SOURCES = fastcgi.cpp
+lib_LTLIBRARIES = libfastcgi.la
+libfastcgi_la_SOURCES = fastcgi.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/http_handler/http_dir/Makefile.am b/myserver/src/http_handler/http_dir/Makefile.am
index cc30206..cbadfee 100644
--- a/myserver/src/http_handler/http_dir/Makefile.am
+++ b/myserver/src/http_handler/http_dir/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libhttp_dir.a
-libhttp_dir_a_SOURCES = http_dir.cpp
+lib_LTLIBRARIES = libhttp_dir.la
+libhttp_dir_la_SOURCES = http_dir.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/http_handler/http_file/Makefile.am b/myserver/src/http_handler/http_file/Makefile.am
index e35b3b3..aeb5b85 100644
--- a/myserver/src/http_handler/http_file/Makefile.am
+++ b/myserver/src/http_handler/http_file/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libhttp_file.a
-libhttp_file_a_SOURCES = http_file.cpp
+lib_LTLIBRARIES = libhttp_file.la
+libhttp_file_la_SOURCES = http_file.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/http_handler/isapi/Makefile.am b/myserver/src/http_handler/isapi/Makefile.am
index 2e9ef67..6d0d07c 100644
--- a/myserver/src/http_handler/isapi/Makefile.am
+++ b/myserver/src/http_handler/isapi/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libisapi.a
-libisapi_a_SOURCES = isapi.cpp
+lib_LTLIBRARIES = libisapi.la
+libisapi_la_SOURCES = isapi.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/http_handler/mscgi/Makefile.am b/myserver/src/http_handler/mscgi/Makefile.am
index e83caab..9052756 100644
--- a/myserver/src/http_handler/mscgi/Makefile.am
+++ b/myserver/src/http_handler/mscgi/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libmscgi.a
-libmscgi_a_SOURCES = mscgi.cpp mscgi_manager.cpp
+lib_LTLIBRARIES = libmscgi.la
+libmscgi_la_SOURCES = mscgi.cpp mscgi_manager.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/http_handler/proxy/Makefile.am b/myserver/src/http_handler/proxy/Makefile.am
index 6dbbda9..c1ca885 100644
--- a/myserver/src/http_handler/proxy/Makefile.am
+++ b/myserver/src/http_handler/proxy/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libproxy.a
-libproxy_a_SOURCES = proxy.cpp
+lib_LTLIBRARIES = libproxy.la
+libproxy_la_SOURCES = proxy.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/http_handler/scgi/Makefile.am b/myserver/src/http_handler/scgi/Makefile.am
index e45cf8e..3b28392 100644
--- a/myserver/src/http_handler/scgi/Makefile.am
+++ b/myserver/src/http_handler/scgi/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libscgi.a
-libscgi_a_SOURCES = scgi.cpp
+lib_LTLIBRARIES = libscgi.la
+libscgi_la_SOURCES = scgi.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/http_handler/wincgi/Makefile.am b/myserver/src/http_handler/wincgi/Makefile.am
index 0fa7b74..76025d9 100644
--- a/myserver/src/http_handler/wincgi/Makefile.am
+++ b/myserver/src/http_handler/wincgi/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libwincgi.a
-libwincgi_a_SOURCES = wincgi.cpp
+lib_LTLIBRARIES = libwincgi.la
+libwincgi_la_SOURCES = wincgi.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/log/Makefile.am b/myserver/src/log/Makefile.am
index dd3ca84..9a8ce2d 100644
--- a/myserver/src/log/Makefile.am
+++ b/myserver/src/log/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = liblog.a
-liblog_a_SOURCES = log_manager.cpp
+lib_LTLIBRARIES = liblog.la
+liblog_la_SOURCES = log_manager.cpp
 SUBDIRS = stream
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/log/stream/Makefile.am b/myserver/src/log/stream/Makefile.am
index eb4e6c5..51d0d19 100644
--- a/myserver/src/log/stream/Makefile.am
+++ b/myserver/src/log/stream/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libstream.a
-libstream_a_SOURCES = console_stream.cpp file_stream.cpp \
+lib_LTLIBRARIES = libstream.la
+libstream_la_SOURCES = console_stream.cpp file_stream.cpp \
 		log_stream.cpp log_stream_factory.cpp \
 		log_stream_creator.cpp file_stream_creator.cpp \
 		console_stream_creator.cpp socket_stream.cpp \
diff --git a/myserver/src/plugin/Makefile.am b/myserver/src/plugin/Makefile.am
index 385a36b..e5d21ad 100644
--- a/myserver/src/plugin/Makefile.am
+++ b/myserver/src/plugin/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libplugin.a
-libplugin_a_SOURCES =  plugin.cpp plugin_info.cpp plugins_manager.cpp 
+lib_LTLIBRARIES = libplugin.la
+libplugin_la_SOURCES =  plugin.cpp plugin_info.cpp plugins_manager.cpp 
 AM_CPPFLAGS = $(all_includes)
 
 install:
diff --git a/myserver/src/protocol/Makefile.am b/myserver/src/protocol/Makefile.am
index a7a30ae..d6582a9 100644
--- a/myserver/src/protocol/Makefile.am
+++ b/myserver/src/protocol/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libprotocol.a
-libprotocol_a_SOURCES = protocol_buffer.cpp protocol.cpp protocols_manager.cpp \
+lib_LTLIBRARIES = libprotocol.la
+libprotocol_la_SOURCES = protocol_buffer.cpp protocol.cpp protocols_manager.cpp \
 			url.cpp
 SUBDIRS = control ftp gopher http https
 AM_CPPFLAGS = $(all_includes)
diff --git a/myserver/src/protocol/control/Makefile.am b/myserver/src/protocol/control/Makefile.am
index 45aeb12..4348bba 100644
--- a/myserver/src/protocol/control/Makefile.am
+++ b/myserver/src/protocol/control/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libcontrol.a
-libcontrol_a_SOURCES = control_header.cpp control_protocol.cpp
+lib_LTLIBRARIES = libcontrol.la
+libcontrol_la_SOURCES = control_header.cpp control_protocol.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/protocol/ftp/Makefile.am b/myserver/src/protocol/ftp/Makefile.am
index 135afd3..6b32ce0 100644
--- a/myserver/src/protocol/ftp/Makefile.am
+++ b/myserver/src/protocol/ftp/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libftp.a
-libftp_a_SOURCES = ftp.cpp ftp_lexer.cpp ftp_parser.cpp
+lib_LTLIBRARIES = libftp.la
+libftp_la_SOURCES = ftp.cpp ftp_lexer.cpp ftp_parser.cpp
 EXTRA_DIST = ftp_lexer.out.cpp  ftp_parser.ypp  ftp_lexer.lpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
diff --git a/myserver/src/protocol/gopher/Makefile.am b/myserver/src/protocol/gopher/Makefile.am
index 75cce42..5815b8f 100644
--- a/myserver/src/protocol/gopher/Makefile.am
+++ b/myserver/src/protocol/gopher/Makefile.am
@@ -15,6 +15,6 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libgopher.a
-libgopher_a_SOURCES = gopher.cpp gopher_content.cpp engine.cpp
+lib_LTLIBRARIES = libgopher.la
+libgopher_la_SOURCES = gopher.cpp gopher_content.cpp engine.cpp
 AM_CPPFLAGS = $(all_includes)
diff --git a/myserver/src/protocol/http/Makefile.am b/myserver/src/protocol/http/Makefile.am
index ebba91c..23c540f 100644
--- a/myserver/src/protocol/http/Makefile.am
+++ b/myserver/src/protocol/http/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libhttp.a
-libhttp_a_SOURCES = http.cpp http_data_handler.cpp http_data_read.cpp \
+lib_LTLIBRARIES = libhttp.la
+libhttp_la_SOURCES = http.cpp http_data_handler.cpp http_data_read.cpp \
 	           http_errors.cpp  http_header.cpp http_headers.cpp \
 		   http_request.cpp http_req_security_domain.cpp \
 		   http_response.cpp http_thread_context.cpp \
diff --git a/myserver/src/protocol/http/env/Makefile.am b/myserver/src/protocol/http/env/Makefile.am
index 4d848d1..2e67a80 100644
--- a/myserver/src/protocol/http/env/Makefile.am
+++ b/myserver/src/protocol/http/env/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libenv.a
-libenv_a_SOURCES = env.cpp
+lib_LTLIBRARIES = libenv.la
+libenv_la_SOURCES = env.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/protocol/https/Makefile.am b/myserver/src/protocol/https/Makefile.am
index f5bd8e6..dc0be0b 100644
--- a/myserver/src/protocol/https/Makefile.am
+++ b/myserver/src/protocol/https/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libhttps.a
-libhttps_a_SOURCES = https.cpp
+lib_LTLIBRARIES = libhttps.la
+libhttps_la_SOURCES = https.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/src/server/Makefile.am b/myserver/src/server/Makefile.am
index 13fa4ae..89cf371 100644
--- a/myserver/src/server/Makefile.am
+++ b/myserver/src/server/Makefile.am
@@ -15,8 +15,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
-lib_LIBRARIES = libserver.a
-libserver_a_SOURCES = clients_thread.cpp server.cpp
+lib_LTLIBRARIES = libserver.la
+libserver_la_SOURCES = clients_thread.cpp server.cpp
 SUBDIRS =
 AM_CPPFLAGS = $(all_includes)
 
diff --git a/myserver/tests/Makefile.am b/myserver/tests/Makefile.am
index 069bd32..d648256 100644
--- a/myserver/tests/Makefile.am
+++ b/myserver/tests/Makefile.am
@@ -82,7 +82,7 @@ test_suite_SOURCES =  	main.cpp				\
 			test_xml_main_configuration.cpp		\
 			test_xml_validator.cpp
 
-test_suite_LDADD = ../src/libmyserver.a  ../lib/libgnu.a $(CPPUNIT_LDFLAGS) \
+test_suite_LDADD = ../src/libmyserver.la  ../lib/libgnu.la $(CPPUNIT_LDFLAGS) \
 	$(PTHREAD_LIB) 	$(IDN_LIB) $(XNET_LIB) $(DL_LIB) $(ZLIB_LIB) \
 	$(XML_LIBS) $(INTLLIBS) $(LDFLAGS)
 

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

Summary of changes:
 myserver/binaries/web/cgi-src/math_sum/Makefile.am |   13 +--
 myserver/binaries/web/cgi-src/post/Makefile.am     |   13 +--
 myserver/bootstrap.conf                            |    2 +-
 myserver/src/Makefile.am                           |  162 +++++++++++++++++--
 myserver/src/base/Makefile.am                      |    4 +-
 myserver/src/base/base64/Makefile.am               |    4 +-
 myserver/src/base/bitvec/Makefile.am               |    4 +-
 myserver/src/base/crypt/Makefile.am                |    4 +-
 myserver/src/base/dynamic_lib/Makefile.am          |    4 +-
 myserver/src/base/file/Makefile.am                 |    4 +-
 myserver/src/base/files_cache/Makefile.am          |    4 +-
 myserver/src/base/hash_map/Makefile.am             |    4 +-
 myserver/src/base/home_dir/Makefile.am             |    4 +-
 myserver/src/base/mem_buff/Makefile.am             |    4 +-
 myserver/src/base/multicast/Makefile.am            |    4 +-
 myserver/src/base/pipe/Makefile.am                 |    4 +-
 myserver/src/base/process/Makefile.am              |    4 +-
 myserver/src/base/read_directory/Makefile.am       |    4 +-
 myserver/src/base/regex/Makefile.am                |    4 +-
 myserver/src/base/safetime/Makefile.am             |    4 +-
 myserver/src/base/slab/Makefile.am                 |    4 +-
 myserver/src/base/socket/Makefile.am               |    4 +-
 myserver/src/base/socket_pair/Makefile.am          |    4 +-
 myserver/src/base/ssl/Makefile.am                  |    4 +-
 myserver/src/base/string/Makefile.am               |    4 +-
 myserver/src/base/sync/Makefile.am                 |    4 +-
 myserver/src/base/thread/Makefile.am               |    4 +-
 myserver/src/base/unix_socket/Makefile.am          |    4 +-
 myserver/src/base/xml/Makefile.am                  |    4 +-
 myserver/src/conf/Makefile.am                      |    4 +-
 myserver/src/conf/main/Makefile.am                 |    4 +-
 myserver/src/conf/mime/Makefile.am                 |    4 +-
 myserver/src/conf/security/Makefile.am             |    4 +-
 myserver/src/conf/vhost/Makefile.am                |    4 +-
 myserver/src/connection/Makefile.am                |    4 +-
 myserver/src/connections_scheduler/Makefile.am     |    4 +-
 myserver/src/filter/Makefile.am                    |    4 +-
 myserver/src/filter/gzip/Makefile.am               |    4 +-
 myserver/src/http_handler/Makefile.am              |    4 +-
 myserver/src/http_handler/cgi/Makefile.am          |    4 +-
 myserver/src/http_handler/fastcgi/Makefile.am      |    4 +-
 myserver/src/http_handler/http_dir/Makefile.am     |    4 +-
 myserver/src/http_handler/http_file/Makefile.am    |    4 +-
 myserver/src/http_handler/isapi/Makefile.am        |    4 +-
 myserver/src/http_handler/mscgi/Makefile.am        |    4 +-
 myserver/src/http_handler/proxy/Makefile.am        |    4 +-
 myserver/src/http_handler/scgi/Makefile.am         |    4 +-
 myserver/src/http_handler/wincgi/Makefile.am       |    4 +-
 myserver/src/log/Makefile.am                       |    4 +-
 myserver/src/log/stream/Makefile.am                |    4 +-
 myserver/src/plugin/Makefile.am                    |    4 +-
 myserver/src/protocol/Makefile.am                  |    4 +-
 myserver/src/protocol/control/Makefile.am          |    4 +-
 myserver/src/protocol/ftp/Makefile.am              |    4 +-
 myserver/src/protocol/gopher/Makefile.am           |    4 +-
 myserver/src/protocol/http/Makefile.am             |    4 +-
 myserver/src/protocol/http/env/Makefile.am         |    4 +-
 myserver/src/protocol/https/Makefile.am            |    4 +-
 myserver/src/server/Makefile.am                    |    4 +-
 myserver/tests/Makefile.am                         |    2 +-
 60 files changed, 263 insertions(+), 149 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Thu Apr 08 19:53:47 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O01Xf-0004QW-4Q
	for mharc-myserver-commit@gnu.org; Thu, 08 Apr 2010 19:53:47 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O01Xd-0004QP-V2
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 19:53:45 -0400
Received: from [140.186.70.92] (port=38972 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O01Xc-0004QB-LP
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 19:53:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O01Xb-0003Q1-HO
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 19:53:44 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:43832
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O01Xb-0003Pt-Af
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 19:53:43 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O01Xa-0001Yr-RP
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 23:53:42 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O01Xa-0005AT-NK
	for myserver-commit@gnu.org; Thu, 08 Apr 2010 23:53:42 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 69c910142b53d8e42705aa2c0147639f85104cc1
X-Git-Newrev: d9a35af49e699a933905345627d16184638fe2e1
Message-Id: <E1O01Xa-0005AT-NK@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Thu, 08 Apr 2010 23:53:42 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-116-gd9a35af
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, 08 Apr 2010 23:53:46 -0000

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

The branch, master has been updated
       via  d9a35af49e699a933905345627d16184638fe2e1 (commit)
      from  69c910142b53d8e42705aa2c0147639f85104cc1 (commit)

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

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


commit d9a35af49e699a933905345627d16184638fe2e1
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 9 01:53:29 2010 +0200

    Do not use a dummy file

diff --git a/myserver/src/Makefile.am b/myserver/src/Makefile.am
index 882b5ae..98801f2 100644
--- a/myserver/src/Makefile.am
+++ b/myserver/src/Makefile.am
@@ -27,7 +27,7 @@ myserver_SOURCES = myserver.cpp
 
 lib_LTLIBRARIES = libmyserver.la
 
-libmyserver_la_SOURCES = dummy.cpp
+libmyserver_la_SOURCES =
 libmyserver_la_LIBADD =  \
     http_handler/proxy/proxy.lo  \
     http_handler/scgi/scgi.lo  \

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

Summary of changes:
 myserver/src/Makefile.am |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Fri Apr 09 04:29:58 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O09bC-0004O5-E1
	for mharc-myserver-commit@gnu.org; Fri, 09 Apr 2010 04:29:58 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O09bA-0004Nn-Kj
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 04:29:56 -0400
Received: from [140.186.70.92] (port=39176 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O09b6-0004N3-Bx
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 04:29:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O09b5-0007yB-E9
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 04:29:52 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:49100
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O09b5-0007y7-Aw
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 04:29:51 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O09b5-0007lr-4R
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 08:29:51 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O09b4-0007sv-Fj
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 08:29:51 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: d9a35af49e699a933905345627d16184638fe2e1
X-Git-Newrev: cb75775426dd183d26d16336baa514c05de6e2e1
Message-Id: <E1O09b4-0007sv-Fj@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Fri, 09 Apr 2010 08:29:51 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-117-gcb75775
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, 09 Apr 2010 08:29:56 -0000

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

The branch, master has been updated
       via  cb75775426dd183d26d16336baa514c05de6e2e1 (commit)
      from  d9a35af49e699a933905345627d16184638fe2e1 (commit)

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

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


commit cb75775426dd183d26d16336baa514c05de6e2e1
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 9 10:21:50 2010 +0200

    dummy.lo does not exist.

diff --git a/myserver/src/Makefile.am b/myserver/src/Makefile.am
index 98801f2..ab11432 100644
--- a/myserver/src/Makefile.am
+++ b/myserver/src/Makefile.am
@@ -51,7 +51,6 @@ libmyserver_la_LIBADD =  \
     log/stream/log_stream_factory.lo  \
     connections_scheduler/connections_scheduler.lo  \
     connections_scheduler/listen_threads.lo  \
-    dummy.lo  \
     server/clients_thread.lo  \
     server/server.lo  \
     base/multicast/multicast.lo  \

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

Summary of changes:
 myserver/src/Makefile.am |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Fri Apr 09 07:10:03 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O0C67-0001uj-9I
	for mharc-myserver-commit@gnu.org; Fri, 09 Apr 2010 07:10:03 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O0C65-0001tQ-5g
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 07:10:01 -0400
Received: from [140.186.70.92] (port=46921 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O0C63-0001sV-I4
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 07:10:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O0C62-0003C9-Bt
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 07:09:59 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:59193
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O0C62-0003C5-AR
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 07:09:58 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O0C62-0001Jh-At
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 11:09:58 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O0C62-000369-9Y
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 11:09:58 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: cb75775426dd183d26d16336baa514c05de6e2e1
X-Git-Newrev: b368198005d87e6ddd045943afa34eaa1f1b5130
Message-Id: <E1O0C62-000369-9Y@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Fri, 09 Apr 2010 11:09:58 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-118-gb368198
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, 09 Apr 2010 11:10:01 -0000

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

The branch, master has been updated
       via  b368198005d87e6ddd045943afa34eaa1f1b5130 (commit)
      from  cb75775426dd183d26d16336baa514c05de6e2e1 (commit)

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

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


commit b368198005d87e6ddd045943afa34eaa1f1b5130
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 9 13:07:23 2010 +0200

    Specify gettext version

diff --git a/myserver/configure.ac b/myserver/configure.ac
index e38be49..1f69c19 100644
--- a/myserver/configure.ac
+++ b/myserver/configure.ac
@@ -68,6 +68,7 @@ AC_DEFINE_UNQUOTED([MYSERVER_VERSION], ["${MYSERVER_VERSION}"],
 				       [The software version])
 
 AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION([0.16])
 
 AC_CHECK_PROG(make_info, makeinfo, yes, no)
 if test x$make_info = xno ; then

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

Summary of changes:
 myserver/configure.ac |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Fri Apr 09 12:33:36 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O0H9E-0004WT-IX
	for mharc-myserver-commit@gnu.org; Fri, 09 Apr 2010 12:33:36 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O0H9C-0004Vj-OB
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 12:33:34 -0400
Received: from [140.186.70.92] (port=44427 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O0H9A-0004Ub-Qc
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 12:33:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O0H96-0002WX-I0
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 12:33:29 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:54979
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O0H96-0002WO-F9
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 12:33:28 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O0H95-0005Fj-Mn
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 16:33:27 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O0H93-0004zK-4G
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 16:33:27 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: b368198005d87e6ddd045943afa34eaa1f1b5130
X-Git-Newrev: 8427719da42f7c0df0dc56755f386f4c6cf829f8
Message-Id: <E1O0H93-0004zK-4G@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Fri, 09 Apr 2010 16:33:26 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-121-g8427719
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, 09 Apr 2010 16:33:35 -0000

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

The branch, master has been updated
       via  8427719da42f7c0df0dc56755f386f4c6cf829f8 (commit)
       via  8f4aec8a9cac850c6f73e302e7348441f4a7a53a (commit)
       via  ed6e880a334fd335e730f4ab7e951a1901481c5f (commit)
      from  b368198005d87e6ddd045943afa34eaa1f1b5130 (commit)

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

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


commit 8427719da42f7c0df0dc56755f386f4c6cf829f8
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 9 18:33:22 2010 +0200

    Use gnulib::snprintf instead of snprintf

diff --git a/myserver/src/base/base64/mime_utils.cpp b/myserver/src/base/base64/mime_utils.cpp
index 3348ee9..d42f232 100644
--- a/myserver/src/base/base64/mime_utils.cpp
+++ b/myserver/src/base/base64/mime_utils.cpp
@@ -489,7 +489,7 @@ char* CQPUtils::encode (char *input)
       }
       finalresult = expandBuffer (finalresult, UsedSize, &BufSize, 0);
 
-      snprintf (mids, 3, "%X", mid);
+      gnulib::snprintf (mids, 3, "%X", mid);
 
       myserver_strupr (mids);
       *(fresult++) = '=';
diff --git a/myserver/src/base/crypt/crypt_algo_manager.cpp b/myserver/src/base/crypt/crypt_algo_manager.cpp
index 1c561ab..1f0d447 100644
--- a/myserver/src/base/crypt/crypt_algo_manager.cpp
+++ b/myserver/src/base/crypt/crypt_algo_manager.cpp
@@ -106,7 +106,7 @@ CryptAlgoManager::check (const char *value, size_t valueLen, const char *result,
   CryptAlgo *f = make (algo);
   if (!f)
     {
-      snprintf (buffer, bufferLen, _("%s is not a registered algorithm"), algo);
+      gnulib::snprintf (buffer, bufferLen, _("%s is not a registered algorithm"), algo);
       throw CryptAlgoManagerException (buffer);
     }
   auto_ptr<CryptAlgo> keeper (f);
diff --git a/myserver/src/base/socket/socket.cpp b/myserver/src/base/socket/socket.cpp
index 738c1b7..f2bab81 100644
--- a/myserver/src/base/socket/socket.cpp
+++ b/myserver/src/base/socket/socket.cpp
@@ -409,7 +409,7 @@ int Socket::connect (const char* host, u_short port)
     }
 
   memset (szPort, 0, sizeof (char)*10);
-  snprintf (szPort, 10, "%d", port);
+  gnulib::snprintf (szPort, 10, "%d", port);
 
   if (aiHints.ai_family != 0)
     nGetaddrinfoRet = getaddrinfo (host, NULL, &aiHints, &pHostInfo);
diff --git a/myserver/src/protocol/control/control_protocol.cpp b/myserver/src/protocol/control/control_protocol.cpp
index 957fd34..8a13616 100644
--- a/myserver/src/protocol/control/control_protocol.cpp
+++ b/myserver/src/protocol/control/control_protocol.cpp
@@ -541,7 +541,7 @@ int ControlProtocol::addToLog (int retCode, ConnectionPtr con, char *buffer,
 {
   string time;
   getRFC822GMTTime (time, 32);
-  snprintf (buffer, bufferSize, "%s [%s] %s:%s:%s - %s - %i", con->getIpAddr (),
+  gnulib::snprintf (buffer, bufferSize, "%s [%s] %s:%s:%s - %s - %i", con->getIpAddr (),
             time.c_str (), header.getCommand (), header.getVersion (),
             header.getOptions (), header.getAuthLogin (), retCode);
   con->host->accessesLogWrite ("%s", buffer);
@@ -565,14 +565,14 @@ int ControlProtocol::sendResponse (char *buffer, int buffersize,
     dataLength = outFile->getFileSize ();
 
   /* Build and send the first line.  */
-  snprintf (buffer, buffersize, "/%i\r\n", errID);
+  gnulib::snprintf (buffer, buffersize, "/%i\r\n", errID);
   if (a->socket->send (buffer, strlen (buffer), 0) < 0)
     {
       a->host->warningsLogWrite (_("Control: socket error"));
       return -1;
     }
 
-  snprintf (buffer, buffersize, "/LEN %u\r\n", (u_int)dataLength);
+  gnulib::snprintf (buffer, buffersize, "/LEN %u\r\n", (u_int)dataLength);
   if (a->socket->send (buffer, strlen (buffer), 0) < 0)
     {
       a->host->warningsLogWrite (_("Control: socket error"));
@@ -669,7 +669,7 @@ int ControlProtocol::visitConnection (ConnectionPtr con, void *argP)
 
   if (arg->command == ControlProtocolVisitorArg::SHOW_CONNECTIONS)
   {
-    snprintf (arg->buffer, arg->bufferSize, "%i - %s - %i - %s - %i - %s - %s\r\n",
+    gnulib::snprintf (arg->buffer, arg->bufferSize, "%i - %s - %i - %s - %i - %s - %s\r\n",
               static_cast<int>(con->getID ()),  con->getIpAddr (),
               static_cast<int>(con->getPort ()),
               con->getLocalIpAddr (),  static_cast<int>(con->getLocalPort ()),



commit 8f4aec8a9cac850c6f73e302e7348441f4a7a53a
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 9 18:20:32 2010 +0200

    Copy mscgi files only when they exist.

diff --git a/myserver/binaries/web/cgi-src/math_sum/Makefile.am b/myserver/binaries/web/cgi-src/math_sum/Makefile.am
index 1cdce5d..b03fb68 100644
--- a/myserver/binaries/web/cgi-src/math_sum/Makefile.am
+++ b/myserver/binaries/web/cgi-src/math_sum/Makefile.am
@@ -26,7 +26,8 @@ SO_EXT=`$(LIBTOOL) --config | $(SED) -e"y/'/\"/" -e '/^shrext_cmds/ !d; s/^.*="\
 all: all-am math_sum.mscgi
 
 math_sum.mscgi: libmath_sum.la
-	cp .libs/libmath_sum$(SO_EXT) ../../cgi-bin/math_sum.mscgi
+	test -e .libs/libmath_sum$(SO_EXT) \
+	|| cp .libs/libmath_sum$(SO_EXT) ../../cgi-bin/math_sum.mscgi
 
 clean-local:
 	test \! -e libmath_sum.la || \
diff --git a/myserver/binaries/web/cgi-src/post/Makefile.am b/myserver/binaries/web/cgi-src/post/Makefile.am
index a793681..fe058b5 100644
--- a/myserver/binaries/web/cgi-src/post/Makefile.am
+++ b/myserver/binaries/web/cgi-src/post/Makefile.am
@@ -26,7 +26,8 @@ SO_EXT=`$(LIBTOOL) --config | $(SED) -e"y/'/\"/" -e '/^shrext_cmds/ !d; s/^.*="\
 all: all-am post.mscgi
 
 post.mscgi: libpost.la
-	cp .libs/libpost$(SO_EXT) ../../cgi-bin/post.mscgi
+	test -e .libs/libpost$(SO_EXT)
+	|| cp .libs/libpost$(SO_EXT) ../../cgi-bin/post.mscgi
 
 clean-local:
 	test \! -e libpost.la || \



commit ed6e880a334fd335e730f4ab7e951a1901481c5f
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 9 18:12:35 2010 +0200

    By default disable the xml2 test at configure time

diff --git a/myserver/configure.ac b/myserver/configure.ac
index 1f69c19..dbab106 100644
--- a/myserver/configure.ac
+++ b/myserver/configure.ac
@@ -199,6 +199,7 @@ if test "x$IDN_LIB" = "x"; then
 
 AC_SUBST(IDN_LIB)
 
+enable_xmltest=no
 dnl Looking for LibXL2
 AM_PATH_XML2(2.6.0, have_xml2=yes)
 if test x$have_xml2 != xyes; then

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

Summary of changes:
 myserver/binaries/web/cgi-src/math_sum/Makefile.am |    3 ++-
 myserver/binaries/web/cgi-src/post/Makefile.am     |    3 ++-
 myserver/configure.ac                              |    1 +
 myserver/src/base/base64/mime_utils.cpp            |    2 +-
 myserver/src/base/crypt/crypt_algo_manager.cpp     |    2 +-
 myserver/src/base/socket/socket.cpp                |    2 +-
 myserver/src/protocol/control/control_protocol.cpp |    8 ++++----
 7 files changed, 12 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Fri Apr 09 15:14:39 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O0Jf4-00060n-V7
	for mharc-myserver-commit@gnu.org; Fri, 09 Apr 2010 15:14:38 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O0Jf2-0005zt-Kf
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 15:14:36 -0400
Received: from [140.186.70.92] (port=49942 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O0Jf1-0005zh-5q
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 15:14:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O0Jf0-0005vG-Ax
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 15:14:35 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:38225
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O0Jf0-0005vB-8n
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 15:14:34 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O0Jf0-0007GV-8P
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 19:14:34 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O0Jex-0003r0-PC
	for myserver-commit@gnu.org; Fri, 09 Apr 2010 19:14:34 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 8427719da42f7c0df0dc56755f386f4c6cf829f8
X-Git-Newrev: ccc953230e78e1819e46eedc637e92ce5801a5a2
Message-Id: <E1O0Jex-0003r0-PC@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Fri, 09 Apr 2010 19:14:33 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-123-gccc9532
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, 09 Apr 2010 19:14:37 -0000

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

The branch, master has been updated
       via  ccc953230e78e1819e46eedc637e92ce5801a5a2 (commit)
       via  0243d24be039550fd317dc63d79aadd4ec01802a (commit)
      from  8427719da42f7c0df0dc56755f386f4c6cf829f8 (commit)

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

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


commit ccc953230e78e1819e46eedc637e92ce5801a5a2
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 9 21:00:26 2010 +0200

    Workaround a linker error when libintl redefines sprintf/snprintf

diff --git a/myserver/myserver.h b/myserver/myserver.h
index 5e1dbed..013c606 100644
--- a/myserver/myserver.h
+++ b/myserver/myserver.h
@@ -48,8 +48,15 @@ typedef void* HANDLE;
 #endif
 
 #ifdef HAVE_GETTEXT
+
+/*XXX: Fix me.  */
+# undef sprintf
+# undef snprintf
+
 # include <libintl.h>
+
 # define _(X) gettext (X)
+
 #else
 # define _(X) X
 #endif



commit 0243d24be039550fd317dc63d79aadd4ec01802a
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 9 19:39:32 2010 +0200

    If the mscgi file is not created, return with success.

diff --git a/myserver/binaries/web/cgi-src/math_sum/Makefile.am b/myserver/binaries/web/cgi-src/math_sum/Makefile.am
index b03fb68..fff3b1b 100644
--- a/myserver/binaries/web/cgi-src/math_sum/Makefile.am
+++ b/myserver/binaries/web/cgi-src/math_sum/Makefile.am
@@ -26,8 +26,7 @@ SO_EXT=`$(LIBTOOL) --config | $(SED) -e"y/'/\"/" -e '/^shrext_cmds/ !d; s/^.*="\
 all: all-am math_sum.mscgi
 
 math_sum.mscgi: libmath_sum.la
-	test -e .libs/libmath_sum$(SO_EXT) \
-	|| cp .libs/libmath_sum$(SO_EXT) ../../cgi-bin/math_sum.mscgi
+	test \! -e .libs/libmath_sum$(SO_EXT) || cp .libs/libmath_sum$(SO_EXT) ../../cgi-bin/math_sum.mscgi
 
 clean-local:
 	test \! -e libmath_sum.la || \
diff --git a/myserver/binaries/web/cgi-src/post/Makefile.am b/myserver/binaries/web/cgi-src/post/Makefile.am
index fe058b5..f435e8a 100644
--- a/myserver/binaries/web/cgi-src/post/Makefile.am
+++ b/myserver/binaries/web/cgi-src/post/Makefile.am
@@ -26,12 +26,11 @@ SO_EXT=`$(LIBTOOL) --config | $(SED) -e"y/'/\"/" -e '/^shrext_cmds/ !d; s/^.*="\
 all: all-am post.mscgi
 
 post.mscgi: libpost.la
-	test -e .libs/libpost$(SO_EXT)
-	|| cp .libs/libpost$(SO_EXT) ../../cgi-bin/post.mscgi
+	test \! -e .libs/libpost$(SO_EXT) || cp .libs/libpost$(SO_EXT) ../../cgi-bin/post.mscgi
 
 clean-local:
-	test \! -e libpost.la || \
-	$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall libpost.la
+	test \! -e libpost.la
+	|| $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall libpost.la
 
 
 .phony : post.mscgi

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

Summary of changes:
 myserver/binaries/web/cgi-src/math_sum/Makefile.am |    3 +--
 myserver/binaries/web/cgi-src/post/Makefile.am     |    7 +++----
 myserver/myserver.h                                |    7 +++++++
 3 files changed, 11 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Mon Apr 12 06:02:21 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O1GTF-0002MH-77
	for mharc-myserver-commit@gnu.org; Mon, 12 Apr 2010 06:02:21 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O1GTC-0002LJ-Au
	for myserver-commit@gnu.org; Mon, 12 Apr 2010 06:02:18 -0400
Received: from [140.186.70.92] (port=37855 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O1GT7-0002J5-Dx
	for myserver-commit@gnu.org; Mon, 12 Apr 2010 06:02:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O1GT4-0003xY-Qf
	for myserver-commit@gnu.org; Mon, 12 Apr 2010 06:02:13 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:44682
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O1GT3-0003xU-SK
	for myserver-commit@gnu.org; Mon, 12 Apr 2010 06:02:10 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O1GT3-0002SE-CV
	for myserver-commit@gnu.org; Mon, 12 Apr 2010 10:02:09 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O1GT1-0003BD-PK
	for myserver-commit@gnu.org; Mon, 12 Apr 2010 10:02:09 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: ccc953230e78e1819e46eedc637e92ce5801a5a2
X-Git-Newrev: f686117d619f999ca33c331c7e4dd833010d5d32
Message-Id: <E1O1GT1-0003BD-PK@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Mon, 12 Apr 2010 10:02:08 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-126-gf686117
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, 12 Apr 2010 10:02:19 -0000

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

The branch, master has been updated
       via  f686117d619f999ca33c331c7e4dd833010d5d32 (commit)
       via  f460c679e33cc57abc467e3303b7e4788e14f991 (commit)
       via  b38f34e7b2eb6c4d075f272374d638abd99092c9 (commit)
      from  ccc953230e78e1819e46eedc637e92ce5801a5a2 (commit)

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

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


commit f686117d619f999ca33c331c7e4dd833010d5d32
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 12 12:02:00 2010 +0200

    Specify -static to link the myserver executable

diff --git a/myserver/src/Makefile.am b/myserver/src/Makefile.am
index ab11432..a123515 100644
--- a/myserver/src/Makefile.am
+++ b/myserver/src/Makefile.am
@@ -160,6 +160,7 @@ libmyserver_la_LIBADD =  \
 
 myserver_CXXFLAGS = $(CXXFLAGS) -DHOST_STR=\"$(build)\" -DPREFIX=\"$(prefix)\"
 
+myserver_LDFLAGS = -static
 myserver_LDADD = libmyserver.la $(PTHREAD_LIB) $(IDN_LIB) \
 	$(XNET_LIB) $(DL_LIB) $(ZLIB_LIB) \
 	$(XML_LIBS) $(INTLLIBS) $(LDFLAGS)



commit f460c679e33cc57abc467e3303b7e4788e14f991
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 12 12:00:51 2010 +0200

    Remove ABOUT-NLS

diff --git a/myserver/ABOUT-NLS b/myserver/ABOUT-NLS
deleted file mode 100644
index 83bc72e..0000000
--- a/myserver/ABOUT-NLS
+++ /dev/null
@@ -1,1068 +0,0 @@
-1 Notes on the Free Translation Project
-***************************************
-
-Free software is going international!  The Free Translation Project is
-a way to get maintainers of free software, translators, and users all
-together, so that free software will gradually become able to speak many
-languages.  A few packages already provide translations for their
-messages.
-
-   If you found this `ABOUT-NLS' file inside a distribution, you may
-assume that the distributed package does use GNU `gettext' internally,
-itself available at your nearest GNU archive site.  But you do _not_
-need to install GNU `gettext' prior to configuring, installing or using
-this package with messages translated.
-
-   Installers will find here some useful hints.  These notes also
-explain how users should proceed for getting the programs to use the
-available translations.  They tell how people wanting to contribute and
-work on translations can contact the appropriate team.
-
-   When reporting bugs in the `intl/' directory or bugs which may be
-related to internationalization, you should tell about the version of
-`gettext' which is used.  The information can be found in the
-`intl/VERSION' file, in internationalized packages.
-
-1.1 Quick configuration advice
-==============================
-
-If you want to exploit the full power of internationalization, you
-should configure it using
-
-     ./configure --with-included-gettext
-
-to force usage of internationalizing routines provided within this
-package, despite the existence of internationalizing capabilities in the
-operating system where this package is being installed.  So far, only
-the `gettext' implementation in the GNU C library version 2 provides as
-many features (such as locale alias, message inheritance, automatic
-charset conversion or plural form handling) as the implementation here.
-It is also not possible to offer this additional functionality on top
-of a `catgets' implementation.  Future versions of GNU `gettext' will
-very likely convey even more functionality.  So it might be a good idea
-to change to GNU `gettext' as soon as possible.
-
-   So you need _not_ provide this option if you are using GNU libc 2 or
-you have installed a recent copy of the GNU gettext package with the
-included `libintl'.
-
-1.2 INSTALL Matters
-===================
-
-Some packages are "localizable" when properly installed; the programs
-they contain can be made to speak your own native language.  Most such
-packages use GNU `gettext'.  Other packages have their own ways to
-internationalization, predating GNU `gettext'.
-
-   By default, this package will be installed to allow translation of
-messages.  It will automatically detect whether the system already
-provides the GNU `gettext' functions.  If not, the included GNU
-`gettext' library will be used.  This library is wholly contained
-within this package, usually in the `intl/' subdirectory, so prior
-installation of the GNU `gettext' package is _not_ required.
-Installers may use special options at configuration time for changing
-the default behaviour.  The commands:
-
-     ./configure --with-included-gettext
-     ./configure --disable-nls
-
-will, respectively, bypass any pre-existing `gettext' to use the
-internationalizing routines provided within this package, or else,
-_totally_ disable translation of messages.
-
-   When you already have GNU `gettext' installed on your system and run
-configure without an option for your new package, `configure' will
-probably detect the previously built and installed `libintl.a' file and
-will decide to use this.  This might not be desirable.  You should use
-the more recent version of the GNU `gettext' library.  I.e. if the file
-`intl/VERSION' shows that the library which comes with this package is
-more recent, you should use
-
-     ./configure --with-included-gettext
-
-to prevent auto-detection.
-
-   The configuration process will not test for the `catgets' function
-and therefore it will not be used.  The reason is that even an
-emulation of `gettext' on top of `catgets' could not provide all the
-extensions of the GNU `gettext' library.
-
-   Internationalized packages usually have many `po/LL.po' files, where
-LL gives an ISO 639 two-letter code identifying the language.  Unless
-translations have been forbidden at `configure' time by using the
-`--disable-nls' switch, all available translations are installed
-together with the package.  However, the environment variable `LINGUAS'
-may be set, prior to configuration, to limit the installed set.
-`LINGUAS' should then contain a space separated list of two-letter
-codes, stating which languages are allowed.
-
-1.3 Using This Package
-======================
-
-As a user, if your language has been installed for this package, you
-only have to set the `LANG' environment variable to the appropriate
-`LL_CC' combination.  If you happen to have the `LC_ALL' or some other
-`LC_xxx' environment variables set, you should unset them before
-setting `LANG', otherwise the setting of `LANG' will not have the
-desired effect.  Here `LL' is an ISO 639 two-letter language code, and
-`CC' is an ISO 3166 two-letter country code.  For example, let's
-suppose that you speak German and live in Germany.  At the shell
-prompt, merely execute `setenv LANG de_DE' (in `csh'),
-`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
-This can be done from your `.login' or `.profile' file, once and for
-all.
-
-   You might think that the country code specification is redundant.
-But in fact, some languages have dialects in different countries.  For
-example, `de_AT' is used for Austria, and `pt_BR' for Brazil.  The
-country code serves to distinguish the dialects.
-
-   The locale naming convention of `LL_CC', with `LL' denoting the
-language and `CC' denoting the country, is the one use on systems based
-on GNU libc.  On other systems, some variations of this scheme are
-used, such as `LL' or `LL_CC.ENCODING'.  You can get the list of
-locales supported by your system for your language by running the
-command `locale -a | grep '^LL''.
-
-   Not all programs have translations for all languages.  By default, an
-English message is shown in place of a nonexistent translation.  If you
-understand other languages, you can set up a priority list of languages.
-This is done through a different environment variable, called
-`LANGUAGE'.  GNU `gettext' gives preference to `LANGUAGE' over `LANG'
-for the purpose of message handling, but you still need to have `LANG'
-set to the primary language; this is required by other parts of the
-system libraries.  For example, some Swedish users who would rather
-read translations in German than English for when Swedish is not
-available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
-
-   Special advice for Norwegian users: The language code for Norwegian
-bokma*l changed from `no' to `nb' recently (in 2003).  During the
-transition period, while some message catalogs for this language are
-installed under `nb' and some older ones under `no', it's recommended
-for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
-older translations are used.
-
-   In the `LANGUAGE' environment variable, but not in the `LANG'
-environment variable, `LL_CC' combinations can be abbreviated as `LL'
-to denote the language's main dialect.  For example, `de' is equivalent
-to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
-(Portuguese as spoken in Portugal) in this context.
-
-1.4 Translating Teams
-=====================
-
-For the Free Translation Project to be a success, we need interested
-people who like their own language and write it well, and who are also
-able to synergize with other translators speaking the same language.
-Each translation team has its own mailing list.  The up-to-date list of
-teams can be found at the Free Translation Project's homepage,
-`http://translationproject.org/', in the "Teams" area.
-
-   If you'd like to volunteer to _work_ at translating messages, you
-should become a member of the translating team for your own language.
-The subscribing address is _not_ the same as the list itself, it has
-`-request' appended.  For example, speakers of Swedish can send a
-message to `sv-request@li.org', having this message body:
-
-     subscribe
-
-   Keep in mind that team members are expected to participate
-_actively_ in translations, or at solving translational difficulties,
-rather than merely lurking around.  If your team does not exist yet and
-you want to start one, or if you are unsure about what to do or how to
-get started, please write to `coordinator@translationproject.org' to
-reach the coordinator for all translator teams.
-
-   The English team is special.  It works at improving and uniformizing
-the terminology in use.  Proven linguistic skills are praised more than
-programming skills, here.
-
-1.5 Available Packages
-======================
-
-Languages are not equally supported in all packages.  The following
-matrix shows the current state of internationalization, as of November
-2007.  The matrix shows, in regard of each package, for which languages
-PO files have been submitted to translation coordination, with a
-translation percentage of at least 50%.
-
-     Ready PO files       af am ar az be bg bs ca cs cy da de el en en_GB eo
-                        +----------------------------------------------------+
-     Compendium         |                      []       [] []        []      |
-     a2ps               |             []                [] [] []     []      |
-     aegis              |                                  ()                |
-     ant-phone          |                                  ()                |
-     anubis             |                                  []                |
-     ap-utils           |                                                    |
-     aspell             |                      [] []    [] []        []      |
-     bash               |                                                 [] |
-     bfd                |                                                    |
-     bibshelf           |                                  []                |
-     binutils           |                                                    |
-     bison              |                               [] []                |
-     bison-runtime      |                                  []                |
-     bluez-pin          | []                      []       [] []          [] |
-     cflow              |                               []                   |
-     clisp              |                               [] []    []          |
-     console-tools      |                         []       []                |
-     coreutils          |                []    [] []       []                |
-     cpio               |                                                    |
-     cpplib             |                      []       [] []                |
-     cryptonit          |                                  []                |
-     dialog             |                                                    |
-     diffutils          |                      [] []    [] [] []          [] |
-     doodle             |                                  []                |
-     e2fsprogs          |                         []       []                |
-     enscript           |                      []       [] []        []      |
-     fetchmail          |                      []       [] () []     []      |
-     findutils          |                []                                  |
-     findutils_stable   |                []    []       []                   |
-     flex               |                      []       [] []                |
-     fslint             |                                                    |
-     gas                |                                                    |
-     gawk               |                      []       [] []                |
-     gcal               |                      []                            |
-     gcc                |                                  []                |
-     gettext-examples   | []                   []          [] []          [] |
-     gettext-runtime    |             []       []       [] []             [] |
-     gettext-tools      |                      []          []                |
-     gip                |                []                                  |
-     gliv               |                []                []                |
-     glunarclock        |                []                                  |
-     gmult              | []                               []                |
-     gnubiff            |                                  ()                |
-     gnucash            |                      [] []       () ()     []      |
-     gnuedu             |                                                    |
-     gnulib             |                []                                  |
-     gnunet             |                                                    |
-     gnunet-gtk         |                                                    |
-     gnutls             |                                  []                |
-     gpe-aerial         |                         []       []                |
-     gpe-beam           |                         []       []                |
-     gpe-calendar       |                                                    |
-     gpe-clock          |                         []       []                |
-     gpe-conf           |                         []       []                |
-     gpe-contacts       |                                                    |
-     gpe-edit           |                         []                         |
-     gpe-filemanager    |                                                    |
-     gpe-go             |                         []                         |
-     gpe-login          |                         []       []                |
-     gpe-ownerinfo      |                         []       []                |
-     gpe-package        |                                                    |
-     gpe-sketchbook     |                         []       []                |
-     gpe-su             |                         []       []                |
-     gpe-taskmanager    |                         []       []                |
-     gpe-timesheet      |                         []                         |
-     gpe-today          |                         []       []                |
-     gpe-todo           |                                                    |
-     gphoto2            |                         []    [] []        []      |
-     gprof              |                               [] []                |
-     gpsdrive           |                                                    |
-     gramadoir          | []                               []                |
-     grep               |                         []                      [] |
-     gretl              |                                  ()                |
-     gsasl              |                                                    |
-     gss                |                                                    |
-     gst-plugins-bad    |                []             []                   |
-     gst-plugins-base   |                []             []                   |
-     gst-plugins-good   |                []    []       []                   |
-     gst-plugins-ugly   |                []             []                   |
-     gstreamer          | []             []    [] []    [] []        []      |
-     gtick              |                                  ()                |
-     gtkam              |             []          []    [] []                |
-     gtkorphan          |                []                []                |
-     gtkspell           |             []                   [] []          [] |
-     gutenprint         |                               []                   |
-     hello              |                []    []       [] []             [] |
-     herrie             |                                  []                |
-     hylafax            |                                                    |
-     idutils            |                               [] []                |
-     indent             |                      [] []       []             [] |
-     iso_15924          |                                                    |
-     iso_3166           |       []    [] [] [] [] [] [] [] [] []          [] |
-     iso_3166_2         |                                                    |
-     iso_4217           |                         []    [] []                |
-     iso_639            |                         []    [] []             [] |
-     jpilot             |                         []                         |
-     jtag               |                                                    |
-     jwhois             |                                                    |
-     kbd                |                         []    [] [] []             |
-     keytouch           |                      []          []                |
-     keytouch-editor    |                                  []                |
-     keytouch-keyboa... |                      []                            |
-     latrine            |                                  ()                |
-     ld                 |                               []                   |
-     leafpad            |                []    [] []       [] []             |
-     libc               |                      [] []    [] []                |
-     libexif            |                                  []                |
-     libextractor       |                                  []                |
-     libgpewidget       |                         []    [] []                |
-     libgpg-error       |                                  []                |
-     libgphoto2         |                               [] []                |
-     libgphoto2_port    |                               [] []                |
-     libgsasl           |                                                    |
-     libiconv           |                                  []             [] |
-     libidn             |                         []    []                [] |
-     lifelines          |                               [] ()                |
-     lilypond           |                                  []                |
-     lingoteach         |                                                    |
-     lprng              |                                                    |
-     lynx               |                      [] []    [] []                |
-     m4                 |                         []    [] [] []             |
-     mailfromd          |                                                    |
-     mailutils          |                      []                            |
-     make               |                               [] []                |
-     man-db             |                      []       [] []                |
-     minicom            |                         []    [] []                |
-     nano               |                []    []          []                |
-     opcodes            |                                  []                |
-     parted             |                         []       []                |
-     pilot-qof          |                                                    |
-     popt               |                         []    [] []                |
-     psmisc             |                []                                  |
-     pwdutils           |                                                    |
-     qof                |                                                    |
-     radius             |                      []                            |
-     recode             |             []       []       [] [] []          [] |
-     rpm                |                               []                   |
-     screem             |                                                    |
-     scrollkeeper       |          [] []       [] [] [] [] []        []      |
-     sed                |                      []          []             [] |
-     shared-mime-info   |                []    [] []    [] () []     []   [] |
-     sharutils          |                []    [] []    [] [] []             |
-     shishi             |                                                    |
-     skencil            |                               [] ()                |
-     solfege            |                                                    |
-     soundtracker       |                               [] []                |
-     sp                 |                                  []                |
-     system-tools-ba... |       []       [] [] [] []    [] [] []     []      |
-     tar                |                []                []                |
-     texinfo            |                               [] []             [] |
-     tin                |                                  ()        ()      |
-     tuxpaint           | []             []             [] []        []   [] |
-     unicode-han-tra... |                                                    |
-     unicode-transla... |                                                    |
-     util-linux         |                      [] []    [] []                |
-     util-linux-ng      |                      [] []    [] []                |
-     vorbis-tools       |                         []                         |
-     wastesedge         |                                  ()                |
-     wdiff              |                      []       [] []        []      |
-     wget               |                      [] []       []                |
-     xchat              |             [] []    [] []       [] []     []      |
-     xkeyboard-config   |                []                                  |
-     xpad               |                []             []           []      |
-                        +----------------------------------------------------+
-                          af am ar az be bg bs ca cs cy da de el en en_GB eo
-                           6  0  2  1  8 26  2 40 48  2 56 88 15  1  15   18
-
-                          es et eu fa fi fr  ga gl gu he hi hr hu id is it
-                        +--------------------------------------------------+
-     Compendium         | []          [] []  []                []          |
-     a2ps               |    []       [] []                             () |
-     aegis              |                                                  |
-     ant-phone          |                []                                |
-     anubis             |                []                                |
-     ap-utils           |             [] []                                |
-     aspell             |                []  []                         [] |
-     bash               | []                                               |
-     bfd                | []          []                                   |
-     bibshelf           | []                 []                         [] |
-     binutils           | []          [] []                                |
-     bison              | [] []          []  []                   []    [] |
-     bison-runtime      |    []          []  []                   []    [] |
-     bluez-pin          |             [] []  []                [] []       |
-     cflow              |                    []                            |
-     clisp              | []             []                                |
-     console-tools      |                                                  |
-     coreutils          | [] []       [] []  []                []          |
-     cpio               | []             []  []                            |
-     cpplib             | []             []                                |
-     cryptonit          |                []                                |
-     dialog             |       []           []                         [] |
-     diffutils          | []          [] []  [] []    []       [] []    [] |
-     doodle             |                    []                         [] |
-     e2fsprogs          | []             []                             [] |
-     enscript           |                []  []             []             |
-     fetchmail          | []                                               |
-     findutils          |    []              []                []          |
-     findutils_stable   |    []          []  []                []          |
-     flex               | []             []  []                            |
-     fslint             |                                                  |
-     gas                | []             []                                |
-     gawk               | []             []  []       []                () |
-     gcal               | []             []                                |
-     gcc                | []                                               |
-     gettext-examples   | []          [] []  []                [] []    [] |
-     gettext-runtime    | []          [] []  []                   []    [] |
-     gettext-tools      | []    []       []                             [] |
-     gip                | []    []       []  []                            |
-     gliv               |                ()                                |
-     glunarclock        |             []     []                []          |
-     gmult              |       []       []                             [] |
-     gnubiff            |                ()                             () |
-     gnucash            | ()             ()                    ()          |
-     gnuedu             | []                                               |
-     gnulib             | [] []              []                            |
-     gnunet             |                                                  |
-     gnunet-gtk         |                                                  |
-     gnutls             |                                                  |
-     gpe-aerial         | []             []                                |
-     gpe-beam           | []             []                                |
-     gpe-calendar       |                                                  |
-     gpe-clock          | []          [] []                    []          |
-     gpe-conf           |                []                                |
-     gpe-contacts       | []             []                                |
-     gpe-edit           | []             []                    [] []       |
-     gpe-filemanager    | []                                               |
-     gpe-go             | []             []                    []          |
-     gpe-login          | []             []                    []          |
-     gpe-ownerinfo      | []          [] []                    [] []       |
-     gpe-package        | []                                               |
-     gpe-sketchbook     | []             []                                |
-     gpe-su             | []          [] []                    []          |
-     gpe-taskmanager    | []          [] []                                |
-     gpe-timesheet      | []             []  []                   []       |
-     gpe-today          | []          [] []  []                            |
-     gpe-todo           | []                                               |
-     gphoto2            | []          [] []                    []       [] |
-     gprof              | []          [] []  []                   []       |
-     gpsdrive           |    []                                            |
-     gramadoir          |                []  []                            |
-     grep               | []          []     []                            |
-     gretl              | []    []       []                             () |
-     gsasl              |                    []                   []       |
-     gss                |                []  []                            |
-     gst-plugins-bad    | []          []                       []       [] |
-     gst-plugins-base   | []          []                       []       [] |
-     gst-plugins-good   | []    []    []                       []       [] |
-     gst-plugins-ugly   | []          []                       []       [] |
-     gstreamer          |             []                       []       [] |
-     gtick              |             []     []                         [] |
-     gtkam              | []             []                    []       [] |
-     gtkorphan          |                []                             [] |
-     gtkspell           | []    []    [] []  []                []       [] |
-     gutenprint         |                                      []          |
-     hello              | [] [] [] [] [] []  [] []    []    [] [] []    [] |
-     herrie             |                    []                            |
-     hylafax            |                                                  |
-     idutils            |                []  []                [] []    [] |
-     indent             | [] [] []    [] []  [] []             [] []    [] |
-     iso_15924          |                []                                |
-     iso_3166           | [] [] []    [] []     [] [] [] [] [] [] []    [] |
-     iso_3166_2         |                []                                |
-     iso_4217           | [] []       [] []                    []       [] |
-     iso_639            | []       [] [] []  []                []          |
-     jpilot             | []             []                                |
-     jtag               |                []                                |
-     jwhois             | []             []                    [] []    [] |
-     kbd                | []             []                                |
-     keytouch           |                []  []                         [] |
-     keytouch-editor    |                    []                            |
-     keytouch-keyboa... |                    []                         [] |
-     latrine            |                    []                         [] |
-     ld                 | []          [] []  []                            |
-     leafpad            | []             []  []       []       []       [] |
-     libc               | []          [] []     []             []          |
-     libexif            | []                                               |
-     libextractor       |                    []                            |
-     libgpewidget       | []             []  []                [] []       |
-     libgpg-error       |                []                                |
-     libgphoto2         | []             []                             [] |
-     libgphoto2_port    |                []                             [] |
-     libgsasl           |                []  []                            |
-     libiconv           |    []       []     []                            |
-     libidn             |                []                             [] |
-     lifelines          |                ()                                |
-     lilypond           | []          [] []                                |
-     lingoteach         |                []                       []    [] |
-     lprng              |                                                  |
-     lynx               |    []                                []       [] |
-     m4                 |                []  [] []                []       |
-     mailfromd          |                                                  |
-     mailutils          | []             []                                |
-     make               | []          [] []  [] []    []    []    []       |
-     man-db             |                                               [] |
-     minicom            | []          [] []                    []          |
-     nano               | []    []       []  [] []             []       [] |
-     opcodes            | []          [] []  []                            |
-     parted             |                []                       []    [] |
-     pilot-qof          |                                                  |
-     popt               |                []  [] []                   []    |
-     psmisc             |                                      []       [] |
-     pwdutils           |                                                  |
-     qof                |                                         []       |
-     radius             | []             []                                |
-     recode             | []             []  [] []    []       [] []    [] |
-     rpm                |                []                       []       |
-     screem             |                                                  |
-     scrollkeeper       | []          []                       []          |
-     sed                | [] []          []  []                []          |
-     shared-mime-info   | []    []    [] []                    []       [] |
-     sharutils          | [] []       [] []  [] []             []       [] |
-     shishi             |                []                                |
-     skencil            | []             []                                |
-     solfege            |                                               [] |
-     soundtracker       | []             []                             [] |
-     sp                 |                []                                |
-     system-tools-ba... | []    []    [] []  []             [] [] []    [] |
-     tar                |    [] []    []     []                []          |
-     texinfo            |                []           []       []          |
-     tin                |    []          ()                                |
-     tuxpaint           |                    []                []          |
-     unicode-han-tra... |                                                  |
-     unicode-transla... |                []  []                            |
-     util-linux         | [] []       [] []                    [] []    [] |
-     util-linux-ng      | [] []       [] []                    [] []    [] |
-     vorbis-tools       |                                                  |
-     wastesedge         |                ()                                |
-     wdiff              | [] []          []  [] []             [] []    [] |
-     wget               |    []       [] []  []             [] [] []    [] |
-     xchat              | []          [] []        []    []    []       [] |
-     xkeyboard-config   | []          [] []                    []          |
-     xpad               | []                 []                []          |
-                        +--------------------------------------------------+
-                          es et eu fa fi fr  ga gl gu he hi hr hu id is it
-                          85 22 14  2 48 101 61 12  2  8  2  6 53 29  1 52
-
-                          ja ka ko ku ky lg lt lv mk mn ms mt nb ne nl  nn
-                        +--------------------------------------------------+
-     Compendium         |                                           []     |
-     a2ps               |       ()                      []          []     |
-     aegis              |                                           ()     |
-     ant-phone          |                                           []     |
-     anubis             |                               []    []    []     |
-     ap-utils           |                               []                 |
-     aspell             |                            []             []     |
-     bash               |                                           []     |
-     bfd                |                                                  |
-     bibshelf           |                               []                 |
-     binutils           |                                                  |
-     bison              |                               []    []    []     |
-     bison-runtime      |                               []    []    []     |
-     bluez-pin          |          []                   []          []     |
-     cflow              |                                                  |
-     clisp              |                                           []     |
-     console-tools      |                                                  |
-     coreutils          |                                           []     |
-     cpio               |                                           []     |
-     cpplib             |                                           []     |
-     cryptonit          |                                           []     |
-     dialog             |                               []          []     |
-     diffutils          | []                            []          []     |
-     doodle             |                                                  |
-     e2fsprogs          |                                           []     |
-     enscript           |                                           []     |
-     fetchmail          | []                                        []     |
-     findutils          |                                           []     |
-     findutils_stable   |                                           []     |
-     flex               |       []                                  []     |
-     fslint             |                                                  |
-     gas                |                                                  |
-     gawk               | []                                        []     |
-     gcal               |                                                  |
-     gcc                |                                                  |
-     gettext-examples   | []                            []          []     |
-     gettext-runtime    | []    []                                  []     |
-     gettext-tools      | []    []                                         |
-     gip                |                               []          []     |
-     gliv               |                                           []     |
-     glunarclock        |                               []          []     |
-     gmult              | []                            []          []     |
-     gnubiff            |                                                  |
-     gnucash            | ()                                  () ()        |
-     gnuedu             |                                                  |
-     gnulib             | []                                        []     |
-     gnunet             |                                                  |
-     gnunet-gtk         |                                                  |
-     gnutls             |                               []                 |
-     gpe-aerial         |                                           []     |
-     gpe-beam           |                                           []     |
-     gpe-calendar       | []                                               |
-     gpe-clock          | []    []                                  []     |
-     gpe-conf           | []    []                                  []     |
-     gpe-contacts       |       []                                         |
-     gpe-edit           | []    []                                  []     |
-     gpe-filemanager    | []    []                                         |
-     gpe-go             | []    []                                  []     |
-     gpe-login          | []    []                                  []     |
-     gpe-ownerinfo      | []                                        []     |
-     gpe-package        | []    []                                         |
-     gpe-sketchbook     |       []                                  []     |
-     gpe-su             | []    []                                  []     |
-     gpe-taskmanager    | []    [] []                               []     |
-     gpe-timesheet      |                                           []     |
-     gpe-today          | []                                        []     |
-     gpe-todo           | []                                               |
-     gphoto2            | []                                        []     |
-     gprof              |                               []                 |
-     gpsdrive           |                                           []     |
-     gramadoir          |                                           ()     |
-     grep               |             []                            []     |
-     gretl              |                                                  |
-     gsasl              |                                           []     |
-     gss                |                                                  |
-     gst-plugins-bad    |                                           []     |
-     gst-plugins-base   |                                           []     |
-     gst-plugins-good   |                                           []     |
-     gst-plugins-ugly   |                                           []     |
-     gstreamer          |                                           []     |
-     gtick              |                                           []     |
-     gtkam              | []                                        []     |
-     gtkorphan          |                                           []     |
-     gtkspell           |                            []             []     |
-     gutenprint         |                                           []     |
-     hello              | [] [] []                      []    []    []  [] |
-     herrie             |                                           []     |
-     hylafax            |                                                  |
-     idutils            |                                           []     |
-     indent             | []                                        []     |
-     iso_15924          |                                           []     |
-     iso_3166           | []    [] []       []    []          []    []  [] |
-     iso_3166_2         |                                           []     |
-     iso_4217           | []                []                      []     |
-     iso_639            | []                []                      []  [] |
-     jpilot             | ()                                        ()     |
-     jtag               |                                                  |
-     jwhois             |                                           []     |
-     kbd                |                                           []     |
-     keytouch           |                                           []     |
-     keytouch-editor    |                                           []     |
-     keytouch-keyboa... |                                                  |
-     latrine            |                                           []     |
-     ld                 |                                                  |
-     leafpad            | []                []                             |
-     libc               | []    []                                  []     |
-     libexif            |                                                  |
-     libextractor       |                                                  |
-     libgpewidget       |                                           []     |
-     libgpg-error       |                                                  |
-     libgphoto2         | []                                               |
-     libgphoto2_port    | []                                               |
-     libgsasl           |                                           []     |
-     libiconv           |                                           []     |
-     libidn             | []                                        []     |
-     lifelines          |                                           []     |
-     lilypond           |                                           []     |
-     lingoteach         |                                           []     |
-     lprng              |                                                  |
-     lynx               | []                                        []     |
-     m4                 | []                                        []     |
-     mailfromd          |                                                  |
-     mailutils          |                                                  |
-     make               | []    []                                  []     |
-     man-db             |                                                  |
-     minicom            | []                                               |
-     nano               |                               []    []    []     |
-     opcodes            |                                           []     |
-     parted             | []                                        []     |
-     pilot-qof          |                                                  |
-     popt               | []    []                                  []     |
-     psmisc             | []                                  []    []     |
-     pwdutils           |                                                  |
-     qof                |                                                  |
-     radius             |                                                  |
-     recode             |                                           []     |
-     rpm                | []    []                                         |
-     screem             | []                                               |
-     scrollkeeper       |                                     [] [] []  [] |
-     sed                | []                                        []     |
-     shared-mime-info   | []    []          []          []    []    []  [] |
-     sharutils          | []                                        []     |
-     shishi             |                                                  |
-     skencil            |                                                  |
-     solfege            |                                     ()        () |
-     soundtracker       |                                                  |
-     sp                 | ()                                               |
-     system-tools-ba... | []    []          []                      []     |
-     tar                | []          []                            []     |
-     texinfo            |                                     []    []     |
-     tin                |                                                  |
-     tuxpaint           |                                     ()    []  [] |
-     unicode-han-tra... |                                                  |
-     unicode-transla... |                                                  |
-     util-linux         | []                                        []     |
-     util-linux-ng      | []                                        []     |
-     vorbis-tools       |                                                  |
-     wastesedge         |                                           []     |
-     wdiff              |                               []    []           |
-     wget               | []                                        []     |
-     xchat              | []    []                []                []     |
-     xkeyboard-config   |    [] []                                  []     |
-     xpad               |       []                      []          []     |
-                        +--------------------------------------------------+
-                          ja ka ko ku ky lg lt lv mk mn ms mt nb ne nl  nn
-                          51  2 25  3  2  0  6  0  2  2 20  0 11  1 103  6
-
-                          or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv  ta
-                        +--------------------------------------------------+
-     Compendium         |          []  []      []       []          []     |
-     a2ps               |       ()     []      [] []       []    [] []     |
-     aegis              |                      () ()                       |
-     ant-phone          |                      []                   []     |
-     anubis             |       []             [] []                       |
-     ap-utils           |       ()                                         |
-     aspell             |                      [] []    []                 |
-     bash               |       []                      []                 |
-     bfd                |                                                  |
-     bibshelf           |                                           []     |
-     binutils           |                         []    []                 |
-     bison              |       []     []      [] []                []     |
-     bison-runtime      |       []     []      []          []       []     |
-     bluez-pin          |       []     []   [] [] []    [] []    [] []     |
-     cflow              |       []                                         |
-     clisp              |                         []                       |
-     console-tools      |                         []                       |
-     coreutils          |       []                []       []       []     |
-     cpio               |       []                []                []     |
-     cpplib             |                                           []     |
-     cryptonit          |              []                           []     |
-     dialog             |                                           []     |
-     diffutils          |       []     []      [] []             [] []     |
-     doodle             |                                     []    []     |
-     e2fsprogs          |       []                                  []     |
-     enscript           |              []      [] []       []       []     |
-     fetchmail          |       []                []          []           |
-     findutils          |       [] []                               []     |
-     findutils_stable   |       [] []          []       [] []       []     |
-     flex               |       []     []      [] []                []     |
-     fslint             |                                           []     |
-     gas                |                                                  |
-     gawk               |       []     []      []                   []     |
-     gcal               |                                           []     |
-     gcc                |                                        [] []     |
-     gettext-examples   |       [] []          [] []    [] []    [] []     |
-     gettext-runtime    |       [] []          [] []    [] []    [] []     |
-     gettext-tools      |       []             [] []    [] []    [] []     |
-     gip                |                   []          []       [] []     |
-     gliv               |       []     []      [] []    []          []     |
-     glunarclock        |              []      [] []    []       [] []     |
-     gmult              |                   [] []                [] []     |
-     gnubiff            |                      ()                   []     |
-     gnucash            |       ()                                  []     |
-     gnuedu             |                                                  |
-     gnulib             |       []                         []       []     |
-     gnunet             |                                                  |
-     gnunet-gtk         |                                           []     |
-     gnutls             |       []                                  []     |
-     gpe-aerial         |          []  []      [] []       []    [] []     |
-     gpe-beam           |          []  []      [] []       []    [] []     |
-     gpe-calendar       |                         []       []    [] []     |
-     gpe-clock          |          []  []      [] []    [] []    [] []     |
-     gpe-conf           |          []  []      [] []    [] []       []     |
-     gpe-contacts       |                      [] []       []    [] []     |
-     gpe-edit           |       [] []  []      [] []    [] []    [] []     |
-     gpe-filemanager    |                                  []       []     |
-     gpe-go             |       []     []      [] []    [] []    [] []     |
-     gpe-login          |          []  []      [] []    [] []    [] []     |
-     gpe-ownerinfo      |          []  []      [] []    [] []    [] []     |
-     gpe-package        |                                  []       []     |
-     gpe-sketchbook     |          []  []      [] []    [] []    [] []     |
-     gpe-su             |          []  []      [] []    [] []    [] []     |
-     gpe-taskmanager    |          []  []      [] []    [] []    [] []     |
-     gpe-timesheet      |          []  []      [] []    [] []    [] []     |
-     gpe-today          |          []  []      [] []    [] []    [] []     |
-     gpe-todo           |                         []       []    [] []     |
-     gphoto2            |    [] []             []       []       [] []     |
-     gprof              |              []      []                   []     |
-     gpsdrive           |                         []                []     |
-     gramadoir          |                               []          []     |
-     grep               |       []                      [] []       []     |
-     gretl              |       [] []  []                                  |
-     gsasl              |       []                               [] []     |
-     gss                |       []             []       []          []     |
-     gst-plugins-bad    |       []     []                           []     |
-     gst-plugins-base   |       []                                  []     |
-     gst-plugins-good   |       []                                  []     |
-     gst-plugins-ugly   |       []     []                           []     |
-     gstreamer          |       []                            [] [] []     |
-     gtick              |                         []                       |
-     gtkam              |    [] []     []         []                []     |
-     gtkorphan          |                                           []     |
-     gtkspell           |              []   [] [] []    [] []    [] []     |
-     gutenprint         |                                           []     |
-     hello              |       []     []      [] []    [] []    [] []     |
-     herrie             |       []                []                []     |
-     hylafax            |                                                  |
-     idutils            |       []     []      [] []                []     |
-     indent             |       []     []      [] []    []       [] []     |
-     iso_15924          |                                                  |
-     iso_3166           |    [] [] []  []      [] [] [] [] [] [] [] []  [] |
-     iso_3166_2         |                                                  |
-     iso_4217           |       [] []             [] []    []    [] []     |
-     iso_639            |       []                [] [] [] []    [] []     |
-     jpilot             |                                                  |
-     jtag               |                               []                 |
-     jwhois             |       []     []      []                   []     |
-     kbd                |       []             []                   []     |
-     keytouch           |                                           []     |
-     keytouch-editor    |                                           []     |
-     keytouch-keyboa... |                                           []     |
-     latrine            |                                                  |
-     ld                 |                                           []     |
-     leafpad            |       [] []             []    []          []  [] |
-     libc               |       []                []    []          []     |
-     libexif            |       []                      []                 |
-     libextractor       |                      []                   []     |
-     libgpewidget       |       [] []  []      []       [] []    [] []     |
-     libgpg-error       |       []             []                   []     |
-     libgphoto2         |       []                                         |
-     libgphoto2_port    |       []                []                []     |
-     libgsasl           |       []             []                [] []     |
-     libiconv           |                                  []    [] []     |
-     libidn             |       []                               [] ()     |
-     lifelines          |       []                                  []     |
-     lilypond           |                                                  |
-     lingoteach         |              []                                  |
-     lprng              |       []                                         |
-     lynx               |              []         []                []     |
-     m4                 |       []     []      [] []                []     |
-     mailfromd          |       []                                         |
-     mailutils          |       []                []                []     |
-     make               |       []     []         []                []     |
-     man-db             |       []             [] []                []     |
-     minicom            |       []     []      [] []                []     |
-     nano               |              []      [] []                []     |
-     opcodes            |                      []                   []     |
-     parted             |       []                                         |
-     pilot-qof          |                                                  |
-     popt               |       [] []             []                []     |
-     psmisc             |       []                                  []     |
-     pwdutils           |       []                                  []     |
-     qof                |              []                           []     |
-     radius             |       []                []                       |
-     recode             |       [] []  []      [] []       []       []     |
-     rpm                |       [] []             []                []     |
-     screem             |                                                  |
-     scrollkeeper       |       []             [] []    []    [] [] []     |
-     sed                |       [] []  []      [] []    [] []    [] []     |
-     shared-mime-info   |       [] []  []                     [] [] []     |
-     sharutils          |       []                []             [] []     |
-     shishi             |       []                                         |
-     skencil            |          []  []                           []     |
-     solfege            |              []                                  |
-     soundtracker       |                               []          []     |
-     sp                 |                                                  |
-     system-tools-ba... |    [] [] []  []      []             [] [] []  [] |
-     tar                |       []                []       []       []     |
-     texinfo            |       []             [] []                []     |
-     tin                |                         ()                       |
-     tuxpaint           |       [] []                      [] [] [] []     |
-     unicode-han-tra... |                                                  |
-     unicode-transla... |                                                  |
-     util-linux         |              []         []       []       []     |
-     util-linux-ng      |              []         []       []       []     |
-     vorbis-tools       |                         []                       |
-     wastesedge         |                                                  |
-     wdiff              |       []     []      [] []    [] []       []     |
-     wget               |          []             []    []          []     |
-     xchat              |    []                   []    [] [] [] [] []     |
-     xkeyboard-config   |                               [] []       []     |
-     xpad               |                               [] []       []     |
-                        +--------------------------------------------------+
-                          or pa pl pt pt_BR rm ro ru rw sk sl sq sr sv  ta
-                           0  5 77 31  53    4 58 72  3 45 46  9 45 122  3
-
-                          tg th tk tr uk ven vi  wa xh zh_CN zh_HK zh_TW zu
-                        +---------------------------------------------------+
-     Compendium         |          []        []         []          []      | 19
-     a2ps               |          [] []     []                             | 19
-     aegis              |                    []                             |  1
-     ant-phone          |          []        []                             |  6
-     anubis             |          [] []     []                             | 11
-     ap-utils           |             ()     []                             |  4
-     aspell             |             []     []  []                         | 16
-     bash               |          []                                       |  6
-     bfd                |                                                   |  2
-     bibshelf           |                    []                             |  7
-     binutils           |          [] []     []                     []      |  9
-     bison              |          [] []     []                     []      | 20
-     bison-runtime      |             []     []         []          []      | 18
-     bluez-pin          |          [] []     []  []     []          []      | 28
-     cflow              |             []     []                             |  5
-     clisp              |                                                   |  9
-     console-tools      |          []        []                             |  5
-     coreutils          |          [] []     []                             | 18
-     cpio               |          [] []     []         []                  | 11
-     cpplib             |          [] []     []         []          []      | 12
-     cryptonit          |                    []                             |  6
-     dialog             |                    []  []     []                  |  9
-     diffutils          |          [] []     []         []          []      | 29
-     doodle             |                    []                             |  6
-     e2fsprogs          |          []        []                             | 10
-     enscript           |          [] []     []                             | 16
-     fetchmail          |          []        []                             | 12
-     findutils          |          [] []     []                             | 11
-     findutils_stable   |          [] []     []                     []      | 18
-     flex               |          []        []                             | 15
-     fslint             |                    []                             |  2
-     gas                |          []                                       |  3
-     gawk               |          []        []         []                  | 16
-     gcal               |          []                                       |  5
-     gcc                |          []                   []          []      |  7
-     gettext-examples   |          [] []     []         []    []    []      | 29
-     gettext-runtime    |          [] []     []         []    []    []      | 28
-     gettext-tools      |          [] []     []         []          []      | 20
-     gip                |                    []                     []      | 13
-     gliv               |          []        []                             | 11
-     glunarclock        |                    []  []                 []      | 15
-     gmult              |          []        []         []          []      | 16
-     gnubiff            |                    []                             |  2
-     gnucash            |          () []                                    |  5
-     gnuedu             |                    []                             |  2
-     gnulib             |                    []                             | 10
-     gnunet             |                                                   |  0
-     gnunet-gtk         |          []        []                             |  3
-     gnutls             |                                                   |  4
-     gpe-aerial         |                    []         []                  | 14
-     gpe-beam           |                    []         []                  | 14
-     gpe-calendar       |                    []  []                         |  7
-     gpe-clock          |          []        []  []     []                  | 21
-     gpe-conf           |                    []  []     []                  | 16
-     gpe-contacts       |                    []         []                  | 10
-     gpe-edit           |          []        []  []     []          []      | 22
-     gpe-filemanager    |                    []  []                         |  7
-     gpe-go             |          []        []  []     []                  | 19
-     gpe-login          |          []        []  []     []          []      | 21
-     gpe-ownerinfo      |          []        []         []          []      | 21
-     gpe-package        |                    []                             |  6
-     gpe-sketchbook     |          []        []                             | 16
-     gpe-su             |          []        []  []     []                  | 21
-     gpe-taskmanager    |          []        []  []     []                  | 21
-     gpe-timesheet      |          []        []         []          []      | 18
-     gpe-today          |          []        []  []     []          []      | 21
-     gpe-todo           |                    []  []                         |  8
-     gphoto2            |             []     []         []          []      | 21
-     gprof              |          []        []                             | 13
-     gpsdrive           |                    []                             |  5
-     gramadoir          |                    []                             |  7
-     grep               |                    []                             | 12
-     gretl              |                                                   |  6
-     gsasl              |                    []         []          []      |  9
-     gss                |                    []                             |  7
-     gst-plugins-bad    |             []     []         []                  | 13
-     gst-plugins-base   |             []     []                             | 11
-     gst-plugins-good   |             []     []         []    []    []      | 16
-     gst-plugins-ugly   |             []     []         []                  | 13
-     gstreamer          |          [] []     []                             | 18
-     gtick              |             []     []                             |  7
-     gtkam              |                    []                             | 16
-     gtkorphan          |                    []                             |  7
-     gtkspell           |             []     []  []     []    []    []      | 27
-     gutenprint         |                                                   |  4
-     hello              |          [] []     []         []          []      | 38
-     herrie             |          []        []                             |  8
-     hylafax            |                                                   |  0
-     idutils            |          []        []                             | 15
-     indent             |          [] []     []         []          []      | 28
-     iso_15924          |                    []         []                  |  4
-     iso_3166           |    [] [] [] []     []  []     []    []    []      | 54
-     iso_3166_2         |                    []         []                  |  4
-     iso_4217           |    []    []        []         []    []            | 24
-     iso_639            |             []     []  []     []    []            | 26
-     jpilot             |          [] []     []         []                  |  7
-     jtag               |                    []                             |  3
-     jwhois             |          []        []                     []      | 13
-     kbd                |          [] []     []                             | 13
-     keytouch           |                    []                             |  8
-     keytouch-editor    |                    []                             |  5
-     keytouch-keyboa... |                    []                             |  5
-     latrine            |          []        []                             |  5
-     ld                 |          []        []         []          []      | 10
-     leafpad            |          [] []     []         []          []      | 24
-     libc               |          []                   []          []      | 19
-     libexif            |                    []                             |  5
-     libextractor       |                    []                             |  5
-     libgpewidget       |                    []  []     []                  | 20
-     libgpg-error       |                    []                             |  6
-     libgphoto2         |             []     []                             |  9
-     libgphoto2_port    |             []     []                     []      | 11
-     libgsasl           |                    []                             |  8
-     libiconv           |                    []  []                         | 11
-     libidn             |                    []         []                  | 11
-     lifelines          |                                                   |  4
-     lilypond           |                    []                             |  6
-     lingoteach         |                    []                             |  6
-     lprng              |                    []                             |  2
-     lynx               |          [] []     []                             | 15
-     m4                 |                    []         []          []      | 18
-     mailfromd          |             []     []                             |  3
-     mailutils          |             []     []                             |  8
-     make               |          []        []         []                  | 20
-     man-db             |                    []                             |  9
-     minicom            |                    []                             | 14
-     nano               |                    []         []          []      | 20
-     opcodes            |          []        []                             | 10
-     parted             |          [] []                            []      | 11
-     pilot-qof          |                    []                             |  1
-     popt               |          []        []         []          []      | 18
-     psmisc             |                    []         []                  | 10
-     pwdutils           |                    []                             |  3
-     qof                |                    []                             |  4
-     radius             |             []     []                             |  7
-     recode             |          []        []         []                  | 25
-     rpm                |          [] []     []                     []      | 13
-     screem             |                    []                             |  2
-     scrollkeeper       |          [] []     []                     []      | 26
-     sed                |          []        []         []          []      | 23
-     shared-mime-info   |             []     []         []                  | 29
-     sharutils          |          []        []                     []      | 23
-     shishi             |                    []                             |  3
-     skencil            |                    []                             |  7
-     solfege            |                    []                             |  3
-     soundtracker       |          []        []                             |  9
-     sp                 |          []                                       |  3
-     system-tools-ba... |    []    [] []     []     []  []          []      | 38
-     tar                |          [] []     []                             | 17
-     texinfo            |          []        []         []                  | 15
-     tin                |                                                   |  1
-     tuxpaint           |                    []  []                 []      | 19
-     unicode-han-tra... |                                                   |  0
-     unicode-transla... |                                                   |  2
-     util-linux         |          [] []     []                             | 20
-     util-linux-ng      |          [] []     []                             | 20
-     vorbis-tools       |             []     []                             |  4
-     wastesedge         |                                                   |  1
-     wdiff              |          []        []                             | 23
-     wget               |          []        []                     []      | 20
-     xchat              |             []     []         []          []      | 29
-     xkeyboard-config   |          [] []     []                             | 14
-     xpad               |                    []         []          []      | 15
-                        +---------------------------------------------------+
-       76 teams           tg th tk tr uk ven vi  wa xh zh_CN zh_HK zh_TW zu
-      163 domains          0  3  1 74 51  0  143 21  1  57     7    45    0  2036
-
-   Some counters in the preceding matrix are higher than the number of
-visible blocks let us expect.  This is because a few extra PO files are
-used for implementing regional variants of languages, or language
-dialects.
-
-   For a PO file in the matrix above to be effective, the package to
-which it applies should also have been internationalized and
-distributed as such by its maintainer.  There might be an observable
-lag between the mere existence a PO file and its wide availability in a
-distribution.
-
-   If November 2007 seems to be old, you may fetch a more recent copy
-of this `ABOUT-NLS' file on most GNU archive sites.  The most
-up-to-date matrix with full percentage details can be found at
-`http://translationproject.org/extra/matrix.html'.
-
-1.6 Using `gettext' in new packages
-===================================
-
-If you are writing a freely available program and want to
-internationalize it you are welcome to use GNU `gettext' in your
-package.  Of course you have to respect the GNU Library General Public
-License which covers the use of the GNU `gettext' library.  This means
-in particular that even non-free programs can use `libintl' as a shared
-library, whereas only free software can use `libintl' as a static
-library or use modified versions of `libintl'.
-
-   Once the sources are changed appropriately and the setup can handle
-the use of `gettext' the only thing missing are the translations.  The
-Free Translation Project is also available for packages which are not
-developed inside the GNU project.  Therefore the information given above
-applies also for every other Free Software Project.  Contact
-`coordinator@translationproject.org' to make the `.pot' files available
-to the translation teams.
-



commit b38f34e7b2eb6c4d075f272374d638abd99092c9
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 12 11:46:48 2010 +0200

    Fix make clean

diff --git a/myserver/binaries/web/cgi-src/post/Makefile.am b/myserver/binaries/web/cgi-src/post/Makefile.am
index f435e8a..30711c0 100644
--- a/myserver/binaries/web/cgi-src/post/Makefile.am
+++ b/myserver/binaries/web/cgi-src/post/Makefile.am
@@ -29,7 +29,7 @@ post.mscgi: libpost.la
 	test \! -e .libs/libpost$(SO_EXT) || cp .libs/libpost$(SO_EXT) ../../cgi-bin/post.mscgi
 
 clean-local:
-	test \! -e libpost.la
+	test \! -e libpost.la \
 	|| $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall libpost.la
 
 

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

Summary of changes:
 myserver/ABOUT-NLS                             | 1068 ------------------------
 myserver/binaries/web/cgi-src/post/Makefile.am |    2 +-
 myserver/src/Makefile.am                       |    1 +
 3 files changed, 2 insertions(+), 1069 deletions(-)
 delete mode 100644 myserver/ABOUT-NLS


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Wed Apr 14 18:35:32 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O2BBE-00071G-Gz
	for mharc-myserver-commit@gnu.org; Wed, 14 Apr 2010 18:35:32 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O2BBC-0006yR-Lb
	for myserver-commit@gnu.org; Wed, 14 Apr 2010 18:35:30 -0400
Received: from [140.186.70.92] (port=57884 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O2BB9-0006sO-2t
	for myserver-commit@gnu.org; Wed, 14 Apr 2010 18:35:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2BB6-00063J-73
	for myserver-commit@gnu.org; Wed, 14 Apr 2010 18:35:26 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:51340
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2BB6-00063A-1K
	for myserver-commit@gnu.org; Wed, 14 Apr 2010 18:35:24 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2BB4-0004VT-Rv
	for myserver-commit@gnu.org; Wed, 14 Apr 2010 22:35:23 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O2BAz-0007xm-TT
	for myserver-commit@gnu.org; Wed, 14 Apr 2010 22:35:22 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: f686117d619f999ca33c331c7e4dd833010d5d32
X-Git-Newrev: 0eb8d9488b4102b99de7a0993d8c801ace41cc90
Message-Id: <E1O2BAz-0007xm-TT@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Wed, 14 Apr 2010 22:35:20 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-128-g0eb8d94
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, 14 Apr 2010 22:35:30 -0000

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

The branch, master has been updated
       via  0eb8d9488b4102b99de7a0993d8c801ace41cc90 (commit)
       via  d351951df56e1b291dfcd8514519f2ac6c55531e (commit)
      from  f686117d619f999ca33c331c7e4dd833010d5d32 (commit)

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

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


commit 0eb8d9488b4102b99de7a0993d8c801ace41cc90
Author: Lisa <syn.shainer@gmail.com>
Date:   Wed Apr 14 20:40:40 2010 +0200

    A new test for the exception set has been created.
    
    This test forces the failure of two checked functions via bad input
    to ensure that the correct exception is thrown.

diff --git a/myserver/tests/Makefile.am b/myserver/tests/Makefile.am
index d648256..66095c6 100644
--- a/myserver/tests/Makefile.am
+++ b/myserver/tests/Makefile.am
@@ -28,6 +28,7 @@ test_suite_SOURCES =  	main.cpp				\
 			test_connection.cpp			\
 			test_connections_scheduler.cpp		\
 			test_crypt_algo_manager.cpp		\
+			test_exceptions.cpp	\
 			test_file.cpp				\
 			test_file_stream.cpp			\
 			test_file_stream_creator.cpp		\
diff --git a/myserver/tests/test_exceptions.cpp b/myserver/tests/test_exceptions.cpp
new file mode 100644
index 0000000..4efff3c
--- /dev/null
+++ b/myserver/tests/test_exceptions.cpp
@@ -0,0 +1,85 @@
+/*
+  MyServer
+  Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "myserver.h"
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+#include "../include/base/exceptions/exceptions.h"
+#include "../include/base/exceptions/checked.h"
+
+#include <errno.h>
+
+using namespace std;
+
+class TestExceptions : public CppUnit::TestFixture
+{
+  CPPUNIT_TEST_SUITE ( TestExceptions );
+  CPPUNIT_TEST (testCatch1);
+  CPPUNIT_TEST (testCatch2);
+  CPPUNIT_TEST_SUITE_END ();
+
+  DIR *foodir;
+  char *buf;
+
+public:
+  void setUp ()
+  {
+    foodir = NULL;
+    buf = NULL;
+  }
+
+  void tearDown () {}
+
+  void testCatch1 ()
+  {
+    try
+      {
+        checked::closedir (foodir);
+        CPPUNIT_FAIL ("The exception in testCatch1 wasn't thrown or caught");
+      }
+    catch (ArgumentListException& e)
+      {
+        CPPUNIT_ASSERT (e.getErrno () == EINVAL);
+      }
+    catch (...)
+      {
+        CPPUNIT_FAIL ("The wrong exception in testCatch1 was thrown");
+      }
+  }
+
+  void testCatch2 ()
+  {
+    try
+      {
+        char *p = checked::getcwd (buf, 1);
+        CPPUNIT_FAIL ("The exception in testCatch2 wasn't thrown or caught");
+      }
+    catch (OverflowException& e)
+      {
+        CPPUNIT_ASSERT (e.getErrno () == ERANGE);
+      }
+    catch (...)
+      {
+        CPPUNIT_FAIL ("The wrong exception in testCatch2 was thrown");
+      }
+  }
+};
+
+CPPUNIT_TEST_SUITE_REGISTRATION (TestExceptions);



commit d351951df56e1b291dfcd8514519f2ac6c55531e
Author: Lisa Vitolo <syn.shainer@gmail.com>
Date:   Tue Apr 6 21:09:36 2010 +0200

    Map POSIX errors to new exceptions.
    
    The exception classes were created, representing errno values, and divided
    in 3 categories. An abstract superclass allows the developer to get the
    error message, the process backtrace, and a numeric value representing the
    logging priority of the error from the exception object.
    The namespace of checked::function is formed by common used functions that
    in case of an error throw the right exception.

diff --git a/myserver/configure.ac b/myserver/configure.ac
index dbab106..eb22297 100644
--- a/myserver/configure.ac
+++ b/myserver/configure.ac
@@ -99,7 +99,7 @@ AC_CHECK_HEADER([sys/sendfile.h], AC_DEFINE(SENDFILE, 1,
 gl_INIT
 
 AC_CHECK_FUNCS(regcomp setgroups localtime_r posix_fallocate \
-		           openat fstatat getpwnam ffsl readdir_r)
+		           openat fstatat getpwnam ffsl readdir_r backtrace backtrace_symbols)
 
 case "${host}" in
     *-*-mingw32*)
@@ -400,6 +400,7 @@ AC_CONFIG_FILES([ po/Makefile.in
     include/base/Makefile
     include/base/bitvec/Makefile
     include/base/read_directory/Makefile
+    include/base/exceptions/Makefile
     include/base/file/Makefile
     include/base/pipe/Makefile
     include/base/base64/Makefile
@@ -457,6 +458,7 @@ AC_CONFIG_FILES([ po/Makefile.in
     src/base/Makefile
     src/base/bitvec/Makefile
     src/base/read_directory/Makefile
+    src/base/exceptions/Makefile
     src/base/file/Makefile
     src/base/pipe/Makefile
     src/base/base64/Makefile
diff --git a/myserver/include/base/Makefile.am b/myserver/include/base/Makefile.am
index dfafe80..97cbc85 100644
--- a/myserver/include/base/Makefile.am
+++ b/myserver/include/base/Makefile.am
@@ -18,4 +18,4 @@ baseincludedir=$(includedir)/myserver/include/base
 baseinclude_HEADERS = utility.h
 SUBDIRS = base64 bitvec crypt dynamic_lib file files_cache read_directory \
 					hash_map home_dir mem_buff multicast pipe process regex safetime \
-					slab socket socket_pair ssl string sync thread unix_socket xml
+					slab socket socket_pair ssl string sync thread unix_socket xml exceptions
diff --git a/myserver/include/base/exceptions/Makefile.am b/myserver/include/base/exceptions/Makefile.am
new file mode 100644
index 0000000..4356022
--- /dev/null
+++ b/myserver/include/base/exceptions/Makefile.am
@@ -0,0 +1,3 @@
+exceptionsincludedir=$(includedir)/myserver/include/base/exceptions
+exceptionsinclude_HEADERS = checked.h exceptions.h
+SUBDIRS =
diff --git a/myserver/include/base/exceptions/checked.h b/myserver/include/base/exceptions/checked.h
new file mode 100644
index 0000000..88a680a
--- /dev/null
+++ b/myserver/include/base/exceptions/checked.h
@@ -0,0 +1,97 @@
+/*
+  MyServer
+  Copyright (C) 2002, 2003, 2004, 2008, 2009, 2010 Free Software
+  Foundation, Inc.
+  Copyright (C) 2010, Lisa Vitolo (shainer)
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef CHECKED_H
+# define CHECKED_H
+
+# include "myserver.h"
+# include <errno.h>
+
+# include <alloca.h>
+# include <dirent.h>
+# include <fcntl.h>
+# include <regex.h>
+# include <signal.h>
+# include <stdio.h>
+# include <stdlib.h>
+# include <sys/ioctl.h>
+# include <sys/select.h>
+# include <sys/socket.h>
+# include <sys/stat.h>
+# include <sys/time.h>
+# include <sys/wait.h>
+# include <time.h>
+# include <unistd.h>
+# include <wchar.h>
+# include <wctype.h>
+
+# include <include/base/exceptions/exceptions.h>
+
+/*!
+ * Group of checked functions that throws an exception in case of error,
+ * instead of just setting errno
+ */
+namespace checked
+{
+  int accept (int fd, struct sockaddr *addr, socklen_t *addrlen);
+  int bind (int fd, const struct sockaddr *addr, socklen_t addrlen);
+  int chown (const char *file, uid_t uid, gid_t gid);
+  int close (int fd);
+  int closedir (DIR *);
+  int connect (int fd, const struct sockaddr *addr, socklen_t addrlen);
+  int dup (int oldfd);
+  int dup2 (int oldfd, int newfd);
+  int fstat (int fd, struct stat *buf);
+  int fstatat (int fd, char const *name, struct stat *st, int flags);
+  char *getcwd (char *buf, size_t size);
+  int gethostname (char *name, size_t len);
+  int getsockname (int fd, struct sockaddr *addr, socklen_t *addrlen);
+  int gettimeofday (struct timeval *, void *);
+  struct tm *gmtime_r (time_t const *__timer, struct tm *__result);
+  int listen (int fd, int backlog);
+  struct tm *localtime_r (time_t const *__timer, struct tm *__result);
+  int lstat (const char *name, struct stat *buf);
+  void *memchr (void const *__s, int __c, size_t __n);
+  int mkdir (char const *name, mode_t mode);
+  time_t mktime (struct tm *__tp);
+  int open (const char *filename, int flags);
+  DIR *opendir (const char *);
+  ssize_t read (int fd, void *buf, size_t count);
+  void *realloc (void *ptr, size_t size);
+  ssize_t recv (int fd, void *buf, size_t len, int flags);
+  int remove (const char *name);
+  int rename (const char *old_filename, const char *new_filename);
+  int rmdir (char const *name);
+  int select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
+  ssize_t send (int fd, const void *buf, size_t len, int flags);
+  int setsockopt (int fd, int level, int optname, const void *optval, socklen_t optlen);
+  int shutdown (int fd, int how);
+  int sigaction (int signum, const struct sigaction *act, struct sigaction *oldact);
+  int sigaddset (sigset_t *set, int signum);
+  int sigemptyset (sigset_t *set);
+  int sigprocmask (int how, const sigset_t *set, sigset_t *oldset);
+  int socket (int domain, int type, int protocol);
+  char *strdup (char const *__s);
+  int unlink (char const *file);
+  ssize_t write (int fd, const void *buf, size_t count);
+
+  void raiseException ();
+}
+
+#endif
diff --git a/myserver/include/base/exceptions/exceptions.h b/myserver/include/base/exceptions/exceptions.h
new file mode 100644
index 0000000..cb74cb1
--- /dev/null
+++ b/myserver/include/base/exceptions/exceptions.h
@@ -0,0 +1,694 @@
+/*
+  MyServer
+  Copyright (C) 2002, 2003, 2004, 2008, 2009, 2010 Free Software
+  Foundation, Inc.
+  Copyright (C) 2010, Lisa Vitolo (shainer)
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+#ifndef EXCEPTIONS_H
+# define EXCEPTIONS_H
+
+# include "myserver.h"
+
+# include <exception>
+# include <errno.h>
+# include <execinfo.h>
+# include <stdlib.h>
+# include <string.h>
+
+# include <include/log/stream/log_stream.h>
+
+using namespace std;
+
+/*!
+ * This class describes an abstract MyServer exception
+ */
+class AbstractServerException: public exception
+{
+  public:
+    /*!
+     * Constructor of the class
+     */
+    AbstractServerException ()
+    {
+      localErrno = errno;
+      buffer = NULL;
+      btString = NULL;
+    }
+
+    int getErrno ()
+    {
+      return localErrno;
+    }
+
+    /*!
+     * Returns the process backtrace of the application
+     * at the moment of the error
+     */
+    char **getBacktrace ()
+    {
+      if (localErrno == ENOMEM) /* it's not safe to allocate more */
+        return NULL;
+
+      if (buffer == NULL)
+        {
+# ifdef HAVE_BACKTRACE
+          size = 20;
+          buffer = (void **) gnulib::malloc (sizeof(void *) *size);
+          int w = backtrace (buffer, size);
+# endif
+
+# ifdef HAVE_BACKTRACE_SYMBOLS
+          btString = (char **) gnulib::malloc (sizeof(char *) *w);
+          btString = backtrace_symbols(buffer, w);
+# endif
+        }
+
+      return btString;
+    }
+
+    /*!
+     * Returns a string representing the error
+     */
+    virtual const char *what () const throw ()
+    {
+      return gnulib::strerror (localErrno);
+    }
+
+    enum LoggingLevel getLogLevel()
+    {
+      return logLevel;
+    }
+
+    virtual ~AbstractServerException () throw ()
+      {
+        if (buffer)
+          free (buffer);
+
+        if (btString)
+          free (btString);
+      }
+
+ protected:
+    int localErrno;
+    char **btString;
+
+    void setLogLevel (enum LoggingLevel l)
+    {
+      logLevel = l;
+    }
+
+ private:
+    void **buffer;
+    int size;
+    enum LoggingLevel logLevel;
+};
+
+/*
+ * Generic categories to group together more exceptions of the same type
+ */
+class GenericFileException : public AbstractServerException
+{
+ public:
+  GenericFileException () : AbstractServerException () {}
+};
+
+class GenericSocketException : public AbstractServerException
+{
+ public:
+  GenericSocketException () : AbstractServerException () {}
+};
+
+class GenericMemoryException : public AbstractServerException
+{
+ public:
+  GenericMemoryException () : AbstractServerException () {}
+};
+
+/*
+ * Exceptions
+ */
+class AbortedConnectionException : public GenericSocketException
+{
+ public:
+  AbortedConnectionException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_INFO);
+    }
+};
+
+class AddressException : public GenericSocketException
+{
+ public:
+  AddressException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class ArgumentListException : public GenericFileException
+{
+ public:
+  ArgumentListException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class BadDescriptorException : public GenericSocketException
+{
+ public:
+  BadDescriptorException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class BlockingException : public GenericFileException
+{
+ public:
+  BlockingException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class BufferOverflowException : public GenericMemoryException
+{
+ public:
+  BufferOverflowException () : GenericMemoryException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class BusyResourceException : public GenericFileException
+{
+ public:
+  BusyResourceException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class ByteException : public GenericMemoryException
+{
+ public:
+  ByteException () : GenericMemoryException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class CancelException : public GenericSocketException
+{
+ public:
+  CancelException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class ChannelOutOfRangeException : public GenericSocketException
+{
+ public:
+  ChannelOutOfRangeException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class ConnectionInProgressException : public GenericSocketException
+{
+ public:
+  ConnectionInProgressException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_INFO);
+    }
+};
+
+class DeadlockException : public GenericFileException
+{
+ public:
+  DeadlockException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class DestAddressException : public GenericSocketException
+{
+ public:
+  DestAddressException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_INFO);
+    }
+};
+
+class DeviceException : public GenericFileException
+{
+ public:
+  DeviceException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class DirectoryException : public GenericFileException
+{
+ public:
+  DirectoryException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class DiskQuotaException : public GenericMemoryException
+{
+ public:
+  DiskQuotaException () : GenericMemoryException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class ExecFormatException : public GenericMemoryException
+{
+ public:
+  ExecFormatException () : GenericMemoryException ()
+    {
+      setLogLevel(MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class FaultException : public GenericMemoryException
+{
+ public:
+  FaultException () : GenericMemoryException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class FileExistsException : public GenericFileException
+{
+ public:
+  FileExistsException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class FileNotFoundException : public GenericFileException
+{
+ public:
+  FileNotFoundException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class FileTooLargeException : public GenericFileException
+{
+ public:
+  FileTooLargeException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class FileTooLongException : public GenericFileException
+{
+ public:
+  FileTooLongException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class FilesystemException : public GenericFileException
+{
+ public:
+  FilesystemException () : GenericFileException ()
+    {
+      setLogLevel(MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class FunctionException : public GenericMemoryException
+{
+ public:
+  FunctionException () : GenericMemoryException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class HaltException : public GenericMemoryException
+{
+ public:
+  HaltException () : GenericMemoryException ()
+    {
+      setLogLevel(MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class HostDownException : public GenericSocketException
+{
+ public:
+  HostDownException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class IOException : public GenericFileException
+{
+ public:
+  IOException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class IdentifierException : public GenericFileException
+{
+ public:
+  IdentifierException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_INFO);
+    }
+};
+
+class InvalidExchangeException : public GenericSocketException
+{
+ public:
+  InvalidExchangeException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_INFO);
+    }
+};
+
+class InvalidResourceException : public GenericFileException
+{
+ public:
+  InvalidResourceException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_INFO);
+    }
+};
+
+class KeyException : public GenericSocketException
+{
+ public:
+  KeyException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class LibraryException : public GenericFileException
+{
+ public:
+  LibraryException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class LinkException : public GenericFileException
+{
+ public:
+  LinkException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class MathException : public GenericMemoryException
+{
+ public:
+  MathException () : GenericMemoryException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_INFO);
+    }
+};
+
+class MediaException : public GenericFileException
+{
+ public:
+  MediaException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_INFO);
+    }
+};
+
+class MemoryOverflowException : public GenericMemoryException
+{
+ public:
+  MemoryOverflowException () : GenericMemoryException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_INFO);
+    }
+};
+
+class MessageException : public GenericSocketException
+{
+ public:
+  MessageException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class MultihopException : public GenericSocketException
+{
+ public:
+  MultihopException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class NamedFileException : public GenericFileException
+{
+ public:
+  NamedFileException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class NetworkException : public GenericSocketException
+{
+ public:
+  NetworkException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_INFO);
+    }
+};
+
+class OverflowException : public GenericMemoryException
+{
+ public:
+  OverflowException () : GenericMemoryException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class PermissionDeniedException : public GenericFileException
+{
+ public:
+  PermissionDeniedException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class PipeException : public GenericFileException
+{
+ public:
+  PipeException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class ProcessException : public GenericFileException
+{
+ public:
+  ProcessException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class ProgressException : public GenericSocketException
+{
+ public:
+  ProgressException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class ProtocolException : public GenericSocketException
+{
+ public:
+  ProtocolException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class ReadException : public GenericSocketException
+{
+ public:
+  ReadException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class RefusedConnectionException : public GenericSocketException
+{
+ public:
+  RefusedConnectionException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class RemoteIOException : public GenericSocketException
+{
+ public:
+  RemoteIOException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class RequestCodeException : public GenericSocketException
+{
+ public:
+  RequestCodeException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_INFO);
+    }
+};
+
+class RequestDescriptorException : public GenericSocketException
+{
+ public:
+  RequestDescriptorException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_INFO);
+    }
+};
+
+class ResetException : public GenericSocketException
+{
+ public:
+  ResetException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class SendException : public GenericSocketException
+{
+ public:
+  SendException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+class SlotException : public GenericMemoryException
+{
+ public:
+  SlotException () : GenericMemoryException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class SocketException : public GenericSocketException
+{
+ public:
+  SocketException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_INFO);
+    }
+};
+
+class StreamException : public GenericSocketException
+{
+ public:
+  StreamException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class TimerException : public GenericMemoryException
+{
+ public:
+  TimerException () : GenericMemoryException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_INFO);
+    }
+};
+
+class TooManyFileException : public GenericMemoryException
+{
+ public:
+  TooManyFileException () : GenericMemoryException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+/*
+ * Thrown if an unknown error occurs
+ */
+class UnknownException : public AbstractServerException
+{
+ public:
+  UnknownException () : AbstractServerException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_INFO);
+    }
+};
+
+class UnreachHostException : public GenericSocketException
+{
+ public:
+  UnreachHostException () : GenericSocketException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_ERROR);
+    }
+};
+
+class UserException : public GenericFileException
+{
+ public:
+  UserException () : GenericFileException ()
+    {
+      setLogLevel (MYSERVER_LOG_MSG_WARNING);
+    }
+};
+
+#endif
diff --git a/myserver/po/Makefile.in.in b/myserver/po/Makefile.in.in
index a781ea3..5022b8b 100644
--- a/myserver/po/Makefile.in.in
+++ b/myserver/po/Makefile.in.in
@@ -1,21 +1,5 @@
-# GNU MyServer
-#
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # Makefile for PO directory in any package using GNU gettext.
-# Copyright (C) 1995-1997, 2000-2007 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+# Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
 #
 # This file can be copied and used freely without restrictions.  It can
 # be used in projects which are not available under the GNU General Public
@@ -24,8 +8,7 @@
 # Please note that the actual code of GNU gettext is covered by the GNU
 # General Public License and is *not* in the public domain.
 #
-# Origin: gettext-0.17
-GETTEXT_MACRO_VERSION = 0.17
+# Origin: gettext-0.16
 
 PACKAGE = @PACKAGE@
 VERSION = @VERSION@
@@ -112,18 +95,11 @@ CATALOGS = @CATALOGS@
 	mv t-$@ $@
 
 
-all: check-macro-version all-@USE_NLS@
+all: all-@USE_NLS@
 
 all-yes: stamp-po
 all-no:
 
-# Ensure that the gettext macros and this Makefile.in.in are in sync.
-check-macro-version:
-	@test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
-	  || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
-	       exit 1; \
-	     }
-
 # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
 # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
 # we don't want to bother translators with empty POT files). We assume that
@@ -154,34 +130,16 @@ stamp-po: $(srcdir)/$(DOMAIN).pot
 # This target rebuilds $(DOMAIN).pot; it is an expensive operation.
 # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
 $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
-	if LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \
-	  package_gnu='GNU '; \
-	else \
-	  package_gnu=''; \
-	fi; \
 	if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
 	  msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
 	else \
 	  msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
 	fi; \
-	case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
-	  '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
-	    $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
-	      --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
-	      --files-from=$(srcdir)/POTFILES.in \
-	      --copyright-holder='$(COPYRIGHT_HOLDER)' \
-	      --msgid-bugs-address="$$msgid_bugs_address" \
-	    ;; \
-	  *) \
-	    $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
-	      --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
-	      --files-from=$(srcdir)/POTFILES.in \
-	      --copyright-holder='$(COPYRIGHT_HOLDER)' \
-	      --package-name="$${package_gnu}@PACKAGE@" \
-	      --package-version='@VERSION@' \
-	      --msgid-bugs-address="$$msgid_bugs_address" \
-	    ;; \
-	esac
+	$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+	  --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
+	  --files-from=$(srcdir)/POTFILES.in \
+	  --copyright-holder='$(COPYRIGHT_HOLDER)' \
+	  --msgid-bugs-address="$$msgid_bugs_address"
 	test ! -f $(DOMAIN).po || { \
 	  if test -f $(srcdir)/$(DOMAIN).pot; then \
 	    sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
diff --git a/myserver/src/Makefile.am b/myserver/src/Makefile.am
index a123515..2f78a55 100644
--- a/myserver/src/Makefile.am
+++ b/myserver/src/Makefile.am
@@ -59,6 +59,8 @@ libmyserver_la_LIBADD =  \
     base/slab/slab.lo  \
     base/unix_socket/unix_socket.lo  \
     base/mem_buff/mem_buff.lo  \
+    base/exceptions/checked.lo  \
+    base/exceptions/exceptions.lo  \
     base/crypt/sha1.lo  \
     base/crypt/crypt_algo_manager.lo  \
     base/crypt/crypt_algo.lo  \
diff --git a/myserver/include/base/Makefile.am b/myserver/src/base/exceptions/Makefile.am
similarity index 70%
copy from myserver/include/base/Makefile.am
copy to myserver/src/base/exceptions/Makefile.am
index dfafe80..d9bd820 100644
--- a/myserver/include/base/Makefile.am
+++ b/myserver/src/base/exceptions/Makefile.am
@@ -14,8 +14,8 @@
 #
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
-baseincludedir=$(includedir)/myserver/include/base
-baseinclude_HEADERS = utility.h
-SUBDIRS = base64 bitvec crypt dynamic_lib file files_cache read_directory \
-					hash_map home_dir mem_buff multicast pipe process regex safetime \
-					slab socket socket_pair ssl string sync thread unix_socket xml
+AM_CXXFLAGS="-I$(top_srcdir)/lib"
+lib_LTLIBRARIES = libexceptions.la
+libexceptions_la_SOURCES = checked.cpp exceptions.cpp
+SUBDIRS =
+AM_CPPFLAGS = $(all_includes)
diff --git a/myserver/src/base/exceptions/checked.cpp b/myserver/src/base/exceptions/checked.cpp
new file mode 100644
index 0000000..541596e
--- /dev/null
+++ b/myserver/src/base/exceptions/checked.cpp
@@ -0,0 +1,701 @@
+/*
+  MyServer
+  Copyright (C) 2002, 2003, 2004, 2008, 2009, 2010 Free Software
+  Foundation, Inc.
+  Copyright (C) 2010, Lisa Vitolo (shainer)
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; either version 3 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+#include <include/base/exceptions/checked.h>
+
+/*!
+ * Check if the last operation was successful
+ * \param x The function's return value
+ */
+static inline int checkError (int x)
+{
+  if (x < 0)
+    checked::raiseException ();
+
+  return x;
+}
+
+/*!
+ * \see checkError
+ */
+static inline const void *checkErrorNull (const void *x)
+{
+  if (x == NULL)
+    checked::raiseException ();
+
+  return x;
+}
+
+namespace checked
+{
+  int accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
+  {
+    return checkError (gnulib::accept (fd, addr, addrlen));
+  }
+
+  int bind (int fd, const struct sockaddr *addr, socklen_t addrlen)
+  {
+    return checkError (gnulib::bind (fd, addr, addrlen));
+  }
+
+  int chown (const char *file, uid_t uid, gid_t gid)
+  {
+    return checkError (gnulib::chown (file, uid, gid));
+  }
+
+  int close (int fd)
+  {
+    return checkError (gnulib::close (fd));
+  }
+
+  int closedir (DIR *dirp)
+  {
+    return checkError (gnulib::closedir (dirp));
+  }
+
+  int connect (int fd, const struct sockaddr *addr, socklen_t addrlen)
+  {
+    return checkError (gnulib::connect (fd, addr, addrlen));
+  }
+
+  int dup (int oldfd)
+  {
+    return checkError (gnulib::dup (oldfd));
+  }
+
+  int dup2 (int oldfd, int newfd)
+  {
+    return checkError (gnulib::dup2 (oldfd, newfd));
+  }
+
+  int fstat (int fd, struct stat *buf)
+  {
+    return checkError (gnulib::fstat (fd, buf));
+  }
+
+  int fstatat (int fd, char const *name, struct stat *st, int flags)
+  {
+    return checkError (gnulib::fstatat (fd, name, st, flags));
+  }
+
+  char *getcwd (char *buf, size_t size)
+  {
+    return (char *) checkErrorNull (gnulib::getcwd (buf, size));
+  }
+
+  int gethostname (char *name, size_t len)
+  {
+    return checkError (gnulib::gethostname (name, len));
+  }
+
+  int getsockname (int fd, struct sockaddr *addr, socklen_t *addrlen)
+  {
+    return checkError (gnulib::getsockname (fd, addr, addrlen));
+  }
+
+  int gettimeofday (struct timeval *tv, struct timezone *tz)
+  {
+    return checkError (gnulib::gettimeofday (tv, tz));
+  }
+
+  struct tm *gmtime_r (time_t const *__timer, struct tm *__result)
+  {
+    return (struct tm *) checkErrorNull (gnulib::gmtime_r (__timer, __result));
+  }
+
+  int listen (int fd, int backlog)
+  {
+    return checkError (gnulib::listen (fd, backlog));
+  }
+
+  struct tm *localtime_r (time_t const *__timer, struct tm *__result)
+  {
+    return (struct tm *) checkErrorNull (gnulib::localtime_r (__timer, __result));
+  }
+
+  int lstat (const char *name, struct stat *buf)
+  {
+    return checkError (gnulib::lstat (name, buf));
+  }
+
+  void *memchr (void const *__s, int __c, size_t __n)
+  {
+    return (void *) checkErrorNull (gnulib::memchr (__s, __c, __n));
+  }
+
+  int mkdir (char const *name, mode_t mode)
+  {
+    return checkError (gnulib::mkdir (name, mode));
+  }
+
+  time_t mktime (struct tm *__tp)
+  {
+    return checkError (gnulib::mktime (__tp));
+  }
+
+  int open (const char *filename, int flags)
+  {
+    return checkError (gnulib::open (filename, flags, 0));
+  }
+
+  DIR *opendir (const char *name)
+  {
+    return (DIR *) checkErrorNull (gnulib::opendir (name));
+  }
+
+  ssize_t read (int fd, void *buf, size_t count)
+  {
+    return checkError (::read (fd, buf, count));
+  }
+
+  void *realloc (void *ptr, size_t size)
+  {
+    return (void *) checkErrorNull (gnulib::realloc (ptr, size));
+  }
+
+  ssize_t recv (int fd, void *buf, size_t len, int flags)
+  {
+    return checkError (gnulib::recv (fd, buf, len, flags));
+  }
+
+  int remove (const char *name)
+  {
+    return checkError (gnulib::remove (name));
+  }
+
+  int rename (const char *old_filename, const char *new_filename)
+  {
+    return checkError (gnulib::rename (old_filename, new_filename));
+  }
+
+  int rmdir (char const *name)
+  {
+    return checkError (gnulib::rmdir (name));
+  }
+
+  int select (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
+              struct timeval *timeout)
+  {
+    return checkError (gnulib::select (nfds, readfds, writefds, exceptfds, timeout));
+  }
+
+  ssize_t send (int fd, const void *buf, size_t len, int flags)
+  {
+    return checkError (gnulib::send (fd, buf, len, flags));
+  }
+
+  int setsockopt (int fd, int level, int optname, const void *optval, socklen_t optlen)
+  {
+    return checkError (gnulib::setsockopt (fd, level, optname, optval, optlen));
+  }
+
+  int shutdown (int fd, int how)
+  {
+    return checkError (gnulib::shutdown (fd, how));
+  }
+
+  int sigaction (int signum, const struct sigaction *act, struct sigaction *oldact)
+  {
+    return checkError (gnulib::sigaction (signum, act, oldact));
+  }
+
+  int sigaddset (sigset_t *set, int signum)
+  {
+    return checkError (gnulib::sigaddset (set, signum));
+  }
+
+  int sigemptyset (sigset_t *set)
+  {
+    return checkError (gnulib::sigemptyset (set));
+  }
+
+  int sigprocmask (int how, const sigset_t *set, sigset_t *oldset)
+  {
+    return checkError (gnulib::sigprocmask (how, set, oldset));
+  }
+
+  int socket (int domain, int type, int protocol)
+  {
+    return checkError (gnulib::socket (domain, type, protocol));
+  }
+
+  char *strdup (char const *__s)
+  {
+    return (char *) checkErrorNull (gnulib::strdup (__s));
+  }
+
+  int unlink (char const *file)
+  {
+    return checkError (gnulib::unlink (file));
+  }
+
+  ssize_t write (int fd, const void *buf, size_t count)
+  {
+    return checkError (gnulib::write (fd, buf, count));
+  }
+
+  /*
+   * Maps POSIX errors to exceptions
+   */
+  void raiseException ()
+  {
+    switch(errno)
+      {
+      case E2BIG:
+        throw ArgumentListException ();
+        break;
+
+      case EACCES:
+        throw PermissionDeniedException ();
+        break;
+
+      case EADDRINUSE:
+        throw AddressException ();
+        break;
+
+      case EADDRNOTAVAIL:
+        throw AddressException ();
+        break;
+
+      case EAFNOSUPPORT:
+        throw ProtocolException ();
+        break;
+
+      case EAGAIN:
+        throw InvalidResourceException ();
+        break;
+
+      case EALREADY:
+        throw ProgressException ();
+        break;
+
+      case EBADE:
+        throw InvalidExchangeException ();
+        break;
+
+      case EBADF:
+        throw BadDescriptorException ();
+        break;
+
+      case EBADFD:
+        throw BadDescriptorException ();
+        break;
+
+      case EBADMSG:
+        throw MessageException ();
+        break;
+
+      case EBADR:
+        throw RequestCodeException ();
+        break;
+
+      case EBADRQC:
+        throw RequestCodeException ();
+        break;
+
+      case EBADSLT:
+        throw SlotException ();
+        break;
+
+      case EBUSY:
+        throw BusyResourceException ();
+        break;
+
+      case ECANCELED:
+        throw CancelException ();
+        break;
+
+      case ECHILD:
+        throw ProcessException ();
+        break;
+
+      case ECHRNG:
+        throw ChannelOutOfRangeException ();
+        break;
+
+      case ECOMM:
+        throw SendException ();
+        break;
+
+      case ECONNABORTED:
+        throw AbortedConnectionException ();
+        break;
+
+      case ECONNREFUSED:
+        throw RefusedConnectionException ();
+        break;
+
+      case ECONNRESET:
+        throw ResetException ();
+        break;
+
+      case EDEADLK:
+        throw DeadlockException ();
+        break;
+
+      case EDESTADDRREQ:
+        throw AddressException ();
+        break;
+
+      case EDOM:
+        throw MathException ();
+        break;
+
+      case EDQUOT:
+        throw DiskQuotaException ();
+        break;
+
+      case EEXIST:
+        throw FileExistsException ();
+        break;
+
+      case EFAULT:
+        throw FaultException ();
+        break;
+
+      case EFBIG:
+        throw FileTooLargeException ();
+        break;
+
+      case EHOSTDOWN:
+        throw HostDownException ();
+        break;
+
+      case EHOSTUNREACH:
+        throw UnreachHostException ();
+        break;
+
+      case EIDRM:
+        throw IdentifierException ();
+        break;
+
+      case EILSEQ:
+        throw ByteException ();
+        break;
+
+      case EINPROGRESS:
+        throw ProgressException ();
+        break;
+
+      case EINTR:
+        throw FunctionException ();
+        break;
+
+      case EINVAL:
+        throw ArgumentListException ();
+        break;
+
+      case EIO:
+        throw IOException ();
+        break;
+
+      case EISCONN:
+        throw SocketException ();
+        break;
+
+      case EISDIR:
+        throw DirectoryException ();
+        break;
+
+      case EISNAM:
+        throw NamedFileException ();
+        break;
+
+      case EKEYEXPIRED:
+        throw KeyException ();
+        break;
+
+      case EKEYREJECTED:
+        throw KeyException ();
+        break;
+
+      case EKEYREVOKED:
+        throw KeyException ();
+        break;
+
+      case EL2HLT:
+        throw HaltException ();
+        break;
+
+      case EL2NSYNC:
+        throw HaltException ();
+        break;
+
+      case EL3HLT:
+        throw HaltException ();
+        break;
+
+      case ELIBACC:
+        throw LibraryException ();
+        break;
+
+      case ELIBBAD:
+        throw LibraryException ();
+        break;
+
+      case ELIBMAX:
+        throw LibraryException ();
+        break;
+
+      case ELIBSCN:
+        throw LibraryException ();
+        break;
+
+      case ELIBEXEC:
+        throw LibraryException ();
+        break;
+
+      case ELOOP:
+        throw LinkException ();
+        break;
+
+      case EMEDIUMTYPE:
+        throw MediaException ();
+        break;
+
+      case EMFILE:
+        throw TooManyFileException ();
+        break;
+
+      case EMLINK:
+        throw LinkException ();
+        break;
+
+      case EMSGSIZE:
+        throw MessageException ();
+        break;
+
+      case EMULTIHOP:
+        throw MultihopException ();
+        break;
+
+      case ENAMETOOLONG:
+        throw FileTooLongException ();
+        break;
+
+      case ENETRESET:
+        throw NetworkException ();
+        break;
+
+      case ENETUNREACH:
+        throw NetworkException ();
+        break;
+
+      case ENFILE:
+        throw FilesystemException ();
+        break;
+
+      case ENOBUFS:
+        throw BufferOverflowException ();
+        break;
+
+      case ENODATA:
+        throw StreamException ();
+        break;
+
+      case ENODEV:
+        throw DeviceException ();
+        break;
+
+      case ENOENT:
+        throw FileNotFoundException ();
+        break;
+
+      case ENOEXEC:
+        throw ExecFormatException ();
+        break;
+
+      case ENOKEY:
+        throw KeyException ();
+        break;
+
+      case ENOLINK:
+        throw LinkException ();
+        break;
+
+      case ENOMEDIUM:
+        throw MediaException ();
+        break;
+
+      case ENOMEM:
+        throw MemoryOverflowException ();
+        break;
+
+      case ENOMSG:
+        throw MessageException ();
+        break;
+
+      case ENONET:
+        throw NetworkException ();
+        break;
+
+      case ENOSPC:
+        throw OverflowException ();
+        break;
+
+      case ENOSR:
+        throw StreamException ();
+        break;
+
+      case ENOSTR:
+        throw StreamException ();
+        break;
+
+      case ENOSYS:
+        throw FunctionException ();
+        break;
+
+      case ENOTBLK:
+        throw BlockingException ();
+        break;
+
+      case ENOTCONN:
+        throw SocketException ();
+        break;
+
+      case ENOTDIR:
+        throw DirectoryException ();
+        break;
+
+      case ENOTEMPTY:
+        throw DirectoryException ();
+        break;
+
+      case ENOTSOCK:
+        throw SocketException ();
+        break;
+
+      case ENOTTY:
+        throw IOException ();
+        break;
+
+      case ENOTUNIQ:
+        throw NetworkException ();
+        break;
+
+      case ENXIO:
+        throw DeviceException ();
+        break;
+
+      case EOVERFLOW:
+        throw OverflowException ();
+        break;
+
+      case EPERM:
+        throw PermissionDeniedException ();
+        break;
+
+      case EPFNOSUPPORT:
+        throw ProtocolException ();
+        break;
+
+      case EPIPE:
+        throw PipeException ();
+        break;
+
+      case EPROTO:
+        throw ProtocolException ();
+        break;
+
+      case EPROTONOSUPPORT:
+        throw ProtocolException ();
+        break;
+
+      case EPROTOTYPE:
+        throw ProtocolException ();
+        break;
+
+      case ERANGE:
+        throw OverflowException ();
+        break;
+
+      case EREMCHG:
+        throw AddressException ();
+        break;
+
+      case EREMOTEIO:
+        throw IOException ();
+        break;
+
+      case ERESTART:
+        throw FunctionException ();
+        break;
+
+      case EROFS:
+        throw FilesystemException ();
+        break;
+
+      case ESHUTDOWN:
+        throw SendException ();
+        break;
+
+      case ESPIPE:
+        throw PipeException ();
+        break;
+
+      case ESOCKTNOSUPPORT:
+        throw SocketException ();
+        break;
+
+      case ESRCH:
+        throw ProcessException ();
+        break;
+
+      case ESTALE:
+        throw GenericFileException ();
+        break;
+
+      case ESTRPIPE:
+        throw PipeException ();
+        break;
+
+      case ETIME:
+        throw TimerException ();
+        break;
+
+      case ETIMEDOUT:
+        throw TimerException ();
+        break;
+
+      case ETXTBSY:
+        throw BusyResourceException ();
+        break;
+
+      case EUNATCH:
+        throw ProtocolException ();
+        break;
+
+      case EUSERS:
+        throw UserException ();
+        break;
+
+      case EXDEV:
+        throw LinkException ();
+        break;
+
+      case EXFULL:
+        throw InvalidExchangeException ();
+        break;
+
+      default:
+        throw UnknownException ();
+        break;
+      }
+  }
+}
diff --git a/myserver/src/base/exceptions/exceptions.cpp b/myserver/src/base/exceptions/exceptions.cpp
new file mode 100644
index 0000000..a926ba4
--- /dev/null
+++ b/myserver/src/base/exceptions/exceptions.cpp
@@ -0,0 +1,21 @@
+/*
+  MyServer
+  Copyright (C) 2002, 2003, 2004, 2008, 2009, 2010 Free Software
+  Foundation, Inc.
+  Copyright (C) 2010, Lisa Vitolo (shainer)
+
+  See include/base/exceptions/exceptions.h
+
+  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/>.
+*/

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

Summary of changes:
 myserver/configure.ac                              |    4 +-
 myserver/include/base/Makefile.am                  |    2 +-
 myserver/include/base/exceptions/Makefile.am       |    3 +
 myserver/include/base/exceptions/checked.h         |   97 +++
 myserver/include/base/exceptions/exceptions.h      |  694 +++++++++++++++++++
 myserver/po/Makefile.in.in                         |   58 +--
 myserver/src/Makefile.am                           |    2 +
 .../src/base/{base64 => exceptions}/Makefile.am    |    5 +-
 myserver/src/base/exceptions/checked.cpp           |  701 ++++++++++++++++++++
 .../exceptions/exceptions.cpp}                     |   10 +-
 myserver/tests/Makefile.am                         |    1 +
 myserver/tests/test_exceptions.cpp                 |   85 +++
 12 files changed, 1603 insertions(+), 59 deletions(-)
 create mode 100644 myserver/include/base/exceptions/Makefile.am
 create mode 100644 myserver/include/base/exceptions/checked.h
 create mode 100644 myserver/include/base/exceptions/exceptions.h
 copy myserver/src/base/{base64 => exceptions}/Makefile.am (89%)
 create mode 100644 myserver/src/base/exceptions/checked.cpp
 copy myserver/src/{log/stream/log_stream_creator.cpp => base/exceptions/exceptions.cpp} (79%)
 create mode 100644 myserver/tests/test_exceptions.cpp


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Wed Apr 14 18:40:20 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O2BFs-0004dC-Nu
	for mharc-myserver-commit@gnu.org; Wed, 14 Apr 2010 18:40:20 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O2BFr-0004bn-MZ
	for myserver-commit@gnu.org; Wed, 14 Apr 2010 18:40:19 -0400
Received: from [140.186.70.92] (port=47857 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O2BFq-0004Zr-KU
	for myserver-commit@gnu.org; Wed, 14 Apr 2010 18:40:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2BFp-0006fA-Ql
	for myserver-commit@gnu.org; Wed, 14 Apr 2010 18:40:18 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:42821
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2BFo-0006ew-Kx
	for myserver-commit@gnu.org; Wed, 14 Apr 2010 18:40:17 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2BFm-0004aj-SU
	for myserver-commit@gnu.org; Wed, 14 Apr 2010 22:40:15 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O2BFk-00087i-UV
	for myserver-commit@gnu.org; Wed, 14 Apr 2010 22:40:14 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 0eb8d9488b4102b99de7a0993d8c801ace41cc90
X-Git-Newrev: 101f97184a0b6d63b28a055adc10487b0f5339d7
Message-Id: <E1O2BFk-00087i-UV@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Wed, 14 Apr 2010 22:40:12 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-129-g101f971
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, 14 Apr 2010 22:40:19 -0000

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

The branch, master has been updated
       via  101f97184a0b6d63b28a055adc10487b0f5339d7 (commit)
      from  0eb8d9488b4102b99de7a0993d8c801ace41cc90 (commit)

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

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


commit 101f97184a0b6d63b28a055adc10487b0f5339d7
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 15 00:40:12 2010 +0200

    Add Lisa Vitolo to the AUTHORS file

diff --git a/myserver/AUTHORS b/myserver/AUTHORS
index 92ebf99..d25abf5 100644
--- a/myserver/AUTHORS
+++ b/myserver/AUTHORS
@@ -24,3 +24,6 @@ Redesign of the logging system.
 
 Giuseppe Scrivano <gscrivano@gnu.org>
 Original author.
+
+Lisa Vitolo <syn.shainer@gmail.com>
+Exceptions system.

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

Summary of changes:
 myserver/AUTHORS |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Thu Apr 15 04:22:50 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O2KLa-0006dz-CG
	for mharc-myserver-commit@gnu.org; Thu, 15 Apr 2010 04:22:50 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O2KLY-0006dn-8T
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 04:22:48 -0400
Received: from [140.186.70.92] (port=35537 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O2KLW-0006dG-R8
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 04:22:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2KLV-00021n-Sg
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 04:22:46 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:32819
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2KLV-00021e-R8
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 04:22:45 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2KLV-00038u-8f
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 08:22:45 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O2KLU-0002Qz-FH
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 08:22:45 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 101f97184a0b6d63b28a055adc10487b0f5339d7
X-Git-Newrev: dc70d8fdaa6bbadfc4069caef758f4d5cfaa8741
Message-Id: <E1O2KLU-0002Qz-FH@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Thu, 15 Apr 2010 08:22:45 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-130-gdc70d8f
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, 15 Apr 2010 08:22:48 -0000

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

The branch, master has been updated
       via  dc70d8fdaa6bbadfc4069caef758f4d5cfaa8741 (commit)
      from  101f97184a0b6d63b28a055adc10487b0f5339d7 (commit)

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

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


commit dc70d8fdaa6bbadfc4069caef758f4d5cfaa8741
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 15 10:20:03 2010 +0200

    Include exceptions in the SUBDIRS

diff --git a/myserver/src/base/Makefile.am b/myserver/src/base/Makefile.am
index abf6a79..8de5c81 100644
--- a/myserver/src/base/Makefile.am
+++ b/myserver/src/base/Makefile.am
@@ -17,9 +17,10 @@
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
 lib_LTLIBRARIES = libbase.la
 libbase_la_SOURCES = utility.cpp
-SUBDIRS = base64 bitvec crypt dynamic_lib file files_cache read_directory \
-	  hash_map home_dir mem_buff multicast pipe process regex safetime slab \
-	  socket socket_pair ssl string sync thread xml unix_socket
+SUBDIRS = base64 bitvec crypt dynamic_lib file exceptions files_cache \
+	  read_directory hash_map home_dir mem_buff multicast pipe process \
+          regex safetime slab socket socket_pair ssl string sync thread xml \
+	  unix_socket
 AM_CPPFLAGS = $(all_includes) -I$(top_builddir)/lib -I$(top_srcdir)/lib
 
 install:

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

Summary of changes:
 myserver/src/base/Makefile.am |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Thu Apr 15 11:28:36 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O2Qzc-0004lO-F3
	for mharc-myserver-commit@gnu.org; Thu, 15 Apr 2010 11:28:36 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O2Qza-0004jB-Sw
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 11:28:35 -0400
Received: from [140.186.70.92] (port=56470 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O2QzY-0004fH-34
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 11:28:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <e.dolstra@tudelft.nl>) id 1O2QzW-00084U-ET
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 11:28:31 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:55741)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <e.dolstra@tudelft.nl>) id 1O2QzW-00083N-7E
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 11:28:30 -0400
Received: from hydra (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.12.11/8.12.8) with SMTP id
	o3FGSRvt000354
	for <myserver-commit@gnu.org>; Thu, 15 Apr 2010 18:28:27 +0200
Message-Id: <201004151628.o3FGSRvt000354@proliant.st.ewi.tudelft.nl>
Received: by hydra (sSMTP sendmail emulation); Thu, 15 Apr 2010 17:28:27 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
Date: Thu, 15 Apr 2010 17:28:27 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
Subject: [myserver-commit] Hydra job gnu:myserver-master:tarball build
	352390 SUCCEEDED
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, 15 Apr 2010 15:28:35 -0000

Hi,

This is to let you know that Hydra build 352390 of job gnu:myserver-master:tarball has changed from FAILED to SUCCEEDED.

Complete build information can be found on this page: http://hydra.nixos.org/build/352390

A summary of the build information follows:

Build ID:              | 352390
Nix name:              | myserver-tarball-0predc70d8fdaa6bbadfc4069caef758f4d5cfaa8741
Short description:     | Build of a source distribution from a checkout
Maintainer(s):         | myserver-commit@gnu.org
System:                | x86_64-linux
Derivation store path: | /nix/store/jra1wz7a7g0f6fx4zna0j4n40g5gpji6-myserver-tarball-0predc70d8fdaa6bbadfc4069caef758f4d5cfaa8741.drv
Output store path:     | /nix/store/057bvj2nk7va82q6dy8lpiibyyprnc9c-myserver-tarball-0predc70d8fdaa6bbadfc4069caef758f4d5cfaa8741
Time added:            | 2010-04-15 17:28:27
Build started:         | 2010-04-15 17:23:58
Build finished:        | 2010-04-15 17:28:27
Duration:              | 269s

The build inputs were:

Name        | Type | Value
------------+------+---------------------------------------------------------------------------
myserverSrc | git  | git://git.sv.gnu.org/myserver.git:dc70d8fdaa6bbadfc4069caef758f4d5cfaa8741
hydraConfig | svn  | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:21098
gnulibSrc   | git  | git://git.sv.gnu.org/gnulib.git:56d363d4ccf9d50e9c2fcc5080e8e8d69bc9d5ca
nixpkgs     | svn  | https://svn.nixos.org/repos/nix/nixpkgs/trunk:21096

Regards,

The Hydra build daemon.



From MAILER-DAEMON Thu Apr 15 16:13:41 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O2VRV-0001Ev-DK
	for mharc-myserver-commit@gnu.org; Thu, 15 Apr 2010 16:13:41 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O2VRU-0001Ec-1h
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 16:13:40 -0400
Received: from [140.186.70.92] (port=41735 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O2VRO-0001E4-2X
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 16:13:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2VRG-0003d2-0Y
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 16:13:33 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:39095
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2SVA-000163-V6
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 13:05:35 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2SVA-00016t-95
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 17:05:16 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O2SV8-0002m3-8B
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 17:05:16 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: dc70d8fdaa6bbadfc4069caef758f4d5cfaa8741
X-Git-Newrev: ca14a85fac9d465bc770699c98fa162168d7bd54
Message-Id: <E1O2SV8-0002m3-8B@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Thu, 15 Apr 2010 17:05:15 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-137-gca14a85
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, 15 Apr 2010 20:13:40 -0000

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

The branch, master has been updated
       via  ca14a85fac9d465bc770699c98fa162168d7bd54 (commit)
       via  b9aa4ca51c64da117ca372dae34501544c1c5512 (commit)
       via  28f364b73b0631ef93153c6f1951f87f808ba208 (commit)
       via  be52d78a003b9a4d4b40ca3727273beb59bbc66b (commit)
       via  53fe1d953e77c08d51be14b0a6e37ccdfe31c75c (commit)
       via  00d9db47fec81591111a5569e333cc0fa59166e7 (commit)
       via  8accbb8a011f574daff78e97c01f72b674dcdf7f (commit)
      from  dc70d8fdaa6bbadfc4069caef758f4d5cfaa8741 (commit)

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

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


commit ca14a85fac9d465bc770699c98fa162168d7bd54
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 15 19:04:51 2010 +0200

    Use the `checked' namespace and adjust the code accordingly

diff --git a/myserver/include/base/socket_pair/socket_pair.h b/myserver/include/base/socket_pair/socket_pair.h
index 7c29e91..a262d9b 100644
--- a/myserver/include/base/socket_pair/socket_pair.h
+++ b/myserver/include/base/socket_pair/socket_pair.h
@@ -44,6 +44,8 @@ public:
   int readHandle (Handle*);
   int writeHandle (Handle);
 
+  /* Reset the fd's without close them.  */
+  void resetHandles (){handles[0] = handles[1] = -1;}
 protected:
   SocketHandle handles[2];
 };
diff --git a/myserver/po/Makevars b/myserver/po/Makevars
index 32692ab..60a44cc 100644
--- a/myserver/po/Makevars
+++ b/myserver/po/Makevars
@@ -1,3 +1,5 @@
+# -*- buffer-read-only: t -*- vi: set ro:
+# DO NOT EDIT! GENERATED AUTOMATICALLY!
 # Makefile variables for PO directory in any package using GNU gettext.
 
 # Usually the message domain is the same as the package name.
@@ -8,7 +10,12 @@ subdir = po
 top_builddir = ..
 
 # These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ \
+          \
+ --flag=_:1:pass-c-format\
+ --flag=N_:1:pass-c-format\
+ --flag=error:3:c-format --flag=error_at_line:5:c-format\
+ $${end_of_xgettext_options+}
 
 # This is the copyright holder that gets inserted into the header of the
 # $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
@@ -34,8 +41,8 @@ COPYRIGHT_HOLDER = Free Software Foundation, Inc.
 # It can be your email address, or a mailing list address where translators
 # can write to without being subscribed, or the URL of a web page through
 # which the translators can contact you.
-MSGID_BUGS_ADDRESS =
+MSGID_BUGS_ADDRESS = bug-myserver@gnu.org
 
 # This is the list of locale categories, beyond LC_MESSAGES, for which the
 # message catalogs shall be used.  It is usually empty.
-EXTRA_LOCALE_CATEGORIES =
+EXTRA_LOCALE_CATEGORIES = 
diff --git a/myserver/src/base/base64/mime_utils.cpp b/myserver/src/base/base64/mime_utils.cpp
index d42f232..c4f47f0 100644
--- a/myserver/src/base/base64/mime_utils.cpp
+++ b/myserver/src/base/base64/mime_utils.cpp
@@ -18,6 +18,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include "myserver.h"
 #include <include/base/base64/mime_utils.h>
+#include <include/base/exceptions/checked.h>
 
 #ifndef WIN32
 # include <ctype.h>
@@ -456,7 +457,7 @@ char* CQPUtils::expandBuffer (char *buffer, int UsedSize, int *BufSize,
   if (UsedSize >= *BufSize - AddVal)
   {
     *BufSize += BufAdd;
-    return (char*)gnulib::realloc (buffer, *BufSize * sizeof (char));
+    return (char*) checked::realloc (buffer, *BufSize * sizeof (char));
   }
   return buffer;
 }
diff --git a/myserver/src/base/exceptions/checked.cpp b/myserver/src/base/exceptions/checked.cpp
index f09df20..e63d866 100644
--- a/myserver/src/base/exceptions/checked.cpp
+++ b/myserver/src/base/exceptions/checked.cpp
@@ -63,7 +63,7 @@ namespace checked
 
   int pipe2 (int pipefd[2], int flags)
   {
-    return checkError (pipe2 (pipefd, flags));
+    return checkError (gnulib::pipe2 (pipefd, flags));
   }
 
   int fstat (int fd, struct stat *buf)
diff --git a/myserver/src/base/file/file.cpp b/myserver/src/base/file/file.cpp
index c5382db..bc67e92 100644
--- a/myserver/src/base/file/file.cpp
+++ b/myserver/src/base/file/file.cpp
@@ -21,6 +21,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <include/base/utility.h>
 #include <include/base/string/stringutils.h>
 #include <include/base/file/files_utility.h>
+#include <include/base/exceptions/checked.h>
 
 #include <fcntl.h>
 #include <unistd.h>
@@ -97,7 +98,7 @@ int File::writeToFile (const char* buffer, u_long buffersize, u_long* nbw)
     return -1;
   }
 
-  ret = gnulib::write (handle, buffer, buffersize);
+  ret = checked::write (handle, buffer, buffersize);
   if (ret < 0)
     return ret;
 
@@ -160,9 +161,9 @@ int File::openFile (const char* nfilename, u_long opt)
     flags |= O_APPEND;
 
   if (exists)
-    handle = gnulib::open (filename.c_str (), O_APPEND | flags);
+    handle = checked::open (filename.c_str (), O_APPEND | flags);
   else
-    handle = gnulib::open (filename.c_str (), O_CREAT | flags, S_IRUSR | S_IWUSR);
+    handle = checked::open (filename.c_str (), O_CREAT | flags, S_IRUSR | S_IWUSR);
 
   try
     {
@@ -174,7 +175,7 @@ int File::openFile (const char* nfilename, u_long opt)
           }
  
       if (opt & File::TEMPORARY)
-        if (gnulib::unlink (filename.c_str ()))
+        if (checked::unlink (filename.c_str ()))
           {
             close ();
             return -1;
@@ -266,9 +267,9 @@ int File::close ()
   if (handle != -1)
     {
       if (opt & File::TEMPORARY_DELAYED)
-        gnulib::unlink (filename.c_str ());
-      ret = gnulib::fsync (handle);
-      ret |= gnulib::close (handle);
+        checked::unlink (filename.c_str ());
+      ret = checked::fsync (handle);
+      ret |= checked::close (handle);
     }
 
   filename.clear ();
@@ -285,7 +286,7 @@ u_long File::getFileSize ()
 {
   u_long ret;
   struct stat fStats;
-  ret = gnulib::fstat (handle, &fStats);
+  ret = checked::fstat (handle, &fStats);
   if (ret)
     return (u_long)(-1);
   else
diff --git a/myserver/src/base/file/files_utility.cpp b/myserver/src/base/file/files_utility.cpp
index d6a1384..e61aa3c 100644
--- a/myserver/src/base/file/files_utility.cpp
+++ b/myserver/src/base/file/files_utility.cpp
@@ -43,6 +43,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <sstream>
 #include <memory>
 
+#include <include/base/exceptions/checked.h>
+
 using namespace std;
 
 string FilesUtility::tmpPath;
@@ -138,7 +140,7 @@ int FilesUtility::getPathRecursionLevel (const char* path)
  */
 int FilesUtility::renameFile (const char* before, const char* after)
 {
-  return gnulib::rename (before, after);
+  return checked::rename (before, after);
 }
 
 /*!
@@ -211,7 +213,7 @@ int FilesUtility::copyFile (File& src, File& dest)
 int FilesUtility::deleteFile (const char *filename)
 {
   int ret;
-  ret = gnulib::remove (filename);
+  ret = checked::remove (filename);
 
   if (ret && errno == ENOENT)
     ret = 0;
@@ -251,7 +253,7 @@ int FilesUtility::isLink (const char* filename)
   return 0;
 #else
   struct stat F_Stats;
-  int ret = gnulib::lstat (filename, &F_Stats);
+  int ret = checked::lstat (filename, &F_Stats);
   if (ret < 0)
     return 0;
 
@@ -358,7 +360,7 @@ time_t FilesUtility::getLastAccTime (const char *filename)
 int FilesUtility::chown (const char* filename, string &uid, string &gid)
 {
 #ifndef WIN32
-  return gnulib::chown (filename, Process::getUid (uid.c_str ()),
+  return checked::chown (filename, Process::getUid (uid.c_str ()),
                         Process::getGid (gid.c_str ())) ? 1 : 0;
 #endif
   return 0;
@@ -527,7 +529,7 @@ int FilesUtility::getShortFileName (char *filePath, char *out, int buffersize)
  * Return non-zero on errors.
  * \param fileName The buffer to use.
  * \param size The new buffer size.
- * \param dontRealloc Don't gnulib::realloc a new buffer.
+ * \param dontRealloc Don't checked::realloc a new buffer.
  */
 int FilesUtility::completePath (char **fileName, int *size, int dontRealloc)
 {
@@ -648,7 +650,7 @@ int FilesUtility::mkdir (const char *path)
 #ifdef WIN32
   return CreateDirectory (path, NULL) ? 0 : -1;
 #else
-  return gnulib::mkdir (path, S_IRUSR | S_IWUSR);
+  return checked::mkdir (path, S_IRUSR | S_IWUSR);
 #endif
 }
 
@@ -662,7 +664,7 @@ int FilesUtility::rmdir (const char *path)
 #ifdef WIN32
   return RemoveDirectory (path) ? 0 : -1;
 #else
-  return gnulib::rmdir (path);
+  return checked::rmdir (path);
 #endif
 }
 
diff --git a/myserver/src/base/pipe/pipe.cpp b/myserver/src/base/pipe/pipe.cpp
index d067ce0..e70e912 100644
--- a/myserver/src/base/pipe/pipe.cpp
+++ b/myserver/src/base/pipe/pipe.cpp
@@ -36,6 +36,9 @@
 #include <string>
 #include <sstream>
 
+
+#include <include/base/exceptions/checked.h>
+
 using namespace std;
 
 /*!
@@ -73,7 +76,7 @@ int Pipe::read (char* buffer, u_long len, u_long *nbr)
  */
 int Pipe::create (bool readPipe)
 {
-  return gnulib::pipe2 (handles, 0);
+  return checked::pipe2 (handles, 0);
 }
 
 /*!
@@ -85,7 +88,7 @@ int Pipe::create (bool readPipe)
 int Pipe::write (const char* buffer, u_long len, u_long *nbw)
 {
   *nbw = 0;
-  int ret = gnulib::write (handles[1], buffer, len);
+  int ret = checked::write (handles[1], buffer, len);
   if (ret == -1)
     {
       terminated = true;
@@ -121,16 +124,16 @@ int Pipe::close ()
 {
   terminated = true;
   if (handles[0] >= 0)
-    gnulib::close (handles[0]);
+    checked::close (handles[0]);
   if (handles[1] >= 0)
-    gnulib::close (handles[1]);
+    checked::close (handles[1]);
 
   handles[0] = handles[1] = -1;
 
   return 0;
 }
 
-class PipeException : public exception
+class PipeExceptionInt : public exception
 {
 public:
   virtual const char *what () const throw ()
@@ -138,7 +141,7 @@ public:
     return message;
   }
 
-  PipeException (string & str)
+  PipeExceptionInt (string & str)
   {
     this->message = str.c_str ();
   }
@@ -154,12 +157,12 @@ private:
  */
 void Pipe::inverted (Pipe& pipe)
 {
-  pipe.handles[0] = gnulib::dup (handles[1]);
-  pipe.handles[1] = gnulib::dup (handles[0]);
+  pipe.handles[0] = checked::dup (handles[1]);
+  pipe.handles[1] = checked::dup (handles[0]);
   if (pipe.handles[0] < 0 || pipe.handles[1] < 0)
     {
       string err (_("Internal error"));
-      throw PipeException (err);
+      throw PipeExceptionInt (err);
     }
 }
 
@@ -181,7 +184,7 @@ void Pipe::closeRead ()
 {
   terminated = true;
   if (handles[0] >= 0)
-    gnulib::close (handles[0]);
+    checked::close (handles[0]);
   handles[0] = -1;
 }
 
@@ -192,7 +195,7 @@ void Pipe::closeWrite ()
 {
   terminated = true;
   if (handles[1] >= 0)
-    gnulib::close (handles[1]);
+    checked::close (handles[1]);
   handles[1] = -1;
 }
 
@@ -214,7 +217,7 @@ int Pipe::waitForData (int sec, int usec)
 
   FD_SET (handles[0], &readfds);
 
-  ret = gnulib::select (handles[0] + 1, &readfds, NULL, NULL, &tv);
+  ret = checked::select (handles[0] + 1, &readfds, NULL, NULL, &tv);
 
   if (ret == -1 || ret == 0)
     return 0;
diff --git a/myserver/src/base/process/fork_server.cpp b/myserver/src/base/process/fork_server.cpp
index f3f25cf..f2f2934 100644
--- a/myserver/src/base/process/fork_server.cpp
+++ b/myserver/src/base/process/fork_server.cpp
@@ -21,6 +21,8 @@
 #include <include/base/file/files_utility.h>
 #include <include/base/utility.h>
 
+#include <include/base/exceptions/checked.h>
+
 #ifndef WIN32
 # include <unistd.h>
 # include <sys/wait.h>
@@ -205,13 +207,13 @@ int ForkServer::handleRequest (Socket *sock)
   delete [] chroot;
 
   if (flags & FLAG_USE_IN)
-    gnulib::close (stdIn);
+    checked::close (stdIn);
 
   if (flags & FLAG_USE_OUT)
-    gnulib::close (stdOut);
+    checked::close (stdOut);
 
   if (flags & FLAG_USE_ERR)
-    gnulib::close (stdErr);
+    checked::close (stdErr);
 #endif
 
   return 0;
@@ -349,10 +351,17 @@ void ForkServer::killServer ()
 {
   u_long nbw;
   UnixSocket s;
-  s.socket ();
-  s.connect (socketPath.c_str ());
-  s.write ("e", 1, &nbw);
-  s.close ();
+  try
+    {
+      s.socket ();
+      s.connect (socketPath.c_str ());
+      s.write ("e", 1, &nbw);
+      s.close ();
+    }
+  catch (...)
+    {
+
+    }
 }
 
 /*!
diff --git a/myserver/src/base/process/process.cpp b/myserver/src/base/process/process.cpp
index 2f08615..e8c992e 100644
--- a/myserver/src/base/process/process.cpp
+++ b/myserver/src/base/process/process.cpp
@@ -25,6 +25,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <stdlib.h>
 #include <stdio.h>
 
+#include <include/base/exceptions/checked.h>
+
 #ifndef WIN32
 # include <unistd.h>
 # include <signal.h>
@@ -265,28 +267,28 @@ int Process::exec (StartProcInfo* spi, bool waitEnd)
         exit (1);
 
       if ((long)spi->stdOut == -1)
-        spi->stdOut = gnulib::open ("/dev/null", O_WRONLY);
+        spi->stdOut = checked::open ("/dev/null", O_WRONLY);
 
       if ((long)spi->stdError == -1)
-        spi->stdError = gnulib::open ("/dev/null", O_WRONLY);
+        spi->stdError = checked::open ("/dev/null", O_WRONLY);
 
-      gnulib::close (0);
+      checked::close (0);
 
       if (spi->stdIn != -1)
         {
-          if (gnulib::dup2 (spi->stdIn, 0) == -1)
+          if (checked::dup2 (spi->stdIn, 0) == -1)
             exit (1);
-          gnulib::close (spi->stdIn);
+          checked::close (spi->stdIn);
         }
 
-      gnulib::close (1);
+      checked::close (1);
 
-      if (gnulib::dup2 (spi->stdOut, 1) == -1)
+      if (checked::dup2 (spi->stdOut, 1) == -1)
         exit (1);
 
-      gnulib::close (2);
+      checked::close (2);
 
-      if (gnulib::dup2 (spi->stdError, 2) == -1)
+      if (checked::dup2 (spi->stdError, 2) == -1)
         exit (1);
 
       if (spi->handlesToClose)
@@ -294,16 +296,15 @@ int Process::exec (StartProcInfo* spi, bool waitEnd)
           FileHandle* h = spi->handlesToClose;
           while (*h)
             {
-              gnulib::close (*h);
+              checked::close (*h);
               h++;
             }
         }
 
-      execve ((const char*)args[0],
-              (char* const*)args, (char* const*) envp);
+      execve ((const char*) args[0],
+              (char* const*) args, (char* const*) envp);
 
     exit (1);
-
   }
 
   if (waitEnd)
@@ -534,11 +535,11 @@ int Process::setAdditionalGroups (u_long len, u_long *groups)
 
   for (i = 0; i < len; i++)
     if (groups)
-      gids[i] = (gid_t)groups[i];
+      gids[i] = (gid_t) groups[i];
     else
-      gids[i] = (gid_t)0;
+      gids[i] = (gid_t) 0;
 
-  ret = setgroups ((size_t)0, gids) == -1;
+  ret = setgroups ((size_t) 0, gids) == -1;
 
   delete [] gids;
 
diff --git a/myserver/src/base/read_directory/read_directory.cpp b/myserver/src/base/read_directory/read_directory.cpp
index 8e02794..4f4dd21 100644
--- a/myserver/src/base/read_directory/read_directory.cpp
+++ b/myserver/src/base/read_directory/read_directory.cpp
@@ -28,6 +28,7 @@
 # include <fcntl.h>
 #endif
 
+#include <include/base/exceptions/checked.h>
 
 using namespace std;
 
@@ -132,7 +133,7 @@ int ReadDirectory::find (const char *filename)
        if (dirName[dirName.length () - 1] == '/')
          dirName.erase (dirName.length () - 1);
 
-       dh = gnulib::opendir (dirName.c_str ());
+       dh = checked::opendir (dirName.c_str ());
 
        if (dh == NULL)
          return -1;
@@ -156,7 +157,7 @@ int ReadDirectory::find (const char *filename)
 # endif
 
 # ifdef HAVE_FSTATAT
-   if (gnulib::fstatat (dirfd (dh), name.c_str (), &stats, 0))
+   if (checked::fstatat (dirfd (dh), name.c_str (), &stats, 0))
      return -1;
 # else
    string tempName;
@@ -196,7 +197,7 @@ int ReadDirectory::findclose ()
   if (!dh)
     return -1;
 
-  gnulib::closedir (dh);
+  checked::closedir (dh);
   dh = NULL;
   return 0;
 #endif
diff --git a/myserver/src/base/safetime/safetime.cpp b/myserver/src/base/safetime/safetime.cpp
index 3bb1eeb..e4ed781 100644
--- a/myserver/src/base/safetime/safetime.cpp
+++ b/myserver/src/base/safetime/safetime.cpp
@@ -27,6 +27,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # include <stdio.h>
 #endif
 
+#include <include/base/exceptions/checked.h>
 
 #ifndef WIN32
 # if !HAVE_LOCALTIME_R
@@ -68,7 +69,7 @@ struct tm *myserver_localtime (const time_t *timep, tm* res)
   memcpy (res, localtime (timep), sizeof (tm));
   return res;
 #elif HAVE_LOCALTIME_R
-  return gnulib::localtime_r (timep, res);
+  return checked::localtime_r (timep, res);
 #else
 
   mutex.lock ();
@@ -90,7 +91,7 @@ struct tm *myserver_gmtime (const time_t *timep, tm* res)
   return res;
 
 #elif HAVE_LOCALTIME_R
-  return gnulib::gmtime_r (timep, res);
+  return checked::gmtime_r (timep, res);
 #else
 
   mutex.lock ();
diff --git a/myserver/src/base/socket/socket.cpp b/myserver/src/base/socket/socket.cpp
index f2bab81..5bce4af 100644
--- a/myserver/src/base/socket/socket.cpp
+++ b/myserver/src/base/socket/socket.cpp
@@ -32,6 +32,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # include <arpa/inet.h>
 #endif
 
+#include <include/base/exceptions/checked.h>
 
 #include <sstream>
 
@@ -94,7 +95,7 @@ int Socket::operator=(Socket* s)
  */
 int Socket::socket (int af, int type, int protocol)
 {
-  fd = gnulib::socket (af, type, protocol);
+  fd = checked::socket (af, type, protocol);
   return fd;
 }
 
@@ -168,7 +169,7 @@ int Socket::bind (MYSERVER_SOCKADDR* sa, int namelen)
       )
     return -1;
 
-  return gnulib::bind (fd, (struct sockaddr*) sa, namelen);
+  return checked::bind (fd, (struct sockaddr*) sa, namelen);
 }
 
 /*!
@@ -176,7 +177,7 @@ int Socket::bind (MYSERVER_SOCKADDR* sa, int namelen)
  */
 int Socket::listen (int max)
 {
-  return gnulib::listen (fd, max);
+  return checked::listen (fd, max);
 }
 
 /*!
@@ -184,7 +185,7 @@ int Socket::listen (int max)
  */
 Socket* Socket::accept (MYSERVER_SOCKADDR* sa, socklen_t* sockaddrlen)
 {
-  int acceptedHandle = gnulib::accept (fd, (struct sockaddr *)sa,
+  int acceptedHandle = checked::accept (fd, (struct sockaddr *)sa,
                                        sockaddrlen);
 
   if (acceptedHandle >= 0)
@@ -200,7 +201,7 @@ int Socket::close ()
 {
   int ret = -1;
   if (fd >= 0)
-    ret = gnulib::close (fd);
+    ret = checked::close (fd);
 
   fd = -1;
   return ret;
@@ -227,7 +228,7 @@ MYSERVER_HOSTENT *Socket::gethostbyname (const char *hostname)
  */
 int Socket::shutdown (int how)
 {
-  return gnulib::shutdown (fd, how);
+  return checked::shutdown (fd, how);
 }
 
 /*!
@@ -236,7 +237,7 @@ int Socket::shutdown (int how)
 int  Socket::setsockopt (int level, int optname,
                        const char *optval, int optlen)
 {
-  return gnulib::setsockopt (fd, level, optname, optval, optlen);
+  return checked::setsockopt (fd, level, optname, optval, optlen);
 }
 
 /*!
@@ -320,7 +321,7 @@ int Socket::getLocalIPsList (string &out)
  */
 int Socket::rawSend (const char* buffer, int len, int flags)
 {
-  return gnulib::send (fd, buffer, len, flags);
+  return checked::send (fd, buffer, len, flags);
 }
 
 /*!
@@ -373,7 +374,7 @@ int Socket::send (const char* buffer, int len, int flags)
  */
 int Socket::ioctlsocket (long cmd, unsigned long* argp)
 {
-  return gnulib::ioctl (fd, cmd, argp);
+  return checked::checkError (gnulib::ioctl (fd, cmd, argp));
 }
 
 /*!
@@ -409,7 +410,7 @@ int Socket::connect (const char* host, u_short port)
     }
 
   memset (szPort, 0, sizeof (char)*10);
-  gnulib::snprintf (szPort, 10, "%d", port);
+  checked::snprintf (szPort, 10, "%d", port);
 
   if (aiHints.ai_family != 0)
     nGetaddrinfoRet = getaddrinfo (host, NULL, &aiHints, &pHostInfo);
@@ -521,7 +522,7 @@ int Socket::connect (MYSERVER_SOCKADDR* sa, int na)
  )
     return -1;
 
-  return gnulib::connect (fd, (sockaddr *) sa, na);
+  return checked::connect (fd, (sockaddr *) sa, na);
 }
 
 /*!
@@ -548,7 +549,7 @@ int Socket::recv (char* buffer,int len,int flags)
 {
   int err = 0;
 
-  err = gnulib::recv (fd, buffer, len, flags);
+  err = checked::recv (fd, buffer, len, flags);
 
   if ( err < 0 && errno == EAGAIN && isNonBlocking)
     return 0;
@@ -593,7 +594,7 @@ int Socket::setNonBlocking (int nonBlocking)
   u_long nonblock = nonBlocking ? 1 : 0;
   ret = ioctlsocket (FIONBIO, &nonblock);
 #else
-  flags = gnulib::fcntl (fd, F_GETFL, 0);
+  flags = checked::checkError (gnulib::fcntl (fd, F_GETFL, 0));
   if (flags < 0)
     return -1;
 
@@ -602,7 +603,7 @@ int Socket::setNonBlocking (int nonBlocking)
   else
     flags &= ~O_NONBLOCK;
 
-  ret = gnulib::fcntl (fd, F_SETFL, flags);
+  ret = checked::checkError (gnulib::fcntl (fd, F_SETFL, flags));
 
   isNonBlocking = nonBlocking ? true : false;
 #endif
@@ -615,7 +616,7 @@ int Socket::setNonBlocking (int nonBlocking)
  */
 int Socket::gethostname (char *name, int namelen)
 {
-  return gnulib::gethostname (name,namelen);
+  return checked::gethostname (name,namelen);
 }
 
 /*!
@@ -624,7 +625,7 @@ int Socket::gethostname (char *name, int namelen)
 int Socket::getsockname (MYSERVER_SOCKADDR *ad, int *namelen)
 {
   socklen_t len =(socklen_t) *namelen;
-  int ret = gnulib::getsockname (fd, (struct sockaddr *)ad, &len);
+  int ret = checked::getsockname (fd, (struct sockaddr *)ad, &len);
   *namelen = (int)len;
   return ret;
 }
@@ -659,7 +660,7 @@ int Socket::dataAvailable (int sec, int usec)
   FD_ZERO (&readfds);
   FD_SET (fd, &readfds);
 
-  ret = gnulib::select (fd + 1, &readfds, NULL, NULL, &tv);
+  ret = checked::select (fd + 1, &readfds, NULL, NULL, &tv);
   if (ret <= 0)
     return 0;
 
diff --git a/myserver/src/base/socket/ssl_socket.cpp b/myserver/src/base/socket/ssl_socket.cpp
index 9804890..defde91 100644
--- a/myserver/src/base/socket/ssl_socket.cpp
+++ b/myserver/src/base/socket/ssl_socket.cpp
@@ -21,6 +21,8 @@
 #include <include/base/utility.h>
 #include "include/base/socket/ssl_socket.h"
 
+#include <include/base/exceptions/checked.h>
+
 #include <string.h>
 #include <stdio.h>
 #include <sys/types.h>
@@ -68,6 +70,7 @@ SslSocket::SslSocket ()
 SslSocket::~SslSocket ()
 {
   freeSSL ();
+  fd = -1;
 }
 
 /*!
@@ -75,8 +78,7 @@ SslSocket::~SslSocket ()
  */
 int SslSocket::close ()
 {
-  freeSSL ();
-  return Socket::close ();
+  return freeSSL ();
 }
 
 /*!
@@ -87,7 +89,7 @@ int SslSocket::shutdown (int how)
   if (sslConnection)
     SSL_shutdown (sslConnection);
 
-  return gnulib::shutdown (fd, how);
+  return checked::shutdown (fd, how);
 }
 
 /*!
@@ -131,7 +133,7 @@ int SslSocket::connect (MYSERVER_SOCKADDR* sa, int na)
     return -1;
 
   /*! Do the TCP connection.  */
-  if (gnulib::connect (fd, (sockaddr *) sa, na))
+  if (checked::connect (fd, (sockaddr *) sa, na))
     {
       SSL_CTX_free (sslContext);
       sslContext = 0;
diff --git a/myserver/src/base/socket_pair/socket_pair.cpp b/myserver/src/base/socket_pair/socket_pair.cpp
index 868b527..c7243c6 100644
--- a/myserver/src/base/socket_pair/socket_pair.cpp
+++ b/myserver/src/base/socket_pair/socket_pair.cpp
@@ -43,6 +43,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <string>
 #include <sstream>
 
+#include <include/base/exceptions/checked.h>
+
 using namespace std;
 
 
@@ -75,7 +77,7 @@ int SocketPair::create ()
     return -1;
 
   handles[0] = handles[1] = -1;
-  listener = gnulib::socket (AF_INET, SOCK_STREAM, 0);
+  listener = checked::socket (AF_INET, SOCK_STREAM, 0);
 
   if (listener < 0)
     return -1;
@@ -85,47 +87,47 @@ int SocketPair::create ()
   addr.sin_addr.s_addr = htonl (0x7f000001);
   addr.sin_port = 0;
 
-  if (gnulib::bind (listener, (struct sockaddr*) &addr, sizeof (addr)) < 0)
+  if (checked::bind (listener, (struct sockaddr*) &addr, sizeof (addr)) < 0)
     {
-      gnulib::close (listener);
+      checked::close (listener);
       return -1;
     }
 
-  if (gnulib::getsockname (listener, (struct sockaddr*) &addr, &addrlen) < 0)
+  if (checked::getsockname (listener, (struct sockaddr*) &addr, &addrlen) < 0)
     {
-      gnulib::close (listener);
+      checked::close (listener);
       return -1;
     }
 
   do
     {
-      if (gnulib::listen (listener, 1) < 0)
+      if (checked::listen (listener, 1) < 0)
         break;
 
-      if ((handles[0] = gnulib::socket (AF_INET, SOCK_STREAM, 0)) < 0)
+      if ((handles[0] = checked::socket (AF_INET, SOCK_STREAM, 0)) < 0)
         break;
 
-      if (gnulib::connect (handles[0], (struct sockaddr*) &addr,
+      if (checked::connect (handles[0], (struct sockaddr*) &addr,
                            sizeof (addr)) < 0)
         break;
 
-      if ((handles[1] = gnulib::accept (listener, NULL, NULL)) < 0)
+      if ((handles[1] = checked::accept (listener, NULL, NULL)) < 0)
         break;
 
       fd = handles[0];
 
-      gnulib::close (listener);
+      checked::close (listener);
       return 0;
     } while (0);
 
-  gnulib::close (listener);
+  checked::close (listener);
 
   if (handles[0] != -1)
-    gnulib::close (handles[0]);
+    checked::close (handles[0]);
 
 
   if (handles[1] != -1)
-    gnulib::close (handles[1]);
+    checked::close (handles[1]);
 
   return -1;
 #endif
@@ -180,8 +182,11 @@ int SocketPair::close ()
  */
 void SocketPair::closeFirstHandle ()
 {
-  Socket sock (handles[0]);
-  sock.close ();
+  if (handles[0] < 0)
+    return;
+
+  checked::close (handles[0]);
+  fd = handles[0] = -1;
 }
 
 /*!
@@ -189,8 +194,11 @@ void SocketPair::closeFirstHandle ()
  */
 void SocketPair::closeSecondHandle ()
 {
-  Socket sock (handles[1]);
-  sock.close ();
+  if (handles[1] < 0)
+    return;
+
+  checked::close (handles[1]);
+  handles[1] = -1;
 }
 
 /*!
diff --git a/myserver/src/base/ssl/ssl.cpp b/myserver/src/base/ssl/ssl.cpp
index f249b22..95c04ba 100644
--- a/myserver/src/base/ssl/ssl.cpp
+++ b/myserver/src/base/ssl/ssl.cpp
@@ -23,6 +23,8 @@
 
 #include <string.h>
 
+#include <include/base/exceptions/checked.h>
+
 #if HAVE_PTHREAD
 # include <pthread.h>
 #endif
diff --git a/myserver/src/base/string/stringutils.cpp b/myserver/src/base/string/stringutils.cpp
index 5a76950..265497e 100644
--- a/myserver/src/base/string/stringutils.cpp
+++ b/myserver/src/base/string/stringutils.cpp
@@ -20,6 +20,8 @@
 #include <include/base/string/stringutils.h>
 #include <include/base/safetime/safetime.h>
 
+#include <include/base/exceptions/checked.h>
+
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>
@@ -309,7 +311,7 @@ time_t getTime (const char* str)
 
   t.tm_isdst = -1;
 
-  return gnulib::mktime (&t);
+  return checked::mktime (&t);
 }
 
 /*!
diff --git a/myserver/src/base/sync/event.cpp b/myserver/src/base/sync/event.cpp
index 20583aa..780f3a8 100644
--- a/myserver/src/base/sync/event.cpp
+++ b/myserver/src/base/sync/event.cpp
@@ -37,6 +37,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # include <sys/wait.h>
 #endif
 
+#include <include/base/exceptions/checked.h>
 
 #include <sys/types.h>
 
@@ -95,7 +96,7 @@ int Event::wait (u_long id, u_long timeout)
   {
     struct timespec ts;
     struct timeval tp;
-    gnulib::gettimeofday (&tp, NULL);
+    checked::gettimeofday (&tp, NULL);
     ts.tv_sec = tp.tv_sec + tp.tv_usec / 1000000 + timeout / 1000;
     ts.tv_nsec = (tp.tv_usec * 1000 + timeout * 1000000) % 1000000000;
 
diff --git a/myserver/src/base/sync/mutex.cpp b/myserver/src/base/sync/mutex.cpp
index f86fe18..09f8217 100644
--- a/myserver/src/base/sync/mutex.cpp
+++ b/myserver/src/base/sync/mutex.cpp
@@ -104,15 +104,7 @@ int Mutex::destroy ()
 int Mutex::lock (u_long /*id*/)
 {
 #ifdef HAVE_PTHREAD
-# ifdef PTHREAD_ALTERNATE_LOCK
   pthread_mutex_lock (&mutex);
-# else
-  while (pthread_mutex_trylock (&mutex) == EBUSY)
-  {
-    Thread::wait (1);
-  }
-# endif
-
 #else
   WaitForSingleObject (mutex, INFINITE);
 #endif
diff --git a/myserver/src/base/unix_socket/unix_socket.cpp b/myserver/src/base/unix_socket/unix_socket.cpp
index 3e76fc3..e130b44 100644
--- a/myserver/src/base/unix_socket/unix_socket.cpp
+++ b/myserver/src/base/unix_socket/unix_socket.cpp
@@ -20,6 +20,8 @@
 #include <include/base/unix_socket/unix_socket.h>
 #include <include/base/utility.h>
 
+#include <include/base/exceptions/checked.h>
+
 #ifdef AF_UNIX
 void UnixSocket::makeAddrInfo (sockaddr_un *info, const char *path)
 {
@@ -52,7 +54,13 @@ int UnixSocket::bind (const char* path)
 
 #ifdef AF_UNIX
   makeAddrInfo (&addr, path);
-  gnulib::unlink (path);
+  try
+    {
+      checked::unlink (path);
+    }
+  catch (...)
+    {
+    }
 
   return Socket::bind ((MYSERVER_SOCKADDR*) &addr, sizeof (sockaddr_un));
 #else
@@ -68,7 +76,7 @@ int UnixSocket::shutdown ()
 {
 #ifdef AF_UNIX
   Socket::shutdown (2);
-  return gnulib::unlink (addr.sun_path);
+  return checked::unlink (addr.sun_path);
 #else
   return -1;
 #endif
diff --git a/myserver/src/base/utility.cpp b/myserver/src/base/utility.cpp
index a7b4653..5df6d69 100644
--- a/myserver/src/base/utility.cpp
+++ b/myserver/src/base/utility.cpp
@@ -41,6 +41,7 @@ extern "C"
 # endif
 #endif
 
+#include <include/base/exceptions/checked.h>
 
 #ifdef WIN32
 # include <direct.h>
@@ -70,7 +71,7 @@ static int initializeCwd ()
   if (currentPath)
     return 0;
 
-  currentPath = gnulib::getcwd (NULL, 0);
+  currentPath = checked::getcwd (NULL, 0);
   if (!currentPath)
     return -1;
 
@@ -145,7 +146,7 @@ char *getdefaultwd (char *path, int len)
 int setcwd (const char *dir)
 {
   int ret;
-  char *tmp = gnulib::strdup (dir);
+  char *tmp = checked::strdup (dir);
   if (!tmp)
     return -1;
 
@@ -204,7 +205,7 @@ u_long getTicks ()
   return GetTickCount ();
 #else
   struct timeval tval;
-  int ret = gnulib::gettimeofday (&tval, 0);
+  int ret = checked::gettimeofday (&tval, 0);
   if (ret == -1)
     return 0;
   return  (tval.tv_sec * 1000) + (tval.tv_usec / 1000);
diff --git a/myserver/src/connections_scheduler/connections_scheduler.cpp b/myserver/src/connections_scheduler/connections_scheduler.cpp
index 0d34e49..2d9c315 100644
--- a/myserver/src/connections_scheduler/connections_scheduler.cpp
+++ b/myserver/src/connections_scheduler/connections_scheduler.cpp
@@ -25,6 +25,7 @@
 #endif
 
 #include <include/connections_scheduler/connections_scheduler.h>
+#include <include/base/exceptions/exceptions.h>
 #include <include/server/server.h>
 
 static DEFINE_THREAD (dispatcher, p)
@@ -35,33 +36,31 @@ static DEFINE_THREAD (dispatcher, p)
   if (da == NULL)
     return NULL;
 
-  da->mutex->lock ();
-  if (!da->terminated)
-    {
-      da->mutex->unlock ();
-      return 0;
-    }
+  if (! da->terminated)
+    return 0;
 
   da->terminated = false;
 
-  da->mutex->unlock ();
-
   while (!da->terminate)
     {
       int res;
 
       da->mutex->lock ();
-      res = event_loop (EVLOOP_ONCE);
-      da->mutex->unlock ();
+      try
+        {
+          res = event_loop (EVLOOP_ONCE);
+          da->mutex->unlock ();
+        }
+      catch (...)
+        {
+          da->mutex->unlock ();
+        }
 
       if (res == 1)
         Thread::wait (10);
     }
 
-  da->mutex->lock ();
   da->terminated = true;
-  da->mutex->unlock ();
-
   return NULL;
 }
 
@@ -80,8 +79,16 @@ void ConnectionsScheduler::newData (short event, SocketHandle handle)
   ConnectionPtr connection = NULL;
 
   connectionsMutex.lock ();
-  connection = connections.get ((int) handle);
-  connectionsMutex.unlock ();
+  try
+    {
+      connection = connections.get ((int) handle);
+      connectionsMutex.unlock ();
+    }
+  catch (...)
+    {
+      connectionsMutex.unlock ();
+      throw;
+    }
 
   if (connection == NULL || server == NULL)
     return;
@@ -166,12 +173,20 @@ static void listenerHandler (int fd, short event, void *arg)
     {
       MYSERVER_SOCKADDRIN asockIn;
       socklen_t asockInLen = sizeof (asockIn);
-      Socket *clientSock;
+      Socket *clientSock = NULL;
       try
         {
           do
             {
-              clientSock = s->serverSocket->accept (&asockIn, &asockInLen);
+              try
+                {
+                  clientSock = s->serverSocket->accept (&asockIn, &asockInLen);
+                }
+              catch (InvalidResourceException & e)
+                {
+                  clientSock = NULL;
+                }
+
               if (s->server && clientSock
                   && s->server->addConnection (clientSock, &asockIn))
                 {
@@ -186,6 +201,11 @@ static void listenerHandler (int fd, short event, void *arg)
         {
           s->server->log (MYSERVER_LOG_MSG_ERROR, _("Error listening on socket %s"),
                           e.what ());
+          throw;
+        }
+      catch (...)
+        {
+          throw;
         }
     }
 
@@ -219,10 +239,18 @@ void ConnectionsScheduler::listener (ConnectionsScheduler::ListenerArg *la)
   listeners.push_front (arg);
 
   eventsSocketMutex.lock ();
-  u_long nbw;
-  dispatcherArg.socketPairWrite.write ("l", 1, &nbw);
-  dispatcherArg.socketPairWrite.write ((const char*) &arg, sizeof (arg), &nbw);
-  eventsSocketMutex.unlock ();
+  try
+    {
+      u_long nbw;
+      dispatcherArg.socketPairWrite.write ("l", 1, &nbw);
+      dispatcherArg.socketPairWrite.write ((const char*) &arg, sizeof (arg), &nbw);
+      eventsSocketMutex.unlock ();
+    }
+  catch (...)
+    {
+      eventsSocketMutex.unlock ();
+      throw;
+    }
 }
 
 /*!
@@ -231,9 +259,16 @@ void ConnectionsScheduler::listener (ConnectionsScheduler::ListenerArg *la)
 void ConnectionsScheduler::removeListener (ConnectionsScheduler::ListenerArg* la)
 {
   eventsMutex.lock ();
-  event_del (&(la->ev));
-  listeners.remove (la);
-  eventsMutex.unlock ();
+  try
+    {
+      event_del (&(la->ev));
+      listeners.remove (la);
+      eventsMutex.unlock ();
+    }
+  catch (...)
+    {
+      eventsMutex.unlock ();
+    }
 }
 
 /*!
@@ -268,8 +303,16 @@ u_long ConnectionsScheduler::getNumTotalConnections ()
 void ConnectionsScheduler::registerConnectionID (ConnectionPtr connection)
 {
   connectionsMutex.lock ();
-  connection->setID (nTotalConnections++);
-  connectionsMutex.unlock ();
+  try
+    {
+      connection->setID (nTotalConnections++);
+      connectionsMutex.unlock ();
+    }
+  catch (...)
+    {
+      connectionsMutex.unlock ();
+      throw;
+    }
 }
 
 /*!
@@ -295,13 +338,7 @@ void ConnectionsScheduler::restart ()
  */
 void ConnectionsScheduler::initialize ()
 {
-  static int initialized = 0;
-
-  if (!initialized)
-    {
-      event_init ();
-      initialized = 1;
-    }
+  event_init ();
 
   dispatcherArg.terminated = true;
   dispatcherArg.terminate = false;
@@ -390,8 +427,16 @@ void ConnectionsScheduler::addReadyConnectionImpl (ConnectionPtr c)
   c->setScheduled (1);
 
   readyMutex.lock ();
-  ready[priority].push (c);
-  readyMutex.unlock ();
+  try
+    {
+      ready[priority].push (c);
+      readyMutex.unlock ();
+    }
+  catch (...)
+    {
+      readyMutex.unlock ();
+      throw;
+    }
 
   if (server)
     server->checkThreadsNumber ();
@@ -437,8 +482,16 @@ void ConnectionsScheduler::addWaitingConnectionImpl (ConnectionPtr c, int lock)
   c->setScheduled (0);
 
   connectionsMutex.lock ();
-  connections.put (socketHandle, c);
-  connectionsMutex.unlock ();
+  try
+    {
+      connections.put (socketHandle, c);
+      connectionsMutex.unlock ();
+    }
+  catch (...)
+    {
+      connectionsMutex.unlock ();
+      throw;
+    }
 
   /*
    * If there is need to obtain the events lock don't block the current
@@ -450,16 +503,22 @@ void ConnectionsScheduler::addWaitingConnectionImpl (ConnectionPtr c, int lock)
     {
       u_long nbw;
       eventsSocketMutex.lock ();
-
-      dispatcherArg.socketPairWrite.write ("c", 1, &nbw);
-      dispatcherArg.socketPairWrite.write ((const char*) &handle,
-                                           sizeof (SocketHandle), &nbw);
-      dispatcherArg.socketPairWrite.write ((const char*) &c,
-                                           sizeof (ConnectionPtr), &nbw);
-      dispatcherArg.socketPairWrite.write ((const char*) &tv,
-                                           sizeof (timeval), &nbw);
-
-      eventsSocketMutex.unlock ();
+      try
+        {
+          dispatcherArg.socketPairWrite.write ("c", 1, &nbw);
+          dispatcherArg.socketPairWrite.write ((const char*) &handle,
+                                               sizeof (SocketHandle), &nbw);
+          dispatcherArg.socketPairWrite.write ((const char*) &c,
+                                               sizeof (ConnectionPtr), &nbw);
+          dispatcherArg.socketPairWrite.write ((const char*) &tv,
+                                               sizeof (timeval), &nbw);
+          eventsSocketMutex.unlock ();
+        }
+      catch (...)
+        {
+          eventsSocketMutex.unlock ();
+          throw;
+        }
     }
   else
     event_once (
@@ -488,27 +547,33 @@ ConnectionPtr ConnectionsScheduler::getConnection ()
     return NULL;
 
   readyMutex.lock ();
-
-  for (int i = 0; i < PRIORITY_CLASSES; i++)
+  try
     {
-      if (currentPriorityDone > currentPriority ||
-          !ready[currentPriority].size ())
+      for (int i = 0; i < PRIORITY_CLASSES; i++)
         {
-          currentPriority = (currentPriority + 1) % PRIORITY_CLASSES;
-          currentPriorityDone = 0;
-        }
+          if (currentPriorityDone > currentPriority ||
+              !ready[currentPriority].size ())
+            {
+              currentPriority = (currentPriority + 1) % PRIORITY_CLASSES;
+              currentPriorityDone = 0;
+            }
 
-      if (ready[currentPriority].size ())
-        {
-          ret = ready[currentPriority].front ();
-          ret->setScheduled (0);
-          ready[currentPriority].pop ();
-          currentPriorityDone++;
-          break;
+          if (ready[currentPriority].size ())
+            {
+              ret = ready[currentPriority].front ();
+              ret->setScheduled (0);
+              ready[currentPriority].pop ();
+              currentPriorityDone++;
+              break;
+            }
         }
+      readyMutex.unlock ();
+    }
+  catch (...)
+    {
+      readyMutex.unlock ();
+      throw;
     }
-
-  readyMutex.unlock ();
   return ret;
 }
 
@@ -529,8 +594,16 @@ void ConnectionsScheduler::release ()
     readySemaphore->unlock ();
 
   eventsSocketMutex.lock ();
-  dispatcherArg.socketPairWrite.write ("r", 1, &nbw);
-  eventsSocketMutex.unlock ();
+  try
+    {
+      dispatcherArg.socketPairWrite.write ("r", 1, &nbw);
+      eventsSocketMutex.unlock ();
+    }
+  catch (...)
+    {
+      eventsSocketMutex.unlock ();
+      throw;
+    }
 
   if (dispatchedThreadId)
     Thread::join (dispatchedThreadId);
@@ -538,23 +611,24 @@ void ConnectionsScheduler::release ()
   terminateConnections ();
 
   eventsMutex.lock ();
-
-  event_del (&(dispatcherArg.loopEvent));
-
-  list<ListenerArg*>::iterator it = listeners.begin ();
-
-  while (it != listeners.end ())
+  try
     {
-      event_del (&((*it)->ev));
-      delete *it;
-      it++;
+      event_del (&(dispatcherArg.loopEvent));
+      list<ListenerArg*>::iterator it = listeners.begin ();
+      while (it != listeners.end ())
+        {
+          event_del (&((*it)->ev));
+          delete *it;
+          it++;
+        }
+      listeners.clear ();
+      eventsMutex.unlock ();
+    }
+  catch (...)
+    {
+      eventsMutex.unlock ();
+      throw;
     }
-
-  listeners.clear ();
-
-  eventsMutex.unlock ();
-
-  dispatcherArg.socketPair.close ();
 }
 
 /*!
@@ -567,12 +641,18 @@ void ConnectionsScheduler::getConnections (list<ConnectionPtr> &out)
   out.clear ();
 
   connectionsMutex.lock ();
-
-  HashMap<SocketHandle, ConnectionPtr>::Iterator it = connections.begin ();
-  for (; it != connections.end (); it++)
-    out.push_back (*it);
-
-  connectionsMutex.unlock ();
+  try
+    {
+      HashMap<SocketHandle, ConnectionPtr>::Iterator it = connections.begin ();
+      for (; it != connections.end (); it++)
+        out.push_back (*it);
+      connectionsMutex.unlock ();
+    }
+  catch (...)
+    {
+      connectionsMutex.unlock ();
+      throw;
+    }
 }
 
 /*!
@@ -589,9 +669,17 @@ u_long ConnectionsScheduler::getNumAliveConnections ()
 void ConnectionsScheduler::removeConnection (ConnectionPtr connection)
 {
   connectionsMutex.lock ();
-  if (connection->socket)
-    connections.remove ((SocketHandle)connection->socket->getHandle ());
-  connectionsMutex.unlock ();
+  try
+    {
+      if (connection->socket)
+        connections.remove (connection->socket->getHandle ());
+      connectionsMutex.unlock ();
+    }
+  catch (...)
+    {
+      connectionsMutex.unlock ();
+      throw;
+    }
 }
 
 /*!
@@ -600,11 +688,9 @@ void ConnectionsScheduler::removeConnection (ConnectionPtr connection)
 void ConnectionsScheduler::terminateConnections ()
 {
   int i;
-
+  connectionsMutex.lock ();
   try
     {
-      connectionsMutex.lock ();
-
       HashMap<SocketHandle, ConnectionPtr>::Iterator it = connections.begin ();
       for (; it != connections.end (); it++)
         {
@@ -612,6 +698,7 @@ void ConnectionsScheduler::terminateConnections ()
           if (c->allowDelete (true) && c->socket)
             c->socket->close ();
         }
+      connectionsMutex.unlock ();
     }
   catch (...)
     {
@@ -621,15 +708,19 @@ void ConnectionsScheduler::terminateConnections ()
 
   connections.clear ();
 
-  connectionsMutex.unlock ();
-
   readyMutex.lock ();
-
-  for (i = 0; i < PRIORITY_CLASSES; i++)
-    while (ready[i].size ())
-      ready[i].pop ();
-
-  readyMutex.unlock ();
+  try
+  {
+    for (i = 0; i < PRIORITY_CLASSES; i++)
+      while (ready[i].size ())
+        ready[i].pop ();
+    readyMutex.unlock ();
+  }
+  catch (...)
+    {
+      readyMutex.unlock ();
+      throw;
+    }
 }
 
 /*!
@@ -639,20 +730,17 @@ int ConnectionsScheduler::accept (ConnectionsSchedulerVisitor* visitor, void* ar
 {
   int ret = 0;
   connectionsMutex.lock ();
-
   try
     {
       for (HashMap<SocketHandle, ConnectionPtr>::Iterator it =
              connections.begin (); it != connections.end ()  && !ret; it++)
         visitor->visitConnection (*it, args);
+      connectionsMutex.unlock ();
     }
   catch (...)
     {
       connectionsMutex.unlock ();
       return 1;
     }
-
-  connectionsMutex.unlock ();
-
   return ret;
 }
diff --git a/myserver/src/log/log_manager.cpp b/myserver/src/log/log_manager.cpp
index e47baf1..eb142b8 100644
--- a/myserver/src/log/log_manager.cpp
+++ b/myserver/src/log/log_manager.cpp
@@ -77,14 +77,21 @@ int
 LogManager::clear ()
 {
   mutex->lock ();
-  map<string, LogStream*>::iterator it;
-  for (it = logStreams.begin (); it != logStreams.end (); it++)
+  try
     {
-      delete it->second;
+      map<string, LogStream*>::iterator it;
+      for (it = logStreams.begin (); it != logStreams.end (); it++)
+        {
+          delete it->second;
+        }
+      logStreams.clear ();
+      owners.clear ();
+      logStreamOwners.clear ();
+    }
+  catch (...)
+    {
+      mutex->unlock ();
     }
-  logStreams.clear ();
-  owners.clear ();
-  logStreamOwners.clear ();
   mutex->unlock ();
   return !empty ();
 }
@@ -108,36 +115,44 @@ int
 LogManager::add (const void *owner, string type, string location,
                  list<string>& filters, u_long cycle)
 {
-  mutex->lock ();
   int failure = 1;
-  if (!contains (location))
+  int oldSize;
+  int newSize;
+
+  mutex->lock ();
+  try
     {
-      LogStream* ls = lsf->create (ff, location, filters, cycle);
-      if (ls)
+      if (! contains (location))
         {
-          failure = add (owner) || add (owner, type) ||
-            add (owner, type, location, ls);
+          LogStream* ls = lsf->create (ff, location, filters, cycle);
+          if (ls)
+            {
+              failure = add (owner) || add (owner, type)
+                || add (owner, type, location, ls);
+            }
+          mutex->unlock ();
+          return failure;
         }
-      mutex->unlock ();
-      return failure;
-    }
 
-  int oldSize;
-  int newSize;
-  ostringstream oss;
+      ostringstream oss;
 
-  oldSize = logStreamOwners[location].size ();
-  if (!containsOwner (owner))
-    {
-      failure = add (owner) || add (owner, type) ||
-        add (owner, type, location, logStreams[location]);
+      oldSize = logStreamOwners[location].size ();
+      if (!containsOwner (owner))
+        {
+          failure = add (owner) || add (owner, type) ||
+            add (owner, type, location, logStreams[location]);
+        }
+      else if (!contains (owner, type))
+        {
+          failure = add (owner, type) ||
+            add (owner, type, location, logStreams[location]);
+        }
+      newSize = logStreamOwners[location].size ();
     }
-  else if (!contains (owner, type))
+  catch (...)
     {
-      failure = add (owner, type) ||
-        add (owner, type, location, logStreams[location]);
+      mutex->unlock ();
     }
-  newSize = logStreamOwners[location].size ();
 
   mutex->unlock ();
 
@@ -244,34 +259,40 @@ LogManager::remove (const void *owner)
 
 
   mutex->lock ();
-
-  if (!containsOwner (owner))
+  try
     {
-      mutex->unlock ();
-      return 1;
-    }
+      if (!containsOwner (owner))
+        {
+          mutex->unlock ();
+          return 1;
+        }
 
-  map<string, map<string, LogStream*> >* m = &owners[owner];
-  map<string, map<string, LogStream*> >::iterator it_1;
-  for (it_1 = m->begin (); it_1 != m->end (); it_1++)
-    {
-      map<string, LogStream*> *t = &it_1->second;
-      map<string, LogStream*>::iterator it_2;
-      for (it_2 = t->begin (); it_2 != t->end (); it_2++)
+      map<string, map<string, LogStream*> >* m = &owners[owner];
+      map<string, map<string, LogStream*> >::iterator it_1;
+      for (it_1 = m->begin (); it_1 != m->end (); it_1++)
         {
-          logStreamOwners[it_2->first].remove (owner);
-          if (!logStreamOwners[it_2->first].size ())
+          map<string, LogStream*> *t = &it_1->second;
+          map<string, LogStream*>::iterator it_2;
+          for (it_2 = t->begin (); it_2 != t->end (); it_2++)
             {
-              delete it_2->second;
-              logStreams.erase (it_2->first);
-              logStreamOwners.erase (it_2->first);
+              logStreamOwners[it_2->first].remove (owner);
+              if (!logStreamOwners[it_2->first].size ())
+                {
+                  delete it_2->second;
+                  logStreams.erase (it_2->first);
+                  logStreamOwners.erase (it_2->first);
+                }
             }
+          t->clear ();
         }
-      t->clear ();
+      m->clear ();
+      owners.erase (owner);
+      failure = 0;
+    }
+  catch (...)
+    {
+      mutex->unlock ();
     }
-  m->clear ();
-  owners.erase (owner);
-  failure = 0;
 
   mutex->unlock ();
   return failure;
@@ -534,7 +555,6 @@ LogManager::log (const void* owner, const string & type, const string & location
     return 1;
 
   mutex->lock ();
-
   try
     {
       failure = notify (owner, type, MYSERVER_LOG_EVT_SET_MODE, &level)
@@ -612,14 +632,12 @@ LogManager::log (const void* owner, const string & type, LoggingLevel level,
                  bool ts, bool appendNL, const char *fmt, va_list args)
 {
   int failure = 0;
+  ostringstream oss;
 
   if (level < this->level)
     return 1;
 
   mutex->lock ();
-
-  ostringstream oss;
-
   try
     {
       if (ts)
diff --git a/myserver/src/myserver.cpp b/myserver/src/myserver.cpp
index 59f4874..156d8dd 100644
--- a/myserver/src/myserver.cpp
+++ b/myserver/src/myserver.cpp
@@ -23,6 +23,8 @@
 #include <include/base/process/process.h>
 #include <include/conf/main/xml_main_configuration.h>
 
+#include <include/base/exceptions/checked.h>
+
 #ifdef WIN32
 # include <direct.h>
 #endif
@@ -105,12 +107,12 @@ void registerSignals ()
   sig1.sa_handler = SIG_IGN;
   sig2.sa_handler = Sig_Quit;
   sig3.sa_handler = Sig_Hup;
-  gnulib::sigaction (SIGPIPE, &sig1, NULL);
-  gnulib::sigaction (SIGINT, &sig2, NULL);
-  gnulib::sigaction (SIGTERM, &sig2, NULL);
-  gnulib::sigaction (SIGHUP, &sig3, NULL);
+  checked::sigaction (SIGPIPE, &sig1, NULL);
+  checked::sigaction (SIGINT, &sig2, NULL);
+  checked::sigaction (SIGTERM, &sig2, NULL);
+  checked::sigaction (SIGHUP, &sig3, NULL);
   /* Avoid zombie processes.  */
-  gnulib::sigaction (SIGCHLD, &sa, (struct sigaction *)NULL);
+  checked::sigaction (SIGCHLD, &sa, (struct sigaction *)NULL);
 #else
   SetConsoleMode (GetStdHandle (STD_INPUT_HANDLE), ENABLE_PROCESSED_INPUT);
   SetConsoleCtrlHandler ((PHANDLER_ROUTINE) SignalHandler, TRUE);
@@ -548,18 +550,18 @@ int writePidfile (const char* filename)
       file.append ("/var/run/myserver.pid");
     }
 
-  pidfile = gnulib::open (filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
+  pidfile = checked::open (filename, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
   if (pidfile == -1)
     return -1;
 
   sprintf (buff,"%i\n", pid);
-  ret = gnulib::write (pidfile, buff, strlen (buff));
+  ret = checked::write (pidfile, buff, strlen (buff));
   if (ret == -1)
     {
-      gnulib::close (pidfile);
+      checked::close (pidfile);
       return -1;
     }
-  return gnulib::close (pidfile);
+  return checked::close (pidfile);
 }
 #endif
 
diff --git a/myserver/src/plugin/plugins_manager.cpp b/myserver/src/plugin/plugins_manager.cpp
index 9b2cf35..8d26810 100644
--- a/myserver/src/plugin/plugins_manager.cpp
+++ b/myserver/src/plugin/plugins_manager.cpp
@@ -154,11 +154,14 @@ PluginsManager::preLoad (Server* server, string &resource)
       if (fdir.name[0] == '.')
         continue;
 
-
-      ret = flib.findfirst (dirname.c_str ());
-
-      if (ret == -1)
-        continue;
+      try
+        {
+          ret = flib.findfirst (dirname.c_str ());
+        }
+      catch (...)
+        {
+          continue;
+        }
 
       do
         {
diff --git a/myserver/src/protocol/ftp/ftp.cpp b/myserver/src/protocol/ftp/ftp.cpp
index 2e1a4b9..016f15b 100644
--- a/myserver/src/protocol/ftp/ftp.cpp
+++ b/myserver/src/protocol/ftp/ftp.cpp
@@ -31,6 +31,8 @@
 #include <include/base/string/stringutils.h>
 #include <include/base/mem_buff/mem_buff.h>
 
+#include <include/base/exceptions/checked.h>
+
 #include <include/conf/security/auth_domain.h>
 
 #ifndef WIN32
@@ -58,7 +60,7 @@ void setFtpHost (FtpHost & out, const FtpHost & in)
 void setFtpHost (FtpHost & out, const char *szIn)
 {
   std::stringstream ss;
-  char *szLocalIn = gnulib::strdup (szIn);
+  char *szLocalIn = checked::strdup (szIn);
   char *tok = strtok (szLocalIn, ",.");
   while (tok != NULL)
     {
diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index 61450f7..cfa0f69 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -45,6 +45,7 @@
 #include <include/http_handler/proxy/proxy.h>
 #include <include/http_handler/http_dir/http_dir.h>
 #include <include/protocol/http/http_data_read.h>
+#include <include/base/exceptions/checked.h>
 
 #include <string>
 #include <ostream>
@@ -1171,18 +1172,24 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
             }
         }
 
-      /* If the inputData file was not closed close it.  */
-      if (td->inputData.getHandle ())
+      try
         {
-          td->inputData.close ();
-          FilesUtility::deleteFile (td->inputDataPath);
-        }
+          /* If the inputData file was not closed close it.  */
+          if (td->inputData.getHandle ())
+            {
+              td->inputData.close ();
+              FilesUtility::deleteFile (td->inputDataPath);
+            }
 
-       /* If the outputData file was not closed close it.  */
-      if (td->outputData.getHandle ())
+          /* If the outputData file was not closed close it.  */
+          if (td->outputData.getHandle ())
+            {
+              td->outputData.close ();
+              FilesUtility::deleteFile (td->outputDataPath);
+            }
+        }
+      catch (GenericFileException & e)
         {
-          td->outputData.close ();
-          FilesUtility::deleteFile (td->outputDataPath);
         }
 
       bool keepalive = false;
diff --git a/myserver/src/server/clients_thread.cpp b/myserver/src/server/clients_thread.cpp
index da1aebc..e4fc0af 100644
--- a/myserver/src/server/clients_thread.cpp
+++ b/myserver/src/server/clients_thread.cpp
@@ -30,6 +30,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <include/protocol/control/control_protocol.h>
 #include <include/protocol/ftp/ftp.h>
 
+#include <include/base/exceptions/checked.h>
+
 #ifndef WIN32
 # include <sys/socket.h>
 # include <netinet/in.h>
@@ -100,11 +102,11 @@ DEFINE_THREAD (clients_thread, pParam)
 #ifndef WIN32
   /* Block SigTerm, SigInt, and SigPipe in threads.  */
   sigset_t sigmask;
-  gnulib::sigemptyset (&sigmask);
-  gnulib::sigaddset (&sigmask, SIGPIPE);
-  gnulib::sigaddset (&sigmask, SIGINT);
-  gnulib::sigaddset (&sigmask, SIGTERM);
-  gnulib::sigprocmask (SIG_SETMASK, &sigmask, NULL);
+  checked::sigemptyset (&sigmask);
+  checked::sigaddset (&sigmask, SIGPIPE);
+  checked::sigaddset (&sigmask, SIGINT);
+  checked::sigaddset (&sigmask, SIGTERM);
+  checked::sigprocmask (SIG_SETMASK, &sigmask, NULL);
 #endif
   ClientsThread *ct = (ClientsThread*)pParam;
 
diff --git a/myserver/tests/test_connection.cpp b/myserver/tests/test_connection.cpp
index 30fea07..8ff0640 100644
--- a/myserver/tests/test_connection.cpp
+++ b/myserver/tests/test_connection.cpp
@@ -198,5 +198,4 @@ public:
 
 };
 
-
 CPPUNIT_TEST_SUITE_REGISTRATION ( TestConnection );
diff --git a/myserver/tests/test_connections_scheduler.cpp b/myserver/tests/test_connections_scheduler.cpp
index ba60bcd..81100da 100644
--- a/myserver/tests/test_connections_scheduler.cpp
+++ b/myserver/tests/test_connections_scheduler.cpp
@@ -27,47 +27,47 @@
 
 class MockSocket : public Socket
 {
-  FileHandle handle;
+  Socket s;
 public:
 
   /*
    * BE SURE TO USE VALID HANDLES.
    * 0, 1, 2 are valid ones.
    */
-  MockSocket (FileHandle handle)
+  MockSocket ()
   {
-    this->handle = handle;
+    s.socket (AF_INET, SOCK_STREAM, 0);
   }
 
   virtual int connect (MYSERVER_SOCKADDR*, int)
   {
     return 0;
   }
-	virtual int closesocket ()
+  virtual int closesocket ()
   {
     return 0;
   }
 
-	virtual int shutdown (int how)
+  virtual int shutdown (int how)
   {
     return 0;
   }
-	virtual int recv (char*, int, int, u_long)
+  virtual int recv (char*, int, int, u_long)
   {
     return 0;
   }
-	virtual int recv (char*, int, int)
+  virtual int recv (char*, int, int)
   {
     return 0;
   }
-	virtual u_long bytesToRead ()
+  virtual u_long bytesToRead ()
   {
     return 0;
   }
 
-	virtual Handle getHandle ()
+  virtual Handle getHandle ()
   {
-    return (Handle) handle;
+    return (Handle) s.getHandle ();
   }
 
 };
@@ -132,7 +132,7 @@ public:
     for (u_long i = 0; i < max; i++)
       {
         ConnectionPtr conn = new Connection;
-        conn->socket = new MockSocket ((FileHandle) i);
+        conn->socket = new MockSocket ();
         scheduler->addWaitingConnection (conn);
       }
 
@@ -145,28 +145,28 @@ public:
   void testGetConnections ()
   {
     ConnectionPtr conn = new Connection;
-    conn->socket = new MockSocket ((FileHandle) 1);
+    conn->socket = new MockSocket ();
 
     list<ConnectionPtr> out;
 
     scheduler->getConnections (out);
 
-    CPPUNIT_ASSERT_EQUAL (out.size (), (size_t)0);
+    CPPUNIT_ASSERT_EQUAL (out.size (), (size_t) 0);
 
     conn = new Connection;
-    conn->socket = new MockSocket ((FileHandle) 2);
+    conn->socket = new MockSocket ();
 
     scheduler->addWaitingConnection (conn);
 
     scheduler->getConnections (out);
 
-    CPPUNIT_ASSERT_EQUAL (out.size (), (size_t)1);
+    CPPUNIT_ASSERT_EQUAL (out.size (), (size_t) 1);
   }
 
   void testGetNumTotalConnections ()
   {
     ConnectionPtr conn = new Connection;
-    conn->socket = new MockSocket ((FileHandle) 1);
+    conn->socket = new MockSocket ();
 
     CPPUNIT_ASSERT_EQUAL (scheduler->getNumTotalConnections (), 0ul);
 
@@ -190,7 +190,7 @@ public:
     ConnectionPtr gotConn;
 
     ConnectionPtr conn = new Connection;
-    conn->socket = new MockSocket ((FileHandle) 1);
+    conn->socket = new MockSocket ();
 
     CPPUNIT_ASSERT_EQUAL (scheduler->getNumTotalConnections (), 0ul);
 
@@ -210,7 +210,7 @@ public:
   void testAddNewConnection ()
   {
     ConnectionPtr conn = new Connection;
-    conn->socket = new MockSocket ((FileHandle) 1);
+    conn->socket = new MockSocket ();
 
     CPPUNIT_ASSERT_EQUAL (scheduler->getNumTotalConnections (), 0ul);
 
@@ -229,5 +229,4 @@ public:
 
 };
 
-
 CPPUNIT_TEST_SUITE_REGISTRATION ( TestConnectionsScheduler );
diff --git a/myserver/tests/test_file.cpp b/myserver/tests/test_file.cpp
index 1eb49b8..0330020 100644
--- a/myserver/tests/test_file.cpp
+++ b/myserver/tests/test_file.cpp
@@ -65,7 +65,13 @@ public:
   void tearDown ()
   {
     delete tfile;
-    FilesUtility::deleteFile (fname);
+    try
+      {
+        FilesUtility::deleteFile (fname);
+      }
+    catch (...)
+      {
+      }
   }
 
   void testCreateTemporaryDelayedFile ()
@@ -126,7 +132,13 @@ public:
     CPPUNIT_ASSERT_EQUAL (tfile->getFileSize (), nbr);
     CPPUNIT_ASSERT_EQUAL (tfile->close (), 0);
 
-    FilesUtility::deleteFile (fname.c_str ());
+    try
+      {
+        FilesUtility::deleteFile (fname.c_str ());
+      }
+    catch (...)
+      {
+      }
   }
 
   void testCreationTime ()
@@ -173,8 +185,14 @@ public:
   void testTruncate ()
   {
     u_long nbw;
-
-    CPPUNIT_ASSERT_EQUAL (FilesUtility::deleteFile (fname.c_str ()), 0);
+    
+    try
+      {
+        FilesUtility::deleteFile (fname.c_str ());
+      }
+    catch (...)
+      {
+      }
 
     CPPUNIT_ASSERT_EQUAL (openHelper (), 0);
 
@@ -195,7 +213,13 @@ public:
 
     CPPUNIT_ASSERT_EQUAL (tfile->getFileSize (), dataLen + dataLen / 2);
 
-    FilesUtility::deleteFile (fname.c_str ());
+    try
+      {
+        FilesUtility::deleteFile (fname.c_str ());
+      }
+    catch (...)
+      {
+      }
   }
 
 };
diff --git a/myserver/tests/test_file_stream.cpp b/myserver/tests/test_file_stream.cpp
index fbf1a4e..a6ff1a5 100644
--- a/myserver/tests/test_file_stream.cpp
+++ b/myserver/tests/test_file_stream.cpp
@@ -47,13 +47,33 @@ public:
     ff->insert ("gzip", Gzip::factory);
   }
 
+  void tearDown ()
+  {
+    delete ff;
+    delete fsc;
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
+  }
+
   void testCycleLog ()
   {
     list<string> filters;
     string message;
     string message2;
     LogStream* ls;
-    FilesUtility::deleteFile ("foo");
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
+
     ostringstream oss;
 
     oss << "thisisaverylongmessage" << endl;
@@ -87,7 +107,7 @@ public:
         CPPUNIT_ASSERT_EQUAL (nbr, (u_long) message.length ());
         CPPUNIT_ASSERT (!message.compare (buf));
         f.close ();
-        CPPUNIT_ASSERT (!FilesUtility::deleteFile (*it));
+        CPPUNIT_ASSERT (! FilesUtility::deleteFile (*it));
       }
     delete ls;
   }
@@ -109,7 +129,13 @@ public:
     oss << endl;
     message2.assign (oss.str ());
 
-    FilesUtility::deleteFile ("foo");
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
     ls = fsc->create (ff, "foo", filters, 0);
     CPPUNIT_ASSERT (ls);
     ls->log (message1);
@@ -130,13 +156,6 @@ public:
     CPPUNIT_ASSERT (!string (buf).compare (message1.append (message2)));
   }
 
-  void tearDown ()
-  {
-    delete ff;
-    delete fsc;
-    FilesUtility::deleteFile ("foo");
-  }
-
 private:
   FiltersFactory* ff;
   FileStreamCreator* fsc;
diff --git a/myserver/tests/test_log_manager.cpp b/myserver/tests/test_log_manager.cpp
index 27afaf3..21fa5e0 100644
--- a/myserver/tests/test_log_manager.cpp
+++ b/myserver/tests/test_log_manager.cpp
@@ -94,6 +94,21 @@ public:
     lm = new LogManager (ff);
   }
 
+  void tearDown ()
+  {
+    lm->close (this, "test", "file://foo");
+    delete lm;
+    delete ff;
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
+  }
+
+
   void testEmpty ()
   {
     CPPUNIT_ASSERT (lm->empty ());
@@ -151,8 +166,13 @@ public:
     File f;
     char buf[message.size () + 1];
     u_long nbr;
-    FilesUtility::deleteFile ("foo");
-
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
     lm->add (this, "test", "file://foo", filters, 0);
     lm->log (this, "test", "file://foo", message);
     lm->close (this);
@@ -167,7 +187,13 @@ public:
   void testFileStreamClose ()
   {
     list<string> filters;
-    FilesUtility::deleteFile ("foo");
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "file://foo", filters, 0);
 
@@ -177,7 +203,13 @@ public:
   void testCloseAnAlreadyClosedFileStream ()
   {
     list<string> filters;
-    FilesUtility::deleteFile ("foo");
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "file://foo", filters, 0);
     lm->close (this, "test", "file://foo");
@@ -198,7 +230,13 @@ public:
     LogStream* ls;
     list<string> cs;
     list<string>::iterator it;
-    FilesUtility::deleteFile ("foobar");
+    try
+      {
+        FilesUtility::deleteFile ("foobar");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "file://foobar", filters, 10);
     lm->log (this, "test", "file://foobar", message);
@@ -220,11 +258,24 @@ public:
         buf[nbr] = '\0';
         f.close ();
         gotMessage.assign (buf);
-        FilesUtility::deleteFile (*it);
+        try
+          {
+            FilesUtility::deleteFile (*it);
+          }
+        catch (...)
+          {
+          }
       }
 
     lm->close (this);
-    FilesUtility::deleteFile ("foobar");
+
+    try
+      {
+        FilesUtility::deleteFile ("foobar");
+      }
+    catch (...)
+      {
+      }
 
     CPPUNIT_ASSERT (!message1.compare (gotMessage1));
     CPPUNIT_ASSERT (!message.compare (gotMessage));
@@ -244,7 +295,14 @@ public:
   void testMessageLevelLessThanLogManagerOne ()
   {
     list<string> filters;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "file://foo", filters, 0);
     lm->setLevel (MYSERVER_LOG_MSG_WARNING);
@@ -256,7 +314,14 @@ public:
   void testMessageLevelEqualToLogManagerOne ()
   {
     list<string> filters;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "file://foo", filters, 0);
     lm->setLevel (MYSERVER_LOG_MSG_WARNING);
@@ -268,7 +333,14 @@ public:
   void testClear ()
   {
     list<string> filters;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "file://foo", filters, 0);
     lm->add (this, "test", "console://stdout", filters, 0);
@@ -288,7 +360,13 @@ public:
     u_long nbr;
     GzipDecompress gzdc;
 
-    FilesUtility::deleteFile ("fooz");
+    try
+      {
+        FilesUtility::deleteFile ("fooz");
+      }
+    catch (...)
+      {
+      }
 
     filters.push_back ("gzip");
     lm->add (this, "test", "file://fooz", filters, 0);
@@ -302,7 +380,13 @@ public:
                      gzipChainDecomp, 64);
     gzipChainDecomp[message.size ()] = '\0';
 
-    FilesUtility::deleteFile ("fooz");
+    try
+      {
+        FilesUtility::deleteFile ("fooz");
+      }
+    catch (...)
+      {
+      }
 
     CPPUNIT_ASSERT (!message.compare (gzipChainDecomp));
   }
@@ -323,7 +407,14 @@ public:
     list<string> cs;
     list<string>::iterator it;
     LogStream* ls;
-    FilesUtility::deleteFile ("fooc");
+
+    try
+      {
+        FilesUtility::deleteFile ("fooc");
+      }
+    catch (...)
+      {
+      }
 
     filters.push_back ("gzip");
     lm->add (this, "test", "file://fooc", filters, cycleLog);
@@ -349,10 +440,24 @@ public:
                          gzipDecomp, 128);
         gzipDecomp[message.size ()] = '\0';
         gotMessage.assign (gzipDecomp);
-        FilesUtility::deleteFile (*it);
+
+        try
+          {
+            FilesUtility::deleteFile (*it);
+          }
+        catch (...)
+          {
+          }
       }
     lm->close (this);
-    FilesUtility::deleteFile ("fooc");
+
+    try
+      {
+        FilesUtility::deleteFile ("fooc");
+      }
+    catch (...)
+      {
+      }
 
     CPPUNIT_ASSERT (!message1.compare (gotMessage1));
     CPPUNIT_ASSERT (!message.compare (gotMessage));
@@ -361,7 +466,14 @@ public:
   void testCountSingleLogStream ()
   {
     list<string> filters;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "console://stdout", filters, 0);
     lm->add (this, "test_1", "console://stderr", filters, 0);
@@ -373,7 +485,14 @@ public:
   void testCountSameTypeLogStreams ()
   {
     list<string> filters;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "console://stdout", filters, 0);
     lm->add (this, "test_1", "console://stderr", filters, 0);
@@ -385,7 +504,14 @@ public:
   void testCountAllLogStreamsOwnedByAnObject ()
   {
     list<string> filters;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "console://stdout", filters, 0);
     lm->add (this, "test_1", "console://stderr", filters, 0);
@@ -406,7 +532,14 @@ public:
     list<string> filters;
     list<string> tmp;
     list<string> l;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "file://foo", filters, 0);
     lm->add (this, "test", "console://stdout", filters, 0);
@@ -426,7 +559,14 @@ public:
     list<string> filters;
     list<string> tmp;
     list<string> l;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "file://foo", filters, 0);
     lm->add (this, "test", "console://stdout", filters, 0);
@@ -444,7 +584,14 @@ public:
   {
     list<string> filters;
     LogStream* ls;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "file://foo", filters, 0);
 
@@ -455,7 +602,14 @@ public:
   {
     list<string> filters;
     LogStream* ls;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "file://foo", filters, 0);
 
@@ -472,7 +626,13 @@ public:
     u_long nbr;
     ostringstream oss;
 
-    FilesUtility::deleteFile ("fooa");
+    try
+      {
+        FilesUtility::deleteFile ("fooa");
+      }
+    catch (...)
+      {
+      }
 
     oss << "message1" << endl;
     message1.assign (oss.str ());
@@ -490,7 +650,13 @@ public:
     f.close ();
     buf[nbr] = '\0';
 
-    FilesUtility::deleteFile ("fooa");
+    try
+      {
+        FilesUtility::deleteFile ("fooa");
+      }
+    catch (...)
+      {
+      }
 
     CPPUNIT_ASSERT (!string (buf).compare (message1.append (message2)));
   }
@@ -498,7 +664,14 @@ public:
   void testFileStreamAddWithNotExistingFilter ()
   {
     list<string> filters;
-    FilesUtility::deleteFile ("foo");
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
+
     filters.push_back ("not_existing_filter");
 
     CPPUNIT_ASSERT (lm->add (this, "test", "file://foo", filters, 0));
@@ -533,7 +706,14 @@ public:
   void testAddMultipleTimesTheSameKey ()
   {
     list<string> filters;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "file://foo", filters, 0);
 
@@ -544,7 +724,14 @@ public:
   {
     list<string> filters;
     AnObject anObject;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "file://foo", filters, 0);
 
@@ -554,10 +741,17 @@ public:
   void testAddLogStreamSharedByTheSameObject ()
   {
     list<string> filters;
+    try
+      {
     FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
+
     lm->add (this, "test", "file://foo", filters, 0);
 
-    CPPUNIT_ASSERT (!lm->add (this, "test1", "file://foo", filters, 0));
+    CPPUNIT_ASSERT (! lm->add (this, "test1", "file://foo", filters, 0));
   }
 
   void testGetLogStreamSharedByDistinctObjects ()
@@ -567,7 +761,14 @@ public:
     list<const void*> l;
     LogStream* ls;
     LogStream* ls1;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "file://foo", filters, 0);
     lm->add (&anObject, "test", "file://foo", filters, 0);
@@ -584,7 +785,14 @@ public:
     list<const void*> l;
     LogStream* ls;
     LogStream* ls1;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "file://foo", filters, 0);
     lm->add (this, "test1", "file://foo", filters, 0);
@@ -601,7 +809,14 @@ public:
     AnObject anObject;
     AnObject anotherObject;
     list<const void*> l;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "file://foo", filters, 0);
     lm->add (&anObject, "test1", "file://foo", filters, 0);
@@ -632,7 +847,14 @@ public:
   void testLogOnAClosedLogStream ()
   {
     list<string> filters;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
 
     lm->add (this, "test", "file://foo", filters, 0);
     lm->close (this, "test", "file://foo");
@@ -644,7 +866,15 @@ public:
   {
 #ifndef WIN32
     list<string> filters;
-    FilesUtility::deleteFile ("foo");
+
+    try
+      {
+        FilesUtility::deleteFile ("foo");
+      }
+    catch (...)
+      {
+      }
+
 
     lm->add (this, "test", "file://foo", filters, 0);
     ostringstream uidOss;
@@ -659,14 +889,6 @@ public:
 #endif
   }
 
-  void tearDown ()
-  {
-    lm->close (this, "test", "file://foo");
-    delete lm;
-    delete ff;
-    FilesUtility::deleteFile ("foo");
-  }
-
 private:
   LogManager* lm;
   FiltersFactory* ff;
diff --git a/myserver/tests/test_log_stream_factory.cpp b/myserver/tests/test_log_stream_factory.cpp
index 3d4886b..69cafd8 100644
--- a/myserver/tests/test_log_stream_factory.cpp
+++ b/myserver/tests/test_log_stream_factory.cpp
@@ -69,8 +69,20 @@ public:
     CPPUNIT_ASSERT (!ls);
     ls = lsf->create (&ff, "console://stdout", filters, 0);
     CPPUNIT_ASSERT (ls);
-    CPPUNIT_ASSERT (!lsf->create (&ff, "socket://" LOCALHOST_ADDRESS ":0",
-                                  filters, 0));
+
+    bool success = false;
+    try
+      {
+        lsf->create (&ff, "socket://" LOCALHOST_ADDRESS ":0",
+                     filters, 0);
+      }
+    catch (...)
+      {
+        success = true;
+      }
+
+    CPPUNIT_ASSERT (success);
+
     delete ls;
   }
 
diff --git a/myserver/tests/test_socket_pair.cpp b/myserver/tests/test_socket_pair.cpp
index 0c2b740..509e409 100644
--- a/myserver/tests/test_socket_pair.cpp
+++ b/myserver/tests/test_socket_pair.cpp
@@ -26,6 +26,9 @@
 #include "../include/base/file/file.h"
 #include "../include/base/file/files_utility.h"
 
+#include "../include/base/exceptions/exceptions.h"
+
+
 #include <string.h>
 
 using namespace std;
@@ -58,7 +61,7 @@ public:
     CPPUNIT_ASSERT_EQUAL (sp.getFirstHandle (), inverted.getSecondHandle ());
     CPPUNIT_ASSERT_EQUAL (sp.getSecondHandle (), inverted.getFirstHandle ());
 
-    sp.close ();
+    inverted.resetHandles ();
   }
   /* FIXME: generalize for other classes that inherit from File.  */
   void testFastCopyToSocket ()
@@ -127,7 +130,6 @@ public:
     writeSock.create ();
     writeSock.inverted (readSock);
 
-
     ret = writeSock.write (inBuffer, strlen (inBuffer) + 1, &nbw);
 
     CPPUNIT_ASSERT_EQUAL (ret, 0);
@@ -139,7 +141,7 @@ public:
 
     CPPUNIT_ASSERT_EQUAL (strcmp (inBuffer, outBuffer), 0);
 
-    writeSock.close ();
+    readSock.resetHandles ();
   }
 
 };
diff --git a/myserver/tests/test_socket_stream_creator.cpp b/myserver/tests/test_socket_stream_creator.cpp
index abc53df..6a92453 100644
--- a/myserver/tests/test_socket_stream_creator.cpp
+++ b/myserver/tests/test_socket_stream_creator.cpp
@@ -46,8 +46,18 @@ public:
   void testCreation ()
   {
     list<string> filters;
-    LogStream* ls = ssc->create (ff, LOCALHOST_ADDRESS ":0", filters, 0);
-    CPPUNIT_ASSERT (!ls);
+    bool success = false;
+
+    try
+      {
+        LogStream* ls = ssc->create (ff, LOCALHOST_ADDRESS ":0", filters, 0);
+      }
+    catch (...)
+      {
+        success = true;
+      }
+
+    CPPUNIT_ASSERT (success);
   }
 
   void testGetPort ()



commit b9aa4ca51c64da117ca372dae34501544c1c5512
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 15 12:02:06 2010 +0200

    Link statically the test suite program

diff --git a/myserver/tests/Makefile.am b/myserver/tests/Makefile.am
index 66095c6..bed6775 100644
--- a/myserver/tests/Makefile.am
+++ b/myserver/tests/Makefile.am
@@ -87,6 +87,8 @@ test_suite_LDADD = ../src/libmyserver.la  ../lib/libgnu.la $(CPPUNIT_LDFLAGS) \
 	$(PTHREAD_LIB) 	$(IDN_LIB) $(XNET_LIB) $(DL_LIB) $(ZLIB_LIB) \
 	$(XML_LIBS) $(INTLLIBS) $(LDFLAGS)
 
+test_suite_LDFLAGS = -static
+
 install:
 
 check-am:



commit 28f364b73b0631ef93153c6f1951f87f808ba208
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 15 11:34:16 2010 +0200

    Use the right prototype for `gettimeofday'.

diff --git a/myserver/include/base/exceptions/checked.h b/myserver/include/base/exceptions/checked.h
index 7220b73..4ceb64a 100644
--- a/myserver/include/base/exceptions/checked.h
+++ b/myserver/include/base/exceptions/checked.h
@@ -92,7 +92,7 @@ namespace checked
   char *getcwd (char *buf, size_t size);
   int gethostname (char *name, size_t len);
   int getsockname (int fd, struct sockaddr *addr, socklen_t *addrlen);
-  int gettimeofday (struct timeval *, void *);
+  int gettimeofday (struct timeval *tv, struct timezone *tz);
   struct tm *gmtime_r (time_t const *__timer, struct tm *__result);
   int listen (int fd, int backlog);
   struct tm *localtime_r (time_t const *__timer, struct tm *__result);



commit be52d78a003b9a4d4b40ca3727273beb59bbc66b
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 15 11:28:10 2010 +0200

    Move `checkError' and `checkErrorNull' to checked.h

diff --git a/myserver/include/base/exceptions/checked.h b/myserver/include/base/exceptions/checked.h
index 28f406c..7220b73 100644
--- a/myserver/include/base/exceptions/checked.h
+++ b/myserver/include/base/exceptions/checked.h
@@ -49,6 +49,35 @@
  */
 namespace checked
 {
+  void raiseException ();
+
+  /*!
+   * Check if the last operation was successful, the operation is consider
+   * successful if the return value is >= 0.
+   *
+   * \param x The function's return value
+   */
+  static inline int checkError (int x)
+  {
+    if (x < 0)
+      checked::raiseException ();
+
+    return x;
+  }
+
+  /*!
+   * Check if the last operation was successful, the operation is consider
+   * successful if the return value is != NULL.
+   *
+   * \param x The function's return value
+   */
+  static inline const void *checkErrorNull (const void *x)
+  {
+    if (x == NULL)
+      checked::raiseException ();
+
+    return x;
+  }
   int accept (int fd, struct sockaddr *addr, socklen_t *addrlen);
   int bind (int fd, const struct sockaddr *addr, socklen_t addrlen);
   int chown (const char *file, uid_t uid, gid_t gid);
@@ -92,8 +121,6 @@ namespace checked
   char *strdup (char const *__s);
   int unlink (char const *file);
   ssize_t write (int fd, const void *buf, size_t count);
-
-  void raiseException ();
 }
 
 #endif
diff --git a/myserver/src/base/exceptions/checked.cpp b/myserver/src/base/exceptions/checked.cpp
index 7fdf2fd..f09df20 100644
--- a/myserver/src/base/exceptions/checked.cpp
+++ b/myserver/src/base/exceptions/checked.cpp
@@ -19,29 +19,6 @@
 */
 #include <include/base/exceptions/checked.h>
 
-/*!
- * Check if the last operation was successful
- * \param x The function's return value
- */
-static inline int checkError (int x)
-{
-  if (x < 0)
-    checked::raiseException ();
-
-  return x;
-}
-
-/*!
- * \see checkError
- */
-static inline const void *checkErrorNull (const void *x)
-{
-  if (x == NULL)
-    checked::raiseException ();
-
-  return x;
-}
-
 namespace checked
 {
   int accept (int fd, struct sockaddr *addr, socklen_t *addrlen)



commit 53fe1d953e77c08d51be14b0a6e37ccdfe31c75c
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 15 11:05:20 2010 +0200

    Add `pipe2' to the `checked' namespace.

diff --git a/myserver/include/base/exceptions/checked.h b/myserver/include/base/exceptions/checked.h
index 7009ee1..28f406c 100644
--- a/myserver/include/base/exceptions/checked.h
+++ b/myserver/include/base/exceptions/checked.h
@@ -57,6 +57,7 @@ namespace checked
   int connect (int fd, const struct sockaddr *addr, socklen_t addrlen);
   int dup (int oldfd);
   int dup2 (int oldfd, int newfd);
+  int pipe2 (int pipefd[2], int flags);
   int fstat (int fd, struct stat *buf);
   int fstatat (int fd, char const *name, struct stat *st, int flags);
   char *getcwd (char *buf, size_t size);
diff --git a/myserver/src/base/exceptions/checked.cpp b/myserver/src/base/exceptions/checked.cpp
index 555fd0e..7fdf2fd 100644
--- a/myserver/src/base/exceptions/checked.cpp
+++ b/myserver/src/base/exceptions/checked.cpp
@@ -84,6 +84,11 @@ namespace checked
     return checkError (gnulib::dup2 (oldfd, newfd));
   }
 
+  int pipe2 (int pipefd[2], int flags)
+  {
+    return checkError (pipe2 (pipefd, flags));
+  }
+
   int fstat (int fd, struct stat *buf)
   {
     return checkError (gnulib::fstat (fd, buf));



commit 00d9db47fec81591111a5569e333cc0fa59166e7
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 15 10:43:11 2010 +0200

    Now`open' accepts the user mask.

diff --git a/myserver/include/base/exceptions/checked.h b/myserver/include/base/exceptions/checked.h
index 11e69a1..7009ee1 100644
--- a/myserver/include/base/exceptions/checked.h
+++ b/myserver/include/base/exceptions/checked.h
@@ -70,7 +70,7 @@ namespace checked
   void *memchr (void const *__s, int __c, size_t __n);
   int mkdir (char const *name, mode_t mode);
   time_t mktime (struct tm *__tp);
-  int open (const char *filename, int flags);
+  int open (const char *filename, int flags, int mask = 0);
   DIR *opendir (const char *);
   int fsync (int fd);
   ssize_t read (int fd, void *buf, size_t count);
diff --git a/myserver/src/base/exceptions/checked.cpp b/myserver/src/base/exceptions/checked.cpp
index 939e0ff..555fd0e 100644
--- a/myserver/src/base/exceptions/checked.cpp
+++ b/myserver/src/base/exceptions/checked.cpp
@@ -149,9 +149,9 @@ namespace checked
     return checkError (gnulib::mktime (__tp));
   }
 
-  int open (const char *filename, int flags)
+  int open (const char *filename, int flags, int mask)
   {
-    return checkError (gnulib::open (filename, flags, 0));
+    return checkError (gnulib::open (filename, flags, mask));
   }
 
   DIR *opendir (const char *name)



commit 8accbb8a011f574daff78e97c01f72b674dcdf7f
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 15 10:35:51 2010 +0200

    Add `fsync' to the `checked' namespace.

diff --git a/myserver/include/base/exceptions/checked.h b/myserver/include/base/exceptions/checked.h
index 88a680a..11e69a1 100644
--- a/myserver/include/base/exceptions/checked.h
+++ b/myserver/include/base/exceptions/checked.h
@@ -72,6 +72,7 @@ namespace checked
   time_t mktime (struct tm *__tp);
   int open (const char *filename, int flags);
   DIR *opendir (const char *);
+  int fsync (int fd);
   ssize_t read (int fd, void *buf, size_t count);
   void *realloc (void *ptr, size_t size);
   ssize_t recv (int fd, void *buf, size_t len, int flags);
diff --git a/myserver/src/base/exceptions/checked.cpp b/myserver/src/base/exceptions/checked.cpp
index 541596e..939e0ff 100644
--- a/myserver/src/base/exceptions/checked.cpp
+++ b/myserver/src/base/exceptions/checked.cpp
@@ -164,6 +164,12 @@ namespace checked
     return checkError (::read (fd, buf, count));
   }
 
+  int fsync (int fd)
+  {
+    return checkError (gnulib::fsync (fd));
+  }
+
+
   void *realloc (void *ptr, size_t size)
   {
     return (void *) checkErrorNull (gnulib::realloc (ptr, size));

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

Summary of changes:
 myserver/include/base/exceptions/checked.h         |   37 +++-
 myserver/include/base/socket_pair/socket_pair.h    |    2 +
 myserver/po/Makevars                               |   13 +-
 myserver/src/base/base64/mime_utils.cpp            |    3 +-
 myserver/src/base/exceptions/checked.cpp           |   38 +--
 myserver/src/base/file/file.cpp                    |   17 +-
 myserver/src/base/file/files_utility.cpp           |   16 +-
 myserver/src/base/pipe/pipe.cpp                    |   27 +-
 myserver/src/base/process/fork_server.cpp          |   23 +-
 myserver/src/base/process/process.cpp              |   33 ++-
 .../src/base/read_directory/read_directory.cpp     |    7 +-
 myserver/src/base/safetime/safetime.cpp            |    5 +-
 myserver/src/base/socket/socket.cpp                |   35 ++--
 myserver/src/base/socket/ssl_socket.cpp            |   10 +-
 myserver/src/base/socket_pair/socket_pair.cpp      |   42 ++--
 myserver/src/base/ssl/ssl.cpp                      |    2 +
 myserver/src/base/string/stringutils.cpp           |    4 +-
 myserver/src/base/sync/event.cpp                   |    3 +-
 myserver/src/base/sync/mutex.cpp                   |    8 -
 myserver/src/base/unix_socket/unix_socket.cpp      |   12 +-
 myserver/src/base/utility.cpp                      |    7 +-
 .../connections_scheduler.cpp                      |  296 ++++++++++++-------
 myserver/src/log/log_manager.cpp                   |  122 +++++----
 myserver/src/myserver.cpp                          |   20 +-
 myserver/src/plugin/plugins_manager.cpp            |   13 +-
 myserver/src/protocol/ftp/ftp.cpp                  |    4 +-
 myserver/src/protocol/http/http.cpp                |   25 +-
 myserver/src/server/clients_thread.cpp             |   12 +-
 myserver/tests/Makefile.am                         |    2 +
 myserver/tests/test_connection.cpp                 |    1 -
 myserver/tests/test_connections_scheduler.cpp      |   37 ++--
 myserver/tests/test_file.cpp                       |   34 ++-
 myserver/tests/test_file_stream.cpp                |   39 ++-
 myserver/tests/test_log_manager.cpp                |  304 +++++++++++++++++---
 myserver/tests/test_log_stream_factory.cpp         |   16 +-
 myserver/tests/test_socket_pair.cpp                |    8 +-
 myserver/tests/test_socket_stream_creator.cpp      |   14 +-
 37 files changed, 882 insertions(+), 409 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Thu Apr 15 17:03:38 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O2WDq-00080r-Ea
	for mharc-myserver-commit@gnu.org; Thu, 15 Apr 2010 17:03:38 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O2WDo-00080O-Vy
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 17:03:37 -0400
Received: from [140.186.70.92] (port=59498 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O2WDe-0007n8-Lo
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 17:03:35 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2W8p-0003dl-VA
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 16:58:38 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:44040
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2W8p-0003dd-HE
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 16:58:27 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2W8o-0003yy-PM
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 20:58:26 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O2W8o-0005Qb-4l
	for myserver-commit@gnu.org; Thu, 15 Apr 2010 20:58:26 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: ca14a85fac9d465bc770699c98fa162168d7bd54
X-Git-Newrev: 31db1be72710a7980801f6f364d17efadffe6345
Message-Id: <E1O2W8o-0005Qb-4l@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Thu, 15 Apr 2010 20:58:26 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-140-g31db1be
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, 15 Apr 2010 21:03:37 -0000

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

The branch, master has been updated
       via  31db1be72710a7980801f6f364d17efadffe6345 (commit)
       via  cbee09074feaf3dccfb22f14c0862cb03b20e36f (commit)
       via  0570505f9b6d0642ef1fcdc8df3188f39355474c (commit)
      from  ca14a85fac9d465bc770699c98fa162168d7bd54 (commit)

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

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


commit 31db1be72710a7980801f6f364d17efadffe6345
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 15 22:58:26 2010 +0200

    Ensure locks are not kept on exceptions

diff --git a/myserver/src/base/files_cache/cached_file_factory.cpp b/myserver/src/base/files_cache/cached_file_factory.cpp
index 4f408b0..2ea785e 100644
--- a/myserver/src/base/files_cache/cached_file_factory.cpp
+++ b/myserver/src/base/files_cache/cached_file_factory.cpp
@@ -68,8 +68,6 @@ CachedFileFactory::CachedFileFactory (u_long size)
  */
 void CachedFileFactory::clean ()
 {
-  mutex.lock ();
-
   HashMap<char*, CachedFileFactoryRecord*>::Iterator it = buffers.begin ();
   for (; it != buffers.end (); it++)
     {
@@ -77,8 +75,6 @@ void CachedFileFactory::clean ()
       delete (*it);
     }
   buffers.clear ();
-
-  mutex.unlock ();
   mutex.destroy ();
 }
 
@@ -146,95 +142,104 @@ File* CachedFileFactory::open (const char* filename)
 
   mutex.lock ();
 
-  ticks = getTicks ();
-  record = buffers.get (filename);
-  buffer = record ? record->buffer : 0;
+  try
+    {
 
-  used++;
+      ticks = getTicks ();
+      record = buffers.get (filename);
+      buffer = record ? record->buffer : 0;
 
-  /*!
-   * If the file on the file system has a different mtime then don't use
-   * the cache, in this way when opened instance of this file will be closed
-   * the null reference callback can be called and the file reloaded.
-   */
-  if (record)
-    {
-      if (ticks - record->lastModTimeCheck > MYSERVER_SEC (5))
-        {
-          record->invalidCache = FilesUtility::getLastModTime (filename)
-                                 != record->mtime;
-          record->lastModTimeCheck = ticks;
-        }
+      used++;
 
-      if (record->invalidCache)
+      /*!
+       * If the file on the file system has a different mtime then don't use
+       * the cache, in this way when opened instance of this file will be closed
+       * the null reference callback can be called and the file reloaded.
+       */
+      if (record)
         {
-          mutex.unlock ();
+          if (ticks - record->lastModTimeCheck > MYSERVER_SEC (5))
+            {
+              record->invalidCache = FilesUtility::getLastModTime (filename)
+                != record->mtime;
+              record->lastModTimeCheck = ticks;
+            }
 
-          File *file = new File ();
-          if (file->openFile (filename, File::OPEN_IF_EXISTS |
-                              File::READ))
+          if (record->invalidCache)
             {
-              delete file;
-              return NULL;
+              mutex.unlock ();
+
+              File *file = new File ();
+              if (file->openFile (filename, File::OPEN_IF_EXISTS |
+                                  File::READ))
+                {
+                  delete file;
+                  return NULL;
+                }
+              return file;
             }
-          return file;
         }
-    }
 
-  if (buffer == NULL)
-    {
-      u_long fileSize;
-      File *file = new File ();
-      if (file->openFile (filename, File::OPEN_IF_EXISTS | File::READ))
+      if (buffer == NULL)
         {
-          mutex.unlock ();
-          delete file;
-          return NULL;
-        }
-      fileSize = file->getFileSize ();
-      purgeRecords ();
-      if ((minSize != 0 && fileSize < minSize) ||
-          (maxSize != 0 && fileSize > maxSize)  ||
-          (fileSize > size - usedSize))
-        {
-          mutex.unlock ();
-          return file;
-        }
-      else
-        {
-          record = new CachedFileFactoryRecord ();
-          if (!record)
+          u_long fileSize;
+          File *file = new File ();
+          if (file->openFile (filename, File::OPEN_IF_EXISTS | File::READ))
             {
-              delete record;
-              file->close ();
-              delete file;
               mutex.unlock ();
-              return 0;
+              delete file;
+              return NULL;
             }
-
-          buffer = new CachedFileBuffer (file);
-          record->mtime = file->getLastModTime ();
-          file->close  ();
-          delete file;
-
-          if (!buffer)
+          fileSize = file->getFileSize ();
+          purgeRecords ();
+          if ((minSize != 0 && fileSize < minSize) ||
+              (maxSize != 0 && fileSize > maxSize)  ||
+              (fileSize > size - usedSize))
             {
-              delete record;
               mutex.unlock ();
-              return 0;
+              return file;
+            }
+          else
+            {
+              record = new CachedFileFactoryRecord ();
+              if (!record)
+                {
+                  delete record;
+                  file->close ();
+                  delete file;
+                  mutex.unlock ();
+                  return 0;
+                }
+
+              buffer = new CachedFileBuffer (file);
+              record->mtime = file->getLastModTime ();
+              file->close  ();
+              delete file;
+
+              if (!buffer)
+                {
+                  delete record;
+                  mutex.unlock ();
+                  return 0;
+                }
+              buffer->setFactoryToNotify (this);
+              record->created = ticks;
+              record->buffer = buffer;
+              buffers.put ((char *)filename, record);
+              usedSize += fileSize;
             }
-          buffer->setFactoryToNotify (this);
-          record->created = ticks;
-          record->buffer = buffer;
-          buffers.put ((char *)filename, record);
-          usedSize += fileSize;
         }
-    }
-  record->used++;
+      record->used++;
 
-  cachedFile = new CachedFile (buffer);
+      cachedFile = new CachedFile (buffer);
 
-  mutex.unlock ();
+      mutex.unlock ();
+    }
+  catch (...)
+    {
+      mutex.unlock ();
+      throw;
+    }
 
   return cachedFile;
 }
@@ -252,29 +257,37 @@ void CachedFileFactory::nullReferences (CachedFileBuffer* cfb)
   u_long ticks;
   mutex.lock ();
 
-  ticks = getTicks ();
-  record = buffers.get (cfb->getFilename ());
-  if (!record)
+  try
     {
-      mutex.unlock ();
-      return;
-    }
+      ticks = getTicks ();
+      record = buffers.get (cfb->getFilename ());
+      if (!record)
+        {
+          mutex.unlock ();
+          return;
+        }
 
-  spaceUsage = (float)usedSize / size;
-  averageUsage = (float)used * 1000.0f / (ticks - created);
-  bufferAverageUsage = (float)record->used * 1000.0f /
-    (getTicks () - record->created);
+      spaceUsage = (float)usedSize / size;
+      averageUsage = (float)used * 1000.0f / (ticks - created);
+      bufferAverageUsage = (float)record->used * 1000.0f /
+        (getTicks () - record->created);
 
-  if (((spaceUsage > 0.65f) && (bufferAverageUsage < averageUsage)
-       && ((ticks - record->created) > 10000))
-      || (spaceUsage > 0.9f)
-      || record->invalidCache)
+      if (((spaceUsage > 0.65f) && (bufferAverageUsage < averageUsage)
+           && ((ticks - record->created) > 10000))
+          || (spaceUsage > 0.9f)
+          || record->invalidCache)
+        {
+          record = buffers.remove (cfb->getFilename ());
+          if (record)
+            buffersToRemove.push_back (record);
+        }
+      mutex.unlock ();
+    }
+  catch (...)
     {
-      record = buffers.remove (cfb->getFilename ());
-      if (record)
-        buffersToRemove.push_back (record);
+      mutex.unlock ();
+      throw;
     }
-  mutex.unlock ();
 }
 
 /*!
diff --git a/myserver/src/base/home_dir/home_dir.cpp b/myserver/src/base/home_dir/home_dir.cpp
index 4699c00..a2e67bf 100644
--- a/myserver/src/base/home_dir/home_dir.cpp
+++ b/myserver/src/base/home_dir/home_dir.cpp
@@ -109,9 +109,16 @@ int HomeDir::load ()
   int ret;
   loadMutex.lock ();
 
-  ret = loadImpl ();
-
-  loadMutex.unlock ();
+  try
+    {
+      ret = loadImpl ();
+      loadMutex.unlock ();
+    }
+  catch (...)
+    {
+      loadMutex.unlock ();
+      throw;
+    }
   return ret;
 }
 
diff --git a/myserver/src/base/process/process_server_manager.cpp b/myserver/src/base/process/process_server_manager.cpp
index 9e55079..b7d49b2 100644
--- a/myserver/src/base/process/process_server_manager.cpp
+++ b/myserver/src/base/process/process_server_manager.cpp
@@ -145,10 +145,18 @@ void ProcessServerManager::load ()
 ProcessServerManager::ServerDomain*
 ProcessServerManager::getDomain (const char* name)
 {
-  ServerDomain* ret;
+  ServerDomain* ret = NULL;
   mutex.lock ();
-  ret = domains.get (name);
-  mutex.unlock ();
+  try
+    {
+      ret = domains.get (name);
+      mutex.unlock ();
+    }
+  catch (...)
+    {
+      mutex.unlock ();
+      throw;
+    }
   return ret;
 }
 
@@ -159,19 +167,26 @@ ProcessServerManager::getDomain (const char* name)
 ProcessServerManager::ServerDomain*
 ProcessServerManager::createDomain (const char* name)
 {
-  ServerDomain* ret;
+  ServerDomain* ret = NULL;
 
   mutex.lock ();
 
-  ret = domains.get (name);
-  if (!ret)
-  {
-    string str (name);
-    ret = new ServerDomain ();
-    domains.put (str, ret);
-  }
-
-  mutex.unlock ();
+  try
+    {
+      ret = domains.get (name);
+      if (!ret)
+        {
+          string str (name);
+          ret = new ServerDomain ();
+          domains.put (str, ret);
+        }
+      mutex.unlock ();
+    }
+  catch (...)
+    {
+      mutex.unlock ();
+      throw;
+    }
 
   return ret;
 }
@@ -184,37 +199,44 @@ void ProcessServerManager::clear ()
   HashMap<string, ServerDomain*>::Iterator it;
 
   mutex.lock ();
-
-  it = domains.begin ();
-
-  for (;it != domains.end (); it++)
+  try
     {
-      ServerDomain *sd = *it;
-      HashMap<string, vector<Server*>*>::Iterator server = sd->servers.begin ();
+      it = domains.begin ();
 
-      for (; server != sd->servers.end (); server++)
+      for (;it != domains.end (); it++)
         {
-          for (vector<Server*>::iterator it = (*server)->begin ();
-               it != (*server)->end ();
-               it++)
-            {
-              Server *s = *it;
+          ServerDomain *sd = *it;
+          HashMap<string, vector<Server*>*>::Iterator server = sd->servers.begin ();
 
-              if (s->isLocal)
-                nServers--;
-
-              if (sd->clear)
-                sd->clear (s);
-
-              s->terminate ();
-              delete s;
+          for (; server != sd->servers.end (); server++)
+            {
+              for (vector<Server*>::iterator it = (*server)->begin ();
+                   it != (*server)->end ();
+                   it++)
+                {
+                  Server *s = *it;
+
+                  if (s->isLocal)
+                    nServers--;
+
+                  if (sd->clear)
+                    sd->clear (s);
+
+                  s->terminate ();
+                  delete s;
+                }
+              delete (*server);
             }
-          delete (*server);
+          delete (*it);
         }
-      delete (*it);
-  }
-  domains.clear ();
-  mutex.unlock ();
+      domains.clear ();
+      mutex.unlock ();
+    }
+  catch (...)
+    {
+      mutex.unlock ();
+      throw;
+    }
 }
 
 /*!
@@ -226,37 +248,45 @@ void ProcessServerManager::clear ()
 ProcessServerManager::Server*
 ProcessServerManager::getServer (const char* domain, const char* name, int seed)
 {
-  ServerDomain* sd;
+  ServerDomain* sd = NULL;
   Server* s = NULL;
 
   mutex.lock ();
-  sd = domains.get (domain);
+  try
+    {
+      sd = domains.get (domain);
+      if (sd)
+        {
+          vector<Server*> *slist = sd->servers.get (name);
+          if (slist)
+            s = slist->at (seed % slist->size ());
+        }
+
+      if (s && s->isLocal && !s->process.isProcessAlive ())
+        {
+          s->socket.close ();
+          s->process.terminateProcess ();
+          if (!s->path.length ())
+            s->path.assign (name);
+
+          s->port = 0;
+
+          if (runServer (s, s->path.c_str (), s->port))
+            {
+              sd->servers.remove (name);
+              delete s;
+              s = 0;
+            }
+        }
 
-  if (sd)
+      mutex.unlock ();
+    }
+  catch (...)
     {
-      vector<Server*> *slist = sd->servers.get (name);
-      if (slist)
-        s = slist->at (seed % slist->size ());
+      mutex.unlock ();
+      throw;
     }
 
-  if (s && s->isLocal && !s->process.isProcessAlive ())
-  {
-    s->socket.close ();
-    s->process.terminateProcess ();
-    if (!s->path.length ())
-      s->path.assign (name);
-
-    s->port = 0;
-
-    if (runServer (s, s->path.c_str (), s->port))
-      {
-        sd->servers.remove (name);
-        delete s;
-        s = 0;
-      }
-  }
-
-  mutex.unlock ();
   return s;
 }
 
@@ -273,17 +303,25 @@ void ProcessServerManager::addServer (ProcessServerManager::Server* server,
   string strName (name);
 
   mutex.lock ();
-  vector<Server*>* slist = sd->servers.get (strName);
-
-  if (slist == NULL)
+  try
     {
-      slist = new vector<Server*> ();
-      sd->servers.put (strName, slist);
-    }
+      vector<Server*>* slist = sd->servers.get (strName);
+
+      if (slist == NULL)
+        {
+          slist = new vector<Server*> ();
+          sd->servers.put (strName, slist);
+        }
 
-  slist->push_back (server);
+      slist->push_back (server);
 
-  mutex.unlock ();
+      mutex.unlock ();
+    }
+  catch (...)
+    {
+      mutex.unlock ();
+      throw;
+    }
 }
 
 /*!
@@ -317,36 +355,42 @@ void ProcessServerManager::removeDomain (const char* domain)
   HashMap<string, Server*>::Iterator server;
 
   mutex.lock ();
-
-  sd = getDomain (domain);
-
-  if (sd)
+  try
     {
-      HashMap<string, vector<Server*>*>::Iterator server = sd->servers.begin ();
-
-      for (; server != sd->servers.end (); server++)
+      sd = getDomain (domain);
+      if (sd)
         {
-          for (vector<Server*>::iterator it = (*server)->begin ();
-               it != (*server)->end ();
-               it++)
+          HashMap<string, vector<Server*>*>::Iterator server
+            = sd->servers.begin ();
+          for (; server != sd->servers.end (); server++)
             {
-              Server *s = *it;
-
-              if (s->isLocal)
-                nServers--;
-
-              if (sd->clear)
-                sd->clear (s);
-
-              s->terminate ();
-              delete s;
+              for (vector<Server*>::iterator it = (*server)->begin ();
+                   it != (*server)->end ();
+                   it++)
+                {
+                  Server *s = *it;
+
+                  if (s->isLocal)
+                    nServers--;
+
+                  if (sd->clear)
+                    sd->clear (s);
+
+                  s->terminate ();
+                  delete s;
+                }
+              delete (*server);
             }
-          delete (*server);
+          delete sd;
         }
-      delete sd;
-    }
 
-  mutex.unlock ();
+      mutex.unlock ();
+    }
+  catch (...)
+    {
+      mutex.unlock ();
+      throw;
+    }
 }
 
 /*!
@@ -376,10 +420,10 @@ ProcessServerManager::runAndAddServer (const char *domain, const char *path,
   Server* server = new Server;
 
   if (runServer (server, path, port, chroot, uid, gid))
-  {
-    delete server;
-    return 0;
-  }
+    {
+      delete server;
+      return 0;
+    }
   addServer (server, domain, path);
   return server;
 }
diff --git a/myserver/src/base/safetime/safetime.cpp b/myserver/src/base/safetime/safetime.cpp
index e4ed781..73884f2 100644
--- a/myserver/src/base/safetime/safetime.cpp
+++ b/myserver/src/base/safetime/safetime.cpp
@@ -73,8 +73,16 @@ struct tm *myserver_localtime (const time_t *timep, tm* res)
 #else
 
   mutex.lock ();
-  memcpy (res, localtime (timep), sizeof (tm));
-  mutex.unlock ();
+  try
+    {
+      memcpy (res, localtime (timep), sizeof (tm));
+      mutex.unlock ();
+    }
+  catch (...)
+    {
+      mutex.unlock ();
+      throw;
+    }
 
   return res;
 #endif
diff --git a/myserver/src/connections_scheduler/connections_scheduler.cpp b/myserver/src/connections_scheduler/connections_scheduler.cpp
index 2d9c315..0fbb115 100644
--- a/myserver/src/connections_scheduler/connections_scheduler.cpp
+++ b/myserver/src/connections_scheduler/connections_scheduler.cpp
@@ -197,15 +197,8 @@ static void listenerHandler (int fd, short event, void *arg)
             }
           while (clientSock);
         }
-      catch (std::exception & e)
-        {
-          s->server->log (MYSERVER_LOG_MSG_ERROR, _("Error listening on socket %s"),
-                          e.what ());
-          throw;
-        }
       catch (...)
         {
-          throw;
         }
     }
 
diff --git a/myserver/src/connections_scheduler/listen_threads.cpp b/myserver/src/connections_scheduler/listen_threads.cpp
index 4f94a4b..152d75b 100644
--- a/myserver/src/connections_scheduler/listen_threads.cpp
+++ b/myserver/src/connections_scheduler/listen_threads.cpp
@@ -439,10 +439,17 @@ int ListenThreads::terminate ()
             continue;
 
           serverSocket->shutdown (SHUT_RDWR);
-          do
+          for (;;)
             {
-              err = serverSocket->recv (buffer, 256, 0);
-            }while (err != -1);
+              try
+                {
+                  err = serverSocket->recv (buffer, 256, 0);
+                }
+              catch (...)
+                {
+                  break;
+                }
+            }
 
           serverSocket->close ();
           delete serverSocket;
diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 6600076..c23a060 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -55,9 +55,18 @@ int HttpFile::putFile (HttpThreadContext* td, string& filename)
     if (FilesUtility::nodeExists (td->filenamePath.c_str ()))
       {
         File file;
-        if (file.openFile (td->filenamePath.c_str (), File::OPEN_IF_EXISTS
-                           | File::WRITE))
-          return td->http->raiseHTTPError (500);
+        try
+          {
+            file.openFile (td->filenamePath.c_str (), File::OPEN_IF_EXISTS
+                           | File::WRITE);
+          }
+        catch (exception & e)
+          {
+            td->connection->host->warningsLogWrite
+              (_("HttpFile: error accessing file %s : %e"),
+               td->filenamePath.c_str (), &e);
+            return td->http->raiseHTTPError (500);
+          }
 
         file.seek (firstByte);
 
@@ -97,10 +106,18 @@ int HttpFile::putFile (HttpThreadContext* td, string& filename)
       {
         /* The file doesn't exist.  */
         File file;
-        if (file.openFile (td->filenamePath.c_str (),
-                           File::FILE_CREATE_ALWAYS
-                           | File::WRITE))
-          return td->http->raiseHTTPError (500);
+        try
+          {
+            file.openFile (td->filenamePath.c_str (), File::FILE_CREATE_ALWAYS
+                           | File::WRITE);
+          }
+        catch (exception & e)
+          {
+            td->connection->host->warningsLogWrite
+              (_("HttpFile: error accessing file %s : %e"),
+               td->filenamePath.c_str (), &e);
+            return td->http->raiseHTTPError (500);
+          }
 
         for (;;)
           {
@@ -248,7 +265,18 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
           !ifModifiedSince->value->compare (tmpTime))
         return td->http->sendHTTPNonModified ();
 
-      file = Server::getInstance ()->getCachedFiles ()->open (filenamePath);
+      try
+        {
+          file = Server::getInstance ()->getCachedFiles ()->open (filenamePath);
+        }
+      catch (exception & e)
+        {
+          td->connection->host->warningsLogWrite
+            (_("HttpFile: error accessing file %s : %e"),
+             td->filenamePath.c_str (), &e);
+          return td->http->raiseHTTPError (500);
+        }
+
       if (!file)
         return td->http->raiseHTTPError (500);
 
diff --git a/myserver/src/log/stream/log_stream.cpp b/myserver/src/log/stream/log_stream.cpp
index e85eb41..5f11eb6 100644
--- a/myserver/src/log/stream/log_stream.cpp
+++ b/myserver/src/log/stream/log_stream.cpp
@@ -49,17 +49,22 @@ LogStream::resetFilters ()
 int
 LogStream::log (const string & message)
 {
-  mutex->lock ();
   int success = 0;
-  if (needToCycle ())
+  mutex->lock ();
+  try
     {
-      success = doCycle () || write (message);
+      if (needToCycle ())
+        success = doCycle () || write (message);
+      else
+        success = write (message);
+
+      mutex->unlock ();
     }
-  else
+  catch (...)
     {
-      success = write (message);
+      mutex->unlock ();
+      throw;
     }
-  mutex->unlock ();
   return success;
 }
 
@@ -111,14 +116,23 @@ LogStream::getFiltersChain ()
 int
 LogStream::close ()
 {
+  int success = 0;
   mutex->lock ();
-  int success = 1;
-  isOpened = fc->flush (&nbw) || out->close ();
-  if (!isOpened)
+  try
     {
-      success = 0;
+      success = 1;
+      isOpened = fc->flush (&nbw) || out->close ();
+      if (! isOpened)
+        success = 0;
+
+      mutex->unlock ();
     }
-  mutex->unlock ();
+  catch (...)
+    {
+      mutex->unlock ();
+      throw;
+    }
+
   return success;
 }
 
@@ -156,18 +170,42 @@ LogStream::update (LogStreamEvent evt, void* message, void* reply)
 int
 LogStream::addFilter (Filter* filter)
 {
+  int success = 0;
   mutex->lock ();
-  int success = fc->addFilter (filter, &nbw);
+  try
+  {
+    success = fc->addFilter (filter, &nbw);
+    mutex->unlock ();
+  }
+  catch (...)
+    {
+      mutex->unlock ();
+      throw;
+    }
+
   mutex->unlock ();
+
   return success;
 }
 
 int
 LogStream::removeFilter (Filter* filter)
 {
+  int success = 0;
   mutex->lock ();
-  int success = fc->removeFilter (filter);
+  try
+  {
+    success = fc->removeFilter (filter);
+    mutex->unlock ();
+  }
+  catch (...)
+    {
+      mutex->unlock ();
+      throw;
+    }
+
   mutex->unlock ();
+
   return success;
 }
 
diff --git a/myserver/src/protocol/ftp/ftp.cpp b/myserver/src/protocol/ftp/ftp.cpp
index 016f15b..eb0d55e 100644
--- a/myserver/src/protocol/ftp/ftp.cpp
+++ b/myserver/src/protocol/ftp/ftp.cpp
@@ -111,13 +111,6 @@ FtpuserData::FtpuserData ()
 
 bool FtpuserData::allowdelete (bool wait)
 {
-  if (wait)
-    {
-      /* Wait for data connection to finish.  */
-      m_DataConnBusy.lock ();
-      m_DataConnBusy.unlock ();
-
-    }
   if (m_pDataConnection != NULL)
     return !m_pDataConnection->isScheduled ();
   else
@@ -633,6 +626,7 @@ void Ftp::retrstor (bool bretr, bool bappend, const std::string & sPath)
 static
 DEFINE_THREAD (SendAsciiFile, pParam)
 {
+  File *file = NULL;
   DataConnectionWorkerThreadData *pWt =
     reinterpret_cast < DataConnectionWorkerThreadData * >(pParam);
   if (pWt == NULL)
@@ -670,27 +664,11 @@ DEFINE_THREAD (SendAsciiFile, pParam)
     }
 
   pFtpuserData->m_DataConnBusy.lock ();
-
-  if (pWt->m_pFtp == NULL)
+  try
     {
-      pFtpuserData->closeDataConnection ();
-      pFtpuserData->m_DataConnBusy.unlock ();
-      delete pWt;
-#ifdef WIN32
-      return 0;
-#elif HAVE_PTHREAD
-      return (void *) 0;
-#endif
-    }
 
-  if (pFtpuserData->m_nFtpstate == FtpuserData::DATA_CONNECTION_UP)
-    ftpReply (pConnection, 125);
-  else
-    {
-      ftpReply (pConnection, 150);
-      if (pWt->m_pFtp->OpenDataConnection () == 0)
+      if (pWt->m_pFtp == NULL)
         {
-          ftpReply (pConnection, 425);
           pFtpuserData->closeDataConnection ();
           pFtpuserData->m_DataConnBusy.unlock ();
           delete pWt;
@@ -700,24 +678,40 @@ DEFINE_THREAD (SendAsciiFile, pParam)
           return (void *) 0;
 #endif
         }
-    }
 
-  if (pFtpuserData->m_pDataConnection == NULL ||
-      pFtpuserData->m_pDataConnection->socket == NULL)
-    {
-      ftpReply (pConnection, 451);
-      pFtpuserData->closeDataConnection ();
-      pFtpuserData->m_DataConnBusy.unlock ();
-      delete pWt;
+      if (pFtpuserData->m_nFtpstate == FtpuserData::DATA_CONNECTION_UP)
+        ftpReply (pConnection, 125);
+      else
+        {
+          ftpReply (pConnection, 150);
+          if (pWt->m_pFtp->OpenDataConnection () == 0)
+            {
+              ftpReply (pConnection, 425);
+              pFtpuserData->closeDataConnection ();
+              pFtpuserData->m_DataConnBusy.unlock ();
+              delete pWt;
 #ifdef WIN32
-      return 0;
+              return 0;
 #elif HAVE_PTHREAD
-      return (void *) 0;
+              return (void *) 0;
 #endif
-    }
-  File *file = NULL;
-  try
-    {
+            }
+        }
+
+      if (pFtpuserData->m_pDataConnection == NULL ||
+          pFtpuserData->m_pDataConnection->socket == NULL)
+        {
+          ftpReply (pConnection, 451);
+          pFtpuserData->closeDataConnection ();
+          pFtpuserData->m_DataConnBusy.unlock ();
+          delete pWt;
+#ifdef WIN32
+          return 0;
+#elif HAVE_PTHREAD
+          return (void *) 0;
+#endif
+        }
+
       file =
         Server::getInstance ()->getCachedFiles ()->open (pWt->m_sFilePath.
                                                          c_str ());
@@ -841,21 +835,23 @@ DEFINE_THREAD (SendAsciiFile, pParam)
         }
       file->close ();
       delete file;
+
+      pFtpuserData->m_sCurrentFileName = "";
+      pFtpuserData->m_nFileSize = 0;
+      pFtpuserData->m_nBytesSent = 0;
+      pFtpuserData->m_nrestartOffset = 0;
+      ftpReply (pConnection, 226);
+      pFtpuserData->closeDataConnection ();
+      pFtpuserData->m_DataConnBusy.unlock ();
     }
   catch (bad_alloc & ba)
     {
       if (file != NULL)
         file->close ();
       delete file;
+      pFtpuserData->m_DataConnBusy.unlock ();
     }
 
-  pFtpuserData->m_sCurrentFileName = "";
-  pFtpuserData->m_nFileSize = 0;
-  pFtpuserData->m_nBytesSent = 0;
-  pFtpuserData->m_nrestartOffset = 0;
-  ftpReply (pConnection, 226);
-  pFtpuserData->closeDataConnection ();
-  pFtpuserData->m_DataConnBusy.unlock ();
   delete pWt;
 #ifdef WIN32
   return 1;
@@ -906,27 +902,11 @@ DEFINE_THREAD (SendImageFile, pParam)
     }
 
   pFtpuserData->m_DataConnBusy.lock ();
-
-  if (pWt->m_pFtp == NULL)
-    {
-      pFtpuserData->closeDataConnection ();
-      pFtpuserData->m_DataConnBusy.unlock ();
-      delete pWt;
-#ifdef WIN32
-      return 0;
-#elif HAVE_PTHREAD
-      return (void *) 0;
-#endif
-    }
-
-  if (pFtpuserData->m_nFtpstate == FtpuserData::DATA_CONNECTION_UP)
-    ftpReply (pConnection, 125);
-  else
+  File *file = NULL;
+  try
     {
-      ftpReply (pConnection, 150);
-      if (pWt->m_pFtp->OpenDataConnection () == 0)
+      if (pWt->m_pFtp == NULL)
         {
-          ftpReply (pConnection, 425);
           pFtpuserData->closeDataConnection ();
           pFtpuserData->m_DataConnBusy.unlock ();
           delete pWt;
@@ -936,25 +916,40 @@ DEFINE_THREAD (SendImageFile, pParam)
           return (void *) 0;
 #endif
         }
-    }
 
-  if (pFtpuserData->m_pDataConnection == NULL ||
-      pFtpuserData->m_pDataConnection->socket == NULL)
-    {
-      ftpReply (pConnection, 451);
-      pFtpuserData->closeDataConnection ();
-      pFtpuserData->m_DataConnBusy.unlock ();
-      delete pWt;
+      if (pFtpuserData->m_nFtpstate == FtpuserData::DATA_CONNECTION_UP)
+        ftpReply (pConnection, 125);
+      else
+        {
+          ftpReply (pConnection, 150);
+          if (pWt->m_pFtp->OpenDataConnection () == 0)
+            {
+              ftpReply (pConnection, 425);
+              pFtpuserData->closeDataConnection ();
+              pFtpuserData->m_DataConnBusy.unlock ();
+              delete pWt;
 #ifdef WIN32
-      return 0;
+              return 0;
 #elif HAVE_PTHREAD
-      return (void *) 0;
+              return (void *) 0;
 #endif
-    }
+            }
+        }
+
+      if (pFtpuserData->m_pDataConnection == NULL ||
+          pFtpuserData->m_pDataConnection->socket == NULL)
+        {
+          ftpReply (pConnection, 451);
+          pFtpuserData->closeDataConnection ();
+          pFtpuserData->m_DataConnBusy.unlock ();
+          delete pWt;
+#ifdef WIN32
+          return 0;
+#elif HAVE_PTHREAD
+          return (void *) 0;
+#endif
+        }
 
-  File *file = NULL;
-  try
-    {
       file =
         Server::getInstance ()->getCachedFiles ()->open (pWt->m_sFilePath.
                                                          c_str ());
@@ -1033,6 +1028,7 @@ DEFINE_THREAD (SendImageFile, pParam)
       if (file != NULL)
         file->close ();
       delete file;
+      pFtpuserData->m_DataConnBusy.unlock ();
     }
 
   pFtpuserData->m_sCurrentFileName = "";
@@ -1042,6 +1038,7 @@ DEFINE_THREAD (SendImageFile, pParam)
   ftpReply (pConnection, 226);
   pFtpuserData->closeDataConnection ();
   pFtpuserData->m_DataConnBusy.unlock ();
+
   delete pWt;
 #ifdef WIN32
   return 1;



commit cbee09074feaf3dccfb22f14c0862cb03b20e36f
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 15 21:23:42 2010 +0200

    The log manager uses %e as formatter for exceptions

diff --git a/myserver/src/log/log_manager.cpp b/myserver/src/log/log_manager.cpp
index eb142b8..61c714e 100644
--- a/myserver/src/log/log_manager.cpp
+++ b/myserver/src/log/log_manager.cpp
@@ -22,6 +22,8 @@
 #include <include/log/log_manager.h>
 #include <include/server/server.h>
 
+#include <include/base/exceptions/exceptions.h>
+
 #include <cstdarg>
 
 /*!
@@ -667,11 +669,11 @@ LogManager::log (const void* owner, const string & type, LoggingLevel level,
               switch (*fmt)
                 {
                 case 's':
-                  oss << static_cast<const char*> (va_arg (args, const char*));
+                  oss << static_cast<const char *> (va_arg (args, const char *));
                   break;
 
                 case 'S':
-                  oss << static_cast<string*> (va_arg (args, string*));
+                  oss << static_cast<string *> (va_arg (args, string *));
                   break;
 
                 case '%':
@@ -682,6 +684,11 @@ LogManager::log (const void* owner, const string & type, LoggingLevel level,
                   oss << static_cast<int> (va_arg (args, int));
                   break;
 
+                case 'e':
+                  oss << (static_cast<exception *> (va_arg (args,
+                                                     exception *)))->what ();
+                  break;
+
                 default:
                   mutex->unlock ();
                   return 1;



commit 0570505f9b6d0642ef1fcdc8df3188f39355474c
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 15 20:21:24 2010 +0200

    Test if errno is read correctly

diff --git a/myserver/tests/test_exceptions.cpp b/myserver/tests/test_exceptions.cpp
index 4efff3c..a6ad610 100644
--- a/myserver/tests/test_exceptions.cpp
+++ b/myserver/tests/test_exceptions.cpp
@@ -31,8 +31,9 @@ using namespace std;
 class TestExceptions : public CppUnit::TestFixture
 {
   CPPUNIT_TEST_SUITE ( TestExceptions );
-  CPPUNIT_TEST (testCatch1);
-  CPPUNIT_TEST (testCatch2);
+  CPPUNIT_TEST (testWrongCloseDir);
+  CPPUNIT_TEST (testWrongCwd);
+  CPPUNIT_TEST (testErrno);
   CPPUNIT_TEST_SUITE_END ();
 
   DIR *foodir;
@@ -47,12 +48,12 @@ public:
 
   void tearDown () {}
 
-  void testCatch1 ()
+  void testWrongCloseDir ()
   {
     try
       {
         checked::closedir (foodir);
-        CPPUNIT_FAIL ("The exception in testCatch1 wasn't thrown or caught");
+        CPPUNIT_FAIL ("The exception in testWrongCloseDir wasn't thrown or caught");
       }
     catch (ArgumentListException& e)
       {
@@ -60,16 +61,32 @@ public:
       }
     catch (...)
       {
-        CPPUNIT_FAIL ("The wrong exception in testCatch1 was thrown");
+        CPPUNIT_FAIL ("The wrong exception in testWrongCloseDir was thrown");
       }
   }
 
-  void testCatch2 ()
+  void testErrno ()
+  {
+    bool success = false;
+    errno = EINVAL;
+    try
+      {
+        checked::raiseException ();
+      }
+    catch (AbstractServerException & ase)
+      {
+        success = ase.getErrno () == EINVAL;
+      }
+
+    CPPUNIT_ASSERT (success);
+  }
+
+  void testWrongCwd ()
   {
     try
       {
         char *p = checked::getcwd (buf, 1);
-        CPPUNIT_FAIL ("The exception in testCatch2 wasn't thrown or caught");
+        CPPUNIT_FAIL ("The exception in testWrongCwd wasn't thrown or caught");
       }
     catch (OverflowException& e)
       {
@@ -77,7 +94,7 @@ public:
       }
     catch (...)
       {
-        CPPUNIT_FAIL ("The wrong exception in testCatch2 was thrown");
+        CPPUNIT_FAIL ("The wrong exception in testWrongCwd was thrown");
       }
   }
 };

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

Summary of changes:
 .../src/base/files_cache/cached_file_factory.cpp   |  197 +++++++++--------
 myserver/src/base/home_dir/home_dir.cpp            |   13 +-
 .../src/base/process/process_server_manager.cpp    |  238 ++++++++++++--------
 myserver/src/base/safetime/safetime.cpp            |   12 +-
 .../connections_scheduler.cpp                      |    7 -
 .../src/connections_scheduler/listen_threads.cpp   |   13 +-
 myserver/src/http_handler/http_file/http_file.cpp  |   44 +++-
 myserver/src/log/log_manager.cpp                   |   11 +-
 myserver/src/log/stream/log_stream.cpp             |   64 +++++-
 myserver/src/protocol/ftp/ftp.cpp                  |  155 +++++++-------
 myserver/tests/test_exceptions.cpp                 |   33 ++-
 11 files changed, 473 insertions(+), 314 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Fri Apr 16 06:16:37 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O2ibF-0006f4-2A
	for mharc-myserver-commit@gnu.org; Fri, 16 Apr 2010 06:16:37 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O2ibC-0006eE-Nu
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 06:16:34 -0400
Received: from [140.186.70.92] (port=48926 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O2ibA-0006cU-AN
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 06:16:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2ib9-00048k-0O
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 06:16:32 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:51031
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2ib7-00048K-MJ
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 06:16:30 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2ib7-0005GM-5y
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 10:16:29 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O2ib6-0002hC-Uv
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 10:16:29 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 31db1be72710a7980801f6f364d17efadffe6345
X-Git-Newrev: f279655f07393b44d1cc8860ea6dbf4ddce4f3fe
Message-Id: <E1O2ib6-0002hC-Uv@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Fri, 16 Apr 2010 10:16:28 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-142-gf279655
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, 16 Apr 2010 10:16:35 -0000

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

The branch, master has been updated
       via  f279655f07393b44d1cc8860ea6dbf4ddce4f3fe (commit)
       via  361b27bfac39972528beffa75956112d82a69afc (commit)
      from  31db1be72710a7980801f6f364d17efadffe6345 (commit)

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

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


commit f279655f07393b44d1cc8860ea6dbf4ddce4f3fe
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 16 12:12:28 2010 +0200

    HttpFile logs errors

diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index c23a060..5dc253a 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -63,7 +63,7 @@ int HttpFile::putFile (HttpThreadContext* td, string& filename)
         catch (exception & e)
           {
             td->connection->host->warningsLogWrite
-              (_("HttpFile: error accessing file %s : %e"),
+              (_E ("HttpFile: error accessing file %s"),
                td->filenamePath.c_str (), &e);
             return td->http->raiseHTTPError (500);
           }
@@ -114,7 +114,7 @@ int HttpFile::putFile (HttpThreadContext* td, string& filename)
         catch (exception & e)
           {
             td->connection->host->warningsLogWrite
-              (_("HttpFile: error accessing file %s : %e"),
+              (_E ("HttpFile: error accessing file %s"),
                td->filenamePath.c_str (), &e);
             return td->http->raiseHTTPError (500);
           }
@@ -152,8 +152,10 @@ int HttpFile::putFile (HttpThreadContext* td, string& filename)
         return HttpDataHandler::RET_OK;
       }
   }
-  catch (...)
+  catch (exception & e)
     {
+      td->connection->host->warningsLogWrite (_E ("HttpFile: internal error"),
+                                              &e);
       return td->http->raiseHTTPError (500);
     };
 }
@@ -168,7 +170,7 @@ int HttpFile::deleteFile (HttpThreadContext* td,
   string file;
   try
     {
-      if (!(td->permissions & MYSERVER_PERMISSION_DELETE))
+      if (! (td->permissions & MYSERVER_PERMISSION_DELETE))
         return td->http->sendAuth ();
 
       if (FilesUtility::nodeExists (td->filenamePath))
@@ -179,8 +181,11 @@ int HttpFile::deleteFile (HttpThreadContext* td,
       else
         return td->http->raiseHTTPError (204);
     }
-  catch (...)
+  catch (exception & e)
     {
+      td->connection->host->warningsLogWrite
+        (_E ("HttpFile: cannot delete file %s"),
+         td->filenamePath.c_str (), &e);
       return td->http->raiseHTTPError (500);
     };
 }
@@ -268,18 +273,17 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
       try
         {
           file = Server::getInstance ()->getCachedFiles ()->open (filenamePath);
+          if (! file)
+            return td->http->raiseHTTPError (500);
         }
       catch (exception & e)
         {
           td->connection->host->warningsLogWrite
-            (_("HttpFile: error accessing file %s : %e"),
+            (_E ("HttpFile: error accessing file %s"),
              td->filenamePath.c_str (), &e);
           return td->http->raiseHTTPError (500);
         }
 
-      if (!file)
-        return td->http->raiseHTTPError (500);
-
     /*
      * Check how many bytes are ready to be send.
      */
@@ -289,7 +293,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
     generateEtag (etag, lastMT, filesize);
 
     HttpRequestHeader::Entry *etagHeader = td->request.other.get ("etag");
-    if (etagHeader &&  !etagHeader->value->compare (etag))
+    if (etagHeader && !etagHeader->value->compare (etag))
       return td->http->sendHTTPNonModified ();
     else
       {
@@ -325,13 +329,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
     /*
      * If fail to set the file pointer returns an internal server error.
      */
-    ret = file->seek (firstByte);
-    if (ret)
-      {
-        file->close ();
-        delete file;
-        return td->http->raiseHTTPError (500);
-      }
+    file->seek (firstByte);
 
     keepalive = td->request.isKeepAlive ();
 
@@ -363,18 +361,12 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
     if (td->mime)
       {
         HttpRequestHeader::Entry* e = td->request.other.get ("accept-encoding");
-        if (td->mime &&
-            Server::getInstance ()->getFiltersFactory ()->chain (&chain,
-                                                                 td->mime->filters,
-                                                                 &memStream,
-                                                                 &nbw, 0,
-                                                                 e ? e->value : NULL))
-          {
-            file->close ();
-            delete file;
-            chain.clearAllFilters ();
-            return HttpDataHandler::RET_FAILURE;
-          }
+        if (td->mime)
+          Server::getInstance ()->getFiltersFactory ()->chain (&chain,
+                                                               td->mime->filters,
+                                                               &memStream,
+                                                               &nbw, 0,
+                                                               e ? e->value : NULL);
         memStream.refresh ();
         dataSent += nbw;
       }
@@ -384,7 +376,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
     if (!useModifiers)
       {
         ostringstream buffer;
-        buffer << (u_int)bytesToSend;
+        buffer << (u_int) bytesToSend;
         td->response.contentLength.assign (buffer.str ());
       }
 
@@ -435,14 +427,8 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
           delete e;
       }
 
-    if (HttpHeaders::sendHeader (td->response, *td->connection->socket,
-                                 *td->buffer, td))
-      {
-        file->close ();
-        delete file;
-        chain.clearAllFilters ();
-        return HttpDataHandler::RET_FAILURE;
-      }
+    HttpHeaders::sendHeader (td->response, *td->connection->socket,
+                             *td->buffer, td);
 
     /*
       If is requested only the header exit from the function;
@@ -464,8 +450,8 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
         && !(td->http->getProtocolOptions () & Protocol::SSL))
       {
         u_long nbw = 0;
-        int ret = file->fastCopyToSocket (td->connection->socket, firstByte,
-                                          td->buffer, &nbw);
+        file->fastCopyToSocket (td->connection->socket, firstByte,
+                                td->buffer, &nbw);
 
         file->close ();
         delete file;
@@ -474,10 +460,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
 
         td->sentData += nbw;
 
-        if (ret)
-          return HttpDataHandler::RET_FAILURE;
-        else
-          return HttpDataHandler::RET_OK;
+        return HttpDataHandler::RET_OK;
       }
 
     if (td->appendOutputs)
@@ -492,29 +475,16 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
     */
     if (memStream.availableToRead ())
       {
-        if (memStream.read (td->buffer->getBuffer (),
-                            td->buffer->getRealLength (), &nbr))
-          {
-            file->close ();
-            delete file;
-            chain.clearAllFilters ();
-            return HttpDataHandler::RET_FAILURE;
-          }
+        memStream.read (td->buffer->getBuffer (),
+                        td->buffer->getRealLength (), &nbr);
 
         memStream.refresh ();
-        if (nbr
-            && HttpDataHandler::appendDataToHTTPChannel (td,
-                                                      td->buffer->getBuffer (),
-                                                     nbr, &(td->outputData),
-                                                     &chain, td->appendOutputs,
-                                                         useChunks))
-          {
-            file->close ();
-            delete file;
-            chain.clearAllFilters ();
-            dataSent += nbw;
-            return HttpDataHandler::RET_FAILURE;
-          }
+        if (nbr)
+          HttpDataHandler::appendDataToHTTPChannel (td,
+                                                    td->buffer->getBuffer (),
+                                                    nbr, &(td->outputData),
+                                                    &chain, td->appendOutputs,
+                                                    useChunks);
       } /* memStream.availableToRead ().  */
 
     /* Flush the rest of the file.  */
@@ -527,11 +497,10 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
         if (bytesToSend)
           {
             /* Read from the file the bytes to send.  */
-            if ((ret = file->read (td->buffer->getBuffer (),
+            file->read (td->buffer->getBuffer (),
                                   std::min (static_cast<u_long> (bytesToSend),
                       static_cast<u_long> (td->buffer->getRealLength () / 2)),
-                                  &nbr)))
-              break;
+                        &nbr);
 
             if (nbr == 0)
               {
@@ -541,11 +510,9 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
 
             bytesToSend -= nbr;
 
-            if ((ret = appendDataToHTTPChannel (td, td->buffer->getBuffer (),
+            appendDataToHTTPChannel (td, td->buffer->getBuffer (),
                            nbr, &(td->outputData), &chain, td->appendOutputs,
-                        useChunks, td->buffer->getRealLength (), &memStream)))
-              break;
-
+                               useChunks, td->buffer->getRealLength (), &memStream);
             dataSent += nbr;
           }
         else /* if (bytesToSend) */
@@ -553,7 +520,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
             /* If we don't use chunks we can flush directly.  */
             if (!useChunks)
               {
-                ret = chain.flush (&nbw);
+                chain.flush (&nbw);
                 break;
               }
             else
@@ -567,22 +534,21 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
                 Stream* tmpStream = chain.getStream ();
                 chain.setStream (&memStream);
                 memStream.refresh ();
-                if ((ret = chain.flush (&nbw)))
-                  break;
+                chain.flush (&nbw);
 
                 chain.setStream (tmpStream);
-                if ((ret = memStream.read (td->buffer->getBuffer (),
-                                          td->buffer->getRealLength (), &nbr)))
-                  break;
-
-                if ((ret = HttpDataHandler::appendDataToHTTPChannel (td,
-                        td->buffer->getBuffer (), nbr, &(td->outputData),
-                                   &chain, td->appendOutputs, useChunks)))
-                  break;
-
-                ret = HttpDataHandler::appendDataToHTTPChannel (td, 0, 0,
-                                               &(td->outputData), &chain,
-                                            td->appendOutputs, useChunks);
+                memStream.read (td->buffer->getBuffer (),
+                                td->buffer->getRealLength (), &nbr);
+
+                HttpDataHandler::appendDataToHTTPChannel (td,
+                                                       td->buffer->getBuffer (),
+                                                       nbr, &(td->outputData),
+                                                       &chain, td->appendOutputs,
+                                                          useChunks);
+
+                HttpDataHandler::appendDataToHTTPChannel (td, 0, 0,
+                                                     &(td->outputData), &chain,
+                                                 td->appendOutputs, useChunks);
                 break;
               }
           }
@@ -592,15 +558,16 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
     file->close ();
     delete file;
   }
-  catch (...)
+  catch (exception & e)
     {
       if (file)
         {
           file->close ();
           delete file;
         }
-      td->connection->host->warningsLogWrite (_("HttpFile: internal error"));
       chain.clearAllFilters ();
+      td->connection->host->warningsLogWrite (_E ("HttpFile: internal error"),
+                                              &e);
       return td->http->raiseHTTPError (500);
     }
 
@@ -608,10 +575,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
   td->sentData += dataSent;
   chain.clearAllFilters ();
 
-  if (ret)
-    return HttpDataHandler::RET_FAILURE;
-  else
-    return HttpDataHandler::RET_OK;
+  return HttpDataHandler::RET_OK;
 }
 
 /*!



commit 361b27bfac39972528beffa75956112d82a69afc
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 16 12:10:48 2010 +0200

    Define a macro _E which helps to format error messages with an exception
    
    It automatically appends the exception formatter to the message string

diff --git a/myserver/myserver.h b/myserver/myserver.h
index 013c606..566b916 100644
--- a/myserver/myserver.h
+++ b/myserver/myserver.h
@@ -60,3 +60,9 @@ typedef void* HANDLE;
 #else
 # define _(X) X
 #endif
+
+/*
+ * Automatically append an exception to the formatting string.
+ * Don't forget to pass as last parameter a pointer to an exception.
+ */
+#define _E(X) _(X " : %e")

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

Summary of changes:
 myserver/myserver.h                               |    6 +
 myserver/src/http_handler/http_file/http_file.cpp |  150 ++++++++-------------
 2 files changed, 63 insertions(+), 93 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Fri Apr 16 06:36:25 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O2iuP-0005qL-Ke
	for mharc-myserver-commit@gnu.org; Fri, 16 Apr 2010 06:36:25 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O2iuN-0005pp-5N
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 06:36:23 -0400
Received: from [140.186.70.92] (port=54622 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O2iuK-0005pK-Mq
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 06:36:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2iuI-0007vS-PJ
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 06:36:20 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:58154
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2iuI-0007vL-Hw
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 06:36:18 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2iuI-0005UG-04
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 10:36:18 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O2iuH-0004Ac-Sw
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 10:36:17 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: f279655f07393b44d1cc8860ea6dbf4ddce4f3fe
X-Git-Newrev: e165cb33edf7a110cd2beb297fe22d25dbe88e76
Message-Id: <E1O2iuH-0004Ac-Sw@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Fri, 16 Apr 2010 10:36:17 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-143-ge165cb3
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, 16 Apr 2010 10:36:23 -0000

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

The branch, master has been updated
       via  e165cb33edf7a110cd2beb297fe22d25dbe88e76 (commit)
      from  f279655f07393b44d1cc8860ea6dbf4ddce4f3fe (commit)

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

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


commit e165cb33edf7a110cd2beb297fe22d25dbe88e76
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 16 12:34:49 2010 +0200

    HttpDir handles exceptions properly

diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp b/myserver/src/http_handler/http_dir/http_dir.cpp
index 89b0060..3fa9fdc 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -286,8 +286,8 @@ void HttpDir::generateElement (MemBuf &out,
  * \param onlyHeader Specify if send only the HTTP header.
 */
 int HttpDir::send (HttpThreadContext* td,
-                  const char* directory, const char* cgi,
-                  bool execute, bool onlyHeader)
+                   const char* directory, const char* cgi,
+                   bool execute, bool onlyHeader)
 {
   u_long nbw;
   string filename;
@@ -307,343 +307,301 @@ int HttpDir::send (HttpThreadContext* td,
   string linkPrefix;
   Regex ignRegex;
   const char *ignPattern;
-  const char *formatString = td->securityToken.getData ("http.dir.format",
-                                                        MYSERVER_SECURITY_CONF
-                                                        | MYSERVER_VHOST_CONF
-                                                        | MYSERVER_SERVER_CONF,
-                                                        "%f%t%s");
+  const char *formatString;
+  HttpRequestHeader::Entry *host;
 
+  try
+    {
+      host = td->request.other.get ("host");
+      formatString = td->securityToken.getData ("http.dir.format",
+                                                MYSERVER_SECURITY_CONF
+                                                | MYSERVER_VHOST_CONF
+                                                | MYSERVER_SERVER_CONF,
+                                                "%f%t%s");
 
-  HttpRequestHeader::Entry *host = td->request.other.get ("host");
 
-  chain.setStream (td->connection->socket);
-  if ( !(td->permissions & MYSERVER_PERMISSION_BROWSE))
-    return td->http->sendAuth ();
+      host = td->request.other.get ("host");
+      chain.setStream (td->connection->socket);
+      if (! (td->permissions & MYSERVER_PERMISSION_BROWSE))
+        return td->http->sendAuth ();
 
-  if (td->mime
-      && Server::getInstance ()->getFiltersFactory ()->chain (&chain,
-                                                    td->mime->filters,
-                                                td->connection->socket,
-                                                              &nbw, 1))
-    {
-      td->connection->host->warningsLogWrite (_("HttpDir: internal error"));
-      chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
+      if (td->mime)
+        Server::getInstance ()->getFiltersFactory ()->chain (&chain,
+                                                             td->mime->filters,
+                                                             td->connection->socket,
+                                                             &nbw, 1);
 
-  lastSlash = td->request.uri.rfind ('/') + 1;
+      lastSlash = td->request.uri.rfind ('/') + 1;
 
-  checkDataChunks (td, &keepalive, &useChunks);
+      checkDataChunks (td, &keepalive, &useChunks);
 
-  td->response.setValue ("content-type", "text/html");
+      td->response.setValue ("content-type", "text/html");
 
-  ignPattern = td->securityToken.getData ("http.dir.ignore",
-                                          MYSERVER_SECURITY_CONF
-                                          | MYSERVER_VHOST_CONF
-                                          | MYSERVER_SERVER_CONF, NULL);
-  if (ignPattern)
-    {
-      int ret = ignRegex.compile (ignPattern, REG_EXTENDED);
-      if (ret)
+      ignPattern = td->securityToken.getData ("http.dir.ignore",
+                                              MYSERVER_SECURITY_CONF
+                                              | MYSERVER_VHOST_CONF
+                                              | MYSERVER_SERVER_CONF, NULL);
+      if (ignPattern)
         {
-          td->connection->host->warningsLogWrite (_("HttpDir: pattern `%s' "
-                                                  "is not valid"), ignPattern);
-
-          fd.findclose ();
-          td->outputData.close ();
-          chain.clearAllFilters ();
-          return td->http->raiseHTTPError (500);
+          int ret = ignRegex.compile (ignPattern, REG_EXTENDED);
+          if (ret)
+            {
+              td->connection->host->warningsLogWrite (_("HttpDir: pattern `%s' "
+                                                        "is not valid"), ignPattern);
+
+              fd.findclose ();
+              td->outputData.close ();
+              chain.clearAllFilters ();
+              return td->http->raiseHTTPError (500);
+            }
         }
-    }
 
-  if (HttpHeaders::sendHeader (td->response, *td->connection->socket,
-                               *td->buffer, td))
-    return HttpDataHandler::RET_FAILURE;
+      HttpHeaders::sendHeader (td->response, *td->connection->socket,
+                               *td->buffer, td);
 
-  if (onlyHeader)
-    return HttpDataHandler::RET_OK;
+      if (onlyHeader)
+        return HttpDataHandler::RET_OK;
 
-  sortIndex = td->request.uriOpts.find ("sort=");
+      sortIndex = td->request.uriOpts.find ("sort=");
 
-  if (sortIndex != string::npos && sortIndex + 5 < td->request.uriOpts.length ())
-    sortType = td->request.uriOpts.at (sortIndex + 5);
+      if (sortIndex != string::npos && sortIndex + 5 < td->request.uriOpts.length ())
+        sortType = td->request.uriOpts.at (sortIndex + 5);
 
-  if (sortIndex != string::npos && sortIndex + 6 < td->request.uriOpts.length ())
-    sortReverse = td->request.uriOpts.at (sortIndex + 6) == 'I';
+      if (sortIndex != string::npos && sortIndex + 6 < td->request.uriOpts.length ())
+        sortReverse = td->request.uriOpts.at (sortIndex + 6) == 'I';
 
-  /* Make sortType always lowercase.  */
-  switch (sortType)
-    {
-    case 's':
-    case 'S':
-      sortType = 's';
-      break;
+      /* Make sortType always lowercase.  */
+      switch (sortType)
+        {
+        case 's':
+        case 'S':
+          sortType = 's';
+          break;
 
-    case 't':
-    case 'T':
-      sortType = 't';
-      break;
-    }
+        case 't':
+        case 'T':
+          sortType = 't';
+          break;
+        }
 
-  cssFile = td->securityToken.getData ("http.dir.css", MYSERVER_SECURITY_CONF
-                                       | MYSERVER_VHOST_CONF
-                                       | MYSERVER_SERVER_CONF, NULL);
+      cssFile = td->securityToken.getData ("http.dir.css", MYSERVER_SECURITY_CONF
+                                           | MYSERVER_VHOST_CONF
+                                           | MYSERVER_SERVER_CONF, NULL);
 
-  td->auxiliaryBuffer->setLength (0);
-  *td->auxiliaryBuffer << "<?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>" ;
-  *td->auxiliaryBuffer << td->request.uri.c_str () ;
-  *td->auxiliaryBuffer << "</title>\r\n";
+      td->auxiliaryBuffer->setLength (0);
+      *td->auxiliaryBuffer << "<?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>" ;
+      *td->auxiliaryBuffer << td->request.uri.c_str () ;
+      *td->auxiliaryBuffer << "</title>\r\n";
+
+      /*
+       * If it is defined a CSS file for the graphic layout of
+       * the browse directory insert it in the page.
+       */
+      if (cssFile)
+        {
+          *td->auxiliaryBuffer << "<link rel=\"stylesheet\" href=\""
+                               << cssFile
+                               << "\" type=\"text/css\" media=\"all\"/>\r\n";
+        }
 
-  /*
-   * If it is defined a CSS file for the graphic layout of
-   * the browse directory insert it in the page.
-   */
-  if (cssFile)
-    {
-      *td->auxiliaryBuffer << "<link rel=\"stylesheet\" href=\""
-                           << cssFile
-                           << "\" type=\"text/css\" media=\"all\"/>\r\n";
-    }
+      *td->auxiliaryBuffer << "</head>\r\n";
 
-  *td->auxiliaryBuffer << "</head>\r\n";
+      appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
+                               td->auxiliaryBuffer->getLength (),
+                               &(td->outputData), &chain,
+                               td->appendOutputs, useChunks);
 
-  ret = appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                 td->auxiliaryBuffer->getLength (),
-                                 &(td->outputData), &chain,
-                                 td->appendOutputs, useChunks);
-  if (ret)
-    {
-      /* Return an internal server error. */
-      td->outputData.close ();
-      chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
+      sentData = td->auxiliaryBuffer->getLength ();
 
-  sentData = td->auxiliaryBuffer->getLength ();
+      filename = directory;
+      td->auxiliaryBuffer->setLength (0);
+      *td->auxiliaryBuffer << "<body>\r\n<h1>Contents of directory ";
+      *td->auxiliaryBuffer <<  &td->request.uri[lastSlash] ;
+      *td->auxiliaryBuffer << "</h1>\r\n<hr />\r\n";
 
-  filename = directory;
-  td->auxiliaryBuffer->setLength (0);
-  *td->auxiliaryBuffer << "<body>\r\n<h1>Contents of directory ";
-  *td->auxiliaryBuffer <<  &td->request.uri[lastSlash] ;
-  *td->auxiliaryBuffer << "</h1>\r\n<hr />\r\n";
+      appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
+                               td->auxiliaryBuffer->getLength (),
+                               &(td->outputData), &chain,
+                               td->appendOutputs, useChunks);
 
-  ret = appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                 td->auxiliaryBuffer->getLength (),
-                                 &(td->outputData), &chain,
-                                 td->appendOutputs, useChunks);
+      sentData += td->auxiliaryBuffer->getLength ();
 
-  if (ret)
-    {
-      td->outputData.close ();
-      /* Return an internal server error.  */
-      return td->http->raiseHTTPError (500);
-    }
-  sentData += td->auxiliaryBuffer->getLength ();
+      fd.findfirst (filename.c_str ());
 
-  ret = fd.findfirst (filename.c_str ());
+      /*
+       * With the current code we build the HTML TABLE to indicize the
+       * files in the directory.
+       */
+      td->auxiliaryBuffer->setLength (0);
+      *td->auxiliaryBuffer << "<table width=\"100%\">\r\n" ;
 
-  if (ret == -1)
-    {
-      chain.clearAllFilters ();
-      return td->http->raiseHTTPError (404);
-    }
+      generateHeader (*td->auxiliaryBuffer, sortType, sortReverse, formatString);
 
-  /*
-   * With the current code we build the HTML TABLE to indicize the
-   * files in the directory.
-   */
-  td->auxiliaryBuffer->setLength (0);
-  *td->auxiliaryBuffer << "<table width=\"100%\">\r\n" ;
+      appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
+                               td->auxiliaryBuffer->getLength (),
+                               &(td->outputData), &chain,
+                               td->appendOutputs, useChunks);
 
-  generateHeader (*td->auxiliaryBuffer, sortType, sortReverse, formatString);
+      sentData += td->auxiliaryBuffer->getLength ();
 
-  ret = appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                 td->auxiliaryBuffer->getLength (),
-                                 &(td->outputData), &chain,
-                                 td->appendOutputs, useChunks);
+      td->auxiliaryBuffer->setLength (0);
 
-  if (ret)
-    {
-      td->outputData.close ();
-      chain.clearAllFilters ();
-      /* Return an internal server error.  */
-      return td->http->raiseHTTPError (500);
-    }
+      if (FilesUtility::getPathRecursionLevel (td->request.uri) >= 1)
+        {
+          const char* cur = formatString;
+          string file;
+          file.assign (td->request.uri);
+          file.append ("/../");
 
-  sentData += td->auxiliaryBuffer->getLength ();
+          *td->auxiliaryBuffer << "<tr>\r\n";
 
-  td->auxiliaryBuffer->setLength (0);
+          for (;;)
+            {
+              while (*cur && ((*cur == '%' ) || (*cur == ' ' )))
+                cur++;
 
-  if (FilesUtility::getPathRecursionLevel (td->request.uri) >= 1)
-    {
-      const char* cur = formatString;
-      string file;
-      file.assign (td->request.uri);
-      file.append ("/../");
+              if (!(*cur))
+                break;
 
-      *td->auxiliaryBuffer << "<tr>\r\n";
+              if (*cur == 'f')
+                *td->auxiliaryBuffer << "<td>\n"
+                                     << "<a href=\""
+                                     << (td->request.uriEndsWithSlash ? ".."
+                                         :  ".")
+                                     << "\">[ .. ]</a></td>\n";
+              else
+                *td->auxiliaryBuffer << "<td></td>\n";
 
-      for (;;)
-        {
-          while (*cur && ((*cur == '%' ) || (*cur == ' ' )))
-            cur++;
+              cur++;
+            }
 
-          if (!(*cur))
-            break;
+          *td->auxiliaryBuffer << "</tr>\r\n";
 
-          if (*cur == 'f')
-            *td->auxiliaryBuffer << "<td>\n"
-                                 << "<a href=\""
-                                 << (td->request.uriEndsWithSlash ? ".." : ".")
-                                 << "\">[ .. ]</a></td>\n";
-          else
-            *td->auxiliaryBuffer << "<td></td>\n";
+          appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
+                                   td->auxiliaryBuffer->getLength (),
+                                   &(td->outputData), &chain,
+                                   td->appendOutputs, useChunks);
 
-          cur++;
+          sentData += td->auxiliaryBuffer->getLength ();
         }
 
-      *td->auxiliaryBuffer << "</tr>\r\n";
-
-      ret = appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                     td->auxiliaryBuffer->getLength (),
-                                     &(td->outputData), &chain,
-                                     td->appendOutputs, useChunks);
-      if (ret)
+      /* Put all files in a vector.  */
+      do
         {
-          fd.findclose ();
-          td->outputData.close ();
-          chain.clearAllFilters ();
-          /* Return an internal server error.  */
-          return td->http->raiseHTTPError (500);
+          if (fd.name[0] == '.')
+            continue;
+
+          if (ignPattern)
+            {
+              regmatch_t pm[1];
+              if (! ignRegex.exec (fd.name, 1, pm, 0))
+                continue;
+            }
+
+          FileStruct file;
+          file.name = fd.name;
+          file.time_write = fd.time_write;
+          file.attrib = fd.attrib;
+          file.size = fd.size;
+          files.push_back (file);
         }
-      sentData += td->auxiliaryBuffer->getLength ();
-    }
+      while (! fd.findnext ());
 
-  /* Put all files in a vector.  */
-  do
-    {
-      if (fd.name[0] == '.')
-        continue;
+      fd.findclose ();
 
-      if (ignPattern)
+      /* Sort the vector.  */
+      switch (sortType)
         {
-          regmatch_t pm[1];
-          if (! ignRegex.exec (fd.name, 1, pm, 0))
-            continue;
+        case 's':
+          sort (files.begin (), files.end (), compareFileStructBySize);
+          break;
+        case 't':
+          sort (files.begin (), files.end (), compareFileStructByTime);
+          break;
+        case 'f':
+          sort (files.begin (), files.end (), compareFileStructByName);
         }
 
-      FileStruct file;
-      file.name = fd.name;
-      file.time_write = fd.time_write;
-      file.attrib = fd.attrib;
-      file.size = fd.size;
-      files.push_back (file);
-    }
-  while (!fd.findnext ());
-
-  fd.findclose ();
-
-  /* Sort the vector.  */
-  switch (sortType)
-    {
-    case 's':
-      sort (files.begin (), files.end (), compareFileStructBySize);
-      break;
-    case 't':
-      sort (files.begin (), files.end (), compareFileStructByTime);
-      break;
-    case 'f':
-      sort (files.begin (), files.end (), compareFileStructByName);
-    }
+      if (sortReverse)
+        reverse (files.begin (), files.end ());
 
-  if (sortReverse)
-    reverse (files.begin (), files.end ());
-
-  if (!td->request.uriEndsWithSlash)
-    {
-      linkPrefix.assign (&td->request.uri[lastSlash]);
-      linkPrefix.append ("/");
-    }
-  else
-    linkPrefix.assign ("");
+      if (!td->request.uriEndsWithSlash)
+        {
+          linkPrefix.assign (&td->request.uri[lastSlash]);
+          linkPrefix.append ("/");
+        }
+      else
+        linkPrefix.assign ("");
 
 
-  /* Build the files table and send it.  */
-  for (vector<FileStruct>::iterator it = files.begin ();
-       it != files.end (); it++)
-    {
-      FileStruct& file = *it;
+      /* Build the files table and send it.  */
+      for (vector<FileStruct>::iterator it = files.begin ();
+           it != files.end (); it++)
+        {
+          FileStruct& file = *it;
+          td->auxiliaryBuffer->setLength (0);
+          generateElement (*td->auxiliaryBuffer, file, linkPrefix, formatString);
+          appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
+                                   td->auxiliaryBuffer->getLength (),
+                                   &(td->outputData), &chain,
+                                   td->appendOutputs, useChunks);
+
+          sentData += td->auxiliaryBuffer->getLength ();
+        }
 
       td->auxiliaryBuffer->setLength (0);
+      *td->auxiliaryBuffer << "</table>\r\n<hr />\r\n<address>"
+                           << MYSERVER_VERSION;
 
-      generateElement (*td->auxiliaryBuffer, file, linkPrefix, formatString);
+      if (host && host->value->length ())
+        {
+          ostringstream portBuff;
+          size_t portSeparator = host->value->find (':');
+          *td->auxiliaryBuffer << " on ";
+          if (portSeparator != string::npos)
+            *td->auxiliaryBuffer << host->value->substr (0, portSeparator).c_str () ;
+          else
+            *td->auxiliaryBuffer << host->value->c_str () ;
 
+          *td->auxiliaryBuffer << " Port ";
+          portBuff << td->connection->getLocalPort ();
+          *td->auxiliaryBuffer << portBuff.str ();
+        }
+      *td->auxiliaryBuffer << "</address>\r\n</body>\r\n</html>\r\n";
       ret = appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                      td->auxiliaryBuffer->getLength (),
                                      &(td->outputData), &chain,
                                      td->appendOutputs, useChunks);
-      if (ret)
-        {
-          td->outputData.close ();
-          chain.clearAllFilters ();
-          /* Return an internal server error.  */
-          return td->http->raiseHTTPError (500);
-        }
+
 
       sentData += td->auxiliaryBuffer->getLength ();
 
-    }
+      *td->auxiliaryBuffer << end_str;
+      /* Changes the \ character in the / character.  */
+      bufferloop = td->auxiliaryBuffer->getBuffer ();
+      while (*bufferloop++)
+        if (*bufferloop == '\\')
+          *bufferloop = '/';
 
-  td->auxiliaryBuffer->setLength (0);
-  *td->auxiliaryBuffer << "</table>\r\n<hr />\r\n<address>"
-                       << MYSERVER_VERSION;
+      if (!td->appendOutputs && useChunks)
+        chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
 
-  if (host && host->value->length ())
-    {
-      ostringstream portBuff;
-      size_t portSeparator = host->value->find (':');
-      *td->auxiliaryBuffer << " on ";
-      if (portSeparator != string::npos)
-        *td->auxiliaryBuffer << host->value->substr (0, portSeparator).c_str () ;
-      else
-        *td->auxiliaryBuffer << host->value->c_str () ;
-
-      *td->auxiliaryBuffer << " Port ";
-      portBuff << td->connection->getLocalPort ();
-      *td->auxiliaryBuffer << portBuff.str ();
+      /* For logging activity.  */
+      td->sentData += sentData;
     }
-  *td->auxiliaryBuffer << "</address>\r\n</body>\r\n</html>\r\n";
-  ret = appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                 td->auxiliaryBuffer->getLength (),
-                                 &(td->outputData), &chain,
-                                 td->appendOutputs, useChunks);
-
-  if (ret)
+  catch (exception & e)
     {
+      /* Return an internal server error. */
       td->outputData.close ();
-      /* Return an internal server error.  */
+      chain.clearAllFilters ();
+      td->connection->host->warningsLogWrite (_E ("HttpDir: internal error"),
+                                              &e);
       return td->http->raiseHTTPError (500);
     }
-  sentData += td->auxiliaryBuffer->getLength ();
-
-  *td->auxiliaryBuffer << end_str;
-  /* Changes the \ character in the / character.  */
-  bufferloop = td->auxiliaryBuffer->getBuffer ();
-  while (*bufferloop++)
-    if (*bufferloop == '\\')
-      *bufferloop = '/';
-
-  if (!td->appendOutputs && useChunks
-      && chain.getStream ()->write ("0\r\n\r\n", 5, &nbw))
-    return HttpDataHandler::RET_FAILURE;
-
-  /* For logging activity.  */
-  td->sentData += sentData;
-
   chain.clearAllFilters ();
   return HttpDataHandler::RET_OK;
 }

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

Summary of changes:
 myserver/src/http_handler/http_dir/http_dir.cpp |  496 +++++++++++------------
 1 files changed, 227 insertions(+), 269 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Fri Apr 16 11:15:52 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O2nGq-0002u3-40
	for mharc-myserver-commit@gnu.org; Fri, 16 Apr 2010 11:15:52 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O2nGl-0002tj-5d
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 11:15:47 -0400
Received: from [140.186.70.92] (port=57053 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O2nGe-0002tL-7q
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 11:15:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2nGY-0004v2-9v
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 11:15:40 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:38562
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2nGX-0004up-SR
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 11:15:34 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2nGX-0000Uo-9e
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 15:15:33 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O2nGU-0007kF-Go
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 15:15:33 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: e165cb33edf7a110cd2beb297fe22d25dbe88e76
X-Git-Newrev: f038e6c8e486ce869d0e27f9c9a70ee4c0437a13
Message-Id: <E1O2nGU-0007kF-Go@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Fri, 16 Apr 2010 15:15:32 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-153-gf038e6c
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, 16 Apr 2010 15:15:50 -0000

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

The branch, master has been updated
       via  f038e6c8e486ce869d0e27f9c9a70ee4c0437a13 (commit)
       via  6e91afdfa3a1828f2187a3d9bdd13c37be3b68c4 (commit)
       via  d69f285f10568981d946278f8e5fb71c9fe91b65 (commit)
       via  e14fa06a3f342cce3ee8261401168123580e8476 (commit)
       via  fd7f3de29174b1ff29b064f9b45459b972de7dcf (commit)
       via  5fb4cd0ee8856d0dd111aa850f5448b641d685f8 (commit)
       via  0442cc1ea679e7e02067103dd97d0a4ffc06a26d (commit)
       via  f9dc0edd06d506c90b00a4e99bd0a428012ca6d4 (commit)
       via  eaf34a00517172e15a224ed02fc390a1a9cdfe8f (commit)
       via  388a6be0ca412abafe0b929fdc9fa7624dd88905 (commit)
      from  e165cb33edf7a110cd2beb297fe22d25dbe88e76 (commit)

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

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


commit f038e6c8e486ce869d0e27f9c9a70ee4c0437a13
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 16 17:13:56 2010 +0200

    Silent InvalidResourceException when the read is not blocking

diff --git a/myserver/src/base/socket/socket.cpp b/myserver/src/base/socket/socket.cpp
index aa25567..a520b8d 100644
--- a/myserver/src/base/socket/socket.cpp
+++ b/myserver/src/base/socket/socket.cpp
@@ -549,13 +549,17 @@ int Socket::recv (char* buffer, int len, int flags)
 {
   int err = 0;
 
-  err = checked::recv (fd, buffer, len, flags);
-
-  if ( err < 0 && errno == EAGAIN && isNonBlocking)
-    return 0;
-
-  if (err == 0)
-    err = -1;
+  try
+    {
+      err = checked::recv (fd, buffer, len, flags);
+    }
+  catch (InvalidResourceException & e)
+    {
+      if (isNonBlocking)
+        return 0;
+      else
+        throw;
+    }
 
   return err;
 }



commit 6e91afdfa3a1828f2187a3d9bdd13c37be3b68c4
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 16 17:10:01 2010 +0200

    Handle exceptions in the control protocol handler

diff --git a/myserver/src/base/socket/socket.cpp b/myserver/src/base/socket/socket.cpp
index 5bce4af..aa25567 100644
--- a/myserver/src/base/socket/socket.cpp
+++ b/myserver/src/base/socket/socket.cpp
@@ -545,7 +545,7 @@ int Socket::recv (char* buffer, int len, int flags, u_long timeout)
  *Receive data from the socket.
  *Returns -1 on errors.
  */
-int Socket::recv (char* buffer,int len,int flags)
+int Socket::recv (char* buffer, int len, int flags)
 {
   int err = 0;
 
diff --git a/myserver/src/protocol/control/control_protocol.cpp b/myserver/src/protocol/control/control_protocol.cpp
index 8a13616..1d654e5 100644
--- a/myserver/src/protocol/control/control_protocol.cpp
+++ b/myserver/src/protocol/control/control_protocol.cpp
@@ -136,7 +136,7 @@ int ControlProtocol::loadProtocol ()
   else
   {
     md5.init ();
-    md5.update (tmpName, (unsigned int)strlen (tmpName));
+    md5.update (tmpName, (unsigned int) strlen (tmpName));
     md5.end ( adminLogin);
   }
 
@@ -145,7 +145,7 @@ int ControlProtocol::loadProtocol ()
   else
   {
     md5.init ();
-    md5.update (tmpPassword,(unsigned int)strlen (tmpPassword));
+    md5.update (tmpPassword,(unsigned int) strlen (tmpPassword));
     md5.end (adminPassword);
   }
 
@@ -174,7 +174,7 @@ int ControlProtocol::checkAuth (ControlHeader& header)
   md5.end (authLoginHeaderMD5);
 
   md5.init ();
-  md5.update (headerPassword, (unsigned int)strlen (headerPassword));
+  md5.update (headerPassword, (unsigned int) strlen (headerPassword));
   md5.end (authPasswordHeaderMD5);
 
   if ((! strcasecmp (adminLogin, authLoginHeaderMD5)) &&
@@ -204,333 +204,239 @@ int ControlProtocol::controlConnection (ConnectionPtr a, char *request,
   char *command = 0;
   char *opt = 0 ;
   int bufferSize = a->getActiveThread ()->getBufferSize ();
-  /* Input file. */
-  File *inFile = 0;
-  /* Output file. */
-  File *outFile = 0;
+  File inFile;
+  File outFile;
 
   /* Use control_header to parse the request. */
   ControlHeader header;
 
   /* Is the specified command a know one? */
   int knownCommand;
-  if (a->getToRemove ())
-  {
-    switch (a->getToRemove ())
+
+  try
     {
-      /* Remove the connection from the list. */
-    case Connection::REMOVE_OVERLOAD:
-      sendResponse (auxBuffer, bufferSize, a, CONTROL_SERVER_BUSY, header, 0);
-      return 0;
-    default:
-      return 0;
-    }
-  }
+      if (a->getToRemove ())
+        {
+          switch (a->getToRemove ())
+            {
+              /* Remove the connection from the list. */
+            case Connection::REMOVE_OVERLOAD:
+              sendResponse (auxBuffer, bufferSize, a, CONTROL_SERVER_BUSY,
+                            header, 0);
+              return 0;
+            default:
+              return 0;
+            }
+        }
 
-  ret = header.parse_header (request, nbtr, &realHeaderLength);
+      /*
+       *On errors remove the connection from the connections list.
+       *For return values look at protocol/control/control_errors.h.
+       *Returning 0 from the controlConnection we will remove the connection
+       *from the active connections list.
+       */
+      if (header.parse_header (request, nbtr, &realHeaderLength) != CONTROL_OK)
+        {
+          /* parse_header returns -1 on an incomplete header.  */
+          if (ret == -1)
+            return 2;
 
-  /*
-   *On errors remove the connection from the connections list.
-   *For return values look at protocol/control/control_errors.h.
-   *Returning 0 from the controlConnection we will remove the connection
-   *from the active connections list.
-   */
-  if (ret != CONTROL_OK)
-  {
-    /* parse_header returns -1 on an incomplete header.  */
-    if (ret == -1)
-    {
-      return 2;
-    }
-    sendResponse (auxBuffer, bufferSize, a, ret, header, 0);
-    return 0;
-  }
-  specifiedLength = header.getLength ();
-  version = header.getVersion ();
-  timeout=getTicks ();
-  if (specifiedLength)
-  {
-    inFile = new File ();
-    if (inFile == 0)
-    {
-      a->host->warningsLogWrite (_("Control: internal error"));
-      return 0;
-    }
+          sendResponse (auxBuffer, bufferSize, a, ret, header, 0);
+          return 0;
+        }
 
-    inFilePath << getdefaultwd (0,0) << "/ControlInput_" << (u_int) id;
+      specifiedLength = header.getLength ();
+      version = header.getVersion ();
+      timeout = getTicks ();
+      if (specifiedLength)
+        {
+          inFilePath << getdefaultwd (0,0) << "/ControlInput_" << (u_int) id;
 
-    ret = inFile->createTemporaryFile (inFilePath.str ().c_str ());
-    if (ret)
-      {
-        a->host->warningsLogWrite (_("Control: internal error"));
-        sendResponse (auxBuffer, bufferSize, a, CONTROL_INTERNAL, header, 0);
-        inFile->close ();
-        FilesUtility::deleteFile (inFilePath.str ().c_str ());
-        delete inFile;
-        return 0;
-      }
-    if (nbtr - realHeaderLength)
-      {
-        ret = inFile->writeToFile (request + realHeaderLength,
-                                   nbtr - realHeaderLength,
-                                   &nbw);
-        dataWritten += nbw;
-        if (ret)
-          {
-            a->host->warningsLogWrite (_("Control: internal error"));
-            sendResponse (auxBuffer, bufferSize, a, CONTROL_INTERNAL, header,
-                          0);
-            inFile->close ();
-            FilesUtility::deleteFile (inFilePath.str ().c_str ());
-            delete inFile;
-            inFile=0;
-            return 0;
-          }
-      }
-  }
+          inFile.createTemporaryFile (inFilePath.str ().c_str ());
 
-  /* Check if there are other bytes waiting to be read. */
-  if (specifiedLength && (specifiedLength
-                          != static_cast<int>(nbtr - realHeaderLength)))
-    {
-      /* Check if we can read all the specified data. */
-      while (specifiedLength != static_cast<int>(nbtr - realHeaderLength))
+          if (nbtr - realHeaderLength)
+            {
+              inFile.writeToFile (request + realHeaderLength,
+                                  nbtr - realHeaderLength, &nbw);
+              dataWritten += nbw;
+            }
+        }
+
+      /* Check if there are other bytes waiting to be read. */
+      if (specifiedLength && (specifiedLength
+                              != static_cast<int>(nbtr - realHeaderLength)))
         {
-          if (a->socket->bytesToRead ())
+          /* Check if we can read all the specified data. */
+          while (specifiedLength != static_cast<int>(nbtr - realHeaderLength))
             {
-              ret = a->socket->recv (auxBuffer, bufferSize, 0);
-              if (ret == -1)
+              if (a->socket->bytesToRead ())
                 {
-                  a->host->warningsLogWrite (_("Control: internal error"));
-                  sendResponse (auxBuffer, bufferSize, a, CONTROL_INTERNAL, header,
-                                0);
-                  inFile->close ();
-                  FilesUtility::deleteFile (inFilePath.str ().c_str ());
-                  delete inFile;
-                  inFile=0;
-                  return -1;
+                  u_long ret;
+                  ret = a->socket->recv (auxBuffer, bufferSize, 0);
+                  inFile.writeToFile (auxBuffer, ret, &nbw);
+                  dataWritten += nbw;
+                  if (dataWritten >=  specifiedLength)
+                    break;
+                  timeout = getTicks ();
                 }
-              ret = inFile->writeToFile (auxBuffer, ret, &nbw);
-              dataWritten += nbw;
-              if (ret)
+              else if (getTicks () - timeout > MYSERVER_SEC (5))
                 {
-                  a->host->warningsLogWrite (_("Control: internal error"));
-                  sendResponse (auxBuffer, bufferSize, a, CONTROL_INTERNAL,
-                                header, 0);
-                  inFile->close ();
+                  sendResponse (auxBuffer, bufferSize, a, CONTROL_BAD_LEN, header,
+                                0);
+                  inFile.close ();
                   FilesUtility::deleteFile (inFilePath.str ().c_str ());
-                  delete inFile;
-                  inFile=0;
+                  return 0;
                 }
-
-              if (dataWritten >=  specifiedLength)
-                break;
-              timeout = getTicks ();
-            }
-          else if (getTicks () - timeout > MYSERVER_SEC (5))
-            {
-              sendResponse (auxBuffer, bufferSize, a, CONTROL_BAD_LEN, header,
-                            0);
-              inFile->close ();
-              FilesUtility::deleteFile (inFilePath.str ().c_str ());
-              delete inFile;
-              inFile=0;
-              return 0;
-            }
-          else
-            {
-              /* Wait a bit.  */
-              Thread::wait (2);
+              else
+                Thread::wait (2);
             }
         }
-    }
-  if (inFile)
-    {
-      inFile->seek (0);
-    }
 
-  if (strcasecmp (version, "CONTROL/1.0"))
-    {
-      a->host->warningsLogWrite (_("Control: specified version not supported"));
-      if (inFile)
+      inFile.seek (0);
+
+      if (strcasecmp (version, "CONTROL/1.0"))
         {
-          inFile->close ();
+          a->host->warningsLogWrite (_("Control: specified version not supported"));
+          inFile.close ();
           FilesUtility::deleteFile (inFilePath.str ().c_str ());
-          delete inFile;
-          inFile = 0;
+          sendResponse (auxBuffer, bufferSize, a, CONTROL_BAD_VERSION, header, 0);
+          return 0;
         }
-      sendResponse (auxBuffer, bufferSize, a, CONTROL_BAD_VERSION, header, 0);
-      return 0;
-    }
 
-  authorized = checkAuth (header);
+      authorized = checkAuth (header);
 
-  /*
-   * If the client is not authorized remove the connection.
-   */
-  if (authorized == 0)
-    {
-      if (inFile)
+      /*
+       * If the client is not authorized remove the connection.
+       */
+      if (authorized == 0)
         {
-          inFile->close ();
+          inFile.close ();
           FilesUtility::deleteFile (inFilePath.str ().c_str ());
-          delete inFile;
-          inFile=0;
+          sendResponse (auxBuffer, bufferSize, a, CONTROL_AUTH, header, 0);
+          return 0;
         }
-      sendResponse (auxBuffer, bufferSize, a, CONTROL_AUTH, header, 0);
-      return 0;
-    }
-  /*
-   * If the specified length is different from the length that the
-   * server can read, remove the connection.
-   */
-  if (dataWritten != specifiedLength)
-    {
-      if (inFile)
+      /*
+       * If the specified length is different from the length that the
+       * server can read, remove the connection.
+       */
+      if (dataWritten != specifiedLength)
         {
-          inFile->close ();
+          inFile.close ();
           FilesUtility::deleteFile (inFilePath.str ().c_str ());
-          delete inFile;
-          inFile = 0;
+          sendResponse (auxBuffer, bufferSize, a, CONTROL_BAD_LEN, header, 0);
+          return 0;
         }
-      sendResponse (auxBuffer, bufferSize, a, CONTROL_BAD_LEN, header, 0);
-      return 0;
-    }
-
-  command = header.getCommand ();
-  opt     = header.getOptions ();
-
-  knownCommand = 0;
 
-  /* Create an out file. This can be used by commands needing it. */
-    outFile = new File ();
-  outFilePath << getdefaultwd (0, 0) << "/ControlOutput_" << (u_int) id;
-
-  ret = outFile->createTemporaryFile (outFilePath.str ().c_str ());
-  if (ret)
-    {
-      a->host->warningsLogWrite (_("Control: internal error"));
-      sendResponse (auxBuffer, bufferSize, a, CONTROL_INTERNAL, header, 0);
-      delete outFile;
-      inFile->close ();
-      delete inFile;
+      command = header.getCommand ();
+      opt = header.getOptions ();
 
-      FilesUtility::deleteFile (inFilePath.str ().c_str ());
-      FilesUtility::deleteFile (outFilePath.str ().c_str ());
+      knownCommand = 0;
 
-      inFile=0;
-      outFile=0;
-      return 0;
-    }
-  if (!strcmp (command, "SHOWCONNECTIONS"))
-    {
-      knownCommand = 1;
-      ret = showConnections (a, outFile, request, bufferSize, header);
-    }
-  else if (!strcmp (command, "KILLCONNECTION"))
-    {
-      char buff[11];
-      u_long id;
-      knownCommand = 1;
-      strncpy (buff, header.getOptions (), 10 );
-      buff[10] = '\0';
-      id = header.getOptions () ? atol (buff) : 0;
-      ret = killConnection (a, id, outFile, request, bufferSize, header);
-    }
-  else if (!strcmp (command, "REBOOT"))
-    {
-      knownCommand = 1;
-      Server::getInstance ()->delayedReboot ();
-      ret = 0;
-    }
-  else if (!strcmp (command, "GETFILE"))
-    {
-      knownCommand = 1;
-      ret = getFile (a, header.getOptions (), inFile, outFile, request,
-                     bufferSize, header);
-    }
-  else if (!strcmp (command, "PUTFILE"))
-    {
-      knownCommand = 1;
-      ret = putFile (a,header.getOptions (), inFile, outFile, request,
-                     bufferSize, header);
-    }
-  else if (!strcmp (command, "DISABLEREBOOT"))
-    {
-      Server::getInstance ()->disableAutoReboot ();
-      knownCommand = 1;
+      /* Create an out file. This can be used by commands needing it. */
+      outFilePath << getdefaultwd (0, 0) << "/ControlOutput_" << (u_int) id;
 
-    }
-  else if (!strcmp (command, "ENABLEREBOOT"))
-    {
-      Server::getInstance ()->enableAutoReboot ();
-      knownCommand = 1;
+      outFile.createTemporaryFile (outFilePath.str ().c_str ());
 
-    }
-  else if (!strcmp (command, "VERSION"))
-    {
-      knownCommand = 1;
-      ret = getVersion (a, outFile, request, bufferSize, header);
-    }
+      if (!strcmp (command, "SHOWCONNECTIONS"))
+        {
+          knownCommand = 1;
+          ret = showConnections (a, &outFile, request, bufferSize, header);
+        }
+      else if (!strcmp (command, "KILLCONNECTION"))
+        {
+          char buff[11];
+          u_long id;
+          knownCommand = 1;
+          strncpy (buff, header.getOptions (), 10 );
+          buff[10] = '\0';
+          id = header.getOptions () ? atol (buff) : 0;
+          ret = killConnection (a, id, &outFile, request, bufferSize, header);
+        }
+      else if (!strcmp (command, "REBOOT"))
+        {
+          knownCommand = 1;
+          Server::getInstance ()->delayedReboot ();
+          ret = 0;
+        }
+      else if (!strcmp (command, "GETFILE"))
+        {
+          knownCommand = 1;
+          ret = getFile (a, header.getOptions (), &inFile, &outFile, request,
+                         bufferSize, header);
+        }
+      else if (!strcmp (command, "PUTFILE"))
+        {
+          knownCommand = 1;
+          ret = putFile (a,header.getOptions (), &inFile, &outFile, request,
+                         bufferSize, header);
+        }
+      else if (!strcmp (command, "DISABLEREBOOT"))
+        {
+          Server::getInstance ()->disableAutoReboot ();
+          knownCommand = 1;
 
-  if (knownCommand)
-    {
-      char *connection;
-      outFile->seek (0);
-      if (ret)
-        sendResponse (auxBuffer, bufferSize, a, CONTROL_INTERNAL, header, 0);
-      else
-        sendResponse (auxBuffer, bufferSize, a, CONTROL_OK, header, outFile);
+        }
+      else if (!strcmp (command, "ENABLEREBOOT"))
+        {
+          Server::getInstance ()->enableAutoReboot ();
+          knownCommand = 1;
 
-      if (inFile)
+        }
+      else if (!strcmp (command, "VERSION"))
         {
-          inFile->close ();
-          delete inFile;
-          inFile = NULL;
+          knownCommand = 1;
+          ret = getVersion (a, &outFile, request, bufferSize, header);
         }
 
-      if (outFile)
+      if (knownCommand)
         {
-          outFile->close ();
-          delete outFile;
-          outFile = NULL;
-        }
+          char *connection;
+          outFile.seek (0);
+          if (ret)
+            sendResponse (auxBuffer, bufferSize, a, CONTROL_INTERNAL, header, 0);
+          else
+            sendResponse (auxBuffer, bufferSize, a, CONTROL_OK, header, &outFile);
 
-      FilesUtility::deleteFile (inFilePath.str ().c_str ());
-      FilesUtility::deleteFile (outFilePath.str ().c_str ());
-      connection = header.getConnection ();
+          inFile.close ();
+          outFile.close ();
 
-      /*
-       * If the Keep-Alive was specified keep the connection in the
-       * active connections list.
-       */
-      if (! strcasecmp (connection, "keep-alive"))
-        return ClientsThread::KEEP_CONNECTION;
+          FilesUtility::deleteFile (inFilePath.str ().c_str ());
+          FilesUtility::deleteFile (outFilePath.str ().c_str ());
+          connection = header.getConnection ();
+
+          /*
+           * If the Keep-Alive was specified keep the connection in the
+           * active connections list.
+           */
+          if (! strcasecmp (connection, "keep-alive"))
+            return ClientsThread::KEEP_CONNECTION;
+          else
+            return ClientsThread::DELETE_CONNECTION;
+        }
       else
-        return ClientsThread::DELETE_CONNECTION;
-    }
-  else
-    {
-      sendResponse (auxBuffer, bufferSize, a, CONTROL_CMD_NOT_FOUND, header, 0);
-
-      if (inFile)
         {
-          inFile->close ();
-          delete inFile;
-          inFile = NULL;
-        }
+          sendResponse (auxBuffer, bufferSize, a, CONTROL_CMD_NOT_FOUND,
+                        header, 0);
 
-      if (outFile)
-        {
-          outFile->close ();
-          delete outFile;
-          outFile = NULL;
+          inFile.close ();
+          outFile.close ();
+          FilesUtility::deleteFile (inFilePath.str ().c_str ());
+          FilesUtility::deleteFile (outFilePath.str ().c_str ());
+
+          return ClientsThread::DELETE_CONNECTION;
         }
+    }
+  catch (exception & e)
+    {
+      inFile.close ();
+      outFile.close ();
       FilesUtility::deleteFile (inFilePath.str ().c_str ());
       FilesUtility::deleteFile (outFilePath.str ().c_str ());
-
+      a->host->warningsLogWrite (_E ("Control: internal error"), &e);
       return ClientsThread::DELETE_CONNECTION;
     }
+
+  return ClientsThread::DELETE_CONNECTION;
 }
 
 /*!
@@ -541,9 +447,10 @@ int ControlProtocol::addToLog (int retCode, ConnectionPtr con, char *buffer,
 {
   string time;
   getRFC822GMTTime (time, 32);
-  gnulib::snprintf (buffer, bufferSize, "%s [%s] %s:%s:%s - %s - %i", con->getIpAddr (),
-            time.c_str (), header.getCommand (), header.getVersion (),
-            header.getOptions (), header.getAuthLogin (), retCode);
+  gnulib::snprintf (buffer, bufferSize, "%s [%s] %s:%s:%s - %s - %i",
+                    con->getIpAddr (), time.c_str (), header.getCommand (),
+                    header.getVersion (), header.getOptions (),
+                    header.getAuthLogin (), retCode);
   con->host->accessesLogWrite ("%s", buffer);
   return 0;
 }
@@ -566,25 +473,13 @@ int ControlProtocol::sendResponse (char *buffer, int buffersize,
 
   /* Build and send the first line.  */
   gnulib::snprintf (buffer, buffersize, "/%i\r\n", errID);
-  if (a->socket->send (buffer, strlen (buffer), 0) < 0)
-    {
-      a->host->warningsLogWrite (_("Control: socket error"));
-      return -1;
-    }
+  a->socket->send (buffer, strlen (buffer), 0);
 
-  gnulib::snprintf (buffer, buffersize, "/LEN %u\r\n", (u_int)dataLength);
-  if (a->socket->send (buffer, strlen (buffer), 0) < 0)
-    {
-      a->host->warningsLogWrite (_("Control: socket error"));
-      return -1;
-    }
+  gnulib::snprintf (buffer, buffersize, "/LEN %u\r\n", (u_int) dataLength);
+  a->socket->send (buffer, strlen (buffer), 0);
 
   /* Send the end of the header.  */
-  if (a->socket->send ("\r\n", 2, 0) < 0)
-    {
-      a->host->warningsLogWrite (_("Control: socket error"));
-      return -1;
-    }
+  a->socket->send ("\r\n", 2, 0);
 
   /* Flush the content of the file if any.  */
   if (dataLength)
@@ -593,24 +488,13 @@ int ControlProtocol::sendResponse (char *buffer, int buffersize,
       u_long nbr;
       for ( ; ; )
         {
-          int err;
-          if (outFile->read (buffer, min (dataToSend, buffersize), &nbr))
-            {
-              a->host->warningsLogWrite (_("Control: internal error"));
-              return -1;
-            }
+          outFile->read (buffer, min (dataToSend, buffersize), &nbr);
 
           dataToSend -= nbr;
-          err = a->socket->send (buffer, nbr, 0);
+          a->socket->send (buffer, nbr, 0);
 
           if (dataToSend == 0)
             break;
-
-          if (err == -1)
-            {
-              a->host->warningsLogWrite (_("Control: socket error"));
-              return -1;
-            }
         }
     }
 



commit d69f285f10568981d946278f8e5fb71c9fe91b65
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 16 16:36:27 2010 +0200

    Handle exceptions in the FTP protocol handler

diff --git a/myserver/src/protocol/ftp/ftp.cpp b/myserver/src/protocol/ftp/ftp.cpp
index eb0d55e..3ae3867 100644
--- a/myserver/src/protocol/ftp/ftp.cpp
+++ b/myserver/src/protocol/ftp/ftp.cpp
@@ -333,7 +333,7 @@ int Ftp::controlConnection (ConnectionPtr pConnection, char *request,
     {
       pFtpuserData->m_nFtpstate = FtpuserData::UNAVAILABLE;
       ftpReply (421);
-      return 0;
+      return ClientsThread::DELETE_CONNECTION;
     }
 
   m_nLocalControlport = pConnection->getLocalPort ();
@@ -350,7 +350,16 @@ int Ftp::controlConnection (ConnectionPtr pConnection, char *request,
   td.pProtocolInterpreter = this;
   td.m_nParseLength = 0;
 
-  return parseControlConnection ();
+  try
+    {
+      return parseControlConnection ();
+    }
+  catch (exception & e)
+    {
+      return ClientsThread::DELETE_CONNECTION;
+    }
+
+  return ClientsThread::DELETE_CONNECTION;
 }
 
 
@@ -844,7 +853,7 @@ DEFINE_THREAD (SendAsciiFile, pParam)
       pFtpuserData->closeDataConnection ();
       pFtpuserData->m_DataConnBusy.unlock ();
     }
-  catch (bad_alloc & ba)
+  catch (exception & e)
     {
       if (file != NULL)
         file->close ();
@@ -1023,7 +1032,7 @@ DEFINE_THREAD (SendImageFile, pParam)
       file->close ();
       delete file;
     }
-  catch (bad_alloc & ba)
+  catch (exception & e)
     {
       if (file != NULL)
         file->close ();
@@ -1229,7 +1238,7 @@ DEFINE_THREAD (ReceiveAsciiFile, pParam)
         }
       file.close ();
     }
-  catch (bad_alloc & ba)
+  catch (exception & e)
     {
       file.close ();
     }
@@ -1378,7 +1387,7 @@ DEFINE_THREAD (ReceiveImageFile, pParam)
         }
       file.close ();
     }
-  catch (bad_alloc & ba)
+  catch (exception & e)
     {
       file.close ();
     }



commit e14fa06a3f342cce3ee8261401168123580e8476
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 16 16:08:57 2010 +0200

    ISAPI handles exceptions properly

diff --git a/myserver/src/http_handler/isapi/isapi.cpp b/myserver/src/http_handler/isapi/isapi.cpp
index e2adc2b..0d4be8e 100644
--- a/myserver/src/http_handler/isapi/isapi.cpp
+++ b/myserver/src/http_handler/isapi/isapi.cpp
@@ -53,7 +53,8 @@ BOOL WINAPI ISAPI_ServerSupportFunctionExport (HCONN hConn, DWORD dwHSERRequest,
   Isapi::isapiMutex->unlock ();
   if (ConnInfo == NULL)
     {
-      Server::getInstance ()->log ("isapi::ServerSupportFunctionExport: invalid hConn");
+      Server::getInstance ()->log
+        ("ISAPI::ServerSupportFunctionExport: invalid hConn");
       return HttpDataHandler::RET_FAILURE;
     }
 
@@ -64,11 +65,11 @@ BOOL WINAPI ISAPI_ServerSupportFunctionExport (HCONN hConn, DWORD dwHSERRequest,
       mapInfo=(HSE_URL_MAPEX_INFO*)lpdwDataType;
       mapInfo->lpszPath = 0;
       tmp.assign (mapInfo->lpszPath);
-      ret=ConnInfo->td->http->getPath (tmp,(char*)lpvBuffer, 0);
+      ret=ConnInfo->td->http->getPath (tmp,(char*) lpvBuffer, 0);
       if (ret != 200)
         return 1;
 
-      mapInfo->cchMatchingURL=(DWORD)strlen ((char*)lpvBuffer);
+      mapInfo->cchMatchingURL=(DWORD)strlen ((char*) lpvBuffer);
       mapInfo->cchMatchingPath=(DWORD)strlen (mapInfo->lpszPath);
       delete [] mapInfo->lpszPath;
       mapInfo->lpszPath = new char[tmp.length () + 1];
@@ -84,12 +85,13 @@ BOOL WINAPI ISAPI_ServerSupportFunctionExport (HCONN hConn, DWORD dwHSERRequest,
       break;
 
     case HSE_REQ_MAP_URL_TO_PATH:
-      if (((char*)lpvBuffer)[0])
-        strcpy (uri,(char*)lpvBuffer);
+      if (((char*) lpvBuffer)[0])
+        strcpy (uri,(char*) lpvBuffer);
       else
         lstrcpyn (uri,ConnInfo->td->request.uri.c_str (),
-                 (int)ConnInfo->td->request.uri.length ()-ConnInfo->td->pathInfo.length () +1);
-      ret = ConnInfo->td->http->getPath (tmp ,uri,0);
+                 (int) ConnInfo->td->request.uri.length ()
+                  - ConnInfo->td->pathInfo.length () + 1);
+      ret = ConnInfo->td->http->getPath (tmp, uri, 0);
       if (ret != 200)
         {
           if (buffer)
@@ -102,28 +104,32 @@ BOOL WINAPI ISAPI_ServerSupportFunctionExport (HCONN hConn, DWORD dwHSERRequest,
           SetLastError (ERROR_INSUFFICIENT_BUFFER);
           return HttpDataHandler::RET_FAILURE;
         }
-      strcpy ((char*)lpvBuffer, tmp.c_str ());
-      if (FilesUtility::completePath ((char**)&lpvBuffer,(int*)lpdwSize,  1))
+      strcpy ((char*) lpvBuffer, tmp.c_str ());
+      if (FilesUtility::completePath ((char **) &lpvBuffer, (int *) lpdwSize,
+                                      1))
         {
           SetLastError (ERROR_INSUFFICIENT_BUFFER);
           return HttpDataHandler::RET_FAILURE;
         }
-      *lpdwSize=(DWORD)strlen ((char*)lpvBuffer);
+      *lpdwSize=(DWORD)strlen ((char*) lpvBuffer);
       break;
 
     case HSE_REQ_SEND_URL_REDIRECT_RESP:
-      return ((Isapi*)ConnInfo->isapi)->Redirect (ConnInfo->td,
-                                                 ConnInfo->connection,(char *)lpvBuffer);
+      return ((Isapi*) ConnInfo->isapi)->Redirect (ConnInfo->td,
+                                                   ConnInfo->connection,
+                                                   (char *) lpvBuffer);
       break;
 
     case HSE_REQ_SEND_URL:
-      return ((Isapi*)ConnInfo->isapi)->Senduri (ConnInfo->td,
-                                                ConnInfo->connection,(char *)lpvBuffer);
+      return ((Isapi*) ConnInfo->isapi)->Senduri (ConnInfo->td,
+                                                ConnInfo->connection,
+                                                  (char *) lpvBuffer);
       break;
 
     case HSE_REQ_SEND_RESPONSE_HEADER:
-      return ((Isapi*)ConnInfo->isapi)->SendHeader (ConnInfo->td,
-                                                   ConnInfo->connection,(char *)lpvBuffer);
+      return ((Isapi*) ConnInfo->isapi)->SendHeader (ConnInfo->td,
+                                                     ConnInfo->connection,
+                                                     (char *) lpvBuffer);
       break;
 
     case HSE_REQ_DONE_WITH_SESSION:
@@ -228,7 +234,7 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
   if (!ConnInfo->headerSent)
     {
       int headerSize = 0;
-      u_long size = (u_long)strlen (buffer);
+      u_long size = (u_long) strlen (buffer);
       strncat (buffer, (char*)Buffer, *lpdwBytes);
       ConnInfo->headerSize += *lpdwBytes;
       if (buffer[0] == '\r')
@@ -263,14 +269,15 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
       /*!
        *Handle the HTTP header if exists.
        */
-      if (headerSize)
+      if (! headerSize)
+        nbw = *lpdwBytes;
+      else
         {
           int len = ConnInfo->headerSize-headerSize;
 
-          HttpHeaders::buildHTTPResponseHeaderStruct (ConnInfo->td->buffer->getBuffer (),
-                                                      &ConnInfo->td->response,
-                                                      &(ConnInfo->td->nBytesToRead));
-
+          HttpHeaders::buildHTTPResponseHeaderStruct
+            (ConnInfo->td->buffer->getBuffer (), &ConnInfo->td->response,
+             &(ConnInfo->td->nBytesToRead));
 
           if (!ConnInfo->td->appendOutputs)
             {
@@ -302,7 +309,8 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
 
           /*! If only the header was requested return. */
           if (ConnInfo->headerSent && ConnInfo->onlyHeader
-              || ConnInfo->td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
+              || ConnInfo->td->response.getStatusType ()
+              == HttpResponseHeader::SUCCESSFUL)
             return 0;
 
           /*!Send the first chunk. */
@@ -313,7 +321,7 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
                 {
                   sprintf (chunkSize, "%x\r\n", len);
                   if (ConnInfo->chain.getStream ()->write (chunkSize,
-                                                           (int)strlen (chunkSize), &nbw))
+                                                           (int) strlen (chunkSize), &nbw))
                     return HttpDataHandler::RET_FAILURE;
                 }
 
@@ -340,10 +348,6 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
                 }
             }
         }
-      else
-        {
-          nbw = *lpdwBytes;
-        }
     }
   else/*!Continue to send data chunks*/
     {
@@ -351,8 +355,8 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
         {
           sprintf (chunkSize, "%x\r\n", *lpdwBytes);
           nbw = ConnInfo->connection->socket->send (chunkSize,
-                                                    (int)strlen (chunkSize), 0);
-          if ((nbw == (u_long)-1) || (!nbw))
+                                                    (int) strlen (chunkSize), 0);
+          if ((nbw == (u_long) -1) || (! nbw))
             return HttpDataHandler::RET_FAILURE;
         }
 
@@ -398,11 +402,12 @@ BOOL WINAPI ISAPI_ReadClientExport (HCONN hConn, LPVOID lpvBuffer,
   Isapi::isapiMutex->unlock ();
   if (ConnInfo == NULL)
   {
-    ((Vhost*)(ConnInfo->td->connection->host))->warningsLogWrite (_("ISAPI: internal error"));
+    ((Vhost*)(ConnInfo->td->connection->host))->warningsLogWrite
+      (_("ISAPI: internal error"));
     return HttpDataHandler::RET_FAILURE;
   }
 
-  ConnInfo->td->inputData.read ((char*)lpvBuffer, *lpdwSize, &NumRead);
+  ConnInfo->td->inputData.read ((char*) lpvBuffer, *lpdwSize, &NumRead);
 
   if (NumRead == -1)
     {
@@ -432,7 +437,7 @@ BOOL WINAPI ISAPI_GetServerVariableExport (HCONN hConn,
   if (ConnInfo == NULL)
     {
       Server::getInstance ()->log (
-                            "Isapi::GetServerVariableExport: invalid hConn");
+                            "ISAPI::GetServerVariableExport: invalid hConn");
       return HttpDataHandler::RET_FAILURE;
     }
 
@@ -464,15 +469,15 @@ BOOL WINAPI ISAPI_GetServerVariableExport (HCONN hConn,
        */
       char *localEnv;
       int variableNameLen;
-      ((char*)lpvBuffer)[0]='\0';
+      ((char*) lpvBuffer)[0] = '\0';
       localEnv = ConnInfo->envString;
-      variableNameLen = (int)strlen (lpszVariableName);
-      for (u_long i = 0;;i += (u_long)strlen (&localEnv[i]) + 1)
+      variableNameLen = (int) strlen (lpszVariableName);
+      for (u_long i = 0;;i += (u_long) strlen (&localEnv[i]) + 1)
         {
           if (((localEnv[i + variableNameLen]) == '=') &&
               (!strncmp (&localEnv[i], lpszVariableName, variableNameLen)))
             {
-              strncpy ((char*)lpvBuffer, &localEnv[i + variableNameLen + 1],
+              strncpy ((char*) lpvBuffer, &localEnv[i + variableNameLen + 1],
                        *lpdwSize);
               break;
             }
@@ -480,7 +485,7 @@ BOOL WINAPI ISAPI_GetServerVariableExport (HCONN hConn,
             break;
         }
     }
-  *lpdwSize = (DWORD) strlen ((char*)lpvBuffer);
+  *lpdwSize = (DWORD) strlen ((char*) lpvBuffer);
   return ret;
 }
 
@@ -514,123 +519,96 @@ BOOL Isapi::buildAllHttpHeaders (HttpThreadContext* td, ConnectionPtr /*!a*/,
       ostringstream rangeBuffer;
       rangeBuffer << "HTTP_RANGE:" << td->request.rangeType << "=" ;
       if (td->request.rangeByteBegin)
-        {
-          rangeBuffer << (int)td->request.rangeByteBegin;
-        }
+        rangeBuffer << (int)td->request.rangeByteBegin;
       rangeBuffer << "-";
       if (td->request.rangeByteEnd)
         rangeBuffer << td->request.rangeByteEnd;
       valLen += sprintf (&ValStr[valLen], "%s\n", rangeBuffer.str ().c_str ());
     }
 
-  {
-    HttpRequestHeader::Entry* e = td->request.other.get ("accept-encoding");
-    if (e && (valLen + 30 < maxLen))
-      valLen += sprintf (&ValStr[valLen], "HTTP_ACCEPT_ENCODING:%s\n",
-                         e->value->c_str ());
-    else if (valLen + 30 < maxLen)
-      return 1;
-  }
-
-  {
-    HttpRequestHeader::Entry* e = td->request.other.get ("accept-language");
-    if (e && (valLen + 30 < maxLen))
-      valLen += sprintf (&ValStr[valLen],"HTTP_ACCEPT_LANGUAGE:%s\n",
-                         e->value->c_str ());
-    else if (valLen + 30 < maxLen)
-      return 1;
-  }
+  HttpRequestHeader::Entry* e = td->request.other.get ("accept-encoding");
+  if (e && (valLen + 30 < maxLen))
+    valLen += sprintf (&ValStr[valLen], "HTTP_ACCEPT_ENCODING:%s\n",
+                       e->value->c_str ());
+  else if (valLen + 30 < maxLen)
+    return 1;
 
+  e = td->request.other.get ("accept-language");
+  if (e && (valLen + 30 < maxLen))
+    valLen += sprintf (&ValStr[valLen],"HTTP_ACCEPT_LANGUAGE:%s\n",
+                       e->value->c_str ());
+  else if (valLen + 30 < maxLen)
+    return 1;
 
-  {
-    HttpRequestHeader::Entry* e = td->request.other.get ("accept-charset");
-    if (e && (valLen + 30 < maxLen))
-      valLen += sprintf (&ValStr[valLen],"HTTP_ACCEPT_CHARSET:%s\n",
-                         e->value->c_str ());
-    else if (valLen + 30 < maxLen)
-      return 1;
-  }
+  e = td->request.other.get ("accept-charset");
+  if (e && (valLen + 30 < maxLen))
+    valLen += sprintf (&ValStr[valLen],"HTTP_ACCEPT_CHARSET:%s\n",
+                       e->value->c_str ());
+  else if (valLen + 30 < maxLen)
+    return 1;
 
-  {
-    HttpRequestHeader::Entry* e = td->request.other.get ("pragma");
-    if (e && (valLen + 30 < maxLen))
-      valLen += sprintf (&ValStr[valLen],"HTTP_PRAGMA:%s\n",
-                         e->value->c_str ());
-    else if (valLen + 30 < maxLen)
-      return 1;
-  }
+  e = td->request.other.get ("pragma");
+  if (e && (valLen + 30 < maxLen))
+    valLen += sprintf (&ValStr[valLen],"HTTP_PRAGMA:%s\n",
+                       e->value->c_str ());
+  else if (valLen + 30 < maxLen)
+    return 1;
 
-  {
-    HttpRequestHeader::Entry* e = td->request.other.get ("connection");
-    if (e && (valLen + 30< maxLen))
-      valLen += sprintf (&ValStr[valLen],"HTTP_CONNECTION:%s\n",
-                         e->value->c_str ());
-    else if (valLen + 30 < maxLen)
-      return 1;
-  }
+  e = td->request.other.get ("connection");
+  if (e && (valLen + 30< maxLen))
+    valLen += sprintf (&ValStr[valLen],"HTTP_CONNECTION:%s\n",
+                       e->value->c_str ());
+  else if (valLen + 30 < maxLen)
+    return 1;
 
-  {
-    HttpRequestHeader::Entry* e = td->request.other.get ("cookie");
-    if (e && (valLen + 30 < maxLen))
-      valLen += sprintf (&ValStr[valLen],"HTTP_COOKIE:%s\n",
-                         e->value->c_str ());
-    else if (valLen + 30 < maxLen)
-      return 1;
-  }
+  e = td->request.other.get ("cookie");
+  if (e && (valLen + 30 < maxLen))
+    valLen += sprintf (&ValStr[valLen],"HTTP_COOKIE:%s\n",
+                       e->value->c_str ());
+  else if (valLen + 30 < maxLen)
+    return 1;
 
-  {
-    HttpRequestHeader::Entry* e = td->request.other.get ("host");
-    if (e && (valLen + 30 < maxLen))
-      valLen += sprintf (&ValStr[valLen],"HTTP_HOST:%s\n",
-                         e->value->c_str ());
-    else if (valLen + 30 < maxLen)
-      return 1;
-  }
+  e = td->request.other.get ("host");
+  if (e && (valLen + 30 < maxLen))
+    valLen += sprintf (&ValStr[valLen],"HTTP_HOST:%s\n",
+                       e->value->c_str ());
+  else if (valLen + 30 < maxLen)
+    return 1;
 
-  {
-    HttpRequestHeader::Entry* e = td->request.other.get ("date");
-    if (e && (valLen + 30 < maxLen))
-      valLen += sprintf (&ValStr[valLen],"HTTP_DATE:%s\n",
-                         e->value->c_str ());
-    else if (valLen + 30 < maxLen)
-      return 1;
-  }
+  e = td->request.other.get ("date");
+  if (e && (valLen + 30 < maxLen))
+    valLen += sprintf (&ValStr[valLen],"HTTP_DATE:%s\n",
+                       e->value->c_str ());
+  else if (valLen + 30 < maxLen)
+    return 1;
 
-  {
-    HttpRequestHeader::Entry* e = td->request.other.get ("if-modified-since");
-    if (e && (valLen + 30 < maxLen))
-      valLen += sprintf (&ValStr[valLen],"HTTP_IF_MODIFIED_SINCE:%s\n",
-                         e->value->c_str ());
-    else if (valLen + 30 < maxLen)
-      return 1;
-  }
+  e = td->request.other.get ("if-modified-since");
+  if (e && (valLen + 30 < maxLen))
+    valLen += sprintf (&ValStr[valLen],"HTTP_IF_MODIFIED_SINCE:%s\n",
+                       e->value->c_str ());
+  else if (valLen + 30 < maxLen)
+    return 1;
 
-  {
-    HttpRequestHeader::Entry* e = td->request.other.get ("referer");
-    if (e && (valLen + 30 < maxLen))
-      valLen += sprintf (&ValStr[valLen],"HTTP_REFERER:%s\n",
-                         e->value->c_str ());
-    else if (valLen + 30 < maxLen)
-      return 1;
-  }
+  e = td->request.other.get ("referer");
+  if (e && (valLen + 30 < maxLen))
+    valLen += sprintf (&ValStr[valLen],"HTTP_REFERER:%s\n",
+                       e->value->c_str ());
+  else if (valLen + 30 < maxLen)
+    return 1;
 
-  {
-    HttpRequestHeader::Entry* e = td->request.other.get ("user-agent");
-    if (e && (valLen + 30 < maxLen))
-      valLen += sprintf (&ValStr[valLen],"HTTP_USER_AGENT:%s\n",
-                         e->value->c_str ());
-    else if (valLen + 30 < maxLen)
-      return 1;
-  }
+  e = td->request.other.get ("user-agent");
+  if (e && (valLen + 30 < maxLen))
+    valLen += sprintf (&ValStr[valLen],"HTTP_USER_AGENT:%s\n",
+                       e->value->c_str ());
+  else if (valLen + 30 < maxLen)
+    return 1;
 
-  {
-    HttpRequestHeader::Entry* e = td->request.other.get ("from");
-    if (e && (valLen + 30 < maxLen))
-      valLen += sprintf (&ValStr[valLen],"HTTP_FROM:%s\n",
-                         e->value->c_str ());
-    else if (valLen + 30 < maxLen)
-      return 1;
-  }
+  e = td->request.other.get ("from");
+  if (e && (valLen + 30 < maxLen))
+    valLen += sprintf (&ValStr[valLen],"HTTP_FROM:%s\n",
+                       e->value->c_str ());
+  else if (valLen + 30 < maxLen)
+    return 1;
 
   return 0;
 }
@@ -646,7 +624,7 @@ BOOL Isapi::buildAllRawHeaders (HttpThreadContext* td,ConnectionPtr a,
   char *ValStr = (char*)output;
   if (buildAllHttpHeaders (td, a, output, dwMaxLen))
     return 1;
-  valLen = (DWORD)strlen (ValStr);
+  valLen = (DWORD) strlen (ValStr);
 
   if (td->pathInfo.length () && (valLen + 30 < maxLen))
     valLen += sprintf (&ValStr[valLen], "PATH_INFO:%s\n",
@@ -737,7 +715,7 @@ int Isapi::send (HttpThreadContext* td,
    *ISAPI works only on the windows architecture.
    */
 #ifdef WIN32
-  DWORD Ret;
+  DWORD ret;
   EXTENSION_CONTROL_BLOCK ExtCtrlBlk;
   DynamicLibrary appHnd;
   HSE_VERSION_INFO Ver;
@@ -745,191 +723,200 @@ int Isapi::send (HttpThreadContext* td,
   PFN_GETEXTENSIONVERSION GetExtensionVersion;
   PFN_HTTPEXTENSIONPROC HttpExtensionProc;
   const char *loadLib;
-  int retvalue = 0;
+  int retvalue = HttpDataHandler::RET_OK;
+
   /*! Under windows there is MAX_PATH then we can use it. */
   char fullpath[MAX_PATH * 2 + 5];
 
-  if (execute)
-    sprintf (fullpath, "%s", cgipath);
-  else
+  try
     {
-      if (cgipath && strlen (cgipath))
-        sprintf (fullpath, "%s \"%s\"", cgipath, td->filenamePath.c_str ());
+      if (execute)
+        sprintf (fullpath, "%s", cgipath);
       else
-        sprintf (fullpath, "%s", td->filenamePath.c_str ());
-    }
+        {
+          if (cgipath && strlen (cgipath))
+            sprintf (fullpath, "%s \"%s\"", cgipath, td->filenamePath.c_str ());
+          else
+            sprintf (fullpath, "%s", td->filenamePath.c_str ());
+        }
 
-  if (!(td->permissions & MYSERVER_PERMISSION_EXECUTE))
-    return td->http->sendAuth ();
+      if (!(td->permissions & MYSERVER_PERMISSION_EXECUTE))
+        return td->http->sendAuth ();
 
-  td->inputData.seek (0);
+      td->inputData.seek (0);
 
-  EnterCriticalSection (&GetTableEntryCritSec);
-  connIndex = 0;
-  Isapi::isapiMutex->lock ();
-  while ((connTable[connIndex].Allocated != 0) &&
-         (connIndex < maxConnections))
-    {
-      connIndex++;
-    }
-  Isapi::isapiMutex->unlock ();
-  LeaveCriticalSection (&GetTableEntryCritSec);
+      EnterCriticalSection (&GetTableEntryCritSec);
+      connIndex = 0;
 
-  if (connIndex == maxConnections)
-    {
-      td->connection->host->warningsLogWrite (_("ISAPI: max connections"));
-      return td->http->raiseHTTPError (503);
-    }
-  if (execute)
-    loadLib = scriptpath;
-  else
-    loadLib = cgipath;
+      Isapi::isapiMutex->lock ();
+      while ((connTable[connIndex].Allocated != 0) &&
+             (connIndex < maxConnections))
+        connIndex++;
+      Isapi::isapiMutex->unlock ();
 
-  Ret = appHnd.loadLibrary (loadLib);
+      LeaveCriticalSection (&GetTableEntryCritSec);
 
-  if (Ret)
-    {
-      td->connection->host->warningsLogWrite (_("ISAPI: cannot load %s"), loadLib);
-      return td->http->raiseHTTPError (500);
-    }
+      if (connIndex == maxConnections)
+        {
+          td->connection->host->warningsLogWrite (_("ISAPI: max connections"));
+          return td->http->raiseHTTPError (503);
+        }
+      if (execute)
+        loadLib = scriptpath;
+      else
+        loadLib = cgipath;
 
-  connTable[connIndex].chain.setStream (td->connection->socket);
-  if (td->mime)
-    {
-      u_long nbw;
-      if (td->mime && Server::getInstance ()->getFiltersFactory ()->chain (
-                                                                           &(connTable[connIndex].chain),
-                                                                           td->mime->filters,
-                                                                           td->connection->socket,
-                                                                           &nbw, 1))
+      ret = appHnd.loadLibrary (loadLib);
+      if (ret)
+        {
+          td->connection->host->warningsLogWrite (_("ISAPI: cannot load %s"), loadLib);
+          return td->http->raiseHTTPError (500);
+        }
+
+      connTable[connIndex].chain.setStream (td->connection->socket);
+      if (td->mime)
+        {
+          u_long nbw;
+          if (td->mime)
+            Server::getInstance ()->getFiltersFactory ()->chain (
+                                             &(connTable[connIndex].chain),
+                                             td->mime->filters,
+                                             td->connection->socket,
+                                             &nbw, 1);
+        }
+
+      connTable[connIndex].connection = td->connection;
+      connTable[connIndex].td = td;
+      connTable[connIndex].onlyHeader = onlyHeader;
+      connTable[connIndex].headerSent = 0;
+      connTable[connIndex].headerSize = 0;
+      connTable[connIndex].dataSent = 0;
+      connTable[connIndex].Allocated = 1;
+      connTable[connIndex].isapi = this;
+      connTable[connIndex].ISAPIDoneEvent = CreateEvent (NULL, 1, 0, NULL);
+
+      GetExtensionVersion = (PFN_GETEXTENSIONVERSION)appHnd.getProc ("GetExtensionVersion");
+
+      if (GetExtensionVersion == NULL)
         {
           td->connection->host->warningsLogWrite (_("ISAPI: internal error"));
+          appHnd.close ();
           connTable[connIndex].chain.clearAllFilters ();
           return td->http->raiseHTTPError (500);
         }
-    }
 
-  connTable[connIndex].connection = td->connection;
-  connTable[connIndex].td = td;
-  connTable[connIndex].onlyHeader = onlyHeader;
-  connTable[connIndex].headerSent = 0;
-  connTable[connIndex].headerSize = 0;
-  connTable[connIndex].dataSent = 0;
-  connTable[connIndex].Allocated = 1;
-  connTable[connIndex].isapi = this;
-  connTable[connIndex].ISAPIDoneEvent = CreateEvent (NULL, 1, 0, NULL);
+      if (!GetExtensionVersion (&Ver))
+        {
+          td->connection->host->warningsLogWrite (_("ISAPI: internal error"));
+          appHnd.close ();
+          connTable[connIndex].chain.clearAllFilters ();
+          return td->http->raiseHTTPError (500);
+        }
 
-  GetExtensionVersion = (PFN_GETEXTENSIONVERSION)appHnd.getProc ("GetExtensionVersion");
+      if (Ver.dwExtensionVersion > MAKELONG (HSE_VERSION_MINOR,
+                                             HSE_VERSION_MAJOR))
+        {
+          td->connection->host->warningsLogWrite (_("ISAPI: version not supported"));
+          appHnd.close ();
+          connTable[connIndex].chain.clearAllFilters ();
+          return td->http->raiseHTTPError (500);
+        }
 
-  if (GetExtensionVersion == NULL)
-    {
-      td->connection->host->warningsLogWrite (_("ISAPI: internal error"));
-      appHnd.close ();
-      connTable[connIndex].chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
+      /* Store the environment string in the auxiliaryBuffer.  */
+      connTable[connIndex].envString=td->auxiliaryBuffer->getBuffer ();
+
+      /* Build the environment string.  */
+      td->scriptPath.assign (scriptpath);
+
+      string tmp;
+      tmp.assign (cgipath);
+      FilesUtility::splitPath (tmp, td->cgiRoot, td->cgiFile);
+      tmp.assign (scriptpath);
+      FilesUtility::splitPath (tmp, td->scriptDir, td->scriptFile);
+
+      connTable[connIndex].envString[0] = '\0';
+      Env::buildEnvironmentString (td,connTable[connIndex].envString);
+
+      ZeroMemory (&ExtCtrlBlk, sizeof (ExtCtrlBlk));
+      ExtCtrlBlk.cbSize = sizeof (ExtCtrlBlk);
+      ExtCtrlBlk.dwVersion = MAKELONG (HSE_VERSION_MINOR, HSE_VERSION_MAJOR);
+      ExtCtrlBlk.GetServerVariable = ISAPI_GetServerVariableExport;
+      ExtCtrlBlk.ReadClient  = ISAPI_ReadClientExport;
+      ExtCtrlBlk.WriteClient = ISAPI_WriteClientExport;
+      ExtCtrlBlk.ServerSupportFunction = ISAPI_ServerSupportFunctionExport;
+      ExtCtrlBlk.ConnID = (HCONN) (connIndex + 1);
+      ExtCtrlBlk.dwHttpStatusCode = 200;
+      ExtCtrlBlk.lpszLogData[0] = '0';
+      ExtCtrlBlk.lpszMethod = (char*) td->request.cmd.c_str ();
+      ExtCtrlBlk.lpszQueryString =(char*) td->request.uriOpts.c_str ();
+      ExtCtrlBlk.lpszPathInfo = (char*) (td->pathInfo.length ()
+                                         ? td->pathInfo.c_str ()
+                                         : "") ;
+      if (td->pathInfo.length ())
+        ExtCtrlBlk.lpszPathTranslated = (char*) td->pathTranslated.c_str ();
+      else
+        ExtCtrlBlk.lpszPathTranslated = (char*) td->filenamePath.c_str ();
+      ExtCtrlBlk.cbTotalBytes = td->inputData.getFileSize ();
+      ExtCtrlBlk.cbAvailable = 0;
+      ExtCtrlBlk.lpbData = 0;
 
-  if (!GetExtensionVersion (&Ver))
-    {
-      td->connection->host->warningsLogWrite (_("ISAPI: internal error"));
-      appHnd.close ();
-      connTable[connIndex].chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
 
-  if (Ver.dwExtensionVersion > MAKELONG (HSE_VERSION_MINOR,
-                                         HSE_VERSION_MAJOR))
-    {
-      td->connection->host->warningsLogWrite (_("ISAPI: version not supported"));
-      appHnd.close ();
-      connTable[connIndex].chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
+      HttpRequestHeader::Entry *content = td->request.other.get ("content-type");
+      ExtCtrlBlk.lpszContentType = content ? (char*)content->value->c_str () : NULL;
 
-  /* Store the environment string in the auxiliaryBuffer.  */
-  connTable[connIndex].envString=td->auxiliaryBuffer->getBuffer ();
+      connTable[connIndex].td->buffer->setLength (0);
+      connTable[connIndex].td->buffer->getAt (0)='\0';
+      HttpExtensionProc = (PFN_HTTPEXTENSIONPROC) appHnd.getProc ("HttpExtensionProc");
+      if (HttpExtensionProc == NULL)
+        {
+          td->connection->host->warningsLogWrite (_("ISAPI: cannot find entry-point"));
+          appHnd.close ();
+          connTable[connIndex].chain.clearAllFilters ();
+          return td->http->raiseHTTPError (500);
+        }
 
-  /* Build the environment string.  */
-  td->scriptPath.assign (scriptpath);
+      ret = HttpExtensionProc (&ExtCtrlBlk);
+      if (ret == HSE_STATUS_PENDING)
+        WaitForSingleObject (connTable[connIndex].ISAPIDoneEvent, td->http->getTimeout ());
 
-  string tmp;
-  tmp.assign (cgipath);
-  FilesUtility::splitPath (tmp, td->cgiRoot, td->cgiFile);
-  tmp.assign (scriptpath);
-  FilesUtility::splitPath (tmp, td->scriptDir, td->scriptFile);
-
-  connTable[connIndex].envString[0]='\0';
-  Env::buildEnvironmentString (td,connTable[connIndex].envString);
-
-  ZeroMemory (&ExtCtrlBlk, sizeof (ExtCtrlBlk));
-  ExtCtrlBlk.cbSize = sizeof (ExtCtrlBlk);
-  ExtCtrlBlk.dwVersion = MAKELONG (HSE_VERSION_MINOR, HSE_VERSION_MAJOR);
-  ExtCtrlBlk.GetServerVariable = ISAPI_GetServerVariableExport;
-  ExtCtrlBlk.ReadClient  = ISAPI_ReadClientExport;
-  ExtCtrlBlk.WriteClient = ISAPI_WriteClientExport;
-  ExtCtrlBlk.ServerSupportFunction = ISAPI_ServerSupportFunctionExport;
-  ExtCtrlBlk.ConnID = (HCONN) (connIndex + 1);
-  ExtCtrlBlk.dwHttpStatusCode = 200;
-  ExtCtrlBlk.lpszLogData[0] = '0';
-  ExtCtrlBlk.lpszMethod = (char*)td->request.cmd.c_str ();
-  ExtCtrlBlk.lpszQueryString =(char*) td->request.uriOpts.c_str ();
-  ExtCtrlBlk.lpszPathInfo = td->pathInfo.length () ? (char*)td->pathInfo.c_str () : (CHAR*)"" ;
-  if (td->pathInfo.length ())
-    ExtCtrlBlk.lpszPathTranslated = (char*)td->pathTranslated.c_str ();
-  else
-    ExtCtrlBlk.lpszPathTranslated = (char*)td->filenamePath.c_str ();
-  ExtCtrlBlk.cbTotalBytes = td->inputData.getFileSize ();
-  ExtCtrlBlk.cbAvailable = 0;
-  ExtCtrlBlk.lpbData = 0;
+      u_long nbw = 0;
+      HttpRequestHeader::Entry *connection
+        = connTable[connIndex].td->request.other.get ("connection");
 
+      if (connection && !stringcmpi (connection->value->c_str (), "keep-alive"))
+        connTable[connIndex].chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
 
-  HttpRequestHeader::Entry *content = td->request.other.get ("content-type");
-  ExtCtrlBlk.lpszContentType = content ? (char*)content->value->c_str () : NULL;
+      switch (ret)
+        {
+        case HSE_STATUS_SUCCESS_AND_KEEP_CONN:
+          retvalue = HttpDataHandler::RET_OK;
+          break;
+
+        case 0:
+        case HSE_STATUS_SUCCESS:
+        case HSE_STATUS_ERROR:
+        default:
+          retvalue = HttpDataHandler::RET_FAILURE;
+          break;
+        }
 
-  connTable[connIndex].td->buffer->setLength (0);
-  connTable[connIndex].td->buffer->getAt (0)='\0';
-  HttpExtensionProc = (PFN_HTTPEXTENSIONPROC)appHnd.getProc ("HttpExtensionProc");
-  if (HttpExtensionProc == NULL)
-    {
-      td->connection->host->warningsLogWrite (_("ISAPI: internal error"));
       appHnd.close ();
-      connTable[connIndex].chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
-
-  Ret = HttpExtensionProc (&ExtCtrlBlk);
-  if (Ret == HSE_STATUS_PENDING)
-    WaitForSingleObject (connTable[connIndex].ISAPIDoneEvent, td->http->getTimeout ());
 
-  {
-    u_long nbw = 0;
-    HttpRequestHeader::Entry *connection = connTable[connIndex].td->request.other.get ("connection");
-
-    if (connection && !stringcmpi (connection->value->c_str (), "keep-alive"))
-      Ret = connTable[connIndex].chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
-  }
+      ostringstream tmps;
+      tmps << connTable[connIndex].dataSent;
+      connTable[connIndex].td->response.contentLength.assign (tmps.str ());
+      connTable[connIndex].chain.clearAllFilters ();
+      connTable[connIndex].Allocated = 0;
 
-  switch (Ret)
+    }
+  catch (exception & e)
     {
-    case HSE_STATUS_SUCCESS_AND_KEEP_CONN:
-      retvalue = HttpDataHandler::RET_OK;
-      break;
-
-    case 0:
-    case HSE_STATUS_SUCCESS:
-    case HSE_STATUS_ERROR:
-    default:
-      retvalue = HttpDataHandler::RET_FAILURE;
-      break;
+      td->connection->host->warningsLogWrite (_E ("ISAPI: internal error"),
+                                              &e);
+      connTable[connIndex].chain.clearAllFilters ();
+      return td->http->raiseHTTPError (500);
     }
 
-  appHnd.close ();
-
-  ostringstream tmps;
-  tmps << connTable[connIndex].dataSent;
-  connTable[connIndex].td->response.contentLength.assign (tmps.str ());
-  connTable[connIndex].chain.clearAllFilters ();
-  connTable[connIndex].Allocated = 0;
   return retvalue;
 #else
   /*



commit fd7f3de29174b1ff29b064f9b45459b972de7dcf
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 16 15:48:10 2010 +0200

    Wincgi handles exceptions properly

diff --git a/myserver/src/http_handler/wincgi/wincgi.cpp b/myserver/src/http_handler/wincgi/wincgi.cpp
index 05154d0..143764e 100644
--- a/myserver/src/http_handler/wincgi/wincgi.cpp
+++ b/myserver/src/http_handler/wincgi/wincgi.cpp
@@ -84,350 +84,293 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
   u_long nbw = 0;
   ostringstream stream;
 
-  if (!(td->permissions & MYSERVER_PERMISSION_EXECUTE))
-    return td->http->sendAuth ();
+  try
+    {
+      if (! (td->permissions & MYSERVER_PERMISSION_EXECUTE))
+        return td->http->sendAuth ();
 
-  if (!FilesUtility::nodeExists (scriptpath))
-    return td->http->raiseHTTPError (404);
+      if (!FilesUtility::nodeExists (scriptpath))
+        return td->http->raiseHTTPError (404);
 
-  FilesUtility::splitPath (scriptpath, pathname, execname);
+      FilesUtility::splitPath (scriptpath, pathname, execname);
 
-  getdefaultwd (dataFilePath,MAX_PATH);
-  GetShortPathName (dataFilePath,dataFilePath,MAX_PATH);
-  sprintf (&dataFilePath[strlen (dataFilePath)],"/data_%u.ini",td->id);
+      getdefaultwd (dataFilePath,MAX_PATH);
+      GetShortPathName (dataFilePath,dataFilePath,MAX_PATH);
+      sprintf (&dataFilePath[strlen (dataFilePath)],"/data_%u.ini",td->id);
 
-  strcpy (outFilePath,td->outputDataPath.c_str ());
-  strcat (outFilePath,"WC");
-  td->inputData.seek (0);
-  chain.setStream (td->connection->socket);
-  if (td->mime)
-    {
-      u_long nbw2;
-      if (td->mime
-          && Server::getInstance ()->getFiltersFactory ()->chain (&chain,
-                                                       td->mime->filters,
-                                        td->connection->socket, &nbw2, 1))
+      strcpy (outFilePath,td->outputDataPath.c_str ());
+      strcat (outFilePath,"WC");
+      td->inputData.seek (0);
+      chain.setStream (td->connection->socket);
+      if (td->mime)
         {
-          td->connection->host->warningsLogWrite (_("WinCGI: internal error"));
-          chain.clearAllFilters ();
-          return td->http->raiseHTTPError (500);
+          u_long nbw2;
+          Server::getInstance ()->getFiltersFactory ()->chain (&chain,
+                                                          td->mime->filters,
+                                                        td->connection->socket,
+                                                               &nbw2, 1);
         }
-    }
 
-  /* The WinCGI protocol uses a .ini file to send data to the new process.  */
-  ret = DataFileHandle.openFile (dataFilePath, File::FILE_CREATE_ALWAYS
-                                 | File::WRITE);
-  if (ret)
-    {
-      td->connection->host->warningsLogWrite (_("WinCGI: internal error"));
-      return td->http->raiseHTTPError (500);
-    }
+      /* The WinCGI protocol uses a .ini file to send data to the new process.  */
+      DataFileHandle.openFile (dataFilePath, File::FILE_CREATE_ALWAYS
+                               | File::WRITE);
 
-  td->auxiliaryBuffer->setLength (0);
-  buffer = td->auxiliaryBuffer->getBuffer ();
-
-  strcpy (buffer, "[CGI]\r\n");
-  DataFileHandle.writeToFile (buffer,7,&nbr);
-
-  strcpy (buffer, "CGI Version=CGI/1.3a WIN\r\n");
-  DataFileHandle.writeToFile (buffer,26,&nbr);
-
-  *td->auxiliaryBuffer << "Server Admin=" <<
-    td->securityToken.getData ("server.admin", MYSERVER_VHOST_CONF |
-                                     MYSERVER_SERVER_CONF, "")<< "\r\n";
-  DataFileHandle.writeToFile (buffer,td->auxiliaryBuffer->getLength (),&nbr);
-
-  {
-    if (td->request.isKeepAlive ())
-      {
-        strcpy (buffer,"Request Keep-Alive=No\r\n");
-        DataFileHandle.writeToFile (buffer, 23, &nbr);
-      }
-    else
-      {
-        strcpy (buffer,"Request Keep-Alive=Yes\r\n");
-        DataFileHandle.writeToFile (buffer, 24, &nbr);
-      }
-  }
-
-  td->auxiliaryBuffer->setLength (0);
-  *td->auxiliaryBuffer << "Request Method=" << td->request.cmd << "\r\n";
-  DataFileHandle.writeToFile (buffer, td->auxiliaryBuffer->getLength (), &nbr);
-
-  td->auxiliaryBuffer->setLength (0);
-  *td->auxiliaryBuffer << "Request Protocol=HTTP/" << td->request.ver << "\r\n";
-  DataFileHandle.writeToFile (buffer, td->auxiliaryBuffer->getLength (), &nbr);
-
-  td->auxiliaryBuffer->setLength (0);
-  *td->auxiliaryBuffer << "Executable Path=" << execname << "\r\n";
-  DataFileHandle.writeToFile (buffer,td->auxiliaryBuffer->getLength (),&nbr);
-
-  if (td->request.uriOpts[0])
-    {
-      sprintf (buffer, "Query String=%s\r\n", td->request.uriOpts.c_str ());
-      DataFileHandle.writeToFile (buffer,(u_long)strlen (buffer), &nbr);
-    }
+      td->auxiliaryBuffer->setLength (0);
+      buffer = td->auxiliaryBuffer->getBuffer ();
 
-  {
-    HttpRequestHeader::Entry *referer = td->request.other.get ("referer");
+      strcpy (buffer, "[CGI]\r\n");
+      DataFileHandle.writeToFile (buffer,7,&nbr);
 
-    if (referer && referer->value->length ())
-      {
-        sprintf (buffer,"Referer=%s\r\n", referer->value->c_str ());
-        DataFileHandle.writeToFile (buffer,(u_long)strlen (buffer),&nbr);
-      }
-  }
+      strcpy (buffer, "CGI Version=CGI/1.3a WIN\r\n");
+      DataFileHandle.writeToFile (buffer,26,&nbr);
 
-  {
-    HttpRequestHeader::Entry *contentType = td->request.other.get ("content-type");
+      *td->auxiliaryBuffer << "Server Admin=" <<
+        td->securityToken.getData ("server.admin", MYSERVER_VHOST_CONF |
+                                   MYSERVER_SERVER_CONF, "")<< "\r\n";
+      DataFileHandle.writeToFile (buffer,td->auxiliaryBuffer->getLength (), &nbr);
 
-    if (contentType && contentType->value->length ())
-      {
-        sprintf (buffer, "Content Type=%s\r\n", contentType->value->c_str ());
-        DataFileHandle.writeToFile (buffer, (u_long)strlen (buffer), &nbr);
-      }
-  }
+      if (td->request.isKeepAlive ())
+        {
+          strcpy (buffer,"Request Keep-Alive=No\r\n");
+          DataFileHandle.writeToFile (buffer, 23, &nbr);
+        }
+      else
+        {
+          strcpy (buffer,"Request Keep-Alive=Yes\r\n");
+          DataFileHandle.writeToFile (buffer, 24, &nbr);
+        }
 
-  {
-    HttpRequestHeader::Entry *userAgent = td->request.other.get ("user-agent");
+      td->auxiliaryBuffer->setLength (0);
+      *td->auxiliaryBuffer << "Request Method=" << td->request.cmd << "\r\n";
+      DataFileHandle.writeToFile (buffer, td->auxiliaryBuffer->getLength (), &nbr);
 
-    if (userAgent && userAgent->value->length ())
-      {
-        sprintf (buffer,"User Agent=%s\r\n", userAgent->value->c_str ());
-        DataFileHandle.writeToFile (buffer, (u_long)strlen (buffer), &nbr);
-      }
-  }
+      td->auxiliaryBuffer->setLength (0);
+      *td->auxiliaryBuffer << "Request Protocol=HTTP/" << td->request.ver << "\r\n";
+      DataFileHandle.writeToFile (buffer, td->auxiliaryBuffer->getLength (), &nbr);
 
-  sprintf (buffer,"Content File=%s\r\n", td->inputData.getFilename ());
-  DataFileHandle.writeToFile (buffer, (u_long)strlen (buffer), &nbr);
+      td->auxiliaryBuffer->setLength (0);
+      *td->auxiliaryBuffer << "Executable Path=" << execname << "\r\n";
+      DataFileHandle.writeToFile (buffer,td->auxiliaryBuffer->getLength (),&nbr);
 
-  if (td->request.contentLength[0])
-    {
-      sprintf (buffer, "Content Length=%s\r\n",
-              td->request.contentLength.c_str ());
-      DataFileHandle.writeToFile (buffer, (u_long)strlen (buffer), &nbr);
-    }
-  else
-    {
-      strcpy (buffer, "Content Length=0\r\n");
-      DataFileHandle.writeToFile (buffer, 18, &nbr);
-    }
+      if (td->request.uriOpts[0])
+        {
+          sprintf (buffer, "Query String=%s\r\n", td->request.uriOpts.c_str ());
+          DataFileHandle.writeToFile (buffer,(u_long) strlen (buffer), &nbr);
+        }
 
-  strcpy (buffer,"Server Software=MyServer\r\n");
-  DataFileHandle.writeToFile (buffer, 26, &nbr);
+      HttpRequestHeader::Entry *referer = td->request.other.get ("referer");
+      if (referer && referer->value->length ())
+        {
+          sprintf (buffer,"Referer=%s\r\n", referer->value->c_str ());
+          DataFileHandle.writeToFile (buffer,(u_long) strlen (buffer),&nbr);
+        }
 
-  sprintf (buffer, "Remote Address=%s\r\n", td->connection->getIpAddr ());
-  DataFileHandle.writeToFile (buffer, (u_long)strlen (buffer), &nbr);
+      HttpRequestHeader::Entry *contentType = td->request.other.get ("content-type");
+      if (contentType && contentType->value->length ())
+        {
+          sprintf (buffer, "Content Type=%s\r\n", contentType->value->c_str ());
+          DataFileHandle.writeToFile (buffer, (u_long) strlen (buffer), &nbr);
+        }
 
-  sprintf (buffer, "Server Port=%u\r\n", td->connection->getLocalPort ());
-  DataFileHandle.writeToFile (buffer, (u_long)strlen (buffer), &nbr);
+      HttpRequestHeader::Entry *userAgent = td->request.other.get ("user-agent");
+      if (userAgent && userAgent->value->length ())
+        {
+          sprintf (buffer,"User Agent=%s\r\n", userAgent->value->c_str ());
+          DataFileHandle.writeToFile (buffer, (u_long) strlen (buffer), &nbr);
+        }
 
-  {
-    HttpRequestHeader::Entry *host = td->request.other.get ("host");
-    if (host)
-      sprintf (buffer, "Server Name=%s\r\n", host->value->c_str ());
-    DataFileHandle.writeToFile (buffer, (u_long)strlen (buffer), &nbr);
-  }
+      sprintf (buffer,"Content File=%s\r\n", td->inputData.getFilename ());
+      DataFileHandle.writeToFile (buffer, (u_long) strlen (buffer), &nbr);
 
-  strcpy (buffer, "[System]\r\n");
-  DataFileHandle.writeToFile (buffer, 10, &nbr);
+      if (td->request.contentLength[0])
+        {
+          sprintf (buffer, "Content Length=%s\r\n",
+                   td->request.contentLength.c_str ());
+          DataFileHandle.writeToFile (buffer, (u_long) strlen (buffer), &nbr);
+        }
+      else
+        {
+          strcpy (buffer, "Content Length=0\r\n");
+          DataFileHandle.writeToFile (buffer, 18, &nbr);
+        }
 
-  sprintf (buffer, "Output File=%s\r\n", outFilePath);
-  DataFileHandle.writeToFile (buffer, (u_long)strlen (buffer), &nbr);
+      strcpy (buffer,"Server Software=MyServer\r\n");
+      DataFileHandle.writeToFile (buffer, 26, &nbr);
 
-  sprintf (buffer,"Content File=%s\r\n", td->inputData.getFilename ());
-  DataFileHandle.writeToFile (buffer, (u_long)strlen (buffer), &nbr);
+      sprintf (buffer, "Remote Address=%s\r\n", td->connection->getIpAddr ());
+      DataFileHandle.writeToFile (buffer, (u_long) strlen (buffer), &nbr);
 
-  /*
-   *Compute the local offset from the GMT time
-   */
-  {
-    tm tmpTm;
-    ltime = 100;
-    gmhour = myserver_gmtime ( &ltime, &tmpTm)->tm_hour;
-    bias = myserver_localtime (&ltime, &tmpTm)->tm_hour - gmhour;
-  }
-  sprintf (buffer, "GMT Offset=%i\r\n", bias);
-  DataFileHandle.writeToFile (buffer, (u_long)strlen (buffer), &nbr);
+      sprintf (buffer, "Server Port=%u\r\n", td->connection->getLocalPort ());
+      DataFileHandle.writeToFile (buffer, (u_long) strlen (buffer), &nbr);
 
-  sprintf (buffer, "Debug Mode=No\r\n", bias);
-  DataFileHandle.writeToFile (buffer, 15, &nbr);
+      HttpRequestHeader::Entry *host = td->request.other.get ("host");
+      if (host)
+        sprintf (buffer, "Server Name=%s\r\n", host->value->c_str ());
+      DataFileHandle.writeToFile (buffer, (u_long) strlen (buffer), &nbr);
 
-  DataFileHandle.close ();
+      strcpy (buffer, "[System]\r\n");
+      DataFileHandle.writeToFile (buffer, 10, &nbr);
 
-  /*
-   *Create the out file.
-   */
-  if (!FilesUtility::nodeExists (outFilePath))
-    {
-      ret = OutFileHandle.openFile (outFilePath, File::FILE_CREATE_ALWAYS);
-      if (ret)
-        {
-          td->connection->host->warningsLogWrite (_("WinCGI: internal error"));
-          DataFileHandle.close ();
-          FilesUtility::deleteFile (outFilePath);
-          FilesUtility::deleteFile (dataFilePath);
-          chain.clearAllFilters ();
-          return td->http->raiseHTTPError (500);
-        }
-    }
-  OutFileHandle.close ();
-  spi.cmdLine.assign ("cmd /c \"");
-  spi.cmdLine.append (scriptpath);
-  spi.cmdLine.append ("\" ");
-  spi.cmdLine.append (dataFilePath);
-  spi.cwd.assign (pathname);
-  spi.envString = 0;
-  if (proc.exec (&spi, true))
-    {
-      td->connection->host->warningsLogWrite (_("WinCGI: error executing %s"), scriptpath);
+      sprintf (buffer, "Output File=%s\r\n", outFilePath);
+      DataFileHandle.writeToFile (buffer, (u_long) strlen (buffer), &nbr);
 
-      FilesUtility::deleteFile (outFilePath);
-      FilesUtility::deleteFile (dataFilePath);
-      chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
+      sprintf (buffer,"Content File=%s\r\n", td->inputData.getFilename ());
+      DataFileHandle.writeToFile (buffer, (u_long) strlen (buffer), &nbr);
 
-  ret=OutFileHandle.openFile (outFilePath, File::FILE_OPEN_ALWAYS|
-                              File::READ);
-  if (ret)
-    {
-      ostringstream msg;
-      msg << "WinCGI: Error opening output file " << outFilePath;
-      td->connection->host->warningsLogWrite (msg.str ().c_str ());
-      chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
-  OutFileHandle.read (buffer,td->auxiliaryBuffer->getRealLength (),&nBytesRead);
-  if (!nBytesRead)
-    {
-      ostringstream msg;
-      msg << "WinCGI: Error zero bytes read from the WinCGI output file "
-          << outFilePath;
-      td->connection->host->warningsLogWrite (msg.str ().c_str ());
-      OutFileHandle.close ();
-      FilesUtility::deleteFile (outFilePath);
-      FilesUtility::deleteFile (dataFilePath);
-      chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
+      /*
+       *Compute the local offset from the GMT time
+       */
+      tm tmpTm;
+      ltime = 100;
+      gmhour = myserver_gmtime ( &ltime, &tmpTm)->tm_hour;
+      bias = myserver_localtime (&ltime, &tmpTm)->tm_hour - gmhour;
 
-  for (u_long i = 0; i < nBytesRead; i++)
-    {
-      if ((buffer[i] == '\r') && (buffer[i+1] == '\n')
-         &&(buffer[i+2] == '\r') && (buffer[i+3] == '\n'))
-        {
-          /*
-           *The HTTP header ends with a \r\n\r\n sequence so
-           *determinate where it ends and set the header size
-           *to i + 4.
-           */
-          headerSize = i + 4;
-          break;
-        }
-    }
+      sprintf (buffer, "GMT Offset=%i\r\n", bias);
+      DataFileHandle.writeToFile (buffer, (u_long) strlen (buffer), &nbr);
 
-  if (td->request.isKeepAlive ())
-    td->response.setValue ("connection", "keep-alive");
+      sprintf (buffer, "Debug Mode=No\r\n", bias);
+      DataFileHandle.writeToFile (buffer, 15, &nbr);
 
-  HttpHeaders::buildHTTPResponseHeaderStruct (buffer, &td->response, &(td->nBytesToRead));
+      DataFileHandle.close ();
 
-  /*
-   *Always specify the size of the HTTP contents.
-   */
-  stream << OutFileHandle.getFileSize () - headerSize;
-  td->response.contentLength.assign (stream.str ());
-  if (!td->appendOutputs)
-    {
-      if (HttpHeaders::sendHeader (td->response, *chain.getStream (),
-                                   *td->buffer, td))
+      /*
+       *Create the out file.
+       */
+      if (! FilesUtility::nodeExists (outFilePath))
+        OutFileHandle.openFile (outFilePath, File::FILE_CREATE_ALWAYS
+                                | File::WRITE);
+
+      OutFileHandle.close ();
+      spi.cmdLine.assign ("cmd /c \"");
+      spi.cmdLine.append (scriptpath);
+      spi.cmdLine.append ("\" ");
+      spi.cmdLine.append (dataFilePath);
+      spi.cwd.assign (pathname);
+      spi.envString = 0;
+      try
         {
-          OutFileHandle.close ();
+          proc.exec (&spi, true);
+        }
+      catch (exception & e)
+        {
+          td->connection->host->warningsLogWrite (_E ("WinCGI: error executing %s"),
+                                                  scriptpath, &e);
           FilesUtility::deleteFile (outFilePath);
           FilesUtility::deleteFile (dataFilePath);
           chain.clearAllFilters ();
-          return HttpDataHandler::RET_FAILURE;
+          return td->http->raiseHTTPError (500);
         }
 
-      if (onlyHeader)
+      OutFileHandle.openFile (outFilePath, File::FILE_OPEN_ALWAYS | File::READ);
+      OutFileHandle.read (buffer,td->auxiliaryBuffer->getRealLength (), &nBytesRead);
+      if (! nBytesRead)
         {
+          ostringstream msg;
+          msg << "WinCGI: Error zero bytes read from the WinCGI output file "
+              << outFilePath;
+          td->connection->host->warningsLogWrite (msg.str ().c_str ());
           OutFileHandle.close ();
           FilesUtility::deleteFile (outFilePath);
           FilesUtility::deleteFile (dataFilePath);
           chain.clearAllFilters ();
-          return HttpDataHandler::RET_OK;
+          return td->http->raiseHTTPError (500);
         }
 
-      u_long written;
-      chain.write ((char*)(buffer + headerSize), nBytesRead - headerSize,
-                   &written);
-      nbw += written;
-    }
-  else
-    {
-      u_long nbw2;
-      HttpHeaders::buildHTTPResponseHeader (td->buffer->getBuffer (),
-                                            &td->response);
-      if (onlyHeader)
+      for (u_long i = 0; i < nBytesRead; i++)
         {
-          chain.clearAllFilters ();
-          return HttpDataHandler::RET_OK;
+          if ((buffer[i] == '\r') && (buffer[i+1] == '\n')
+              &&(buffer[i+2] == '\r') && (buffer[i+3] == '\n'))
+            {
+              /*
+                The HTTP header ends with a \r\n\r\n sequence so
+                determinate where it ends and set the header size
+                to i + 4.
+               */
+              headerSize = i + 4;
+              break;
+            }
         }
 
-      td->outputData.writeToFile ((char*)(buffer + headerSize),
-                                  nBytesRead - headerSize,
-                                  &nbw2);
-      nbw += nbw2;
-    }
+      if (td->request.isKeepAlive ())
+        td->response.setValue ("connection", "keep-alive");
 
-  if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
-    {
-      /* Flush the rest of the file.  */
-      do
+      HttpHeaders::buildHTTPResponseHeaderStruct (buffer, &td->response, &(td->nBytesToRead));
+
+      /*
+       *Always specify the size of the HTTP contents.
+       */
+      stream << OutFileHandle.getFileSize () - headerSize;
+      td->response.contentLength.assign (stream.str ());
+      if (!td->appendOutputs)
+        {
+          HttpHeaders::sendHeader (td->response, *chain.getStream (),
+                                   *td->buffer, td);
+
+          if (onlyHeader)
+            {
+              OutFileHandle.close ();
+              FilesUtility::deleteFile (outFilePath);
+              FilesUtility::deleteFile (dataFilePath);
+              chain.clearAllFilters ();
+              return HttpDataHandler::RET_OK;
+            }
+
+          u_long written;
+          chain.write ((char*)(buffer + headerSize), nBytesRead - headerSize,
+                       &written);
+          nbw += written;
+        }
+      else
         {
-          OutFileHandle.read (buffer, td->auxiliaryBuffer->getLength (),
-                             &nBytesRead);
-          if (nBytesRead)
+          u_long nbw2;
+          HttpHeaders::buildHTTPResponseHeader (td->buffer->getBuffer (),
+                                                &td->response);
+          if (onlyHeader)
             {
-              int ret;
+              chain.clearAllFilters ();
+              return HttpDataHandler::RET_OK;
+            }
+
+          td->outputData.writeToFile ((char*) (buffer + headerSize),
+                                      nBytesRead - headerSize,
+                                      &nbw2);
+          nbw += nbw2;
+        }
+
+      if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
+        {
+          /* Flush the rest of the file.  */
+          do
+            {
+              OutFileHandle.read (buffer, td->auxiliaryBuffer->getLength (),
+                                  &nBytesRead);
+              if (! nBytesRead)
+                break;
+
               if (td->appendOutputs)
-                {
-                  ret = td->outputData.writeToFile (buffer, nBytesRead, &nbw);
-                  if (ret)
-                    {
-                      OutFileHandle.close ();
-                      FilesUtility::deleteFile (outFilePath);
-                      FilesUtility::deleteFile (dataFilePath);
-                      chain.clearAllFilters ();
-                      return HttpDataHandler::RET_FAILURE;
-                    }
-                }
+                td->outputData.writeToFile (buffer, nBytesRead, &nbw);
               else
                 {
                   u_long nbw2;
-                  ret = chain.write ((char*)buffer, nBytesRead, &nbw2);
-                  if (ret == -1)
-                    {
-                      OutFileHandle.close ();
-                      FilesUtility::deleteFile (outFilePath);
-                      FilesUtility::deleteFile (dataFilePath);
-                      chain.clearAllFilters ();
-                      return HttpDataHandler::RET_FAILURE;
-                    }
+                  chain.write ((char*) buffer, nBytesRead, &nbw2);
                 }
             }
-          else
-            break;
+          while (nBytesRead);
+        }
+      td->sentData += nbw;
 
-        }while (nBytesRead);
+      chain.clearAllFilters ();
+      OutFileHandle.close ();
+      FilesUtility::deleteFile (outFilePath);
+      FilesUtility::deleteFile (dataFilePath);
+    }
+  catch (exception & e)
+    {
+      td->connection->host->warningsLogWrite (_E ("WinCGI: internal error",
+                                                  &e));
+      chain.clearAllFilters ();
+      return td->http->raiseHTTPError (500);
     }
-  td->sentData += nbw;
-
-  chain.clearAllFilters ();
-  OutFileHandle.close ();
-  FilesUtility::deleteFile (outFilePath);
-  FilesUtility::deleteFile (dataFilePath);
-
   return HttpDataHandler::RET_OK;
 #else
   td->connection->host->warningsLogWrite (_("WinCGI: not implemented"));



commit 5fb4cd0ee8856d0dd111aa850f5448b641d685f8
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 16 15:03:42 2010 +0200

    Proxy handles exceptions properly

diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index 97ba057..3f96454 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -68,68 +68,63 @@ int Proxy::send (HttpThreadContext *td,
       return td->http->raiseHTTPError (500);
     }
 
-  req.ver.assign ("HTTP/1.1");
-  req.cmd.assign (td->request.cmd);
-  req.uri.assign ("/");
-  req.uri.append (destUrl.getResource ());
-  req.uri.append (td->pathInfo);
-  req.setValue ("Connection", "Close");
+  try
+    {
+      req.ver.assign ("HTTP/1.1");
+      req.cmd.assign (td->request.cmd);
+      req.uri.assign ("/");
+      req.uri.append (destUrl.getResource ());
+      req.uri.append (td->pathInfo);
+      req.setValue ("Connection", "Close");
 
-  ostringstream host;
-  host << destUrl.getHost ();
-  if (destUrl.getPort () != 80 )
-    host << ":" << destUrl.getPort ();
+      ostringstream host;
+      host << destUrl.getHost ();
+      if (destUrl.getPort () != 80 )
+        host << ":" << destUrl.getPort ();
 
-  req.setValue ("Host", host.str ().c_str ());
+      req.setValue ("Host", host.str ().c_str ());
 
-  string xForwardedFor;
-  td->request.getValue ("X-Forwarded-For", &xForwardedFor);
-  if (xForwardedFor.size ())
-    xForwardedFor.append (", ");
-  xForwardedFor.append (td->connection->getIpAddr ());
-  req.setValue ("X-Forwarded-For", xForwardedFor.c_str ());
+      string xForwardedFor;
+      td->request.getValue ("X-Forwarded-For", &xForwardedFor);
+      if (xForwardedFor.size ())
+        xForwardedFor.append (", ");
+      xForwardedFor.append (td->connection->getIpAddr ());
+      req.setValue ("X-Forwarded-For", xForwardedFor.c_str ());
 
-  if (sock.connect (destUrl.getHost ().c_str (), destUrl.getPort ()))
-    return td->http->raiseHTTPError (500);
+      sock.connect (destUrl.getHost ().c_str (), destUrl.getPort ());
 
-  u_long hdrLen =
-    HttpHeaders::buildHTTPRequestHeader (td->auxiliaryBuffer->getBuffer (),
-                                         &req);
+      u_long hdrLen =
+        HttpHeaders::buildHTTPRequestHeader (td->auxiliaryBuffer->getBuffer (),
+                                             &req);
 
 
-  if (sock.write (td->auxiliaryBuffer->getBuffer (), hdrLen, &nbw))
-    {
-      chain.clearAllFilters ();
-      return HttpDataHandler::RET_FAILURE;
-    }
+      sock.write (td->auxiliaryBuffer->getBuffer (), hdrLen, &nbw);
 
-  if (td->request.uriOptsPtr &&
-      td->inputData.fastCopyToSocket (&sock, 0, td->auxiliaryBuffer, &nbw))
-    {
-      sock.close ();
-      return td->http->raiseHTTPError (500);
-    }
+      if (td->request.uriOptsPtr)
+        td->inputData.fastCopyToSocket (&sock, 0, td->auxiliaryBuffer, &nbw);
 
-  chain.setStream (td->connection->socket);
+      chain.setStream (td->connection->socket);
+      if (td->mime)
+        Server::getInstance ()->getFiltersFactory ()->chain (&chain,
+                                                             td->mime->filters,
+                                                             td->connection->socket,
+                                                             &nbw,
+                                                             1);
 
-  if (td->mime
-      && Server::getInstance ()->getFiltersFactory ()->chain (&chain,
-                                                              td->mime->filters,
-                                                         td->connection->socket,
-                                                              &nbw,
-                                                              1))
-    {
+
+      flushToClient (td, sock, chain, onlyHeader);
+
+      chain.clearAllFilters ();
       sock.close ();
+      req.free ();
+    }
+  catch (exception & e)
+    {
+      chain.clearAllFilters ();
       return td->http->raiseHTTPError (500);
     }
 
-  int ret = flushToClient (td, sock, chain, onlyHeader);
-
-  chain.clearAllFilters ();
-  sock.close ();
-  req.free ();
-
-  return ret;
+  return HttpDataHandler::RET_OK;
 }
 
 /*!
@@ -151,8 +146,6 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
                          td->auxiliaryBuffer->getRealLength () - read,
                          0,
                          td->http->getTimeout ());
-      if (ret < 0)
-        return td->http->raiseHTTPError (500);
 
       read += ret;
 
@@ -193,27 +186,16 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
   u_long hdrLen = HttpHeaders::buildHTTPResponseHeader (td->buffer->getBuffer (),
                                                         &td->response);
 
-  if (out.getStream ()->write (td->buffer->getBuffer (),
-                               hdrLen,
-                               &nbw))
-    return HttpDataHandler::RET_FAILURE;
+  out.getStream ()->write (td->buffer->getBuffer (), hdrLen, &nbw);
 
   if (onlyHeader)
     return HttpDataHandler::RET_OK;
 
-  ret = readPayLoad (td,
-                     &td->response,
-                     &out,
-                     &client,
-                     td->auxiliaryBuffer->getBuffer () + headerLength,
-                     read - headerLength,
-                     td->http->getTimeout (),
-                     useChunks,
-                     keepalive,
-                     hasTransferEncoding ? &transferEncoding : NULL);
-
-  if (ret == -1)
-    return HttpDataHandler::RET_FAILURE;
+  readPayLoad (td, &td->response, &out, &client,
+               td->auxiliaryBuffer->getBuffer () + headerLength,
+               read - headerLength, td->http->getTimeout (),
+               useChunks, keepalive,
+               hasTransferEncoding ? &transferEncoding : NULL);
 
   td->sentData += ret;
   return HttpDataHandler::RET_OK;
@@ -273,84 +255,63 @@ int Proxy::readPayLoad (HttpThreadContext* td,
 
   /* If it is specified a transfer encoding read data using it.  */
   if (serverTransferEncoding)
-  {
-    if (!serverTransferEncoding->compare ("chunked"))
     {
-      for (;;)
+      if (!serverTransferEncoding->compare ("chunked"))
         {
-          if (HttpDataRead::readChunkedPostData (initBuffer,
-                                                 &inPos,
-                                                 initBufferSize,
-                                                 client,
-                                                 td->buffer->getBuffer (),
+          for (;;)
+            {
+              HttpDataRead::readChunkedPostData (initBuffer, &inPos, initBufferSize,
+                                                 client, td->buffer->getBuffer (),
                                                  td->buffer->getRealLength () - 1,
-                                                 &nbr,
-                                                 timeout,
-                                                 NULL,
-                                                 1))
-            return HttpDataHandler::RET_FAILURE;
+                                                 &nbr, timeout, NULL, 1);
 
-          if (!nbr)
-            break;
+              if (!nbr)
+                break;
 
-          if (HttpDataHandler::appendDataToHTTPChannel (td,
+              HttpDataHandler::appendDataToHTTPChannel (td,
                                                         td->buffer->getBuffer (),
-                                                        nbr,
-                                                        &(td->outputData),
-                                                        out,
-                                                        td->appendOutputs,
-                                                        useChunks))
-            return HttpDataHandler::RET_FAILURE;
-
-          written += nbr;
+                                                        nbr, &(td->outputData),
+                                                        out, td->appendOutputs,
+                                                        useChunks);
+              written += nbr;
+            }
         }
     }
-  }
-  /* If it is not specified an encoding, read the data as it is.  */
-  else for (;;)
-  {
-
-    u_long len = td->buffer->getRealLength () - 1;
-
-    if (contentLength && length < len)
-      len = length;
-
-    if (len == 0)
-      break;
-
-    if (HttpDataRead::readContiguousPrimitivePostData (initBuffer,
-                                                      &inPos,
-                                                      initBufferSize,
-                                                      client,
-                                                      td->buffer->getBuffer (),
-                                                      len,
-                                                      &nbr,
-                                                      timeout))
-      return HttpDataHandler::RET_FAILURE;
+  else
+    {
+      /* If it is not specified an encoding, read the data as it is.  */
+      for (;;)
+        {
+          u_long len = td->buffer->getRealLength () - 1;
 
-    if (contentLength == 0 && nbr == 0)
-      break;
+          if (contentLength && length < len)
+            len = length;
 
-    if (length)
-      length -= nbr;
+          if (len == 0)
+            break;
 
-    if (nbr && HttpDataHandler::appendDataToHTTPChannel (td,
+          HttpDataRead::readContiguousPrimitivePostData (initBuffer, &inPos,
+                                                         initBufferSize, client,
                                                          td->buffer->getBuffer (),
-                                                         nbr,
-                                                         &(td->outputData),
-                                                         out,
-                                                         td->appendOutputs,
-                                                         useChunks))
-      return HttpDataHandler::RET_FAILURE;
+                                                         len, &nbr, timeout);
 
-    written += nbr;
+          if (contentLength == 0 && nbr == 0)
+            break;
 
-    if (contentLength && length == 0)
-      break;
-  }
+          if (length)
+            length -= nbr;
 
-  if (useChunks && out->getStream ()->write ("0\r\n\r\n", 5, &nbw))
-    return HttpDataHandler::RET_FAILURE;
+          HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
+                                                    nbr, &(td->outputData), out,
+                                                    td->appendOutputs, useChunks);
+          written += nbr;
+
+          if (contentLength && length == 0)
+            break;
+        }
+    }
+  if (useChunks)
+    out->getStream ()->write ("0\r\n\r\n", 5, &nbw);
 
-  return written;
+  return HttpDataHandler::RET_OK;
 }



commit 0442cc1ea679e7e02067103dd97d0a4ffc06a26d
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 16 14:47:20 2010 +0200

    Scgi handles exceptions properly

diff --git a/myserver/src/http_handler/scgi/scgi.cpp b/myserver/src/http_handler/scgi/scgi.cpp
index f75b0b1..08bca7e 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -47,8 +47,6 @@ int Scgi::send (HttpThreadContext* td, const char* scriptpath,
   ScgiContext con;
   FiltersChain chain;
 
-  int ret;
-
   string outDataPath;
 
   int sizeEnvString;
@@ -60,159 +58,153 @@ int Scgi::send (HttpThreadContext* td, const char* scriptpath,
 
   td->scriptPath.assign (scriptpath);
 
-  if (!(td->permissions & MYSERVER_PERMISSION_EXECUTE))
-    return td->http->sendAuth ();
-
-  {
-    string tmp;
-    tmp.assign (cgipath);
-    FilesUtility::splitPath (tmp, td->cgiRoot, td->cgiFile);
-    tmp.assign (scriptpath);
-    FilesUtility::splitPath (tmp, td->scriptDir, td->scriptFile);
-  }
-
-  chain.setStream (td->connection->socket);
-  if (td->mime)
-  {
-    u_long nbw;
-    if (td->mime && Server::getInstance ()->getFiltersFactory ()->chain (&chain,
-                                                    td->mime->filters,
-                                                    td->connection->socket,
-                                                    &nbw,
-                                                    1))
-    {
-      td->connection->host->warningsLogWrite (_("SCGI: internal error"));
-      chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
-  }
-
-  td->buffer->setLength (0);
-  td->auxiliaryBuffer->getAt (0) = '\0';
-
-  {
-    /* Do not modify the text between " and ".  */
-    int i;
-    int subString = cgipath[0] == '"';
-    int len = strlen (cgipath);
-    string tmpCgiPath;
-    for (i = 1; i < len; i++)
-    {
-      if (!subString && cgipath[i]==' ')
-        break;
-      if (cgipath[i] == '"' && cgipath[i - 1] != '\\')
-        subString = !subString;
-    }
-    /*!
-      Save the cgi path and the possible arguments.
-      the (x < len) case is when additional arguments are specified.
-      If the cgipath is enclosed between " and " do not consider them
-      when splitting directory and file name.
-     */
-    if (len)
+  try
     {
-      if (i < len)
-      {
-        string tmpString (cgipath);
-        int begin = tmpString[0]=='"' ? 1: 0;
-        int end = tmpString[i] == '"' ? i - 1: i;
-        tmpCgiPath.assign (tmpString.substr (begin, end - begin));
-        moreArg.assign (tmpString.substr (i, len - 1));
-      }
-      else
-      {
-        int begin = (cgipath[0] == '"') ? 1 : 0;
-        int end   = (cgipath[len] == '"') ? len - 1 : len;
-        tmpCgiPath.assign (&cgipath[begin], end - begin);
-        moreArg.assign ("");
-      }
-      FilesUtility::splitPath (tmpCgiPath, td->cgiRoot, td->cgiFile);
-    }
-    tmpCgiPath.assign (scriptpath);
-    FilesUtility::splitPath (tmpCgiPath, td->scriptDir, td->scriptFile);
-  }
+      string tmp;
+      if (!(td->permissions & MYSERVER_PERMISSION_EXECUTE))
+        return td->http->sendAuth ();
+
+      tmp.assign (cgipath);
+      FilesUtility::splitPath (tmp, td->cgiRoot, td->cgiFile);
+      tmp.assign (scriptpath);
+      FilesUtility::splitPath (tmp, td->scriptDir, td->scriptFile);
+
+      chain.setStream (td->connection->socket);
+      if (td->mime)
+        {
+          u_long nbw;
+          if (td->mime)
+            Server::getInstance ()->getFiltersFactory ()->chain (&chain,
+                                                                 td->mime->filters,
+                                                                 td->connection->socket,
+                                                                 &nbw,
+                                                                 1);
+        }
+
+      td->buffer->setLength (0);
+      td->auxiliaryBuffer->getAt (0) = '\0';
 
-  if (execute)
-  {
-    if (cgipath && strlen (cgipath))
-    {
-#ifdef WIN32
       {
-        int x;
-        string cgipathString (cgipath);
-        int len = strlen (cgipath);
+        /* Do not modify the text between " and ".  */
+        int i;
         int subString = cgipath[0] == '"';
+        int len = strlen (cgipath);
+        string tmpCgiPath;
+        for (i = 1; i < len; i++)
+          {
+            if (!subString && cgipath[i]==' ')
+              break;
+            if (cgipath[i] == '"' && cgipath[i - 1] != '\\')
+              subString = !subString;
+          }
 
-        cmdLine << "\"" << td->cgiRoot << "/" << td->cgiFile << "\" "
-                << moreArg << " \"" <<  td->filenamePath << "\"";
+        /*
+          Save the cgi path and the possible arguments.
+          the (x < len) case is when additional arguments are specified.
+          If the cgipath is enclosed between " and " do not consider them
+          when splitting directory and file name.
+        */
+        if (len)
+          {
+            if (i < len)
+              {
+                string tmpString (cgipath);
+                int begin = tmpString[0]=='"' ? 1: 0;
+                int end = tmpString[i] == '"' ? i - 1: i;
+                tmpCgiPath.assign (tmpString.substr (begin, end - begin));
+                moreArg.assign (tmpString.substr (i, len - 1));
+              }
+            else
+              {
+                int begin = (cgipath[0] == '"') ? 1 : 0;
+                int end   = (cgipath[len] == '"') ? len - 1 : len;
+                tmpCgiPath.assign (&cgipath[begin], end - begin);
+                moreArg.assign ("");
+              }
+            FilesUtility::splitPath (tmpCgiPath, td->cgiRoot, td->cgiFile);
+          }
+        tmpCgiPath.assign (scriptpath);
+        FilesUtility::splitPath (tmpCgiPath, td->scriptDir, td->scriptFile);
       }
+
+      if (execute)
+        {
+          if (cgipath && strlen (cgipath))
+            {
+#ifdef WIN32
+              {
+                int x;
+                string cgipathString (cgipath);
+                int len = strlen (cgipath);
+                int subString = cgipath[0] == '"';
+
+                cmdLine << "\"" << td->cgiRoot << "/" << td->cgiFile << "\" "
+                        << moreArg << " \"" <<  td->filenamePath << "\"";
+              }
 #else
-       cmdLine << cgipath << " " << td->filenamePath;
+              cmdLine << cgipath << " " << td->filenamePath;
 #endif
-    }/*if (execute).  */
-    else
-    {
-      cmdLine << scriptpath;
-    }
-  }
-  else
-  {
+            }/*if (execute).  */
+          else
+            {
+              cmdLine << scriptpath;
+            }
+        }
+      else
+        {
 #ifdef WIN32
-    cmdLine << "\"" << td->cgiRoot << "/" << td->cgiFile
-            << "\" " << moreArg;
+          cmdLine << "\"" << td->cgiRoot << "/" << td->cgiFile
+                  << "\" " << moreArg;
 #else
-    cmdLine << cgipath;
+          cmdLine << cgipath;
 #endif
-  }
-
-  Env::buildEnvironmentString (td, td->buffer->getBuffer ());
-  sizeEnvString = buildScgiEnvironmentString (td,td->buffer->getBuffer (),
-                                             td->auxiliaryBuffer->getBuffer ());
-  if (sizeEnvString == -1)
-  {
-    td->connection->host->warningsLogWrite (_("SCGI: internal error"));
-    chain.clearAllFilters ();
-    return td->http->raiseHTTPError (500);
-  }
-  td->inputData.close ();
-  if (td->inputData.openFile (td->inputDataPath, File::READ |
-                            File::FILE_OPEN_ALWAYS |
-                            File::NO_INHERIT))
-  {
-    td->connection->host->warningsLogWrite (_("SCGI: internal error"));
-    chain.clearAllFilters ();
-    return td->http->raiseHTTPError (500);
-  }
-
-  server = connect (&con, cmdLine.str ().c_str ());
-
-  if (server == 0)
-  {
-    td->connection->host->warningsLogWrite (_("SCGI: error connecting to the process %s"),
-                                           cmdLine.str ().c_str ());
-    chain.clearAllFilters ();
-    return td->http->raiseHTTPError (500);
-  }
-  ret = sendNetString (&con, td->auxiliaryBuffer->getBuffer (), sizeEnvString);
-
-  if (td->request.contentLength.size () &&
-     !td->request.contentLength.compare ("0"))
-  {
-    if (sendPostData (&con))
-     {
-      chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
-  }
+        }
+
+      Env::buildEnvironmentString (td, td->buffer->getBuffer ());
+      sizeEnvString = buildScgiEnvironmentString (td,td->buffer->getBuffer (),
+                                                  td->auxiliaryBuffer->getBuffer ());
+      if (sizeEnvString == -1)
+        {
+          td->connection->host->warningsLogWrite (_("SCGI: internal error"));
+          chain.clearAllFilters ();
+          return td->http->raiseHTTPError (500);
+        }
+      td->inputData.close ();
+      td->inputData.openFile (td->inputDataPath, File::READ
+                              | File::FILE_OPEN_ALWAYS | File::NO_INHERIT);
 
-  ret = sendResponse (&con, onlyHeader, &chain);
+      try
+        {
+          server = connect (&con, cmdLine.str ().c_str ());
+        }
+      catch (exception & e)
+        {
+          td->connection->host->warningsLogWrite
+            (_E ("SCGI: error connecting to the process %s"),
+             cmdLine.str ().c_str (), &e);
+          chain.clearAllFilters ();
+          return td->http->raiseHTTPError (500);
+        }
 
+      sendNetString (&con, td->auxiliaryBuffer->getBuffer (), sizeEnvString);
+      if (td->request.contentLength.size ()
+          && !td->request.contentLength.compare ("0"))
+        sendPostData (&con);
 
-  chain.clearAllFilters ();
-  con.tempOut.close ();
+      sendResponse (&con, onlyHeader, &chain);
 
-  con.sock.close ();
-  return ret;
+      chain.clearAllFilters ();
+      con.tempOut.close ();
+      con.sock.close ();
+    }
+  catch (exception & e)
+    {
+      td->connection->host->warningsLogWrite (_E ("SCGI: internal error"), &e);
+      chain.clearAllFilters ();
+      return td->http->raiseHTTPError (500);
+    }
+
+  return HttpDataHandler::RET_OK;
 }
 
 
@@ -272,21 +264,19 @@ int Scgi::sendResponse (ScgiContext* ctx, int onlyHeader, FiltersChain* chain)
                                                 &td->response,
                                                 &(td->nBytesToRead));
 
-  if (HttpHeaders::sendHeader (td->response, *td->connection->socket,
-                               *td->auxiliaryBuffer, td))
-    return HttpDataHandler::RET_FAILURE;
+  HttpHeaders::sendHeader (td->response, *td->connection->socket,
+                           *td->auxiliaryBuffer, td);
 
   if (onlyHeader)
     return HttpDataHandler::RET_OK;
 
   if (read - headerSize)
-    if (appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer () + headerSize,
-                                 read - headerSize,
-                                 &(td->outputData),
-                                 chain,
-                                 td->appendOutputs,
-                                 useChunks))
-      return HttpDataHandler::RET_FAILURE;
+    appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer () + headerSize,
+                             read - headerSize,
+                             &(td->outputData),
+                             chain,
+                             td->appendOutputs,
+                             useChunks);
 
   sentData += read - headerSize;
 
@@ -301,22 +291,18 @@ int Scgi::sendResponse (ScgiContext* ctx, int onlyHeader, FiltersChain* chain)
           if (!nbr || (nbr == (u_long)-1))
             break;
 
-          if (appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                       nbr,
-                                       &(td->outputData),
-                                       chain,
-                                       td->appendOutputs,
-                                       useChunks))
-            return HttpDataHandler::RET_FAILURE;
+          appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
+                                   nbr,
+                                   &(td->outputData),
+                                   chain,
+                                   td->appendOutputs,
+                                   useChunks);
 
           sentData += nbr;
         }
 
       if (!td->appendOutputs && useChunks)
-        {
-          if (chain->getStream ()->write ("0\r\n\r\n", 5, &nbw))
-            return HttpDataHandler::RET_FAILURE;
-        }
+        chain->getStream ()->write ("0\r\n\r\n", 5, &nbw);
     }
   /* For logging activity.  */
   td->sentData += sentData;
@@ -332,14 +318,9 @@ int Scgi::sendNetString (ScgiContext* ctx, const char* data, int len)
   char header[7];
   int headerLen = sprintf (header, "%i:", len);
 
-  if (ctx->sock.send (header, headerLen, 0) == -1)
-    return -1;
-
-  if (ctx->sock.send (data, len, 0) == -1)
-    return -1;
-
-  if (ctx->sock.send (",", 1, 0) == -1)
-    return -1;
+  ctx->sock.send (header, headerLen, 0);
+  ctx->sock.send (data, len, 0);
+  ctx->sock.send (",", 1, 0);
 
   return 0;
 }
@@ -352,15 +333,15 @@ int Scgi::sendPostData (ScgiContext* ctx)
   u_long nbr;
   do
     {
-      if (ctx->td->inputData.read (ctx->td->auxiliaryBuffer->getBuffer (),
-                                   ctx->td->auxiliaryBuffer->getRealLength (),
-                                   &nbr))
-        return -1;
+      ctx->td->inputData.read (ctx->td->auxiliaryBuffer->getBuffer (),
+                               ctx->td->auxiliaryBuffer->getRealLength (),
+                               &nbr);
 
-      if (nbr && (ctx->sock.send (ctx->td->auxiliaryBuffer->getBuffer (), nbr, 0) == -1))
-        return -1;
+      if (nbr)
+        ctx->sock.send (ctx->td->auxiliaryBuffer->getBuffer (), nbr, 0);
     }
   while (nbr);
+
   return 0;
 }
 
@@ -425,8 +406,9 @@ int Scgi::buildScgiEnvironmentString (HttpThreadContext* td, char* src,
       if (max == 0)
         return -1;
 
-      if (! strcasecmp (varName, "CONTENT_LENGTH") || ! strcasecmp (varName, "SCGI") ||
-          !varNameLen || !varValueLen)
+      if (! strcasecmp (varName, "CONTENT_LENGTH")
+          || ! strcasecmp (varName, "SCGI")
+          || !varNameLen || !varValueLen)
         continue;
 
       for (i = 0; i < varNameLen; i++)
@@ -440,7 +422,7 @@ int Scgi::buildScgiEnvironmentString (HttpThreadContext* td, char* src,
       if (*(++sptr) == '\0')
         break;
     }
-  return static_cast<int>(ptr - dest);
+  return static_cast<int> (ptr - dest);
 }
 
 /*!



commit f9dc0edd06d506c90b00a4e99bd0a428012ca6d4
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 16 14:32:39 2010 +0200

    Fastcgi handles exceptions properly

diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index 6a50412..9bfc7de 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -89,239 +89,229 @@ int FastCgi::send (HttpThreadContext* td, const char* scriptpath,
   if (!(td->permissions & MYSERVER_PERMISSION_EXECUTE))
     return td->http->sendAuth ();
 
-  string tmp;
-  tmp.assign (cgipath);
-  FilesUtility::splitPath (tmp, td->cgiRoot, td->cgiFile);
-  tmp.assign (scriptpath);
-  FilesUtility::splitPath (tmp, td->scriptDir, td->scriptFile);
-  chain.setStream (td->connection->socket);
-
-  if (td->mime
-      && Server::getInstance ()->getFiltersFactory ()->chain (&chain,
-                                                              td->mime->filters,
-                                                              td->connection->socket,
-                                                              &nbw,
-                                                              1))
+  try
     {
-      td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
-      chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
+      string tmp;
+      tmp.assign (cgipath);
+      FilesUtility::splitPath (tmp, td->cgiRoot, td->cgiFile);
+      tmp.assign (scriptpath);
+      FilesUtility::splitPath (tmp, td->scriptDir, td->scriptFile);
+      chain.setStream (td->connection->socket);
+
+      if (td->mime)
+        Server::getInstance ()->getFiltersFactory ()->chain (&chain,
+                                                             td->mime->filters,
+                                                             td->connection->socket,
+                                                             &nbw,
+                                                             1);
 
-  td->buffer->setLength (0);
-  td->auxiliaryBuffer->getAt (0) = '\0';
+      td->buffer->setLength (0);
+      td->auxiliaryBuffer->getAt (0) = '\0';
 
 
-  /*! Do not modify the text between " and ".  */
-  int i;
-  int subString = cgipath[0] == '"';
-  int len = strlen (cgipath);
-  string tmpCgiPath;
-  for (i = 1; i < len; i++)
-    {
-      if (!subString && cgipath[i]==' ')
-        break;
-      if (cgipath[i] == '"' && cgipath[i - 1] != '\\')
-        subString = !subString;
-    }
-  /*!
-    Save the cgi path and the possible arguments.
-    the (x < len) case is when additional arguments are specified.
-    If the cgipath is enclosed between " and " do not consider them
-    when splitting directory and file name.
-   */
-  if (len)
-    {
-      if (i < len)
+      /* Do not modify the text between " and ".  */
+      int i;
+      int subString = cgipath[0] == '"';
+      int len = strlen (cgipath);
+      string tmpCgiPath;
+      for (i = 1; i < len; i++)
         {
-          string tmpString (cgipath);
-          int begin = tmpString[0]=='"' ? 1: 0;
-          int end = tmpString[i] == '"' ? i - 1: i;
-          tmpCgiPath.assign (tmpString.substr (begin, end - begin));
-          moreArg.assign (tmpString.substr (i, len - 1));
+          if (!subString && cgipath[i]==' ')
+            break;
+          if (cgipath[i] == '"' && cgipath[i - 1] != '\\')
+            subString = !subString;
         }
-      else
+
+      /*
+        Save the cgi path and the possible arguments.
+        the (x < len) case is when additional arguments are specified.
+        If the cgipath is enclosed between " and " do not consider them
+        when splitting directory and file name.
+      */
+      if (len)
         {
-          int begin = (cgipath[0] == '"') ? 1 : 0;
-          int end   = (cgipath[len] == '"') ? len - 1 : len;
-          tmpCgiPath.assign (&cgipath[begin], end - begin);
-          moreArg.assign ("");
+          if (i < len)
+            {
+              string tmpString (cgipath);
+              int begin = tmpString[0]=='"' ? 1: 0;
+              int end = tmpString[i] == '"' ? i - 1: i;
+              tmpCgiPath.assign (tmpString.substr (begin, end - begin));
+              moreArg.assign (tmpString.substr (i, len - 1));
+            }
+          else
+            {
+              int begin = (cgipath[0] == '"') ? 1 : 0;
+              int end   = (cgipath[len] == '"') ? len - 1 : len;
+              tmpCgiPath.assign (&cgipath[begin], end - begin);
+              moreArg.assign ("");
+            }
+          FilesUtility::splitPath (tmpCgiPath, td->cgiRoot, td->cgiFile);
         }
-      FilesUtility::splitPath (tmpCgiPath, td->cgiRoot, td->cgiFile);
-    }
-  tmpCgiPath.assign (scriptpath);
-  FilesUtility::splitPath (tmpCgiPath, td->scriptDir, td->scriptFile);
-
+      tmpCgiPath.assign (scriptpath);
+      FilesUtility::splitPath (tmpCgiPath, td->scriptDir, td->scriptFile);
 
-  if (execute)
-    {
-      if (cgipath && strlen (cgipath))
+      if (execute)
         {
+          if (cgipath && strlen (cgipath))
+            {
 #ifdef WIN32
-          {
-            int x;
-            string cgipathString (cgipath);
-            int len = strlen (cgipath);
-            int subString = cgipath[0] == '"';
-
-            cmdLine << "\"" << td->cgiRoot << "/" << td->cgiFile << "\" "
-                    << moreArg << " \"" <<  td->filenamePath << "\"";
-          }
+              {
+                int x;
+                string cgipathString (cgipath);
+                int len = strlen (cgipath);
+                int subString = cgipath[0] == '"';
+
+                cmdLine << "\"" << td->cgiRoot << "/" << td->cgiFile << "\" "
+                        << moreArg << " \"" <<  td->filenamePath << "\"";
+              }
 #else
-          cmdLine << cgipath << " " << td->filenamePath;
+              cmdLine << cgipath << " " << td->filenamePath;
 #endif
-        }/*if (execute).  */
+            }/*if (execute).  */
+          else
+            cmdLine << scriptpath;
+        }
       else
-        cmdLine << scriptpath;
-    }
-  else
-    {
+        {
 #ifdef WIN32
-      cmdLine << "\"" << td->cgiRoot << "/" << td->cgiFile
-              << "\" " << moreArg;
+          cmdLine << "\"" << td->cgiRoot << "/" << td->cgiFile
+                  << "\" " << moreArg;
 #else
-      cmdLine << cgipath;
+          cmdLine << cgipath;
 #endif
-    }
-
-  td->inputData.close ();
-  if (td->inputData.openFile (td->inputDataPath, File::READ |
-                              File::FILE_OPEN_ALWAYS |
-                              File::NO_INHERIT))
-    {
-      td->buffer->setLength (0);
-      td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
-      chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
-
-  server = connect (&con, cmdLine.str ().c_str ());
-
-  if (server == NULL)
-    {
-      td->buffer->setLength (0);
-      td->connection->host->warningsLogWrite (_("FastCGI: cannot connect to the %s process"),
-                                              cmdLine.str ().c_str ());
-      chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
+        }
 
-  id = td->id + 1;
+      td->inputData.close ();
+      td->inputData.openFile (td->inputDataPath, File::READ
+                              | File::FILE_OPEN_ALWAYS
+                              | File::NO_INHERIT);
 
-  if (fastCgiRequest (&con, id))
-    return td->http->raiseHTTPError (500);
+      server = connect (&con, cmdLine.str ().c_str ());
+      if (server == NULL)
+        {
+          td->buffer->setLength (0);
+          td->connection->host->warningsLogWrite
+              (_("FastCGI: cannot connect to the %s process"),
+               cmdLine.str ().c_str ());
+          chain.clearAllFilters ();
+          return td->http->raiseHTTPError (500);
+        }
 
-  /*! Now read the output. This flag is used by the external loop.  */
-  exit = 0;
+      id = td->id + 1;
+      if (fastCgiRequest (&con, id))
+        return td->http->raiseHTTPError (500);
 
-  /*! Return 1 if keep the connection. A nonzero value also mean no errors. */
-  ret = HttpDataHandler::RET_OK;
+      /* Now read the output. This flag is used by the external loop.  */
+      exit = 0;
 
-  initialTicks = getTicks ();
+      /* Return 1 if keep the connection. A nonzero value also mean no errors.  */
+      ret = HttpDataHandler::RET_OK;
 
-  td->buffer->setLength (0);
-  checkDataChunks (td, &con.keepalive, &con.useChunks);
+      initialTicks = getTicks ();
 
-  do
-    {
-      u_long dim;
-      u_long timeout = td->http->getTimeout ();
+      td->buffer->setLength (0);
+      checkDataChunks (td, &con.keepalive, &con.useChunks);
 
-      if (readHeader (&con, &header, initialTicks, timeout, id))
+      do
         {
-          exit = 1;
-          ret = td->http->raiseHTTPError (500);
-          break;
-        }
+          u_long dim;
+          u_long timeout = td->http->getTimeout ();
 
-      /*!
-       *contentLengthB1 is the high word of the content length value
-       *while contentLengthB0 is the low one.
-       *To retrieve the value of content length push left contentLengthB1
-       *of eight byte then do an or with contentLengthB0.
-       */
-      dim = (header.contentLengthB1 << 8) | header.contentLengthB0;
+          readHeader (&con, &header, initialTicks, timeout, id);
 
-      if (dim == 0)
-        {
-          exit = 1;
-          ret = HttpDataHandler::RET_FAILURE;
-        }
-      else
-        {
-          bool headerCompleted = false;
-          u_long timeout = td->http->getTimeout ();
+          /*
+           *contentLengthB1 is the high word of the content length value
+           *while contentLengthB0 is the low one.
+           *To retrieve the value of content length push left contentLengthB1
+           *of eight byte then do an or with contentLengthB0.
+           */
+          dim = (header.contentLengthB1 << 8) | header.contentLengthB0;
 
-          switch (header.type)
+          if (dim == 0)
             {
-            case FCGISTDERR:
-              con.sock.close ();
-              td->http->raiseHTTPError (501);
               exit = 1;
               ret = HttpDataHandler::RET_FAILURE;
-              break;
-            case FCGISTDOUT:
-              headerCompleted = false;
-              ret = sendData (&con, dim, static_cast<u_long>(timeout),
-                              &chain, &headerCompleted, onlyHeader);
+            }
+          else
+            {
+              bool headerCompleted = false;
+              u_long timeout = td->http->getTimeout ();
 
-              if (ret)
+              switch (header.type)
                 {
+                case FCGISTDERR:
+                  con.sock.close ();
+                  td->http->raiseHTTPError (501);
                   exit = 1;
-                  if (ret == 1)
-                    responseCompleted = true;
-                  else
-                    ret = HttpDataHandler::RET_FAILURE;
+                  ret = HttpDataHandler::RET_FAILURE;
+                  break;
+
+                case FCGISTDOUT:
+                  headerCompleted = false;
+                  ret = sendData (&con, dim, static_cast<u_long>(timeout),
+                                  &chain, &headerCompleted, onlyHeader);
+
+                  if (ret)
+                    {
+                      exit = 1;
+                      if (ret == 1)
+                        responseCompleted = true;
+                      else
+                        ret = HttpDataHandler::RET_FAILURE;
+
+                      break;
+                    }
+
+                  if (headerCompleted)
+                    {
+                      exit = 1;
+                      break;
+                    }
 
                   break;
-                }
 
-              if (headerCompleted)
-                {
+                case FCGIEND_REQUEST:
                   exit = 1;
                   break;
-                }
 
-              break;
-            case FCGIEND_REQUEST:
-              exit = 1;
-              break;
-            case FCGIGET_VALUES_RESULT:
-            case FCGIUNKNOWN_TYPE:
-            default:
-              break;
+                case FCGIGET_VALUES_RESULT:
+                case FCGIUNKNOWN_TYPE:
+                default:
+                  break;
+                }
             }
-        }
 
-      if (header.paddingLength)
-        {
-          u_long toPad = header.paddingLength;
-          u_long timeout = td->http->getTimeout ();
-          while (toPad)
+          if (header.paddingLength)
             {
-              if (td->buffer->getRealLength () < toPad)
-                toPad =  td->buffer->getRealLength ();
-
-              nbr = con.sock.recv (td->buffer->getBuffer (), toPad,
-                                   0, static_cast<u_long>(timeout));
-              if (nbr == (u_long)-1)
+              u_long toPad = header.paddingLength;
+              u_long timeout = td->http->getTimeout ();
+              while (toPad)
                 {
-                  exit = 1;
-                  ret = HttpDataHandler::RET_FAILURE;
-                  break;
+                  if (td->buffer->getRealLength () < toPad)
+                    toPad =  td->buffer->getRealLength ();
+
+                  nbr = con.sock.recv (td->buffer->getBuffer (), toPad,
+                                       0, static_cast<u_long> (timeout));
+                  toPad -= nbr;
                 }
-              toPad -= nbr;
             }
-        }
-    }while (!exit);
+        }while (!exit);
 
-  /* Send the last null chunk if needed.  */
-  if (!responseCompleted && con.useChunks &&
-      (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL))
-    chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
+      /* Send the last null chunk if needed.  */
+      if (!responseCompleted && con.useChunks &&
+          (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL))
+        chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
 
-  chain.clearAllFilters ();
-  con.sock.close ();
+      chain.clearAllFilters ();
+      con.sock.close ();
+    }
+  catch (exception & e)
+    {
+      td->connection->host->warningsLogWrite (_E ("FastCGI: internal error"),
+                                              &e);
+      chain.clearAllFilters ();
+      return td->http->raiseHTTPError (500);
+    }
 
   return ret;
 }
@@ -336,10 +326,8 @@ int FastCgi::sendFcgiBody (FcgiContext* con, char* buffer, int len, int type,
   FcgiHeader header;
   generateFcgiHeader ( header, type, id, len );
 
-  if (con->sock.send ((char*)&header, sizeof (header), 0) == -1)
-    return -1;
-  if (con->sock.send ((char*)buffer, len, 0) == -1)
-    return -1;
+  con->sock.send ((char*) &header, sizeof (header), 0);
+  con->sock.send ((char*) buffer, len, 0);
   return 0;
 }
 
@@ -416,7 +404,7 @@ int FastCgi::buildFASTCGIEnvironmentString (HttpThreadContext*, char* src,
     if (*(++sptr) == '\0')
       break;
   }
-  return static_cast<int>(ptr - dest);
+  return static_cast<int> (ptr - dest);
 }
 
 /*!
@@ -487,7 +475,6 @@ FastCgiServer* FastCgi::connect (FcgiContext* con, const char* path)
   if (server)
   {
     int ret = processServerManager->connect (&(con->sock), server);
-
     if (ret == -1)
       return 0;
   }
@@ -568,74 +555,33 @@ int FastCgi::fastCgiRequest (FcgiContext* con, int id)
   tBody.flags = 0;
   memset ( tBody.reserved, 0, sizeof ( tBody.reserved ) );
 
-  if (sendFcgiBody (con, (char*)&tBody, sizeof (tBody), FCGIBEGIN_REQUEST, id))
-  {
-    td->buffer->setLength (0);
-    td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
-    return 1;
-  }
-
-  if (sendFcgiBody (con, td->auxiliaryBuffer->getBuffer (), sizeEnvString,
-                  FCGIPARAMS, id))
-  {
-    td->buffer->setLength (0);
-    td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
-    return 1;
-  }
-
-  if (sendFcgiBody (con, 0, 0, FCGIPARAMS, id))
-  {
-    td->buffer->setLength (0);
-    td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
-    return 1;
-  }
+  sendFcgiBody (con, (char*)&tBody, sizeof (tBody), FCGIBEGIN_REQUEST, id);
+  sendFcgiBody (con, td->auxiliaryBuffer->getBuffer (), sizeEnvString,
+                FCGIPARAMS, id);
+  sendFcgiBody (con, 0, 0, FCGIPARAMS, id);
 
   if (atoi (td->request.contentLength.c_str ()))
   {
     td->buffer->setLength (0);
+    td->inputData.seek (0);
 
-
-    if (td->inputData.seek (0))
-      {
-        td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
-        return 1;
-      }
-
-    /*! Send the STDIN data.  */
+    /* Send the STDIN data.  */
     do
     {
-      if (td->inputData.read (td->buffer->getBuffer (),
-                                    maxStdinChunk, &nbr))
-      {
-        td->buffer->setLength (0);
-        td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
-        return 1;
-      }
+      td->inputData.read (td->buffer->getBuffer (), maxStdinChunk, &nbr);
 
       if (!nbr)
         break;
 
       generateFcgiHeader (header, FCGISTDIN, id, nbr);
-      if (con->sock.send ((char*)&header, sizeof (header), 0) == -1)
-        return 1;
-
-      if (con->sock.send (td->buffer->getBuffer (), nbr, 0) == -1)
-        {
-          td->buffer->setLength (0);
-          td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
-          return 1;
-        }
+      con->sock.send ((char*) &header, sizeof (header), 0);
+      con->sock.send (td->buffer->getBuffer (), nbr, 0);
     }
     while (nbr == maxStdinChunk);
   }
 
-  /*! Final stdin chunk.  */
-  if (sendFcgiBody (con, 0, 0, FCGISTDIN, id))
-    {
-      td->buffer->setLength (0);
-      td->connection->host->warningsLogWrite (_("FastCGI: internal error"));
-      return 1;
-    }
+  /* Final stdin chunk.  */
+  sendFcgiBody (con, 0, 0, FCGISTDIN, id);
 
   return 0;
 }
@@ -677,8 +623,6 @@ int FastCgi::sendData (FcgiContext* con, u_long dim, u_long timeout,
                                 std::min ((u_long) td->buffer->getRealLength (),
                                              dim - td->buffer->getLength ()),
                                    0, timeout);
-      if (nbr == (u_long)-1 || nbr == 0)
-        return -1;
 
       td->buffer->setLength (td->buffer->getLength () + nbr);
 
@@ -691,14 +635,13 @@ int FastCgi::sendData (FcgiContext* con, u_long dim, u_long timeout,
   if (onlyHeader || con->td->response.getStatusType () != HttpResponseHeader::SUCCESSFUL)
     return 1;
 
-  if (HttpDataHandler::appendDataToHTTPChannel (con->td,
-                                                con->td->buffer->getBuffer (),
-                                                con->td->buffer->getLength (),
-                                                &(con->td->outputData),
-                                                chain,
-                                                con->td->appendOutputs,
-                                                con->useChunks))
-    return -1;
+  HttpDataHandler::appendDataToHTTPChannel (con->td,
+                                            con->td->buffer->getBuffer (),
+                                            con->td->buffer->getLength (),
+                                            &(con->td->outputData),
+                                            chain,
+                                            con->td->appendOutputs,
+                                            con->useChunks);
 
   con->td->sentData += con->td->buffer->getLength ();
 
@@ -738,7 +681,7 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain* chain, bool* response
     ! strcasecmp (con->td->securityToken.getData ("fastcgi.sendfile.allow",
                                               MYSERVER_VHOST_CONF
                                               | MYSERVER_SERVER_CONF, "NO"),
-              "YES");
+                  "YES");
   if (allowSendfile)
     {
       string *sendfile = con->td->response.getValue ("X-Sendfile", NULL);
@@ -785,15 +728,13 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain* chain, bool* response
   if (con->td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL &&
       size - headerSize)
     {
-      if (HttpDataHandler::appendDataToHTTPChannel (con->td,
-                                                    con->td->buffer->getBuffer () + headerSize,
-                                                    size - headerSize,
-                                                    &(con->td->outputData),
-                                                    chain,
-                                                    con->td->appendOutputs,
-                                                    con->useChunks))
-        return 1;
-
+      HttpDataHandler::appendDataToHTTPChannel (con->td,
+                                                con->td->buffer->getBuffer () + headerSize,
+                                                size - headerSize,
+                                                &(con->td->outputData),
+                                                chain,
+                                                con->td->appendOutputs,
+                                                con->useChunks);
       con->td->sentData += size - headerSize;
     }
 



commit eaf34a00517172e15a224ed02fc390a1a9cdfe8f
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 16 14:13:43 2010 +0200

    Mscgi handles exceptions properly

diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp b/myserver/src/http_handler/mscgi/mscgi.cpp
index cf3a245..2b349d4 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -81,72 +81,77 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
   if (!(td->permissions & MYSERVER_PERMISSION_EXECUTE))
     return td->http->sendAuth ();
 
-  td->scriptPath.assign (exec);
-
-  {
-    string tmp;
-    tmp.assign (exec);
-    FilesUtility::splitPath (tmp, td->cgiRoot, td->cgiFile);
-    FilesUtility::splitPath (exec, td->scriptDir, td->scriptFile);
-  }
-
-  Env::buildEnvironmentString (td,data.envString);
-  chain.setStream (td->connection->socket);
-
-  if (td->mime && Server::getInstance ()->getFiltersFactory ()->chain (&chain,
-                                                                      td->mime->filters,
-                                                                      td->connection->socket,
-                                                                      &nbw,
-                                                                      1))
+  try
     {
-      td->connection->host->warningsLogWrite (_("MSCGI: internal error"));
-      chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
-
-  checkDataChunks (td, &(data.keepAlive), &(data.useChunks));
-
-  ret = hinstLib.loadLibrary (exec, 0);
+      td->scriptPath.assign (exec);
+
+      {
+        string tmp;
+        tmp.assign (exec);
+        FilesUtility::splitPath (tmp, td->cgiRoot, td->cgiFile);
+        FilesUtility::splitPath (exec, td->scriptDir, td->scriptFile);
+      }
+
+      Env::buildEnvironmentString (td,data.envString);
+      chain.setStream (td->connection->socket);
+
+      if (td->mime)
+        Server::getInstance ()->getFiltersFactory ()->chain (&chain,
+                                                             td->mime->filters,
+                                                             td->connection->socket,
+                                                             &nbw, 1);
+
+      checkDataChunks (td, &(data.keepAlive), &(data.useChunks));
+      try
+        {
+          hinstLib.loadLibrary (exec, 0);
+        }
+      catch (exception & e)
+        {
+          td->connection->host->warningsLogWrite (_E ("MSCGI: cannot load %s"),
+                                                  exec, &e);
+          chain.clearAllFilters ();
+          /* Internal server error.  */
+          return td->http->raiseHTTPError (500);
+        }
+
+      td->auxiliaryBuffer->getAt (0) = '\0';
+      ProcMain = (CGIMAIN) hinstLib.getProc ( "myserver_main");
+      if (ProcMain)
+        (ProcMain)(td->request.uriOpts.c_str (), &data);
+      else
+        {
+          td->connection->host->warningsLogWrite
+            (_("MSCGI: cannot find entry-point for %s"),exec);
+          return td->http->raiseHTTPError (500);
+        }
+      hinstLib.close ();
+
+      if (data.errorPage)
+        {
+          chain.clearAllFilters ();
+          return td->http->raiseHTTPError (data.errorPage);
+        }
+
+      if (!td->appendOutputs && data.useChunks && !data.error)
+        chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
+
+      if (!data.error)
+        return HttpDataHandler::RET_FAILURE;
+
+      ostringstream tmp;
+      tmp << td->sentData;
+      td->response.contentLength.assign (tmp.str ());
 
-  if (ret)
-    {
-      td->connection->host->warningsLogWrite (_("MSCGI: cannot load %s"), exec);
       chain.clearAllFilters ();
-      /* Internal server error.  */
-      return td->http->raiseHTTPError (500);
-    }
 
-  td->auxiliaryBuffer->getAt (0) = '\0';
-
-  ProcMain = (CGIMAIN) hinstLib.getProc ( "myserver_main");
-  if (ProcMain)
-    (ProcMain)(td->request.uriOpts.c_str (), &data);
-  else
-    {
-      td->connection->host->warningsLogWrite (_("MSCGI: cannot find entry-point for %s"), exec);
-      return td->http->raiseHTTPError (500);
     }
-  hinstLib.close ();
-
-
-  if (data.errorPage)
+  catch (exception & e)
     {
-      chain.clearAllFilters ();
-      return td->http->raiseHTTPError (data.errorPage);
+      td->connection->host->warningsLogWrite (_E ("Cgi: internal error"), &e);
+      return td->http->raiseHTTPError (500);
     }
 
-  if (!td->appendOutputs && data.useChunks && !data.error
-      && chain.getStream ()->write ("0\r\n\r\n", 5, &nbw))
-    return HttpDataHandler::RET_FAILURE;
-
-  if (!data.error)
-    return HttpDataHandler::RET_FAILURE;
-
-  ostringstream tmp;
-  tmp << td->sentData;
-  td->response.contentLength.assign (tmp.str ());
-
-  chain.clearAllFilters ();
   return HttpDataHandler::RET_OK;
 }
 
@@ -164,14 +169,13 @@ int MsCgi::write (const char* data, u_long len, MsCgiData* mcd)
   if (mcd->onlyHeader)
     return 0;
 
-  if (HttpDataHandler::appendDataToHTTPChannel (mcd->td,
-                                                (char*) data,
-                                                len,
-                                                &(mcd->td->outputData),
-                                                mcd->filtersChain,
-                                                mcd->td->appendOutputs,
-                                                mcd->useChunks))
-    return 1;
+  HttpDataHandler::appendDataToHTTPChannel (mcd->td,
+                                            (char*) data,
+                                            len,
+                                            &(mcd->td->outputData),
+                                            mcd->filtersChain,
+                                            mcd->td->appendOutputs,
+                                            mcd->useChunks);
 
   mcd->td->sentData +=len;
   return 0;
@@ -190,9 +194,8 @@ int MsCgi::sendHeader (MsCgiData* mcd)
   if (mcd->headerSent)
     return 0;
 
-  if (HttpHeaders::sendHeader (td->response, *td->connection->socket,
-                               *td->auxiliaryBuffer, td))
-    return 1;
+  HttpHeaders::sendHeader (td->response, *td->connection->socket,
+                           *td->auxiliaryBuffer, td);
 
   mcd->headerSent = true;
   return 0;



commit 388a6be0ca412abafe0b929fdc9fa7624dd88905
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 16 14:08:15 2010 +0200

    Cgi handles exceptions properly

diff --git a/myserver/src/http_handler/cgi/cgi.cpp b/myserver/src/http_handler/cgi/cgi.cpp
index 45bce5a..d01187e 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -80,235 +80,225 @@ int Cgi::send (HttpThreadContext* td, const char* scriptpath,
   int len = strlen (cgipath);
   int i;
 
-  if (!(td->permissions & MYSERVER_PERMISSION_EXECUTE))
-    return td->http->sendAuth ();
+  try
+    {
+      if (! (td->permissions & MYSERVER_PERMISSION_EXECUTE))
+        return td->http->sendAuth ();
 
-  td->scriptPath.assign (scriptpath);
+      td->scriptPath.assign (scriptpath);
 
-  if (!FilesUtility::nodeExists (scriptpath))
-    return td->http->raiseHTTPError (404);
+      if (!FilesUtility::nodeExists (scriptpath))
+        return td->http->raiseHTTPError (404);
 
-  int subString = cgipath[0] == '"';
-  /* Do not modify the text between " and ".  */
-  for (i = 1; i < len; i++)
-    {
-      if (!subString && cgipath[i] == ' ')
-        break;
-      if (cgipath[i] == '"' && cgipath[i - 1] != '\\')
-        subString = !subString;
-    }
+      int subString = cgipath[0] == '"';
+      /* Do not modify the text between " and ".  */
+      for (i = 1; i < len; i++)
+        {
+          if (!subString && cgipath[i] == ' ')
+            break;
+          if (cgipath[i] == '"' && cgipath[i - 1] != '\\')
+            subString = !subString;
+        }
 
-  /*
-   *Save the cgi path and the possible arguments.
-   *the (x < len) case is when additional arguments are specified.
-   *If the cgipath is enclosed between " and " do not consider them
-   *when splitting directory and file name.
-   */
-  if (i < len)
-    {
-      string tmpString (cgipath);
-      int begin = tmpString[0] == '"' ? 1 : 0;
-      int end   = tmpString[i] == '"' ? i : i - 1;
-      tmpCgiPath.assign (tmpString.substr (begin, end - 1));
-      moreArg.assign (tmpString.substr (i, len - 1));
-    }
-  else
-    {
-      int begin = (cgipath[0] == '"') ? 1 : 0;
-      int end   = (cgipath[len] == '"') ? len-1 : len;
-      tmpCgiPath.assign (&cgipath[begin], end-begin);
-      moreArg.assign ("");
-    }
-  FilesUtility::splitPath (tmpCgiPath, td->cgiRoot, td->cgiFile);
+      /*
+        Save the cgi path and the possible arguments.
+        the (x < len) case is when additional arguments are specified.
+        If the cgipath is enclosed between " and " do not consider them
+        when splitting directory and file name.
+      */
+      if (i < len)
+        {
+          string tmpString (cgipath);
+          int begin = tmpString[0] == '"' ? 1 : 0;
+          int end   = tmpString[i] == '"' ? i : i - 1;
+          tmpCgiPath.assign (tmpString.substr (begin, end - 1));
+          moreArg.assign (tmpString.substr (i, len - 1));
+        }
+      else
+        {
+          int begin = (cgipath[0] == '"') ? 1 : 0;
+          int end   = (cgipath[len] == '"') ? len-1 : len;
+          tmpCgiPath.assign (&cgipath[begin], end-begin);
+          moreArg.assign ("");
+        }
+      FilesUtility::splitPath (tmpCgiPath, td->cgiRoot, td->cgiFile);
 
-  tmpScriptPath.assign (scriptpath);
-  FilesUtility::splitPath (tmpScriptPath, td->scriptDir, td->scriptFile);
+      tmpScriptPath.assign (scriptpath);
+      FilesUtility::splitPath (tmpScriptPath, td->scriptDir, td->scriptFile);
 
-  chain.setStream (td->connection->socket);
+      chain.setStream (td->connection->socket);
 
-  if (execute)
-    {
-      const char *args = 0;
-      if (td->request.uriOpts.length ())
-        args = td->request.uriOpts.c_str ();
-      else if (td->pathInfo.length ())
-        args = &td->pathInfo[1];
-
-    if (cgipath && strlen (cgipath))
-      cmdLine << tmpCgiPath << " " << moreArg << " "
-              << td->scriptFile <<  (args ? args : "" ) ;
-    else
-      cmdLine << tmpScriptPath << moreArg << " " << (args ? args : "" );
-
-    nph = td->scriptFile.length () > 4 && td->scriptFile[0] == 'n'
-      && td->scriptFile[1] == 'p' && td->scriptFile[2] == 'h'
-      && td->scriptFile[3] == '-' ;
-
-    if (cgipath && strlen (cgipath))
-      {
-        spi.cmd.assign (tmpCgiPath);
-        spi.arg.append (" ");
-        spi.arg.assign (moreArg);
-        spi.arg.append (" ");
-        spi.arg.append (td->scriptFile);
+      if (execute)
+        {
+          const char *args = 0;
+          if (td->request.uriOpts.length ())
+            args = td->request.uriOpts.c_str ();
+          else if (td->pathInfo.length ())
+            args = &td->pathInfo[1];
+
+          if (cgipath && strlen (cgipath))
+            cmdLine << tmpCgiPath << " " << moreArg << " "
+                    << td->scriptFile <<  (args ? args : "" ) ;
+          else
+            cmdLine << tmpScriptPath << moreArg << " " << (args ? args : "" );
 
-        if (args)
-          {
-            spi.arg.append (" ");
-            spi.arg.append (args);
-          }
-      }
-    else
-      {
-      spi.cmd.assign (scriptpath);
-      spi.arg.assign (moreArg);
+          nph = td->scriptFile.length () > 4 && td->scriptFile[0] == 'n'
+            && td->scriptFile[1] == 'p' && td->scriptFile[2] == 'h'
+            && td->scriptFile[3] == '-' ;
 
-      if (args)
-        {
-          spi.arg.append (" ");
-          spi.arg.append (args);
+          if (cgipath && strlen (cgipath))
+            {
+              spi.cmd.assign (tmpCgiPath);
+              spi.arg.append (" ");
+              spi.arg.assign (moreArg);
+              spi.arg.append (" ");
+              spi.arg.append (td->scriptFile);
+              if (args)
+                {
+                  spi.arg.append (" ");
+                  spi.arg.append (args);
+                }
+            }
+          else
+            {
+              spi.cmd.assign (scriptpath);
+              spi.arg.assign (moreArg);
+              if (args)
+                {
+                  spi.arg.append (" ");
+                  spi.arg.append (args);
+                }
+            }
         }
-    }
-    }
-  else
-    {
-      if (!FilesUtility::nodeExists (tmpCgiPath.c_str ()))
+      else
         {
-          if (tmpCgiPath.length () > 0)
-            td->connection->host->warningsLogWrite (_("Cgi: cannot find the %s file")),
-              tmpCgiPath.c_str ();
-          else
-            td->connection->host->warningsLogWrite (_("Cgi: Executable file not specified"));
+          if (! FilesUtility::nodeExists (tmpCgiPath.c_str ()))
+            {
+              if (tmpCgiPath.length () > 0)
+                td->connection->host->warningsLogWrite
+                         (_("Cgi: cannot find the %s file")),
+                         tmpCgiPath.c_str ();
+              else
+                td->connection->host->warningsLogWrite
+                           (_("Cgi: Executable file not specified"));
+
+              td->scriptPath.assign ("");
+              td->scriptFile.assign ("");
+              td->scriptDir.assign ("");
+              chain.clearAllFilters ();
+              return td->http->raiseHTTPError (500);
+            }
 
-          td->scriptPath.assign ("");
-          td->scriptFile.assign ("");
-          td->scriptDir.assign ("");
-          chain.clearAllFilters ();
-          return td->http->raiseHTTPError (500);
+          spi.arg.assign (moreArg);
+          spi.arg.append (" ");
+          spi.arg.append (td->scriptFile);
+
+          cmdLine << "\"" << td->cgiRoot << "/" << td->cgiFile << "\" "
+                  << moreArg << " " << td->scriptFile;
+
+          spi.cmd.assign (td->cgiRoot);
+          spi.cmd.append ("/");
+          spi.cmd.append (td->cgiFile);
+
+          if (td->cgiFile.length () > 4 && td->cgiFile[0] == 'n'
+              && td->cgiFile[1] == 'p' && td->cgiFile[2] == 'h'
+              && td->cgiFile[3] == '-' )
+            nph = true;
+          else
+            nph = false;
         }
 
-      spi.arg.assign (moreArg);
-      spi.arg.append (" ");
-      spi.arg.append (td->scriptFile);
+      /*
+        Open the stdout file for the new CGI process.
+      */
+      stdOutFile.create ();
 
-    cmdLine << "\"" << td->cgiRoot << "/" << td->cgiFile << "\" "
-            << moreArg << " " << td->scriptFile;
+      /* Open the stdin file for the new CGI process.  */
+      stdInFile.openFile (td->inputDataPath,
+                          File::READ | File::FILE_OPEN_ALWAYS);
 
-    spi.cmd.assign (td->cgiRoot);
-    spi.cmd.append ("/");
-    spi.cmd.append (td->cgiFile);
+      /*
+        Build the environment string used by the CGI process.
+        Use the td->auxiliaryBuffer to build the environment string.
+      */
+      (td->auxiliaryBuffer->getBuffer ())[0] = '\0';
+      Env::buildEnvironmentString (td, td->auxiliaryBuffer->getBuffer ());
+
+      spi.cmdLine = cmdLine.str ();
+      spi.cwd.assign (td->scriptDir);
+
+      spi.gid = atoi (td->securityToken.getData ("cgi.gid", MYSERVER_VHOST_CONF |
+                                                 MYSERVER_MIME_CONF |
+                                                 MYSERVER_SECURITY_CONF |
+                                                 MYSERVER_SERVER_CONF, "0"));
+      spi.uid = atoi (td->securityToken.getData ("cgi.uid", MYSERVER_VHOST_CONF |
+                                                 MYSERVER_MIME_CONF |
+                                                 MYSERVER_SECURITY_CONF |
+                                                 MYSERVER_SERVER_CONF, "0"));
+      spi.chroot.assign (td->securityToken.getData ("cgi.chroot", MYSERVER_VHOST_CONF |
+                                                    MYSERVER_MIME_CONF |
+                                                    MYSERVER_SECURITY_CONF |
+                                                    MYSERVER_SERVER_CONF, ""));
+
+      spi.stdError = (FileHandle) stdOutFile.getWriteHandle ();
+      spi.stdIn = (FileHandle) stdInFile.getHandle ();
+      spi.stdOut = (FileHandle) stdOutFile.getWriteHandle ();
+      spi.envString = td->auxiliaryBuffer->getBuffer ();
+
+      if (spi.stdError == (FileHandle) -1 ||
+          spi.stdIn == (FileHandle) -1 ||
+          spi.stdOut == (FileHandle) -1)
+        {
+          td->connection->host->warningsLogWrite (_("Cgi: internal error"));
+          stdOutFile.close ();
+          chain.clearAllFilters ();
+          return td->http->raiseHTTPError (500);
+        }
 
-    if (td->cgiFile.length () > 4 && td->cgiFile[0] == 'n'
-        && td->cgiFile[1] == 'p' && td->cgiFile[2] == 'h'
-        && td->cgiFile[3] == '-' )
-      nph = true;
-    else
-      nph = false;
-    }
+      /* Execute the CGI process. */
+      {
+        int ret;
+        if (Process::getForkServer ()->isInitialized ())
+          {
+            int pid;
+            int port;
+
+            Process::getForkServer ()->executeProcess (&spi,
+                                                       ForkServer::FLAG_USE_IN
+                                                       | ForkServer::FLAG_USE_OUT
+                                                       | ForkServer::FLAG_USE_ERR,
+                                                       &pid, &port);
+            cgiProc.setPid (pid);
+          }
+        else
+          cgiProc.exec (&spi);
 
-  /*
-   *Open the stdout file for the new CGI process.
-   */
-  if (stdOutFile.create ())
-    {
-      td->connection->host->warningsLogWrite (_("Cgi: internal error"));
-      chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
+        /* Close the write stream of the pipe on the server.  */
+        stdOutFile.closeWrite ();
+      }
 
-  /* Open the stdin file for the new CGI process. */
-  if (stdInFile.openFile (td->inputDataPath,
-                         File::READ | File::FILE_OPEN_ALWAYS))
-    {
-      td->connection->host->warningsLogWrite (_("Cgi: internal error"));
-      stdOutFile.close ();
-      chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
+      sendData (td, stdOutFile, chain, cgiProc, onlyHeader, nph);
 
-  /*
-   *Build the environment string used by the CGI process.
-   *Use the td->auxiliaryBuffer to build the environment string.
-   */
-  (td->auxiliaryBuffer->getBuffer ())[0] = '\0';
-  Env::buildEnvironmentString (td, td->auxiliaryBuffer->getBuffer ());
-
-  spi.cmdLine = cmdLine.str ();
-  spi.cwd.assign (td->scriptDir);
-
-  spi.gid = atoi (td->securityToken.getData ("cgi.gid", MYSERVER_VHOST_CONF |
-                                             MYSERVER_MIME_CONF |
-                                             MYSERVER_SECURITY_CONF |
-                                             MYSERVER_SERVER_CONF, "0"));
-  spi.uid = atoi (td->securityToken.getData ("cgi.uid", MYSERVER_VHOST_CONF |
-                                             MYSERVER_MIME_CONF |
-                                             MYSERVER_SECURITY_CONF |
-                                             MYSERVER_SERVER_CONF, "0"));
-  spi.chroot.assign (td->securityToken.getData ("cgi.chroot", MYSERVER_VHOST_CONF |
-                                                MYSERVER_MIME_CONF |
-                                                MYSERVER_SECURITY_CONF |
-                                                MYSERVER_SERVER_CONF, ""));
-
-  spi.stdError = (FileHandle) stdOutFile.getWriteHandle ();
-  spi.stdIn = (FileHandle) stdInFile.getHandle ();
-  spi.stdOut = (FileHandle) stdOutFile.getWriteHandle ();
-  spi.envString = td->auxiliaryBuffer->getBuffer ();
-
-  if (spi.stdError == (FileHandle) -1 ||
-      spi.stdIn == (FileHandle) -1 ||
-      spi.stdOut == (FileHandle) -1)
-    {
-      td->connection->host->warningsLogWrite (_("Cgi: internal error"));
       stdOutFile.close ();
+      stdInFile.close ();
+      cgiProc.terminateProcess ();
       chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
-    }
 
-  /* Execute the CGI process. */
-  {
-    int ret;
-    if (Process::getForkServer ()->isInitialized ())
-      {
-        int pid;
-        int port;
-
-        ret = Process::getForkServer ()->executeProcess (&spi,
-                                                         ForkServer::FLAG_USE_IN |
-                                                         ForkServer::FLAG_USE_OUT |
-                                                         ForkServer::FLAG_USE_ERR,
-                                                         &pid,
-                                                         &port);
-        cgiProc.setPid (pid);
-      }
-    else
-      ret = cgiProc.exec (&spi);
+      cgiProc.terminateProcess ();
 
-    if ( ret == -1)
+      /* Delete the file only if it was created by the CGI module.  */
+      if (!td->inputData.getHandle ())
+        FilesUtility::deleteFile (td->inputDataPath.c_str ());
+    }
+  catch (exception & e)
     {
-      stdInFile.close ();
+      td->connection->host->warningsLogWrite (_E ("Cgi: internal error"), &e);
       stdOutFile.close ();
-      td->connection->host->warningsLogWrite (_("Cgi: internal error"));
       chain.clearAllFilters ();
       return td->http->raiseHTTPError (500);
-      }
-    /* Close the write stream of the pipe on the server.  */
-    stdOutFile.closeWrite ();
-  }
-
-  int ret = sendData (td, stdOutFile, chain, cgiProc, onlyHeader, nph);
-
-  stdOutFile.close ();
-  stdInFile.close ();
-  cgiProc.terminateProcess ();
-  chain.clearAllFilters ();
-
-  cgiProc.terminateProcess ();
-
-  /* Delete the file only if it was created by the CGI module.  */
-  if (!td->inputData.getHandle ())
-    FilesUtility::deleteFile (td->inputDataPath.c_str ());
+    }
 
-  return ret;
+  return HttpDataHandler::RET_OK;
 }
 
 /*

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

Summary of changes:
 myserver/src/base/socket/socket.cpp                |   20 +-
 myserver/src/http_handler/cgi/cgi.cpp              |  392 +++++++-------
 myserver/src/http_handler/fastcgi/fastcgi.cpp      |  465 +++++++---------
 myserver/src/http_handler/isapi/isapi.cpp          |  569 ++++++++++----------
 myserver/src/http_handler/mscgi/mscgi.cpp          |  141 +++---
 myserver/src/http_handler/proxy/proxy.cpp          |  223 ++++-----
 myserver/src/http_handler/scgi/scgi.cpp            |  338 ++++++------
 myserver/src/http_handler/wincgi/wincgi.cpp        |  511 ++++++++----------
 myserver/src/protocol/control/control_protocol.cpp |  502 +++++++-----------
 myserver/src/protocol/ftp/ftp.cpp                  |   21 +-
 10 files changed, 1443 insertions(+), 1739 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Fri Apr 16 16:07:01 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O2roa-0008Ig-Qm
	for mharc-myserver-commit@gnu.org; Fri, 16 Apr 2010 16:07:01 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O2roY-0008Gg-3v
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 16:06:58 -0400
Received: from [140.186.70.92] (port=45562 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O2roP-0007rB-4j
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 16:06:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2rn3-0004dB-Ko
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 16:05:27 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:39625
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2rn3-0004d0-Hp
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 16:05:25 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2rn2-0003ys-Ax
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 20:05:24 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O2rn0-0003hj-PR
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 20:05:24 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: f038e6c8e486ce869d0e27f9c9a70ee4c0437a13
X-Git-Newrev: 29f2439da0cd2a0d6d4fb4964451990753044d12
Message-Id: <E1O2rn0-0003hj-PR@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Fri, 16 Apr 2010 20:05:23 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-155-g29f2439
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, 16 Apr 2010 20:06:59 -0000

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

The branch, master has been updated
       via  29f2439da0cd2a0d6d4fb4964451990753044d12 (commit)
       via  6d27ff8c9eab02636815ab2eb1adac4a16b40ecd (commit)
      from  f038e6c8e486ce869d0e27f9c9a70ee4c0437a13 (commit)

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

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


commit 29f2439da0cd2a0d6d4fb4964451990753044d12
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 16 22:05:21 2010 +0200

    Remove superfluous error checks

diff --git a/myserver/src/base/file/files_utility.cpp b/myserver/src/base/file/files_utility.cpp
index e61aa3c..090f111 100644
--- a/myserver/src/base/file/files_utility.cpp
+++ b/myserver/src/base/file/files_utility.cpp
@@ -181,7 +181,6 @@ int FilesUtility::copyFile (File& src, File& dest)
 {
   char buffer[4096];
   u_long nbr, nbw;
-  int ret;
 
 #ifdef HAVE_POSIX_FALLOCATE
   if (posix_fallocate (dest.getHandle (), dest.getSeek (),
@@ -191,34 +190,24 @@ int FilesUtility::copyFile (File& src, File& dest)
 
   for (;;)
   {
-    ret = src.read (buffer, 4096, &nbr);
-    if (ret)
-      return -1;
+    src.read (buffer, 4096, &nbr);
 
     if (!nbr)
       break;
 
-    ret = dest.writeToFile (buffer, nbr, &nbw);
-    if (ret)
-      return -1;
+    dest.writeToFile (buffer, nbr, &nbw);
   }
   return 0;
 }
 
 /*!
  * Delete an existing file passing the path.
- * Return a non-null value on errors.
  * \param filename The file to delete.
  */
 int FilesUtility::deleteFile (const char *filename)
 {
-  int ret;
-  ret = checked::remove (filename);
-
-  if (ret && errno == ENOENT)
-    ret = 0;
-
-  return ret;
+  checked::remove (filename);
+  return 0;
 }
 
 /*!
@@ -227,20 +216,9 @@ int FilesUtility::deleteFile (const char *filename)
  */
 int FilesUtility::isDirectory (const char *filename)
 {
-#ifdef WIN32
-  u_long fa = GetFileAttributes (filename);
-  if (fa != INVALID_FILE_ATTRIBUTES)
-    return (fa & FILE_ATTRIBUTE_DIRECTORY)?1:0;
-  else
-    return 0;
-#else
   struct stat F_Stats;
-  int ret = stat (filename, &F_Stats);
-  if (ret < 0)
-    return 0;
-
-  return (S_ISDIR (F_Stats.st_mode))? 1 : 0;
-#endif
+  checked::stat (filename, &F_Stats);
+  return (S_ISDIR (F_Stats.st_mode)) ? 1 : 0;
 }
 
 /*!
@@ -253,10 +231,7 @@ int FilesUtility::isLink (const char* filename)
   return 0;
 #else
   struct stat F_Stats;
-  int ret = checked::lstat (filename, &F_Stats);
-  if (ret < 0)
-    return 0;
-
+  checked::lstat (filename, &F_Stats);
   return S_ISLNK (F_Stats.st_mode) ? 1 : 0;
 #endif
 
@@ -268,22 +243,17 @@ int FilesUtility::isLink (const char* filename)
  */
 int FilesUtility::nodeExists (const char* filename)
 {
-#ifdef WIN32
-  HANDLE hFile = CreateFile (filename, GENERIC_READ, FILE_SHARE_READ,
-                             NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL
-                             | FILE_FLAG_BACKUP_SEMANTICS, NULL);
-
-  int nRet = (hFile != INVALID_HANDLE_VALUE) ? 1 : 0;
-  CloseHandle (hFile);
-  return nRet;
-#else
   struct stat fstats;
-  int ret = stat (filename, &fstats);
-  if (ret < 0)
-    return 0;
+  try
+    {
+      checked::stat (filename, &fstats);
+    }
+  catch (...)
+    {
+      return 0;
+    }
 
   return 1;
-#endif
 }
 
 /*!
@@ -294,13 +264,8 @@ int FilesUtility::nodeExists (const char* filename)
 time_t FilesUtility::getLastModTime (const char *filename)
 {
   int res;
-#ifdef WIN32
-  struct _stat sf;
-  res = _stat (filename, &sf);
-#else
   struct stat sf;
   res = stat (filename,&sf);
-#endif
 
   if (res == 0)
     return sf.st_mtime;
@@ -316,13 +281,9 @@ time_t FilesUtility::getLastModTime (const char *filename)
 time_t FilesUtility::getCreationTime (const char *filename)
 {
   int res;
-#ifdef WIN32
-  struct _stat sf;
-  res = _stat (filename, &sf);
-#else
   struct stat sf;
   res = stat (filename, &sf);
-#endif
+
   if (res == 0)
     return sf.st_ctime;
   else
@@ -337,13 +298,8 @@ time_t FilesUtility::getCreationTime (const char *filename)
 time_t FilesUtility::getLastAccTime (const char *filename)
 {
   int res;
-#ifdef WIN32
-  struct _stat sf;
-  res = _stat (filename, &sf);
-#else
   struct stat sf;
   res = stat (filename, &sf);
-#endif
   if (res == 0)
     return sf.st_atime;
   else
diff --git a/myserver/src/base/socket/socket.cpp b/myserver/src/base/socket/socket.cpp
index a520b8d..c1b6ec2 100644
--- a/myserver/src/base/socket/socket.cpp
+++ b/myserver/src/base/socket/socket.cpp
@@ -344,26 +344,21 @@ int Socket::send (const char* buffer, int len, int flags)
   {
     while (1)
       {
-        /*! When we can send data again?  */
+        /* When we can send data again?  */
         u_long time = getTicks () + (1000 * 1024 / throttlingRate) ;
-        /*! If a throttling rate is specified, send chunks of 1024 bytes.  */
+        /* If a throttling rate is specified, send chunks of 1024 bytes.  */
         ret = rawSend (buffer + (len - toSend), toSend < 1024 ?
                        toSend : 1024, flags);
-        /*! On errors returns directly -1.  */
-        if (ret < 0)
-          return -1;
+
         toSend -= (u_long) ret;
-        /*!
-         *If there are other bytes to send wait before cycle again.
-         */
+
+        /* If there are other bytes to send wait before cycle again.  */
         if (toSend)
-          {
-            Thread::wait (getTicks () - time);
-          }
+          Thread::wait (getTicks () - time);
         else
           break;
       }
-    /*! Return the number of sent bytes. */
+    /* Return the number of sent bytes.  */
     return len - toSend;
   }
   return 0;
@@ -532,9 +527,6 @@ int Socket::recv (char* buffer, int len, int flags, u_long timeout)
 {
   int ret = dataAvailable (timeout / 1000, timeout % 1000);
 
-  if (ret < 0)
-    return ret;
-
   if (ret)
     return recv (buffer, len, flags);
 
@@ -665,7 +657,7 @@ int Socket::dataAvailable (int sec, int usec)
   FD_SET (fd, &readfds);
 
   ret = checked::select (fd + 1, &readfds, NULL, NULL, &tv);
-  if (ret <= 0)
+  if (ret == 0)
     return 0;
 
   if (FD_ISSET (fd, &readfds))
@@ -680,11 +672,7 @@ int Socket::dataAvailable (int sec, int usec)
  */
 int Socket::read (char* buffer, u_long len, u_long *nbr)
 {
-  int ret = recv (buffer, len, 0);
-  if (ret < 0)
-    return ret;
-
-  *nbr = static_cast<u_long> (ret);
+  *nbr = static_cast<u_long> (recv (buffer, len, 0));
   return 0;
 }
 
@@ -694,10 +682,6 @@ int Socket::read (char* buffer, u_long len, u_long *nbr)
  */
 int Socket::write (const char* buffer, u_long len, u_long *nbw)
 {
-  int ret = send (buffer, len, 0);
-  if (ret < 0)
-    return ret;
-
-  *nbw = static_cast<u_long> (ret);
+  *nbw = static_cast<u_long> (send (buffer, len, 0));
   return 0;
 }
diff --git a/myserver/src/base/sync/event.cpp b/myserver/src/base/sync/event.cpp
index 780f3a8..f44d0c5 100644
--- a/myserver/src/base/sync/event.cpp
+++ b/myserver/src/base/sync/event.cpp
@@ -64,10 +64,10 @@ int Event::init (bool broadcast)
 {
   int ret = 0;
   if (initialized)
-  {
-    destroy ();
-    initialized = false;
-  }
+    {
+      destroy ();
+      initialized = false;
+    }
   this->broadcast = broadcast;
 #ifdef HAVE_PTHREAD
   ret = pthread_mutex_init (&mutex,(pthread_mutexattr_t*) NULL);
diff --git a/myserver/src/base/utility.cpp b/myserver/src/base/utility.cpp
index 5df6d69..45c42b1 100644
--- a/myserver/src/base/utility.cpp
+++ b/myserver/src/base/utility.cpp
@@ -231,7 +231,6 @@ int readFileHandle (SocketHandle s, Handle* fd)
   } cmh;
   char tbuf[4];
   struct iovec iov;
-  int ret;
   struct cmsghdr *cmsg;
 
   memset (&mh, 0, sizeof (mh));
@@ -242,10 +241,8 @@ int readFileHandle (SocketHandle s, Handle* fd)
   iov.iov_base = tbuf;
   iov.iov_len = 4;
 
-  ret = recvmsg (s, &mh, 0);
-  if (ret < 0)
-    return ret;
-
+  /* FIXME:  add recvmsg to checked.  */
+  checked::checkError (recvmsg (s, &mh, 0));
   cmsg = CMSG_FIRSTHDR (&mh);
   *fd = *((int *) CMSG_DATA (cmsg));
   return 0;
@@ -285,8 +282,9 @@ int writeFileHandle (SocketHandle s, Handle fd)
   cmsg->cmsg_len = CMSG_LEN (sizeof (int));
   cmsg->cmsg_level = SOL_SOCKET;
   cmsg->cmsg_type = SCM_RIGHTS;
-  *(int *)CMSG_DATA (cmsg) = fd;
+  *(int *) CMSG_DATA (cmsg) = fd;
 
-  return sendmsg (s, &mh, 0);
+  /* FIXME: add sendmsg to checked.  */
+  return checked::checkError (sendmsg (s, &mh, 0));
 #endif
 }
diff --git a/myserver/src/filter/gzip/gzip.cpp b/myserver/src/filter/gzip/gzip.cpp
index 8f8fdc5..021f2d1 100644
--- a/myserver/src/filter/gzip/gzip.cpp
+++ b/myserver/src/filter/gzip/gzip.cpp
@@ -263,26 +263,26 @@ u_long Gzip::getHeader (char *buffer,u_long buffersize)
 int Gzip::read (char* buffer, u_long len, u_long *nbr)
 {
   char *tmp_buff;
-  int ret;
   u_long nbr_parent;
   if (!parent)
     return -1;
-  tmp_buff = new char[len/2];
-  if (!tmp_buff)
-    return -1;
 
   if (!active)
     return parent->read (buffer, len, nbr);
 
-  ret = parent->read (tmp_buff, len/2, &nbr_parent);
+  tmp_buff = new char[len/2];
 
-  if (ret == -1)
+  try
+    {
+      parent->read (tmp_buff, len/2, &nbr_parent);
+      *nbr = compress (tmp_buff, nbr_parent, buffer, len);
+    }
+  catch (...)
     {
       delete [] tmp_buff;
-      return -1;
+      throw;
     }
 
-  *nbr = compress (tmp_buff, nbr_parent, buffer, len);
   delete [] tmp_buff;
   return 0;
 }
@@ -310,10 +310,10 @@ int Gzip::write (const char* buffer, u_long len, u_long *nbw)
     {
       u_long nbw_parent;
       u_long size=std::min (len, 512UL);
-      u_long ret=compress (buffer, size, tmpBuffer, 1024);
+      u_long ret = compress (buffer, size, tmpBuffer, 1024);
 
-      if (ret && parent->write (tmpBuffer, ret, &nbw_parent) == -1)
-        return -1;
+      if (ret)
+        parent->write (tmpBuffer, ret, &nbw_parent);
 
       written += ret;
       buffer += size;
@@ -341,10 +341,9 @@ int Gzip::flush (u_long *nbw)
       u_long nbwParentFlush;
       if (!parent)
         return -1;
-      if (parent->write (buffer, *nbw, &nbwParent) != 0)
-        return -1;
-      if (parent->flush (&nbwParentFlush) != 0)
-        return -1;
+
+      parent->write (buffer, *nbw, &nbwParent);
+      parent->flush (&nbwParentFlush);
       *nbw = nbwParentFlush + nbwParent;
     }
   return 0;
diff --git a/myserver/src/filter/gzip/gzip_decompress.cpp b/myserver/src/filter/gzip/gzip_decompress.cpp
index 4cb69c8..4fef3b2 100644
--- a/myserver/src/filter/gzip/gzip_decompress.cpp
+++ b/myserver/src/filter/gzip/gzip_decompress.cpp
@@ -89,7 +89,6 @@ u_long GzipDecompress::free ()
 {
   u_long ret = 0;
 #ifdef HAVE_ZLIB
-
   if (data.initialized == 0)
     return 0;
   data.initialized = 0;
@@ -217,22 +216,22 @@ int GzipDecompress::read (char* buffer, u_long len, u_long *nbr)
   u_long nbr_parent;
   if (!parent)
     return -1;
-  tmp_buff = new char[len/2];
-  if (!tmp_buff)
-    return -1;
 
   if (!active)
     return parent->read (buffer, len, nbr);
 
-  ret = parent->read (tmp_buff, len/2, &nbr_parent);
-
-  if (ret == -1)
+  tmp_buff = new char[len/2];
+  try
+    {
+      parent->read (tmp_buff, len/2, &nbr_parent);
+      *nbr = decompress (tmp_buff, nbr_parent, buffer, len);
+    }
+  catch (...)
     {
       delete [] tmp_buff;
-      return -1;
+      throw;
     }
 
-  *nbr = decompress (tmp_buff, nbr_parent, buffer, len);
 
   delete [] tmp_buff;
   return 0;



commit 6d27ff8c9eab02636815ab2eb1adac4a16b40ecd
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 16 21:43:29 2010 +0200

    Add stat to the checked namespace

diff --git a/myserver/include/base/exceptions/checked.h b/myserver/include/base/exceptions/checked.h
index 4ceb64a..982a2a5 100644
--- a/myserver/include/base/exceptions/checked.h
+++ b/myserver/include/base/exceptions/checked.h
@@ -87,6 +87,7 @@ namespace checked
   int dup (int oldfd);
   int dup2 (int oldfd, int newfd);
   int pipe2 (int pipefd[2], int flags);
+  int stat(const char *path, struct stat *buf);
   int fstat (int fd, struct stat *buf);
   int fstatat (int fd, char const *name, struct stat *st, int flags);
   char *getcwd (char *buf, size_t size);
diff --git a/myserver/src/base/exceptions/checked.cpp b/myserver/src/base/exceptions/checked.cpp
index e63d866..f5f0a27 100644
--- a/myserver/src/base/exceptions/checked.cpp
+++ b/myserver/src/base/exceptions/checked.cpp
@@ -86,6 +86,11 @@ namespace checked
     return checkError (gnulib::gethostname (name, len));
   }
 
+  int stat (const char *path, struct stat *buf)
+  {
+    return checkError (::stat (path, buf));
+  }
+
   int getsockname (int fd, struct sockaddr *addr, socklen_t *addrlen)
   {
     return checkError (gnulib::getsockname (fd, addr, addrlen));

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

Summary of changes:
 myserver/include/base/exceptions/checked.h   |    1 +
 myserver/src/base/exceptions/checked.cpp     |    5 ++
 myserver/src/base/file/files_utility.cpp     |   76 ++++++--------------------
 myserver/src/base/socket/socket.cpp          |   36 ++++---------
 myserver/src/base/sync/event.cpp             |    8 ++--
 myserver/src/base/utility.cpp                |   12 ++---
 myserver/src/filter/gzip/gzip.cpp            |   29 +++++-----
 myserver/src/filter/gzip/gzip_decompress.cpp |   17 +++---
 8 files changed, 63 insertions(+), 121 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Fri Apr 16 17:13:33 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O2sqz-0001Ce-Ln
	for mharc-myserver-commit@gnu.org; Fri, 16 Apr 2010 17:13:33 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O2sqx-0001BS-Io
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 17:13:31 -0400
Received: from [140.186.70.92] (port=59022 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O2sqv-0001AQ-NC
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 17:13:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2squ-0004oR-EF
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 17:13:29 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:56913
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2squ-0004oG-Ae
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 17:13:28 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O2sqt-0004mh-Pi
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 21:13:27 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O2sqs-0006Sw-CM
	for myserver-commit@gnu.org; Fri, 16 Apr 2010 21:13:27 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 29f2439da0cd2a0d6d4fb4964451990753044d12
X-Git-Newrev: 6ce0bb4748c478112b86b5370dbe4f14f51fc10e
Message-Id: <E1O2sqs-0006Sw-CM@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Fri, 16 Apr 2010 21:13:26 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-157-g6ce0bb4
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, 16 Apr 2010 21:13:32 -0000

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

The branch, master has been updated
       via  6ce0bb4748c478112b86b5370dbe4f14f51fc10e (commit)
       via  50e1dd95347eb8bb2c332e3c56762880573db4b6 (commit)
      from  29f2439da0cd2a0d6d4fb4964451990753044d12 (commit)

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

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


commit 6ce0bb4748c478112b86b5370dbe4f14f51fc10e
Merge: 29f2439 50e1dd9
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 16 23:12:35 2010 +0200

    Merge branch 'master' of git://github.com/rupinder/GNU-MyServer




commit 50e1dd95347eb8bb2c332e3c56762880573db4b6
Author: Rupinder Singh <rupinder.singh@nsitonline.in>
Date:   Sat Apr 17 01:56:26 2010 +0530

    New function for returning number of fields in url class

diff --git a/myserver/include/protocol/url.h b/myserver/include/protocol/url.h
index 47934aa..e10d5bb 100644
--- a/myserver/include/protocol/url.h
+++ b/myserver/include/protocol/url.h
@@ -31,6 +31,7 @@ public:
   Url (const char*, u_short port);
   string& getProtocol ();
   u_short getPort ();
+  int getNumFields ();
   string& getResource ();
   string& getHost ();
   string& getQuery ();
diff --git a/myserver/src/protocol/url.cpp b/myserver/src/protocol/url.cpp
index 2f018eb..e58940d 100644
--- a/myserver/src/protocol/url.cpp
+++ b/myserver/src/protocol/url.cpp
@@ -48,7 +48,6 @@ string& Url::getProtocol ()
   return protocol;
 }
 
-
 /*!
  *Get the query part of the URL.
  */
@@ -58,6 +57,20 @@ string& Url::getQuery ()
 }
 
 /*!
+ *Get the number of fields in the query
+ */
+int Url::getNumFields ()
+{
+  int l = query.length ();
+  int numFields = (l != 0);
+
+  for (int i = 0; i < l; i++)
+   numFields += (query[i] == '&');
+
+  return numFields;
+}
+
+/*!
  *Get the credentials part of the URL.
  */
 string& Url::getCredentials ()
diff --git a/myserver/tests/test_url.cpp b/myserver/tests/test_url.cpp
index 9b773fb..944be1b 100644
--- a/myserver/tests/test_url.cpp
+++ b/myserver/tests/test_url.cpp
@@ -60,20 +60,21 @@ public:
     CPPUNIT_ASSERT (!url.getResource ().compare ("what/i/want"));
     CPPUNIT_ASSERT (!url.getProtocol ().compare ("http"));
     CPPUNIT_ASSERT (!url.getQuery ().compare (""));
-    CPPUNIT_ASSERT_EQUAL (url.getPort (), (u_short)8080);
+    CPPUNIT_ASSERT_EQUAL (url.getPort (), (u_short) 8080);
   }
 
   void testUrlWithQuery ()
   {
-    const char *urlStr = "http://foo.bar:8080/what/i/want?my_query";
+    const char *urlStr = "http://foo.bar:8080/what/i/want?my_query1&my_query2";
     Url url (urlStr, 80);
 
     CPPUNIT_ASSERT (!url.getCredentials ().compare (""));
     CPPUNIT_ASSERT (!url.getHost ().compare ("foo.bar"));
     CPPUNIT_ASSERT (!url.getResource ().compare ("what/i/want"));
     CPPUNIT_ASSERT (!url.getProtocol ().compare ("http"));
-    CPPUNIT_ASSERT (!url.getQuery ().compare ("my_query"));
-    CPPUNIT_ASSERT_EQUAL (url.getPort (), (u_short)8080);
+    CPPUNIT_ASSERT (!url.getQuery ().compare ("my_query1&my_query2"));
+    CPPUNIT_ASSERT_EQUAL (url.getNumFields (), 2);
+    CPPUNIT_ASSERT_EQUAL (url.getPort (), (u_short) 8080);
   }
 
   void testUrl ()
@@ -86,7 +87,7 @@ public:
     CPPUNIT_ASSERT (!url.getResource ().compare ("what/i/want"));
     CPPUNIT_ASSERT (!url.getProtocol ().compare ("http"));
     CPPUNIT_ASSERT (!url.getQuery ().compare (""));
-    CPPUNIT_ASSERT_EQUAL (url.getPort (), (u_short)8080);
+    CPPUNIT_ASSERT_EQUAL (url.getPort (), (u_short) 8080);
   }
 
   void testUrlWithoutPort ()
@@ -98,7 +99,7 @@ public:
     CPPUNIT_ASSERT (!url.getHost ().compare ("foo.bar"));
     CPPUNIT_ASSERT (!url.getResource ().compare ("what/i/want"));
     CPPUNIT_ASSERT (!url.getProtocol ().compare ("http"));
-    CPPUNIT_ASSERT_EQUAL (url.getPort (), (u_short)80);
+    CPPUNIT_ASSERT_EQUAL (url.getPort (), (u_short) 80);
   }
 
 };

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

Summary of changes:
 myserver/include/protocol/url.h |    1 +
 myserver/src/protocol/url.cpp   |   15 ++++++++++++++-
 myserver/tests/test_url.cpp     |   13 +++++++------
 3 files changed, 22 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Sat Apr 17 17:24:36 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O3FVE-0000nC-IC
	for mharc-myserver-commit@gnu.org; Sat, 17 Apr 2010 17:24:36 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O3FVC-0000n0-Bp
	for myserver-commit@gnu.org; Sat, 17 Apr 2010 17:24:34 -0400
Received: from [140.186.70.92] (port=58738 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O3FV8-0000mk-Ho
	for myserver-commit@gnu.org; Sat, 17 Apr 2010 17:24:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3FV5-0006oO-MB
	for myserver-commit@gnu.org; Sat, 17 Apr 2010 17:24:29 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:60300
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3FV5-0006oH-GI
	for myserver-commit@gnu.org; Sat, 17 Apr 2010 17:24:27 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3FV4-0005Q0-SF
	for myserver-commit@gnu.org; Sat, 17 Apr 2010 21:24:26 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O3FV2-0002AT-5A
	for myserver-commit@gnu.org; Sat, 17 Apr 2010 21:24:26 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 6ce0bb4748c478112b86b5370dbe4f14f51fc10e
X-Git-Newrev: 06601b45ee04b9b78537879501a7d1aebb1b4296
Message-Id: <E1O3FV2-0002AT-5A@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Sat, 17 Apr 2010 21:24:26 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-164-g06601b4
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, 17 Apr 2010 21:24:34 -0000

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

The branch, master has been updated
       via  06601b45ee04b9b78537879501a7d1aebb1b4296 (commit)
       via  4872c39a40e8e4348d601b18546fe1e454caabb6 (commit)
       via  5da59b2c50846128fd02314db181f681316216a5 (commit)
       via  b5a539c2c42060879def9aac76d423ab1d2eb446 (commit)
       via  bc5a97323c6941d6bdf4ca65311af9e16db52a80 (commit)
       via  8a7258a6dbdacd41369361a96a3930ae808b2b6b (commit)
       via  344439789e734a7ebf7f5cdf02936e62efa32ae9 (commit)
      from  6ce0bb4748c478112b86b5370dbe4f14f51fc10e (commit)

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

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


commit 06601b45ee04b9b78537879501a7d1aebb1b4296
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 17 23:24:12 2010 +0200

    Handle exceptions in the dynamic libraries handler

diff --git a/myserver/src/base/dynamic_lib/dynamiclib.cpp b/myserver/src/base/dynamic_lib/dynamiclib.cpp
index 5ad911c..bcff708 100644
--- a/myserver/src/base/dynamic_lib/dynamiclib.cpp
+++ b/myserver/src/base/dynamic_lib/dynamiclib.cpp
@@ -18,6 +18,25 @@
 
 #include "myserver.h"
 #include <include/base/dynamic_lib/dynamiclib.h>
+#include <include/base/exceptions/exceptions.h>
+
+
+class DynError : public AbstractServerException
+{
+public:
+  DynError (const char *err)
+  {
+    this->err = err;
+  }
+
+  virtual const char *what () const throw ()
+  {
+    return err;
+  }
+private:
+  const char *err;
+};
+
 
 /*!
  * Initialize class internal data.
@@ -45,6 +64,9 @@ int DynamicLibrary::loadLibrary (const char* filename, int globally)
   fileName.assign (filename);
 #ifdef WIN32
   handle = LoadLibrary (filename);
+  /* FIXME: use a real error message.  */
+  if (handle == NULL)
+    throw DynError ("");
 #endif
 
 #ifdef HAVE_DL
@@ -59,6 +81,9 @@ int DynamicLibrary::loadLibrary (const char* filename, int globally)
 # endif
 
   handle = dlopen (filename, flag);
+  if (handle == NULL)
+    throw DynError (dlerror ());
+
 #endif
   return handle ? 0 : 1;
 }
@@ -73,7 +98,7 @@ void* DynamicLibrary::getProc (const char* fnName)
   if (!handle)
     return 0;
 #ifdef WIN32
-    return (void*) GetProcAddress ((HMODULE)handle, fnName);
+    return (void*) GetProcAddress ((HMODULE) handle, fnName);
 #endif
 #ifdef HAVE_DL
     return (void*) dlsym (handle, fnName);
@@ -89,10 +114,15 @@ int DynamicLibrary::close ()
   if (!handle)
     return 1;
 #ifdef WIN32
-    ret = FreeLibrary ((HMODULE)handle) ? 0 : 1;
+    ret = FreeLibrary ((HMODULE) handle) ? 0 : 1;
+    /* FIXME: use a real error message.  */
+    if (! ret)
+      throw DynError ("");
 #endif
 #ifdef HAVE_DL
     ret = dlclose (handle);
+    if (ret)
+      throw DynError (dlerror ());
 #endif
     handle = 0;
     fileName.assign ("");
diff --git a/myserver/src/http_handler/mscgi/mscgi_manager.cpp b/myserver/src/http_handler/mscgi/mscgi_manager.cpp
index 9a63cba..15c9a5f 100644
--- a/myserver/src/http_handler/mscgi/mscgi_manager.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi_manager.cpp
@@ -33,7 +33,7 @@ using namespace std;
  */
 int MscgiManager::write (const char* str)
 {
-  return cgidata->mscgi->write (str, (u_long)strlen (str), cgidata);
+  return cgidata->mscgi->write (str, (u_long) strlen (str), cgidata);
 }
 
 /*!
@@ -41,7 +41,7 @@ int MscgiManager::write (const char* str)
  */
 int MscgiManager::write (const void* data, int len)
 {
-  return cgidata->mscgi->write ((const char*)data, len, cgidata);
+  return cgidata->mscgi->write ((const char*) data, len, cgidata);
 }
 
 Server* MscgiManager::getServer ()
@@ -148,7 +148,10 @@ char* MscgiManager::postParam (const char* param)
   u_long nbr = 0;
   char c;
 
-  u_long toRead = td->inputData.getFileSize ();
+  u_long toRead = 0;
+
+  if (td->inputData.getHandle () >= 0)
+    toRead = td->inputData.getFileSize ();
 
   buffer[0] = '\0';
   localbuffer[0] = '\0';
@@ -164,7 +167,8 @@ char* MscgiManager::postParam (const char* param)
     {
       if (!strncmp (param, buffer, strlen (param)))
       {
-        myserver_strlcpy (localbuffer, &buffer[strlen (param)], LOCAL_BUFFER_DIM);
+        myserver_strlcpy (localbuffer, &buffer[strlen (param)],
+                          LOCAL_BUFFER_DIM);
         break;
       }
       buffer[0] = '\0';



commit 4872c39a40e8e4348d601b18546fe1e454caabb6
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 17 23:23:49 2010 +0200

    Ask libtool to copy the myserver executable to the destination

diff --git a/myserver/src/Makefile.am b/myserver/src/Makefile.am
index 2f78a55..68c796e 100644
--- a/myserver/src/Makefile.am
+++ b/myserver/src/Makefile.am
@@ -18,7 +18,6 @@
 AM_CPPFLAGS = $(all_includes) -I$(top_builddir)/lib -I$(top_srcdir)/lib
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
 
-
 SUBDIRS = base conf connection connections_scheduler filter http_handler \
 	log plugin protocol server GUI
 
@@ -168,4 +167,4 @@ myserver_LDADD = libmyserver.la $(PTHREAD_LIB) $(IDN_LIB) \
 	$(XML_LIBS) $(INTLLIBS) $(LDFLAGS)
 
 all-local: libmyserver.la myserver${EXEEXT}
-	cp myserver${EXEEXT} ../binaries*/
+	$(LIBTOOL) --mode=install cp libmyserver.la myserver $(abs_top_srcdir)/binaries/



commit 5da59b2c50846128fd02314db181f681316216a5
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 17 23:20:24 2010 +0200

    Specify the module suffix to libtool

diff --git a/myserver/binaries/web/cgi-src/math_sum/Makefile.am b/myserver/binaries/web/cgi-src/math_sum/Makefile.am
index fff3b1b..21ce31b 100644
--- a/myserver/binaries/web/cgi-src/math_sum/Makefile.am
+++ b/myserver/binaries/web/cgi-src/math_sum/Makefile.am
@@ -19,18 +19,14 @@
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
 lib_LTLIBRARIES = libmath_sum.la
 libmath_sum_la_SOURCES = math_sum.cpp
-libmath_sum_la_LDFLAGS = -avoid-version -module -shared
+libmath_sum_la_LDFLAGS = -shared -export-dynamic -no-install -no-undefined -module \
+										 -avoid-version -shrext .mscgi
 libmath_sum_la_LIBADD = ../../../../src/libmyserver.la ../../../../lib/libgnu.la
-SO_EXT=`$(LIBTOOL) --config | $(SED) -e"y/'/\"/" -e '/^shrext_cmds/ !d; s/^.*="\(.*\)"/\1/'`
 
 all: all-am math_sum.mscgi
 
 math_sum.mscgi: libmath_sum.la
-	test \! -e .libs/libmath_sum$(SO_EXT) || cp .libs/libmath_sum$(SO_EXT) ../../cgi-bin/math_sum.mscgi
-
-clean-local:
-	test \! -e libmath_sum.la || \
-	$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall libmath_sum.la
-
+	test \! -e .libs/libmath_sum.mscgi \
+		|| cp .libs/libmath_sum.mscgi ../../cgi-bin/math_sum.mscgi
 
 .phony : math_sum.mscgi
diff --git a/myserver/binaries/web/cgi-src/post/Makefile.am b/myserver/binaries/web/cgi-src/post/Makefile.am
index 30711c0..4ac532f 100644
--- a/myserver/binaries/web/cgi-src/post/Makefile.am
+++ b/myserver/binaries/web/cgi-src/post/Makefile.am
@@ -19,18 +19,14 @@
 AM_CXXFLAGS="-I$(top_srcdir)/lib"
 lib_LTLIBRARIES = libpost.la
 libpost_la_SOURCES = post.cpp
-libpost_la_LDFLAGS = -avoid-version -module -shared
+libpost_la_LDFLAGS = -shared -export-dynamic -no-install -no-undefined -module \
+										 -avoid-version -shrext .mscgi
 libpost_la_LIBADD = ../../../../src/libmyserver.la ../../../../lib/libgnu.la
-SO_EXT=`$(LIBTOOL) --config | $(SED) -e"y/'/\"/" -e '/^shrext_cmds/ !d; s/^.*="\(.*\)"/\1/'`
 
 all: all-am post.mscgi
 
 post.mscgi: libpost.la
-	test \! -e .libs/libpost$(SO_EXT) || cp .libs/libpost$(SO_EXT) ../../cgi-bin/post.mscgi
-
-clean-local:
-	test \! -e libpost.la \
-	|| $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall libpost.la
-
+	test \! -e .libs/libpost.mscgi \
+		|| cp .libs/libpost.mscgi ../../cgi-bin/post.mscgi
 
 .phony : post.mscgi



commit b5a539c2c42060879def9aac76d423ab1d2eb446
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 17 23:19:44 2010 +0200

    Silent exceptions in the mscgi examples

diff --git a/myserver/binaries/web/cgi-src/math_sum/math_sum.cpp b/myserver/binaries/web/cgi-src/math_sum/math_sum.cpp
index 4416867..a0c6436 100644
--- a/myserver/binaries/web/cgi-src/math_sum/math_sum.cpp
+++ b/myserver/binaries/web/cgi-src/math_sum/math_sum.cpp
@@ -1,14 +1,13 @@
 #include <include/http_handler/mscgi/mscgi_manager.h>
 
-int isNumber(char* s)
+static int isNumber (char* s)
 {
-  if(!s)
+  if (!s)
     return 0;
-  for(u_long i=0; i<strlen(s);i++)
-    if(!isdigit(s[i]))
+  for (u_long i = 0; i < strlen (s); i++)
+    if (!isdigit (s[i]))
       return 0;
   return 1;
-
 }
 
 
@@ -16,116 +15,127 @@ const char *program_name;
 
 EXPORTABLE(int) myserver_main (char *cmd, MsCgiData* data)
 {
-	MscgiManager cm(data);
-  program_name = cmd;
+  try
+    {
+      MscgiManager cm(data);
+      program_name = cmd;
+      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"
+                    "<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\n"
+                    "<form action=\"math_sum.mscgi\" method=\"get\" enctype=\"text/plain\">\r\n"
+                    "<div>\r\n<input type=\"text\" name=\"a\" size=\"20\" />\r\n"
+                    "<br /><br />\r\n+<br /><br />\r\n"
+                    "<input type=\"text\" name=\"b\" size=\"20\" />\r\n"
+                    "<br /><br />\r\n<input type=\"submit\" value=\"Compute!\" />\r\n"
+                    "</div>\r\n</form>\r\n<br />\r\n</div>\r\n</body>\r\n</html>");
+        }
+      else
+        {
+          u_long dim = 120;
+          char lb[120];
+          int a = 0;
+          int b = 0;
+          char *tmp;
+          int validNumbers = 1;
+          int iRes;
+          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"
+                    "<head>\r\n<title>MyServer</title>\r\n"
+                    "<meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\r\n"
+                    "</head>"
+                    "<body style=\"color: #666699;\">\r\n<div style=\"text-align: center;\">\r\n"
+                    "<br /><br />\r\n<img src=\"/logo.png\" alt=\"\" style=\"border: 0px;\" />\r\n"
+                    "<br /><br />\r\n");
 
-	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\
-<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\n\
-<form action=\"math_sum.mscgi\" method=\"get\" enctype=\"text/plain\">\r\n\
-<div>\r\n<input type=\"text\" name=\"a\" size=\"20\" />\r\n<br /><br />\r\n+<br /><br />\r\n<input type=\"text\" name=\"b\" size=\"20\" />\r\n<br /><br />\r\n<input type=\"submit\" value=\"Compute!\" />\r\n</div>\r\n</form>\r\n<br />\r\n</div>\r\n</body>\r\n</html>");
-	}
-	else
-	{
-		u_long dim = 120;
-		char lb[120];
-		int a = 0;
-		int b = 0;
-		char *tmp;
-    int validNumbers = 1;
-		int iRes;
-		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\
-<head>\r\n<title>MyServer</title>\r\n\
-<meta http-equiv=\"content-type\" content=\"text/html;charset=UTF-8\" />\r\n\
-</head>\
-<body style=\"color: #666699;\">\r\n<div style=\"text-align: center;\">\r\n\
-<br /><br />\r\n<img src=\"/logo.png\" alt=\"\" style=\"border: 0px;\" />\r\n<br /><br />\r\n");
+          tmp = cm.getParam ("a");
+          if(tmp && !isNumber (tmp))
+            validNumbers = 0;
 
-    tmp = cm.getParam("a");
-    if(tmp && !isNumber(tmp))
-    {
-      validNumbers=0;
-    }
-    tmp = cm.getParam("b");
-    if(tmp && !isNumber(tmp))
-    {
-      validNumbers=0;
-    }
+          tmp = cm.getParam ("b");
+          if (tmp && !isNumber(tmp))
+            validNumbers = 0;
 
-    if(validNumbers)
-    {
-      tmp = cm.getParam("a");
-      if (tmp && tmp[0] != '\0')
-      {
-        if (strlen(tmp) > 11)
-          tmp[11] = '\0';
-        a = atoi(tmp);
-        cm.write(tmp);
-      }
-      else
-      {
-        cm.write("0");
-      }
-      cm.write(" + ");
+          if (validNumbers)
+            {
+              tmp = cm.getParam ("a");
+              if (tmp && tmp[0] != '\0')
+                {
+                  if (strlen (tmp) > 11)
+                    tmp[11] = '\0';
+                  a = atoi (tmp);
+                  cm.write (tmp);
+                }
+              else
+                cm.write ("0");
 
-      tmp = cm.getParam("b");
+              cm.write (" + ");
 
-      if (tmp && tmp[0] != '\0')
-      {
-        if (strlen(tmp) > 11)
-          tmp[11] = '\0';
-        b = atoi(tmp);
-        cm.write(tmp);
-      }
-      else
-        cm.write("0");
+              tmp = cm.getParam ("b");
+              if (tmp && tmp[0] != '\0')
+                {
+                  if (strlen (tmp) > 11)
+                    tmp[11] = '\0';
+                  b = atoi (tmp);
+                  cm.write (tmp);
+                }
+              else
+                cm.write("0");
 
-      cm.write(" = ");
-      iRes = a + b;
+              cm.write(" = ");
+              iRes = a + b;
 #ifdef	WIN32
-      _i64toa(iRes, res, 10);
+              _i64toa(iRes, res, 10);
 #else
-      sprintf(res,"%i", (int)iRes);
+              sprintf(res,"%i", (int) iRes);
 #endif
-      cm.write(res);
+              cm.write (res);
+            }
+          else
+            {
+              cm.write ("Invalid input format");
+            }
+
+          cm.getenv ("SERVER_NAME", lb, &dim);
+          cm.write ("\r\n<br />\r\nRunning on: ");
+          cm.write (lb);
+          cm.write ("(");
+          cm.getenv ("HTTP_HOST", lb, &dim);
+          cm.write (lb);
+
+          cm.write (")\r\n</div>\r\n</body>\r\n</html>");
+        }
+
+      cm.clean ();
     }
-    else
+  catch (exception & e)
     {
-      cm.write("Invalid input format");
+      return 1;
     }
-
-		cm.getenv("SERVER_NAME", lb, &dim);
-		cm.write("\r\n<br />\r\nRunning on: ");
-		cm.write(lb);
-		cm.write("(");
-		cm.getenv("HTTP_HOST", lb, &dim);
-		cm.write(lb);
-
-		cm.write(")\r\n</div>\r\n</body>\r\n</html>");
-	}
-     cm.clean();
-     return 0;
+  return 0;
 }
 #ifdef WIN32
-BOOL APIENTRY DllMain( HANDLE,DWORD ul_reason_for_call,LPVOID)
+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;
-	}
+    }
 	return TRUE;
 }
 #endif
diff --git a/myserver/binaries/web/cgi-src/post/post.cpp b/myserver/binaries/web/cgi-src/post/post.cpp
index 0f9203f..fd7043b 100644
--- a/myserver/binaries/web/cgi-src/post/post.cpp
+++ b/myserver/binaries/web/cgi-src/post/post.cpp
@@ -5,37 +5,47 @@ const char *program_name;
 
 EXPORTABLE(int) myserver_main (char *cmd, MsCgiData* data)
 {
-  MscgiManager cm(data);
+  try
+    {
+      MscgiManager cm (data);
 
-  char *post = cm.postParam("T1");
+      char *post = cm.postParam ("T1");
 
-  program_name = cmd;
-  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\
-<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\n\
-<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>");
+      program_name = cmd;
+      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"
+                    "<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\n"
+                    "<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"
+                    "\"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\n"
+                    "Posted argument:&nbsp;");
+          cm.write (post);
+          cm.write ("\r\n</div>\r\n</body>\r\n</html>");
+        }
+
+      cm.clean ();
     }
-	else
+  catch (exception & e)
     {
-      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;");
-      cm.write(post);
-      cm.write("\r\n</div>\r\n</body>\r\n</html>");
+      return 1;
     }
-	cm.clean();
 	return 0;
 }
 



commit bc5a97323c6941d6bdf4ca65311af9e16db52a80
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 17 20:19:23 2010 +0200

    Error pages are already mapped to the local file system

diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index cfa0f69..4bcc303 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -408,6 +408,10 @@ int Http::getFilePermissions (string& filename, string& directory, string& file,
       else
         td->authScheme = HTTP_AUTH_SCHEME_BASIC;
     }
+  catch (FileNotFoundException & e)
+    {
+      return raiseHTTPError (404);
+    }
   catch (...)
     {
       td->connection->host->warningsLogWrite (
@@ -533,6 +537,10 @@ int Http::preprocessHttpRequest (string& filename, int yetmapped, int* permissio
 
       td->mime = mimeLoc ? mimeLoc : getMIME (td->filenamePath);
     }
+  catch (FileNotFoundException & e)
+    {
+      return 404;
+    }
   catch (...)
     {
       td->connection->host->warningsLogWrite (_("HTTP: internal error"));
@@ -1415,7 +1423,7 @@ int Http::raiseHTTPError (int ID)
           if (FilesUtility::nodeExists (errorFile.str ().c_str ()))
             {
               string errorFileStr = errorFile.str ();
-              return sendHTTPResource (errorFileStr, 1, td->onlyHeader);
+              return sendHTTPResource (errorFileStr, 1, td->onlyHeader, 1);
             }
           else
             td->connection->host->warningsLogWrite (



commit 8a7258a6dbdacd41369361a96a3930ae808b2b6b
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 17 13:45:11 2010 +0200

    Fix mistake in an error message

diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp b/myserver/src/http_handler/mscgi/mscgi.cpp
index 2b349d4..28ba912 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -148,7 +148,7 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
     }
   catch (exception & e)
     {
-      td->connection->host->warningsLogWrite (_E ("Cgi: internal error"), &e);
+      td->connection->host->warningsLogWrite (_E ("Msgi: internal error"), &e);
       return td->http->raiseHTTPError (500);
     }
 



commit 344439789e734a7ebf7f5cdf02936e62efa32ae9
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 17 13:44:58 2010 +0200

    A negative handle is invalid

diff --git a/myserver/src/protocol/http/env/env.cpp b/myserver/src/protocol/http/env/env.cpp
index fa088fd..4ba281f 100644
--- a/myserver/src/protocol/http/env/env.cpp
+++ b/myserver/src/protocol/http/env/env.cpp
@@ -106,7 +106,7 @@ void Env::buildEnvironmentString (HttpThreadContext* td, char *cgiEnv,
     u_long fs = 0;
     ostringstream stream;
 
-    if (td->inputData.getHandle ())
+    if (td->inputData.getHandle () >= 0)
       fs = td->inputData.getFileSize ();
 
     stream << fs;

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

Summary of changes:
 myserver/binaries/web/cgi-src/math_sum/Makefile.am |   12 +-
 .../binaries/web/cgi-src/math_sum/math_sum.cpp     |  198 ++++++++++---------
 myserver/binaries/web/cgi-src/post/Makefile.am     |   12 +-
 myserver/binaries/web/cgi-src/post/post.cpp        |   62 ++++---
 myserver/src/Makefile.am                           |    3 +-
 myserver/src/base/dynamic_lib/dynamiclib.cpp       |   34 +++-
 myserver/src/http_handler/mscgi/mscgi.cpp          |    2 +-
 myserver/src/http_handler/mscgi/mscgi_manager.cpp  |   12 +-
 myserver/src/protocol/http/env/env.cpp             |    2 +-
 myserver/src/protocol/http/http.cpp                |   10 +-
 10 files changed, 200 insertions(+), 147 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Sat Apr 17 19:48:18 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O3HkI-0005eG-1K
	for mharc-myserver-commit@gnu.org; Sat, 17 Apr 2010 19:48:18 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O3HkF-0005cy-Sc
	for myserver-commit@gnu.org; Sat, 17 Apr 2010 19:48:15 -0400
Received: from [140.186.70.92] (port=41787 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O3HkE-0005c3-6a
	for myserver-commit@gnu.org; Sat, 17 Apr 2010 19:48:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3Hk9-0000Yv-C3
	for myserver-commit@gnu.org; Sat, 17 Apr 2010 19:48:14 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:60361
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3Hk9-0000Yn-AW
	for myserver-commit@gnu.org; Sat, 17 Apr 2010 19:48:09 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3Hk8-00079r-DE
	for myserver-commit@gnu.org; Sat, 17 Apr 2010 23:48:08 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O3Hk7-0007bA-6Z
	for myserver-commit@gnu.org; Sat, 17 Apr 2010 23:48:08 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 06601b45ee04b9b78537879501a7d1aebb1b4296
X-Git-Newrev: af7a9a097db1f9ca192cd51feea6378057104e77
Message-Id: <E1O3Hk7-0007bA-6Z@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Sat, 17 Apr 2010 23:48:08 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-165-gaf7a9a0
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, 17 Apr 2010 23:48:16 -0000

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

The branch, master has been updated
       via  af7a9a097db1f9ca192cd51feea6378057104e77 (commit)
      from  06601b45ee04b9b78537879501a7d1aebb1b4296 (commit)

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

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


commit af7a9a097db1f9ca192cd51feea6378057104e77
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sun Apr 18 01:47:58 2010 +0200

    Silent socket exceptions on connection cleanup

diff --git a/myserver/src/connection/connection.cpp b/myserver/src/connection/connection.cpp
index dc3d1b6..5091544 100644
--- a/myserver/src/connection/connection.cpp
+++ b/myserver/src/connection/connection.cpp
@@ -19,6 +19,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "myserver.h"
 #include <include/connection/connection.h>
 #include <include/conf/vhost/vhost.h>
+#include <include/base/exceptions/exceptions.h>
 
 /*!
  * Initialize the structure.
@@ -51,12 +52,18 @@ void Connection::init ()
 void Connection::destroy ()
 {
   if (socket)
-  {
-    socket->shutdown (SHUT_RDWR);
-    socket->close ();
-    delete socket;
-    socket = NULL;
-  }
+    {
+      try
+        {
+          socket->shutdown (SHUT_RDWR);
+          socket->close ();
+          delete socket;
+          socket = NULL;
+        }
+      catch (SocketException & e)
+        {
+        }
+    }
 
   if (login)
     delete login;
@@ -78,7 +85,7 @@ void Connection::destroy ()
 
   /*! Remove the reference for the vhost. */
   if (host)
-    ((Vhost*)host)->removeRef ();
+    ((Vhost*) host)->removeRef ();
 
   login = NULL;
   password = NULL;

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

Summary of changes:
 myserver/src/connection/connection.cpp |   21 ++++++++++++++-------
 1 files changed, 14 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Sun Apr 18 08:49:06 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O3Tvu-0008Te-Dp
	for mharc-myserver-commit@gnu.org; Sun, 18 Apr 2010 08:49:06 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O3Tvs-0008TZ-Ol
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 08:49:04 -0400
Received: from [140.186.70.92] (port=51840 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O3Tvp-0008TR-Ry
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 08:49:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3Tvo-0001dH-8I
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 08:49:01 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:36396
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3Tvo-0001dB-4k
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 08:49:00 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3Tvn-00089r-Kj
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 12:48:59 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O3Tvk-0003Pj-RF
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 12:48:59 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: af7a9a097db1f9ca192cd51feea6378057104e77
X-Git-Newrev: 2dd5e22fb5ea6d078f14dd32d5ba62264078c4d9
Message-Id: <E1O3Tvk-0003Pj-RF@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Sun, 18 Apr 2010 12:48:58 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-167-g2dd5e22
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, 18 Apr 2010 12:49:05 -0000

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

The branch, master has been updated
       via  2dd5e22fb5ea6d078f14dd32d5ba62264078c4d9 (commit)
       via  e82ec6a398df9ccf6bf23cf66681343e04bfb751 (commit)
      from  af7a9a097db1f9ca192cd51feea6378057104e77 (commit)

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

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


commit 2dd5e22fb5ea6d078f14dd32d5ba62264078c4d9
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sun Apr 18 14:48:23 2010 +0200

    Log exceptions messages in the HTTP protocol handler

diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index 4bcc303..3c8776f 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -141,20 +141,13 @@ int Http::optionsHTTPRESOURCE (string& filename, int yetmapped)
         *td->auxiliaryBuffer << "\r\nConnection:" << connection->value->c_str () << "\r\n";
       *td->auxiliaryBuffer << "Content-length: 0\r\nAccept-Ranges: bytes\r\n";
       *td->auxiliaryBuffer << "Allow: " << methods << "\r\n\r\n";
-
-      /* Send the HTTP header. */
-      ret = td->connection->socket->send (td->auxiliaryBuffer->getBuffer (),
-                                          td->auxiliaryBuffer->getLength (), 0);
-      if (ret < 0)
-        {
-          td->connection->host->warningsLogWrite (_("HTTP: socket error"));
-          return 0;
-        }
+      td->connection->socket->send (td->auxiliaryBuffer->getBuffer (),
+                                    td->auxiliaryBuffer->getLength (), 0);
       return 1;
     }
-  catch (...)
+  catch (exception & e)
     {
-      td->connection->host->warningsLogWrite (_("HTTP: internal error"));
+      td->connection->host->warningsLogWrite (_E ("HTTP: internal error"), &e);
       return raiseHTTPError (500);
     };
 }
@@ -202,19 +195,13 @@ int Http::traceHTTPRESOURCE (string& filename, int yetmapped)
           return 0;
         }
 
-      /* Send the client request header as the HTTP body.  */
-      ret = td->connection->socket->send (td->buffer->getBuffer (),
-                                          contentLength, 0);
-      if (ret < 0)
-        {
-          td->connection->host->warningsLogWrite (_("HTTP: socket error"));
-          return 0;
-        }
+      /* Send the client request header as the HTTP payload.  */
+      td->connection->socket->send (td->buffer->getBuffer (), contentLength, 0);
       return 1;
     }
-  catch (...)
+  catch (exception & e)
     {
-      td->connection->host->warningsLogWrite (_("HTTP: internal error"));
+      td->connection->host->warningsLogWrite (_E ("HTTP: internal error"), &e);
       return raiseHTTPError (500);
     };
 }
@@ -268,8 +255,9 @@ int Http::getFilePermissions (string& filename, string& directory, string& file,
 {
   try
     {
+      const string *sysdir = &td->connection->host->getSystemRoot ();
       td->securityToken.setServer (Server::getInstance ());
-      td->securityToken.setSysDirectory ((string*)&(td->connection->host->getSystemRoot ()));
+      td->securityToken.setSysDirectory (sysdir);
 
       td->securityToken.setVhost (td->connection->host);
 
@@ -412,11 +400,11 @@ int Http::getFilePermissions (string& filename, string& directory, string& file,
     {
       return raiseHTTPError (404);
     }
-  catch (...)
+  catch (exception & e)
     {
       td->connection->host->warningsLogWrite (
-                                 _("HTTP: cannot get permissions for %s"),
-                                 filename.c_str ());
+                                 _E ("HTTP: cannot get permissions for %s"),
+                                 filename.c_str (), &e);
       return 500;
     }
 
@@ -440,7 +428,8 @@ int Http::getFilePermissions (string& filename, string& directory, string& file,
  * \return Return 200 on success.
  * \return Any other value is the HTTP error code.
  */
-int Http::preprocessHttpRequest (string& filename, int yetmapped, int* permissions)
+int Http::preprocessHttpRequest (string& filename, int yetmapped,
+                                 int* permissions)
 {
   string directory;
   string file;
@@ -483,7 +472,6 @@ int Http::preprocessHttpRequest (string& filename, int yetmapped, int* permissio
            */
 
           u_long next = td->filenamePath.find ('/', i + 1);
-
           string curr = td->filenamePath.substr (0, next);
 
           mimeLoc = td->connection->host
@@ -519,7 +507,9 @@ int Http::preprocessHttpRequest (string& filename, int yetmapped, int* permissio
       /*
        * PATH_TRANSLATED is the local filesystem mapped version of PATH_INFO.
        */
-      if (td->pathInfo.length () > 1)
+      if (td->pathInfo.length () <= 1)
+        td->pathTranslated.assign ("");
+      else
         {
           int ret;
           /* Omit the first slash character.  */
@@ -529,10 +519,7 @@ int Http::preprocessHttpRequest (string& filename, int yetmapped, int* permissio
           else
             FilesUtility::completePath (td->pathTranslated);
         }
-      else
-        {
-          td->pathTranslated.assign ("");
-        }
+
       FilesUtility::completePath (td->filenamePath);
 
       td->mime = mimeLoc ? mimeLoc : getMIME (td->filenamePath);
@@ -541,6 +528,11 @@ int Http::preprocessHttpRequest (string& filename, int yetmapped, int* permissio
     {
       return 404;
     }
+  catch (exception & e)
+    {
+      td->connection->host->warningsLogWrite (_E ("HTTP: internal error"), &e);
+      return 404;
+    }
   catch (...)
     {
       td->connection->host->warningsLogWrite (_("HTTP: internal error"));
@@ -730,11 +722,11 @@ Http::sendHTTPResource (string& uri, int systemrequest, int onlyHeader,
 
       return manager->send (td, td->filenamePath.c_str (), 0, onlyHeader);
     }
-  catch (...)
+  catch (exception & e)
     {
-      td->connection->host->warningsLogWrite (_("HTTP: internal error"));
+      td->connection->host->warningsLogWrite (_E ("HTTP: internal error"), &e);
       return raiseHTTPError (500);
-    };
+    }
 
   return HttpDataHandler::RET_OK;
 }
@@ -811,14 +803,17 @@ int Http::logHTTPaccess ()
        * Request the access to the log file then append the message.
        */
       if (td->connection->host)
-        td->connection->host->accessesLogWrite ("%s", td->auxiliaryBuffer->getBuffer ());
+        {
+          const char *msg = td->auxiliaryBuffer->getBuffer ();
+          td->connection->host->accessesLogWrite ("%s", msg);
+        }
 
       td->auxiliaryBuffer->setLength (0);
     }
   catch (...)
     {
       return HttpDataHandler::RET_FAILURE;
-    };
+    }
   return 0;
 }
 



commit e82ec6a398df9ccf6bf23cf66681343e04bfb751
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sun Apr 18 14:43:24 2010 +0200

    Make const some getters

diff --git a/myserver/include/conf/security/auth_domain.h b/myserver/include/conf/security/auth_domain.h
index 1843739..9eb0836 100644
--- a/myserver/include/conf/security/auth_domain.h
+++ b/myserver/include/conf/security/auth_domain.h
@@ -33,7 +33,7 @@ class AuthDomain : public SecurityDomain
 public:
   AuthDomain (SecurityToken*);
   virtual ~AuthDomain ();
-  virtual string *getValue (string &name);
+  virtual const string *getValue (string &name);
 protected:
   string name;
   SecurityToken *securityToken;
diff --git a/myserver/include/conf/security/security_domain.h b/myserver/include/conf/security/security_domain.h
index 472ae28..92437c7 100644
--- a/myserver/include/conf/security/security_domain.h
+++ b/myserver/include/conf/security/security_domain.h
@@ -32,7 +32,7 @@ public:
   SecurityDomain (const char* name);
   SecurityDomain (string &name);
   virtual ~SecurityDomain ();
-  virtual string *getValue (string &name);
+  virtual const string *getValue (string &name);
   string& getName (){return name;}
 protected:
   string name;
diff --git a/myserver/include/conf/security/security_token.h b/myserver/include/conf/security/security_token.h
index 799795e..1665a93 100644
--- a/myserver/include/conf/security/security_token.h
+++ b/myserver/include/conf/security/security_token.h
@@ -73,17 +73,17 @@ public:
     return &values;
   }
 
-  string *getDirectory ()
+  const string *getDirectory ()
   {
     return directory;
   }
 
-  string *getSysDirectory ()
+  const string *getSysDirectory ()
   {
     return sysdirectory;
   }
 
-  string *getResource ()
+  const string *getResource ()
   {
     return resource;
   }
@@ -139,17 +139,17 @@ public:
     password.assign (pw);
   }
 
-  void setDirectory (string *d)
+  void setDirectory (const string *d)
   {
     directory = d;
   }
 
-  void setSysDirectory (string *sd)
+  void setSysDirectory (const string *sd)
   {
     sysdirectory = sd;
   }
 
-  void setResource (string *r)
+  void setResource (const string *r)
   {
     resource = r;
   }
@@ -222,13 +222,13 @@ private:
   string password;
 
   /*! Directory that the user is in.  */
-  string *directory;
+  const string *directory;
 
   /*! System directory for the host.  */
-  string *sysdirectory;
+  const string *sysdirectory;
 
   /*! Resource that the user tried to access.  */
-  string *resource;
+  const string *resource;
 
   /*! Permission mask.  */
   int mask;
diff --git a/myserver/include/conf/security/validator.h b/myserver/include/conf/security/validator.h
index f4d945c..2a3decf 100644
--- a/myserver/include/conf/security/validator.h
+++ b/myserver/include/conf/security/validator.h
@@ -50,7 +50,7 @@ public:
                                      AuthMethod* authMethod);
 
 
-  string *getValue (HashMap<string, SecurityDomain*> *hashedDomains,
+  const string *getValue (HashMap<string, SecurityDomain*> *hashedDomains,
                     string &name);
 protected:
   bool comparePassword (const char *password, const char *savedPassword,
diff --git a/myserver/src/conf/security/auth_domain.cpp b/myserver/src/conf/security/auth_domain.cpp
index 7a540ce..579dee5 100644
--- a/myserver/src/conf/security/auth_domain.cpp
+++ b/myserver/src/conf/security/auth_domain.cpp
@@ -36,7 +36,7 @@ AuthDomain::~AuthDomain ()
 /*!
  *\see SecurityDomain::getValue.
  */
-string *AuthDomain::getValue (string &name)
+const string *AuthDomain::getValue (string &name)
 {
   if (!name.compare ("user"))
     return &(securityToken->getUser ());
diff --git a/myserver/src/conf/security/security_domain.cpp b/myserver/src/conf/security/security_domain.cpp
index 3a777bd..00c1ea7 100644
--- a/myserver/src/conf/security/security_domain.cpp
+++ b/myserver/src/conf/security/security_domain.cpp
@@ -45,7 +45,7 @@ SecurityDomain::~SecurityDomain ()
 /*!
  *Get the stored value for [name].
  */
-string *SecurityDomain::getValue (string &name)
+const string *SecurityDomain::getValue (string &name)
 {
   return NULL;
 }
diff --git a/myserver/src/conf/security/validator.cpp b/myserver/src/conf/security/validator.cpp
index 2b3f09f..690e275 100644
--- a/myserver/src/conf/security/validator.cpp
+++ b/myserver/src/conf/security/validator.cpp
@@ -87,7 +87,8 @@ int Validator::getPermissionMask (SecurityToken* st,
  *Decorate getPermissionMaskImpl.
  */
 int Validator::getPermissionMaskInt (SecurityToken* st,
-                                     HashMap<string, SecurityDomain*> *hashedDomains,
+                                     HashMap<string,
+                                             SecurityDomain*> *hashedDomains,
                                      AuthMethod* authMethod)
 {
   int ret = 0;
@@ -108,7 +109,8 @@ int Validator::getPermissionMaskInt (SecurityToken* st,
  *Get the permission mask for the requested resource.
  */
 int Validator::getPermissionMaskImpl (SecurityToken* st,
-                                      HashMap<string, SecurityDomain*> *hashedDomains,
+                                      HashMap<string,
+                                      SecurityDomain*> *hashedDomains,
                                       AuthMethod* authMethod)
 {
   return 0;
@@ -120,7 +122,9 @@ int Validator::getPermissionMaskImpl (SecurityToken* st,
  *\param name Variable name.
  *\return The value of the requested variable.
  */
-string *Validator::getValue (HashMap<string, SecurityDomain*> *hashedDomains, string &name)
+const string *Validator::getValue (HashMap<string,
+                                           SecurityDomain*> *hashedDomains,
+                                   string &name)
 {
   string domain;
   string var;
diff --git a/myserver/src/conf/security/xml_validator.cpp b/myserver/src/conf/security/xml_validator.cpp
index d8ca272..9fdc1cc 100644
--- a/myserver/src/conf/security/xml_validator.cpp
+++ b/myserver/src/conf/security/xml_validator.cpp
@@ -327,8 +327,7 @@ bool XmlValidator::doCondition (xmlNodePtr node,
       attrs = attrs->next;
     }
 
-  string *storedValue = getValue (hashedDomains, name);
-
+  const string *storedValue = getValue (hashedDomains, name);
   if (!storedValue)
     return false;
 
diff --git a/myserver/tests/test_security_domain.cpp b/myserver/tests/test_security_domain.cpp
index eaf1dbe..c2cb296 100644
--- a/myserver/tests/test_security_domain.cpp
+++ b/myserver/tests/test_security_domain.cpp
@@ -59,7 +59,8 @@ public:
   void testGetValue ()
   {
     string val ("value");
-    CPPUNIT_ASSERT_EQUAL (securityDomain->getValue (val), (string*)NULL);
+    CPPUNIT_ASSERT_EQUAL (securityDomain->getValue (val),
+                          (const string *) NULL);
   }
 
 };
diff --git a/myserver/tests/test_security_token.cpp b/myserver/tests/test_security_token.cpp
index c292bb0..d4e4c39 100644
--- a/myserver/tests/test_security_token.cpp
+++ b/myserver/tests/test_security_token.cpp
@@ -86,21 +86,21 @@ public:
 
   void testDirectory ()
   {
-    string dir ("foo");
+    const string dir ("foo");
     securityToken->setDirectory (&dir);
     CPPUNIT_ASSERT_EQUAL (securityToken->getDirectory (), &dir);
   }
 
   void testSysDirectory ()
   {
-    string sysDir ("foo");
+    const string sysDir ("foo");
     securityToken->setSysDirectory (&sysDir);
     CPPUNIT_ASSERT_EQUAL (securityToken->getSysDirectory (), &sysDir);
   }
 
   void testResource ()
   {
-    string resource ("foo");
+    const string resource ("foo");
     securityToken->setResource (&resource);
     CPPUNIT_ASSERT_EQUAL (securityToken->getResource (), &resource);
   }
diff --git a/myserver/tests/test_validator.cpp b/myserver/tests/test_validator.cpp
index e7a571c..b535f7c 100644
--- a/myserver/tests/test_validator.cpp
+++ b/myserver/tests/test_validator.cpp
@@ -56,14 +56,16 @@ public:
   {
     string val ("value");
     HashMap<string, SecurityDomain*> hashedDomains;
-    CPPUNIT_ASSERT_EQUAL (validator->getValue (&hashedDomains, val), (string*)NULL);
+    CPPUNIT_ASSERT_EQUAL (validator->getValue (&hashedDomains, val),
+                          (const string*) NULL);
   }
 
   void testGetPermissionMaskImpl ()
   {
     string val ("value");
     SecurityToken secToken;
-    CPPUNIT_ASSERT_EQUAL (validator->getPermissionMaskImpl (&secToken, NULL, NULL), 0);
+    CPPUNIT_ASSERT_EQUAL (validator->getPermissionMaskImpl (&secToken, NULL,
+                                                            NULL), NULL);
 
   }
 
diff --git a/myserver/tests/test_xml_validator.cpp b/myserver/tests/test_xml_validator.cpp
index c7da1b8..80f664e 100644
--- a/myserver/tests/test_xml_validator.cpp
+++ b/myserver/tests/test_xml_validator.cpp
@@ -57,7 +57,8 @@ public:
     string val ("value");
     HashMap<string, SecurityDomain*> hashedDomains;
 
-    CPPUNIT_ASSERT_EQUAL (xmlValidator->getValue (&hashedDomains, val), (string*)NULL);
+    CPPUNIT_ASSERT_EQUAL (xmlValidator->getValue (&hashedDomains, val),
+                          (const string *) NULL);
 
   }
 
@@ -69,7 +70,8 @@ public:
     secToken.setResource (&val);
     secToken.setDirectory (&val);
     secToken.setSysDirectory (&val);
-    CPPUNIT_ASSERT_EQUAL (xmlValidator->getPermissionMaskImpl (&secToken, NULL, NULL), 0);
+    CPPUNIT_ASSERT_EQUAL (xmlValidator->getPermissionMaskImpl (&secToken, NULL,
+                                                               NULL), 0);
 
   }
 

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

Summary of changes:
 myserver/include/conf/security/auth_domain.h     |    2 +-
 myserver/include/conf/security/security_domain.h |    2 +-
 myserver/include/conf/security/security_token.h  |   18 +++---
 myserver/include/conf/security/validator.h       |    2 +-
 myserver/src/conf/security/auth_domain.cpp       |    2 +-
 myserver/src/conf/security/security_domain.cpp   |    2 +-
 myserver/src/conf/security/validator.cpp         |   10 ++-
 myserver/src/conf/security/xml_validator.cpp     |    3 +-
 myserver/src/protocol/http/http.cpp              |   69 ++++++++++------------
 myserver/tests/test_security_domain.cpp          |    3 +-
 myserver/tests/test_security_token.cpp           |    6 +-
 myserver/tests/test_validator.cpp                |    6 +-
 myserver/tests/test_xml_validator.cpp            |    6 +-
 13 files changed, 67 insertions(+), 64 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Sun Apr 18 11:30:28 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O3WS4-00038m-Cn
	for mharc-myserver-commit@gnu.org; Sun, 18 Apr 2010 11:30:28 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O3WS1-00037e-Pa
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 11:30:25 -0400
Received: from [140.186.70.92] (port=48551 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O3WRz-00035s-Dp
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 11:30:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3WRx-0004z7-Rv
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 11:30:23 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:52561
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3WRx-0004yt-5g
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 11:30:21 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3WRw-0001hU-HC
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 15:30:20 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O3WRw-0002xb-0A
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 15:30:20 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 2dd5e22fb5ea6d078f14dd32d5ba62264078c4d9
X-Git-Newrev: 44ab79f9255ee387c703311a2435663c18be8395
Message-Id: <E1O3WRw-0002xb-0A@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Sun, 18 Apr 2010 15:30:20 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-169-g44ab79f
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, 18 Apr 2010 15:30:26 -0000

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

The branch, master has been updated
       via  44ab79f9255ee387c703311a2435663c18be8395 (commit)
       via  0eea53d6c56cfb00ceb37baaa76bde61fd025195 (commit)
      from  2dd5e22fb5ea6d078f14dd32d5ba62264078c4d9 (commit)

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

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


commit 44ab79f9255ee387c703311a2435663c18be8395
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sun Apr 18 17:30:03 2010 +0200

    Add method `reuseAddress' and use it instead of `setsockopt' when possible

diff --git a/myserver/include/base/socket/socket.h b/myserver/include/base/socket/socket.h
index 6917c80..5ad6be0 100644
--- a/myserver/include/base/socket/socket.h
+++ b/myserver/include/base/socket/socket.h
@@ -83,7 +83,8 @@ public:
   Socket (SocketHandle);
   virtual ~Socket ();
   Socket* accept (MYSERVER_SOCKADDR*, socklen_t*);
-  int setsockopt (int,int, const char*,int);
+  void reuseAddress (bool);
+  int setsockopt (int, int, const char*, int);
 
   virtual int connect (MYSERVER_SOCKADDR*, int);
   virtual int close ();
diff --git a/myserver/src/base/socket/socket.cpp b/myserver/src/base/socket/socket.cpp
index e8d4a1c..128aaa6 100644
--- a/myserver/src/base/socket/socket.cpp
+++ b/myserver/src/base/socket/socket.cpp
@@ -364,6 +364,23 @@ int Socket::send (const char* buffer, int len, int flags)
   return 0;
 }
 
+
+/*!
+  Specify if the ip address can be re-used.
+
+  \value reuseAddr Specify if re-use the address.
+ */
+void Socket::reuseAddress (bool reuseAddr)
+{
+#ifndef WIN32
+  int optvalReuseAddr = reuseAddr ? 1 : 0;
+
+  setsockopt (SOL_SOCKET, SO_REUSEADDR,
+              (const char *) &optvalReuseAddr,
+              sizeof (optvalReuseAddr));
+#endif
+}
+
 /*!
  *Connect to the specified host:port.
  *Returns zero on success.
diff --git a/myserver/src/connections_scheduler/listen_threads.cpp b/myserver/src/connections_scheduler/listen_threads.cpp
index 152d75b..16d95ff 100644
--- a/myserver/src/connections_scheduler/listen_threads.cpp
+++ b/myserver/src/connections_scheduler/listen_threads.cpp
@@ -63,7 +63,6 @@ ListenThreads::ListenThreads (ConnectionsScheduler* scheduler, Server* server)
  */
 int ListenThreads::createServerAndListener (u_short port)
 {
-  int optvalReuseAddr = 1;
   string listenPortMsg;
 
   if (fastRebooting)
@@ -87,170 +86,81 @@ int ListenThreads::createServerAndListener (u_short port)
    */
   try
     {
-      if (serverSocketIPv4 != NULL)
-        {
-          serverSocketIPv4->socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
-          if (serverSocketIPv4->getHandle () < 0)
-            {
-              server->log (MYSERVER_LOG_MSG_ERROR,
-                            _("Error while creating the server socket"));
-              delete serverSocketIPv4;
-              serverSocketIPv4 = NULL;
-            }
-          else
-            {
-              MYSERVER_SOCKADDR_STORAGE sockServerSocketIPv4 = { 0 };
-              ((sockaddr_in*)(&sockServerSocketIPv4))->sin_family = AF_INET;
-              ((sockaddr_in*)(&sockServerSocketIPv4))->sin_addr.s_addr =
-                htonl (INADDR_ANY);
-              ((sockaddr_in*)(&sockServerSocketIPv4))->sin_port =
-                htons ((u_short)port);
-
-#ifndef WIN32
-              if (serverSocketIPv4->setsockopt (SOL_SOCKET, SO_REUSEADDR,
-                                                (const char *)&optvalReuseAddr,
-                                                sizeof (optvalReuseAddr)) < 0)
-                {
-                  server->log (MYSERVER_LOG_MSG_ERROR,
-                                 _("Error while creating the server socket"));
-
-                  delete serverSocketIPv4;
-                  serverSocketIPv4 = NULL;
-                }
-#endif
-              if (serverSocketIPv4)
-                {
-                  server->log (MYSERVER_LOG_MSG_INFO,
-                                      _("Binding the port"));
-
-                  if (!serverSocketIPv4->bind (&sockServerSocketIPv4,
-                                              sizeof (sockaddr_in)))
-                    server->log (MYSERVER_LOG_MSG_INFO, _("Port was bound"));
-                  else
-                    {
-                      server->log (MYSERVER_LOG_MSG_ERROR,
-                                          _("Error while creating the server socket"));
-                      delete serverSocketIPv4;
-                      serverSocketIPv4 = NULL;
-                    }
-
-                }
-            }
-        }
+      MYSERVER_SOCKADDR_STORAGE sockServerSocketIPv4 = { 0 };
+      sockaddr_in* sai = (sockaddr_in *) &sockServerSocketIPv4;
+      serverSocketIPv4->socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
+      sai->sin_family = AF_INET;
+      sai->sin_addr.s_addr = htonl (INADDR_ANY);
+      sai->sin_port = htons ((u_short) port);
+      serverSocketIPv4->reuseAddress (true);
+      server->log (MYSERVER_LOG_MSG_INFO, _("Binding the port"));
+      serverSocketIPv4->bind (&sockServerSocketIPv4, sizeof (sockaddr_in));
+      server->log (MYSERVER_LOG_MSG_INFO, _("Port was bound"));
+
+      serverSocketIPv4->listen (SOMAXCONN);
+    }
+  catch (exception & e)
+    {
+      server->log (MYSERVER_LOG_MSG_ERROR,
+                   _E ("Error while creating the server socket"), &e);
+      delete serverSocketIPv4;
+      serverSocketIPv4 = NULL;
+    }
 
 #if HAVE_IPV6
-      serverSocketIPv6 = new Socket ();
+  serverSocketIPv6 = new Socket ();
+  try
+    {
+      MYSERVER_SOCKADDR_STORAGE sockServerSocketIPv6 = { 0 };
+      sockaddr_in6 *sai = (sockaddr_in6 *)(&sockServerSocketIPv6);
+      serverSocketIPv6->socket (AF_INET6, SOCK_STREAM, IPPROTO_TCP);
+      sai->sin6_family = AF_INET6;
+      sai->sin6_addr = in6addr_any;
+      sai->sin6_port = htons ((u_short) port);
+      serverSocketIPv6->reuseAddress (true);
 
-      if (serverSocketIPv6 != NULL)
-        {
-          serverSocketIPv6->socket (AF_INET6, SOCK_STREAM, IPPROTO_TCP);
-          if (serverSocketIPv6->getHandle () < 0)
-            {
-              server->log (MYSERVER_LOG_MSG_ERROR,
-                                 _("Error while creating the server socket"));
-              delete serverSocketIPv6;
-              serverSocketIPv6 = NULL;
-            }
-          else
-            {
-              MYSERVER_SOCKADDR_STORAGE sockServerSocketIPv6 = { 0 };
-              ((sockaddr_in6*)(&sockServerSocketIPv6))->sin6_family = AF_INET6;
-              ((sockaddr_in6*)(&sockServerSocketIPv6))->sin6_addr = in6addr_any;
-              ((sockaddr_in6*)(&sockServerSocketIPv6))->sin6_port =
-                htons ((u_short)port);
 # ifndef WIN32
-              if (serverSocketIPv6->setsockopt (SOL_SOCKET, SO_REUSEADDR,
-                                                (const char *)&optvalReuseAddr,
-                                                sizeof (optvalReuseAddr)) < 0)
-                {
-                  server->log (MYSERVER_LOG_MSG_ERROR,
-                                 _("Error while creating the server socket"));
-                  delete serverSocketIPv6;
-                  serverSocketIPv6 = NULL;
-                }
-
-              if (serverSocketIPv6->setsockopt (IPPROTO_IPV6, IPV6_V6ONLY,
-                                              (const char *)&optvalReuseAddr,
-                                              sizeof (optvalReuseAddr)) < 0)
-                {
-                  server->log (MYSERVER_LOG_MSG_ERROR,
-                                 _("Error while creating the server socket"));
-                  delete serverSocketIPv6;
-                  serverSocketIPv6 = NULL;
-                }
+      int one = 1;
+      serverSocketIPv6->setsockopt (IPPROTO_IPV6, IPV6_V6ONLY,
+                                    (const char *) &one,
+                                    sizeof (one));
 # endif
-              if (serverSocketIPv6)
-                {
-                  server->log (MYSERVER_LOG_MSG_INFO,
-                                      _("Binding the port"));
-
-                  if (!serverSocketIPv6->bind (&sockServerSocketIPv6,
-                                               sizeof (sockaddr_in6)))
-                    server->log (MYSERVER_LOG_MSG_INFO,
-                                        _("Port was bound"));
-                  else
-                    {
-                      server->log (MYSERVER_LOG_MSG_ERROR,
-                                 _("Error while creating the server socket"));
-                      delete serverSocketIPv6;
-                      serverSocketIPv6 = NULL;
-                    }
-                }
-            }
-        }
-#endif // HAVE_IPV6
-
-      if (serverSocketIPv4 == NULL && serverSocketIPv6 == NULL)
-        {
-          delete si;
-          return 1;
-        }
-
-      if (serverSocketIPv4 != NULL && serverSocketIPv4->listen (SOMAXCONN))
-        {
-          server->log (MYSERVER_LOG_MSG_ERROR,
-                             _("Error while creating the server socket"));
-          delete serverSocketIPv4;
-          serverSocketIPv4 = NULL;
-        }
+      server->log (MYSERVER_LOG_MSG_INFO, _("Binding the port"));
+      serverSocketIPv6->bind (&sockServerSocketIPv6,  sizeof (sockaddr_in6));
+      server->log (MYSERVER_LOG_MSG_INFO, _("Port was bound"));
+      serverSocketIPv6->listen (SOMAXCONN);
+    }
+  catch (exception & e)
+    {
+      server->log (MYSERVER_LOG_MSG_ERROR,
+                   _("Error while creating the server socket"));
+      delete serverSocketIPv6;
+      serverSocketIPv6 = NULL;
+    }
+#endif
 
-      if (serverSocketIPv6 != NULL && serverSocketIPv6->listen (SOMAXCONN))
-        {
-          server->log (MYSERVER_LOG_MSG_ERROR,
-                             _("Error while creating the server socket"));
-          delete serverSocketIPv6;
-          serverSocketIPv6 = NULL;
-        }
+  if (serverSocketIPv4 == NULL && serverSocketIPv6 == NULL)
+    {
+      delete si;
+      return 1;
+    }
 
-      if (serverSocketIPv4 == NULL && serverSocketIPv6 == NULL)
-        {
-          delete si;
-          return 1;
-        }
+  if (serverSocketIPv4 == NULL && serverSocketIPv6 == NULL)
+    {
+      delete si;
+      return 1;
+    }
 
-      server->log (MYSERVER_LOG_MSG_INFO,
-                          _("Listening on the port: %i"), port);
+  server->log (MYSERVER_LOG_MSG_INFO, _("Listening on the port: %i"), port);
 
-      si->ipv4 = serverSocketIPv4;
-      si->ipv6 = serverSocketIPv6;
+  si->ipv4 = serverSocketIPv4;
+  si->ipv6 = serverSocketIPv6;
 
-      usedPorts.put (port, si);
+  usedPorts.put (port, si);
 
-      registerListener (si);
+  registerListener (si);
 
-      return 0;
-    }
-  catch (bad_alloc &ba)
-    {
-      server->log (MYSERVER_LOG_MSG_ERROR, _("Bad alloc: %s"),
-                          ba.what ());
-    }
-  catch (exception &e)
-    {
-      server->log (MYSERVER_LOG_MSG_ERROR, _("Error: %s"),
-                          e.what ());
-    };
-  return 1;
+  return 0;
 }
 
 /*!
@@ -264,11 +174,11 @@ void ListenThreads::registerListener (SocketInformation* si)
       scheduler->listener (&(si->laIpv4));
     }
 
-    if (si->ipv6)
-      {
-        si->laIpv6.reset (si->ipv6, si->port, server);
-        scheduler->listener (&(si->laIpv6));
-      }
+  if (si->ipv6)
+    {
+      si->laIpv6.reset (si->ipv6, si->port, server);
+      scheduler->listener (&(si->laIpv6));
+    }
 }
 
 /*!
diff --git a/myserver/src/protocol/ftp/ftp.cpp b/myserver/src/protocol/ftp/ftp.cpp
index 3ae3867..28373f8 100644
--- a/myserver/src/protocol/ftp/ftp.cpp
+++ b/myserver/src/protocol/ftp/ftp.cpp
@@ -1536,38 +1536,41 @@ Ftp::openDataPassive ()
     static_cast < FtpuserData * >(td.pConnection->protocolBuffer);
 
   Socket *pSocket = new Socket ();
-  pSocket->socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
-  if (pSocket->getHandle () < 0)
-    return 0;
 
-  int nReuseAddr = 1;
-  MYSERVER_SOCKADDR_STORAGE storage = { 0 };
-  ((sockaddr_in *) (&storage))->sin_family = AF_INET;
-  char szIpAddr[16];
-  memset (szIpAddr, 0, 16);
-  getIpAddr (pFtpuserData->m_cdh, szIpAddr, 16);
+  try
+    {
+      pSocket->socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
+      MYSERVER_SOCKADDR_STORAGE storage = { 0 };
+      ((sockaddr_in *) (&storage))->sin_family = AF_INET;
+      char szIpAddr[16];
+      memset (szIpAddr, 0, 16);
+      getIpAddr (pFtpuserData->m_cdh, szIpAddr, 16);
 #ifdef WIN32
-  ((sockaddr_in *) (&storage))->sin_addr.s_addr = inet_addr (szIpAddr);
+      ((sockaddr_in *) (&storage))->sin_addr.s_addr = inet_addr (szIpAddr);
 #else
-  inet_aton (szIpAddr, &((sockaddr_in *) (&storage))->sin_addr);
+      inet_aton (szIpAddr, &((sockaddr_in *) (&storage))->sin_addr);
 #endif
-  ((sockaddr_in *) (&storage))->sin_port =
-    htons (getPortNo (pFtpuserData->m_cdh));
-  if (pSocket->setsockopt (SOL_SOCKET, SO_REUSEADDR, (const char *) &nReuseAddr,
-                           sizeof (nReuseAddr)) < 0)
-    return 0;
+      ((sockaddr_in *) (&storage))->sin_port =
+        htons (getPortNo (pFtpuserData->m_cdh));
+      pSocket->reuseAddress (true);
 
-  if (pSocket->bind (&storage, sizeof (sockaddr_in)) != 0
-      || pSocket->listen (SOMAXCONN) != 0)
-    return 0;
+      pSocket->bind (&storage, sizeof (sockaddr_in));
+      pSocket->listen (SOMAXCONN);
+
+      pFtpuserData->m_pDataConnection->setPort (getPortNo (pFtpuserData->m_cdh));
+      pFtpuserData->m_pDataConnection->setLocalPort (pFtpuserData->m_nLocalDataport);
+      pFtpuserData->m_pDataConnection->setIpAddr (td.pConnection->getIpAddr ());
+      pFtpuserData->m_pDataConnection->setLocalIpAddr (td.pConnection->getLocalIpAddr ());
+      pFtpuserData->m_pDataConnection->host = td.pConnection->host;
+      pFtpuserData->m_pDataConnection->socket = pSocket;
+      pFtpuserData->m_pDataConnection->setScheduled (1);
+    }
+  catch (...)
+    {
+      delete pSocket;
+      return 0;
+    }
 
-  pFtpuserData->m_pDataConnection->setPort (getPortNo (pFtpuserData->m_cdh));
-  pFtpuserData->m_pDataConnection->setLocalPort (pFtpuserData->m_nLocalDataport);
-  pFtpuserData->m_pDataConnection->setIpAddr (td.pConnection->getIpAddr ());
-  pFtpuserData->m_pDataConnection->setLocalIpAddr (td.pConnection->getLocalIpAddr ());
-  pFtpuserData->m_pDataConnection->host = td.pConnection->host;
-  pFtpuserData->m_pDataConnection->socket = pSocket;
-  pFtpuserData->m_pDataConnection->setScheduled (1);
   return 1;
 }
 



commit 0eea53d6c56cfb00ceb37baaa76bde61fd025195
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sun Apr 18 16:47:11 2010 +0200

    Remove `Socket::ioctlsocket'

diff --git a/myserver/include/base/socket/socket.h b/myserver/include/base/socket/socket.h
index b601c7b..6917c80 100644
--- a/myserver/include/base/socket/socket.h
+++ b/myserver/include/base/socket/socket.h
@@ -92,7 +92,6 @@ public:
   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*);
diff --git a/myserver/src/base/socket/socket.cpp b/myserver/src/base/socket/socket.cpp
index c1b6ec2..e8d4a1c 100644
--- a/myserver/src/base/socket/socket.cpp
+++ b/myserver/src/base/socket/socket.cpp
@@ -365,14 +365,6 @@ int Socket::send (const char* buffer, int len, int flags)
 }
 
 /*!
- *Function used to control the socket.
- */
-int Socket::ioctlsocket (long cmd, unsigned long* argp)
-{
-  return checked::checkError (gnulib::ioctl (fd, cmd, argp));
-}
-
-/*!
  *Connect to the specified host:port.
  *Returns zero on success.
  */
@@ -564,10 +556,10 @@ u_long Socket::bytesToRead ()
   u_long nBytesToRead = 0;
 
 #ifdef FIONREAD
-  ioctlsocket (FIONREAD,&nBytesToRead);
+  checked::checkError (gnulib::ioctl (fd, FIONREAD, &nBytesToRead));
 #else
 # ifdef I_NREAD
-  ::ioctlsocket ( I_NREAD, &nBytesToRead ) ;
+  checked::checkError (gnulib::ioctl (fd, I_NREAD, &nBytesToRead));
 # endif
 #endif
   return nBytesToRead;
@@ -588,7 +580,7 @@ int Socket::setNonBlocking (int nonBlocking)
 
 #ifdef WIN32
   u_long nonblock = nonBlocking ? 1 : 0;
-  ret = ioctlsocket (FIONBIO, &nonblock);
+  ret = checked::checkError (gnulib::ioctl (fd, FIONBIO, &nonblock));
 #else
   flags = checked::checkError (gnulib::fcntl (fd, F_GETFL, 0));
   if (flags < 0)

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

Summary of changes:
 myserver/include/base/socket/socket.h              |    4 +-
 myserver/src/base/socket/socket.cpp                |   21 ++-
 .../src/connections_scheduler/listen_threads.cpp   |  226 ++++++--------------
 myserver/src/protocol/ftp/ftp.cpp                  |   57 +++---
 4 files changed, 115 insertions(+), 193 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Sun Apr 18 11:49:29 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O3WkT-0000ni-R8
	for mharc-myserver-commit@gnu.org; Sun, 18 Apr 2010 11:49:29 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O3WkR-0000kg-Kh
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 11:49:27 -0400
Received: from [140.186.70.92] (port=54236 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O3WkQ-0000iP-7c
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 11:49:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3WkO-0008BF-L1
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 11:49:26 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:51293
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3WkO-0008B4-JQ
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 11:49:24 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3WkO-0001tM-3t
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 15:49:24 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O3WkN-0004Iz-Rk
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 15:49:24 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 44ab79f9255ee387c703311a2435663c18be8395
X-Git-Newrev: fcecfcb8183863ae337a02cb0a591672feecb7f1
Message-Id: <E1O3WkN-0004Iz-Rk@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Sun, 18 Apr 2010 15:49:23 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-170-gfcecfcb
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, 18 Apr 2010 15:49:28 -0000

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

The branch, master has been updated
       via  fcecfcb8183863ae337a02cb0a591672feecb7f1 (commit)
      from  44ab79f9255ee387c703311a2435663c18be8395 (commit)

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

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


commit fcecfcb8183863ae337a02cb0a591672feecb7f1
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sun Apr 18 17:49:19 2010 +0200

    Do not copy libmyserver under binaries

diff --git a/myserver/src/Makefile.am b/myserver/src/Makefile.am
index 68c796e..20d0b37 100644
--- a/myserver/src/Makefile.am
+++ b/myserver/src/Makefile.am
@@ -161,10 +161,10 @@ libmyserver_la_LIBADD =  \
 
 myserver_CXXFLAGS = $(CXXFLAGS) -DHOST_STR=\"$(build)\" -DPREFIX=\"$(prefix)\"
 
-myserver_LDFLAGS = -static
+myserver_LDFLAGS = -static -no-install
 myserver_LDADD = libmyserver.la $(PTHREAD_LIB) $(IDN_LIB) \
 	$(XNET_LIB) $(DL_LIB) $(ZLIB_LIB) \
 	$(XML_LIBS) $(INTLLIBS) $(LDFLAGS)
 
 all-local: libmyserver.la myserver${EXEEXT}
-	$(LIBTOOL) --mode=install cp libmyserver.la myserver $(abs_top_srcdir)/binaries/
+	$(LIBTOOL) --mode=install cp myserver $(abs_top_srcdir)/binaries/

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

Summary of changes:
 myserver/src/Makefile.am |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Sun Apr 18 15:52:28 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O3aXb-0003AW-Sk
	for mharc-myserver-commit@gnu.org; Sun, 18 Apr 2010 15:52:27 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O3aXa-00039H-Rv
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 15:52:26 -0400
Received: from [140.186.70.92] (port=48654 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O3aXZ-00037O-2B
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 15:52:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3aXX-0006Mq-IX
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 15:52:24 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:60031
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3aXX-0006Mg-B0
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 15:52:23 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3aXX-0004vf-4v
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 19:52:23 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O3aXU-0008Ak-KU
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 19:52:23 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: fcecfcb8183863ae337a02cb0a591672feecb7f1
X-Git-Newrev: 476a013549ad805136ebfb3d94b6aa1ed3b37312
Message-Id: <E1O3aXU-0008Ak-KU@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Sun, 18 Apr 2010 19:52:22 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-171-g476a013
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, 18 Apr 2010 19:52:27 -0000

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

The branch, master has been updated
       via  476a013549ad805136ebfb3d94b6aa1ed3b37312 (commit)
      from  fcecfcb8183863ae337a02cb0a591672feecb7f1 (commit)

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

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


commit 476a013549ad805136ebfb3d94b6aa1ed3b37312
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sun Apr 18 21:50:03 2010 +0200

    Avoid a race situation when parsing a CGI header

diff --git a/myserver/src/http_handler/cgi/cgi.cpp b/myserver/src/http_handler/cgi/cgi.cpp
index d01187e..5ace184 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -256,26 +256,20 @@ int Cgi::send (HttpThreadContext* td, const char* scriptpath,
         }
 
       /* Execute the CGI process. */
-      {
-        int ret;
-        if (Process::getForkServer ()->isInitialized ())
-          {
-            int pid;
-            int port;
-
-            Process::getForkServer ()->executeProcess (&spi,
-                                                       ForkServer::FLAG_USE_IN
-                                                       | ForkServer::FLAG_USE_OUT
-                                                       | ForkServer::FLAG_USE_ERR,
-                                                       &pid, &port);
-            cgiProc.setPid (pid);
-          }
-        else
-          cgiProc.exec (&spi);
-
-        /* Close the write stream of the pipe on the server.  */
-        stdOutFile.closeWrite ();
-      }
+      if (Process::getForkServer ()->isInitialized ())
+        {
+          int pid;
+          int port;
+          int flags = ForkServer::FLAG_USE_IN | ForkServer::FLAG_USE_OUT
+                                              | ForkServer::FLAG_USE_ERR;
+          Process::getForkServer ()->executeProcess (&spi, flags, &pid, &port);
+          cgiProc.setPid (pid);
+        }
+      else
+        cgiProc.exec (&spi);
+
+      /* Close the write stream of the pipe on the server.  */
+      stdOutFile.closeWrite ();
 
       sendData (td, stdOutFile, chain, cgiProc, onlyHeader, nph);
 
@@ -330,63 +324,56 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
     return HttpDataHandler::RET_OK;
 
   /* Create the output filters chain.  */
-  if (td->mime
-      && Server::getInstance ()->getFiltersFactory ()->chain (&chain,
-                                                       td->mime->filters,
-                                                       td->connection->socket,
-                                                              &nbw,
-                                                              1))
+  if (td->mime)
     {
-      td->connection->host->warningsLogWrite (_("Cgi: internal error"));
-      return td->http->raiseHTTPError (500);
+      FiltersFactory *ff = Server::getInstance ()->getFiltersFactory ();
+      ff->chain (&chain, td->mime->filters, td->connection->socket, &nbw, 1);
     }
 
   if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
-  {
-    /* Send the rest of the data until we can read from the pipe.  */
-    for (;;)
     {
-      nBytesRead = 0;
-      int aliveProcess = 0;
-      u_long ticks = getTicks () - procStartTime;
-      u_long timeout = td->http->getTimeout ();
-      if (timeout <= ticks
-          || stdOutFile.waitForData ((timeout - ticks) / 1000,
-                                     (timeout - ticks) % 1000) == 0)
+      /* Send the rest of the data until we can read from the pipe.  */
+      for (;;)
         {
-          td->connection->host->warningsLogWrite (_("Cgi: process %i timeout"),
-                                                  cgiProc.getPid ());
-          break;
-        }
+          nBytesRead = 0;
+          int aliveProcess = 0;
+          u_long ticks = getTicks () - procStartTime;
+          u_long timeout = td->http->getTimeout ();
+          if (timeout <= ticks
+              || stdOutFile.waitForData ((timeout - ticks) / 1000,
+                                         (timeout - ticks) % 1000) == 0)
+            {
+              td->connection->host->warningsLogWrite (_("Cgi: process %i timeout"),
+                                                      cgiProc.getPid ());
+              break;
+            }
 
-      aliveProcess = !stdOutFile.pipeTerminated ();
+          aliveProcess = !stdOutFile.pipeTerminated ();
 
-      /* Read data from the process standard output file.  */
-      if (stdOutFile.read (td->auxiliaryBuffer->getBuffer (),
+          /* Read data from the process standard output file.  */
+          stdOutFile.read (td->auxiliaryBuffer->getBuffer (),
                            td->auxiliaryBuffer->getRealLength (),
-                           &nBytesRead))
-        return HttpDataHandler::RET_FAILURE;
+                           &nBytesRead);
 
-      if (!aliveProcess && !nBytesRead)
-        break;
+          if (!aliveProcess && !nBytesRead)
+            break;
 
-      if (nBytesRead &&
-          HttpDataHandler::appendDataToHTTPChannel (td,
-                                                    td->auxiliaryBuffer->getBuffer (),
-                                                    nBytesRead,
-                                                    &(td->outputData),
-                                                    &chain,
-                                                    td->appendOutputs,
-                                                    useChunks))
-        return HttpDataHandler::RET_FAILURE;
+          if (nBytesRead)
+            HttpDataHandler::appendDataToHTTPChannel (td,
+                                             td->auxiliaryBuffer->getBuffer (),
+                                                      nBytesRead,
+                                                      &(td->outputData),
+                                                      &chain,
+                                                      td->appendOutputs,
+                                                      useChunks);
 
-      nbw += nBytesRead;
-    }
+          nbw += nBytesRead;
+        }
 
-    /* Send the last null chunk if needed.  */
-    if (useChunks && chain.getStream ()->write ("0\r\n\r\n", 5, &nbw2))
+      /* Send the last null chunk if needed.  */
+      if (useChunks && chain.getStream ()->write ("0\r\n\r\n", 5, &nbw2))
         return HttpDataHandler::RET_FAILURE;
-  }
+    }
 
   /* Update the Content-length field for logging activity.  */
   td->sentData += nbw;
@@ -398,9 +385,10 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
  *Send the HTTP header.
  *\return nonzero if the reply is already complete.
  */
-int Cgi::sendHeader (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
-                     Process& cgiProc, int onlyHeader, bool nph, u_long procStartTime,
-                     bool keepalive, bool useChunks, int *ret)
+int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile, FiltersChain &chain,
+                     Process &cgiProc, int onlyHeader, bool nph,
+                     u_long procStartTime, bool keepalive, bool useChunks,
+                     int *ret)
 {
   u_long headerSize = 0;
   bool headerCompleted = false;
@@ -409,80 +397,70 @@ int Cgi::sendHeader (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chai
 
   /* Parse initial chunks of data looking for the HTTP header.  */
   while (!headerCompleted && !nph)
-  {
-    u_long timeout = td->http->getTimeout ();
-    u_long ticks = getTicks () - procStartTime;
-    bool term;
-
-    nBytesRead = 0;
-
-    /* Do not try to read using a small buffer as this has some
-       bad influence on the performances.  */
-    if (td->auxiliaryBuffer->getRealLength () - headerOffset - 1 < 512)
-      break;
-
-    term = stdOutFile.pipeTerminated ();
-    if (!term
-        && stdOutFile.waitForData ((timeout - ticks) / 1000,
-                                   (timeout - ticks) % 1000) == 0)
-      {
-        td->connection->host->warningsLogWrite (_("Cgi: process %i timeout"),
-                                                cgiProc.getPid ());
-        break;
-      }
-
-    if (stdOutFile.read (td->auxiliaryBuffer->getBuffer () + headerOffset,
-                         td->auxiliaryBuffer->getRealLength () - headerOffset - 1,
-                         &nBytesRead))
-      {
-        *ret = td->http->raiseHTTPError (500);
-        return 1;
-      }
-
-    if (nBytesRead == 0 && term)
-      {
-        headerCompleted = true;
-        headerSize = 0;
+    {
+      u_long timeout = td->http->getTimeout ();
+      u_long ticks = getTicks () - procStartTime;
+      bool term;
+
+      nBytesRead = 0;
+
+      /* Do not try to read using a small buffer as this has some
+         bad influence on the performances.  */
+      if (td->auxiliaryBuffer->getRealLength () - headerOffset - 1 < 512)
         break;
-      }
-
-    headerOffset += nBytesRead;
-    if (headerOffset > td->buffersize - 5)
-      (td->auxiliaryBuffer->getBuffer ())[headerOffset] = '\0';
-
-    if (headerOffset == 0)
-      {
-        *ret = td->http->raiseHTTPError (500);
-        return 1;
-      }
-
-    for (u_long i = std::max (0UL, headerOffset - nBytesRead - 10);
-         i < headerOffset; i++)
-      {
-        char *buff = td->auxiliaryBuffer->getBuffer ();
-        if ((buff[i] == '\r') && (buff[i+1] == '\n')
-            && (buff[i+2] == '\r') && (buff[i+3] == '\n'))
-          {
-            /*
-             * The HTTP header ends with a \r\n\r\n sequence so
-             * determine where it ends and set the header size
-             * to i + 4.
-             */
-            headerSize = i + 4 ;
-            headerCompleted = true;
-            break;
-          }
-        else if ((buff[i] == '\n') && (buff[i+1] == '\n'))
-          {
-            /*
-             *\n\n case.
-             */
-            headerSize = i + 2;
-            headerCompleted = true;
-            break;
-          }
-      }
-  }
+
+      term = stdOutFile.pipeTerminated ();
+      if (!term
+          && stdOutFile.waitForData ((timeout - ticks) / 1000,
+                                     (timeout - ticks) % 1000) == 0)
+        {
+          td->connection->host->warningsLogWrite (_("Cgi: process %i timeout"),
+                                                  cgiProc.getPid ());
+          break;
+        }
+
+      if (stdOutFile.read (td->auxiliaryBuffer->getBuffer () + headerOffset,
+                           td->auxiliaryBuffer->getRealLength () - headerOffset - 1,
+                           &nBytesRead))
+        {
+          *ret = td->http->raiseHTTPError (500);
+          return 1;
+        }
+
+      if (nBytesRead == 0 && term)
+        {
+          headerCompleted = true;
+          headerSize = 0;
+          break;
+        }
+
+      headerOffset += nBytesRead;
+
+      if (headerOffset == 0)
+        {
+          *ret = td->http->raiseHTTPError (500);
+          return 1;
+        }
+
+      for (int i = std::max (0, (int) (headerOffset - nBytesRead - 10));
+           i < headerOffset; i++)
+        {
+          char *buff = td->auxiliaryBuffer->getBuffer ();
+          if ((buff[i] == '\r') && (buff[i+1] == '\n')
+              && (buff[i+2] == '\r') && (buff[i+3] == '\n'))
+            {
+              headerSize = i + 4;
+              headerCompleted = true;
+              break;
+            }
+          else if ((buff[i] == '\n') && (buff[i+1] == '\n'))
+            {
+              headerSize = i + 2;
+              headerCompleted = true;
+              break;
+            }
+        }
+    }
 
   /* Send the header.  */
   if (!nph)
@@ -511,30 +489,21 @@ int Cgi::sendHeader (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chai
               return 1;
             }
 
-          if (HttpHeaders::sendHeader (td->response, *chain.getStream (),
-                                       *td->buffer, td))
-            {
-              *ret = HttpDataHandler::RET_FAILURE;
-              return 1;
-            }
-
+          HttpHeaders::sendHeader (td->response, *chain.getStream (),
+                                   *td->buffer, td);
         }
     }
 
   if (headerOffset - headerSize)
     {
       /* Flush the buffer.  Data from the header parsing can be present.  */
-      if (HttpDataHandler::appendDataToHTTPChannel (td,
-                             td->auxiliaryBuffer->getBuffer () + headerSize,
+      HttpDataHandler::appendDataToHTTPChannel (td,
+                               td->auxiliaryBuffer->getBuffer () + headerSize,
                                                     headerOffset - headerSize,
                                                     &(td->outputData),
                                                     &chain,
                                                     td->appendOutputs,
-                                                    useChunks))
-        {
-          *ret = HttpDataHandler::RET_FAILURE;
-          return 1;
-        }
+                                                useChunks);
 
       td->sentData += headerOffset - headerSize;
     }

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

Summary of changes:
 myserver/src/http_handler/cgi/cgi.cpp |  275 +++++++++++++++------------------
 1 files changed, 122 insertions(+), 153 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Sun Apr 18 17:08:04 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O3bim-0007uM-KP
	for mharc-myserver-commit@gnu.org; Sun, 18 Apr 2010 17:08:04 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O3bik-0007uG-U3
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 17:08:02 -0400
Received: from [140.186.70.92] (port=38338 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O3bii-0007u8-W5
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 17:08:02 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3bih-00008m-Dt
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 17:08:00 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:40712
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3bih-00008b-Bv
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 17:07:59 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3big-0005qI-Nt
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 21:07:58 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O3big-0002Mq-I5
	for myserver-commit@gnu.org; Sun, 18 Apr 2010 21:07:58 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 476a013549ad805136ebfb3d94b6aa1ed3b37312
X-Git-Newrev: 65ae115899512a5ebde9d66bf7ebbdbcf062a956
Message-Id: <E1O3big-0002Mq-I5@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Sun, 18 Apr 2010 21:07:58 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-173-g65ae115
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, 18 Apr 2010 21:08:03 -0000

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

The branch, master has been updated
       via  65ae115899512a5ebde9d66bf7ebbdbcf062a956 (commit)
       via  687ff1cd87cf7d1897223a0905a5a127b4b09ca4 (commit)
      from  476a013549ad805136ebfb3d94b6aa1ed3b37312 (commit)

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

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


commit 65ae115899512a5ebde9d66bf7ebbdbcf062a956
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sun Apr 18 23:03:53 2010 +0200

    Reformat code

diff --git a/myserver/src/base/xml/xml_parser.cpp b/myserver/src/base/xml/xml_parser.cpp
index ba125c1..22cdc04 100644
--- a/myserver/src/base/xml/xml_parser.cpp
+++ b/myserver/src/base/xml/xml_parser.cpp
@@ -35,7 +35,7 @@
  */
 static int MemBufWriteCallback (void * context, const char * buffer, int len)
 {
-  ((MemBuf *)context)->addBuffer ((const void *)buffer, len);
+  ((MemBuf *)context)->addBuffer ((const void *) buffer, len);
   return len;
 }
 
@@ -50,7 +50,6 @@ static int MemBufCloseCallback (void *context)
   return 0;
 }
 
-
 /**
  * Initializes the libxml2 library
  * Calls xmlInitParser ()
@@ -92,34 +91,32 @@ int XmlParser::open (const char* filename, bool useXpath)
     close ();
 
   doc = xmlParseFile (filename);
-
   if (doc == NULL)
     return -1;
 
   cur = xmlDocGetRootElement (doc);
   if (!cur)
-  {
-    close ();
-    return -1;
-  }
+    {
+      close ();
+      return -1;
+    }
 
   mtime = FilesUtility::getLastModTime (filename);
-
   if (mtime == static_cast<time_t>(-1))
-  {
-    close ();
-    return -1;
-  }
-
-  if (useXpath)
-  {
-    xpathCtx = xmlXPathNewContext (doc);
-    if (xpathCtx == NULL)
     {
       close ();
       return -1;
     }
-  }
+
+  if (useXpath)
+    {
+      xpathCtx = xmlXPathNewContext (doc);
+      if (xpathCtx == NULL)
+        {
+          close ();
+          return -1;
+        }
+    }
   return 0;
 }
 
@@ -148,11 +145,9 @@ int XmlParser::openMemBuf (MemBuf & memory, bool useXpath)
   if (memory.getLength () == 0)
     return -1;
 
-  if (!doc)
-    {
-      doc = xmlParseMemory ((const char * )memory.getBuffer (),
-                            memory.getLength ());
-    }
+  if (! doc)
+    doc = xmlParseMemory ((const char * ) memory.getBuffer (),
+                          memory.getLength ());
   else
     close ();
 
@@ -160,7 +155,6 @@ int XmlParser::openMemBuf (MemBuf & memory, bool useXpath)
     return -1;
 
   cur = xmlDocGetRootElement (doc);
-
   if (!cur)
     {
       close ();
@@ -170,11 +164,11 @@ int XmlParser::openMemBuf (MemBuf & memory, bool useXpath)
   if (useXpath)
     {
       xpathCtx = xmlXPathNewContext (doc);
-    if (xpathCtx == NULL)
-      {
-      close ();
-      return -1;
-      }
+      if (xpathCtx == NULL)
+        {
+          close ();
+          return -1;
+        }
     }
   return 0;
 }
@@ -220,23 +214,23 @@ const char *XmlParser::getValue (const char* vName)
 {
   char *ret = NULL;
   xmlNodePtr lcur;
-  cur = xmlDocGetRootElement (doc);
 
+  cur = xmlDocGetRootElement (doc);
   if (!cur)
     return 0;
 
   lcur = cur->xmlChildrenNode;
 
   while (lcur)
-  {
-    if (!xmlStrcmp (lcur->name, (const xmlChar *)vName))
     {
-      lastNode = lcur;
-      return (char*)lcur->children->content;
-    }
+      if (!xmlStrcmp (lcur->name, (const xmlChar *) vName))
+        {
+          lastNode = lcur;
+          return (const char*) lcur->children->content;
+        }
 
-    lcur = lcur->next;
-  }
+      lcur = lcur->next;
+    }
 
   return ret;
 }
@@ -252,58 +246,53 @@ int XmlParser::setValue (const char* vName, const char *value)
 {
   xmlNodePtr lcur = cur->xmlChildrenNode;
   while (lcur)
-  {
-    if (!xmlStrcmp (lcur->name, (const xmlChar *)vName))
     {
-      lastNode = lcur;
+      if (!xmlStrcmp (lcur->name, (const xmlChar *)vName))
+        {
+          lastNode = lcur;
 
-      if (lcur->children->content)
-        xmlFree (lcur->children->content);
+          if (lcur->children->content)
+            xmlFree (lcur->children->content);
 
-      lcur->children->content = (xmlChar *)
-        checked::checkErrorNull (xmlStrdup ((const xmlChar *) value));
+          lcur->children->content = (xmlChar *)
+            checked::checkErrorNull (xmlStrdup ((const xmlChar *) value));
 
-      return 0;
-    }
+          return 0;
+        }
 
-    lcur = lcur->next;
-  }
+      lcur = lcur->next;
+    }
 
   return 1;
 }
 
-
 /**
  * Gets the attribute for the node field.
  * \param field Field
  * \param attr Attribute
  * \return
  */
-const char *XmlParser::getAttr (const char* field, const char *attr)
+const char *XmlParser::getAttr (const char *field, const char *attr)
 {
   xmlNodePtr lcur = cur->xmlChildrenNode;
 
   while (lcur)
-  {
-    if (!xmlStrcmp (lcur->name, (const xmlChar *)field))
     {
-      lastNode = lcur;
-      xmlAttr *attrs =  lcur->properties;
-
-      while (attrs)
-      {
-        if (!xmlStrcmp (attrs->name, (const xmlChar *)attr))
+      if (!xmlStrcmp (lcur->name, (const xmlChar *) field))
         {
-          return (char*)attrs->children->content;
+          lastNode = lcur;
+          xmlAttr *attrs =  lcur->properties;
+          while (attrs)
+            {
+              if (!xmlStrcmp (attrs->name, (const xmlChar *) attr))
+                return (const char *) attrs->children->content;
+
+              attrs = attrs->next;
+            }
         }
-
-        attrs = attrs->next;
-      }
+      lcur = lcur->next;
     }
 
-    lcur = lcur->next;
-  }
-
   return 0;
 }
 
@@ -313,22 +302,20 @@ const char *XmlParser::getAttr (const char* field, const char *attr)
  *\return NULL on errors.
  *\return The XmlXPathResult containing the result.
  */
-XmlXPathResult* XmlParser::evaluateXpath (const char* expr)
+XmlXPathResult* XmlParser::evaluateXpath (const char *expr)
 {
   xmlXPathObjectPtr xpathObj;
 
-  if (!useXpath)
+  if (! useXpath)
     return NULL;
 
-  xpathObj = xmlXPathEvalExpression ((const xmlChar*)expr, xpathCtx);
-
+  xpathObj = xmlXPathEvalExpression ((const xmlChar *) expr, xpathCtx);
   if (xpathObj == NULL)
     return NULL;
 
   return new XmlXPathResult (xpathObj);
 }
 
-
 /**
  * Frees the memory, use by the XmlParser class
  */
@@ -361,10 +348,9 @@ int XmlParser::close ()
  * \param nbytes Amount of bytes
  * \return Returns 0 on success, non 0 on failures
  */
-int XmlParser::save (const char *filename,int *nbytes)
+int XmlParser::save (const char *filename, int *nbytes)
 {
   int err = xmlSaveFile (filename,doc);
-
   if (nbytes)
     *nbytes = err;
 
@@ -380,13 +366,13 @@ int XmlParser::save (const char *filename,int *nbytes)
  * \param nbytes Amount of bytes
  * \return Returns 0 on success, non 0 on failures
  */
-int XmlParser::saveMemBuf (MemBuf & memory,int *nbytes)
+int XmlParser::saveMemBuf (MemBuf &memory, int *nbytes)
 {
   /*! Initialize the callback struct. */
   xmlOutputBufferPtr callback;
   callback = xmlOutputBufferCreateIO (MemBufWriteCallback,
                                       MemBufCloseCallback,
-                                      (void *)&memory,
+                                      (void *) &memory,
                                       NULL);
 
   /*! Clear the buffer */
@@ -394,7 +380,6 @@ int XmlParser::saveMemBuf (MemBuf & memory,int *nbytes)
 
   /*! Let libxml2 fill the MemBuf class with our interal callbacks. */
   int err = xmlSaveFileTo (callback, doc, NULL);
-
   if (nbytes)
     *nbytes = err;
 
@@ -411,8 +396,8 @@ void XmlParser::newfile (const char * root)
   if (doc != NULL)
     close ();
 
-  doc = xmlNewDoc ((const xmlChar*)"1.0");
-  cur = xmlNewDocNode (doc, NULL, (const xmlChar*)root, NULL);
+  doc = xmlNewDoc ((const xmlChar *) "1.0");
+  cur = xmlNewDocNode (doc, NULL, (const xmlChar *) root, NULL);
 
   xmlDocSetRootElement (doc, cur);
 
@@ -426,10 +411,10 @@ void XmlParser::newfile (const char * root)
  * \param name Child name
  * \param value Value of the child
  */
-void XmlParser::addChild (const char * name, const char * value)
+void XmlParser::addChild (const char *name, const char *value)
 {
-  lastNode = xmlNewTextChild (cur, NULL, (const xmlChar*)name,
-                              (const xmlChar*)value);
+  lastNode = xmlNewTextChild (cur, NULL, (const xmlChar *) name,
+                              (const xmlChar *) value);
 
   addLineFeed ();
 }
@@ -440,12 +425,12 @@ void XmlParser::addChild (const char * name, const char * value)
  * Only one level for now
  * \param name Name of the sub group
  */
-void XmlParser::addGroup (const char * name)
+void XmlParser::addGroup (const char *name)
 {
   if (prevCur == NULL)
     {
       prevCur = cur;
-      cur = xmlNewTextChild (cur, NULL, (const xmlChar*)name, NULL);
+      cur = xmlNewTextChild (cur, NULL, (const xmlChar *) name, NULL);
       lastNode = cur;
       addLineFeed ();
     }
@@ -459,12 +444,12 @@ void XmlParser::addGroup (const char * name)
 void XmlParser::endGroup ()
 {
   if (prevCur != NULL)
-  {
-    cur = prevCur;
-    prevCur = NULL;
-    addLineFeed ();
-    addLineFeed ();
-  }
+    {
+      cur = prevCur;
+      prevCur = NULL;
+      addLineFeed ();
+      addLineFeed ();
+    }
 }
 
 
@@ -473,12 +458,12 @@ void XmlParser::endGroup ()
  * \param name Name
  * \param value Value
  */
-void XmlParser::setAttr (const char * name, const char * value)
+void XmlParser::setAttr (const char *name, const char *value)
 {
   if (lastNode == NULL)
     return;
 
-  xmlSetProp (lastNode, (const xmlChar*)name, (const xmlChar*)value);
+  xmlSetProp (lastNode, (const xmlChar*) name, (const xmlChar*) value);
 }
 
 
@@ -488,9 +473,9 @@ void XmlParser::setAttr (const char * name, const char * value)
 void XmlParser::addLineFeed ()
 {
 #ifdef WIN32
-    xmlNodePtr endline = xmlNewDocText (doc, (const xmlChar *)"\r\n");
+  xmlNodePtr endline = xmlNewDocText (doc, (const xmlChar *) "\r\n");
 #else
-    xmlNodePtr endline = xmlNewDocText (doc, (const xmlChar *)"\n");
+  xmlNodePtr endline = xmlNewDocText (doc, (const xmlChar *) "\n");
 #endif
 
   xmlAddChild (cur, endline);



commit 687ff1cd87cf7d1897223a0905a5a127b4b09ca4
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sun Apr 18 22:33:29 2010 +0200

    Fix a segfault when the new value is longer than the previous one

diff --git a/myserver/src/base/xml/xml_parser.cpp b/myserver/src/base/xml/xml_parser.cpp
index 13b0b8f..ba125c1 100644
--- a/myserver/src/base/xml/xml_parser.cpp
+++ b/myserver/src/base/xml/xml_parser.cpp
@@ -21,6 +21,7 @@
 #include <include/base/xml/xml_parser.h>
 #include <include/base/utility.h>
 #include <include/base/file/files_utility.h>
+#include <include/base/exceptions/checked.h>
 
 #include <string.h>
 
@@ -257,7 +258,10 @@ int XmlParser::setValue (const char* vName, const char *value)
       lastNode = lcur;
 
       if (lcur->children->content)
-        strcpy ((char*)lcur->children->content, value);
+        xmlFree (lcur->children->content);
+
+      lcur->children->content = (xmlChar *)
+        checked::checkErrorNull (xmlStrdup ((const xmlChar *) value));
 
       return 0;
     }

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

Summary of changes:
 myserver/src/base/xml/xml_parser.cpp |  169 ++++++++++++++++------------------
 1 files changed, 79 insertions(+), 90 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Mon Apr 19 04:57:08 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O3mmy-0000Gl-My
	for mharc-myserver-commit@gnu.org; Mon, 19 Apr 2010 04:57:08 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O3mmv-0000FS-Qa
	for myserver-commit@gnu.org; Mon, 19 Apr 2010 04:57:05 -0400
Received: from [140.186.70.92] (port=46852 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O3mmu-0000ES-3F
	for myserver-commit@gnu.org; Mon, 19 Apr 2010 04:57:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <e.dolstra@tudelft.nl>) id 1O3mmq-0005E4-07
	for myserver-commit@gnu.org; Mon, 19 Apr 2010 04:57:03 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:57820)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <e.dolstra@tudelft.nl>) id 1O3mmp-0005DS-Ni
	for myserver-commit@gnu.org; Mon, 19 Apr 2010 04:56:59 -0400
Received: from hydra (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.12.11/8.12.8) with SMTP id
	o3J9utr0011457
	for <myserver-commit@gnu.org>; Mon, 19 Apr 2010 11:56:55 +0200
Message-Id: <201004190956.o3J9utr0011457@proliant.st.ewi.tudelft.nl>
Received: by hydra (sSMTP sendmail emulation); Mon, 19 Apr 2010 10:56:55 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
Date: Mon, 19 Apr 2010 10:56:55 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
Subject: [myserver-commit] Hydra job gnu:myserver-master:tarball build
	353080 FAILED
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, 19 Apr 2010 08:57:06 -0000

Hi,

This is to let you know that Hydra build 353080 of job gnu:myserver-master:tarball has changed from SUCCEEDED to FAILED.

Complete build information can be found on this page: http://hydra.nixos.org/build/353080

The last 50 lines of the build log are shown at the bottom of this email.

A summary of the build information follows:

Build ID:              | 353080
Nix name:              | myserver-tarball-0pre65ae115899512a5ebde9d66bf7ebbdbcf062a956
Short description:     | Build of a source distribution from a checkout
Maintainer(s):         | myserver-commit@gnu.org
System:                | x86_64-linux
Derivation store path: | /nix/store/y3n5nzzg16l2rlxh44qy5m4003m1ix4z-myserver-tarball-0pre65ae115899512a5ebde9d66bf7ebbdbcf062a956.drv
Output store path:     | /nix/store/dd3y7w3j3bplipkfgmqc1pad93x45i9w-myserver-tarball-0pre65ae115899512a5ebde9d66bf7ebbdbcf062a956
Time added:            | 2010-04-19 10:56:55
Build started:         | 2010-04-19 10:52:08
Build finished:        | 2010-04-19 10:56:55
Duration:              | 287s

The build inputs were:

Name        | Type | Value
------------+------+---------------------------------------------------------------------------
myserverSrc | git  | git://git.sv.gnu.org/myserver.git:65ae115899512a5ebde9d66bf7ebbdbcf062a956
hydraConfig | svn  | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:21117
gnulibSrc   | git  | git://git.sv.gnu.org/gnulib.git:e768d427cc2d135f6123e0408cd61e52345bf922
nixpkgs     | svn  | https://svn.nixos.org/repos/nix/nixpkgs/trunk:21150

Regards,

The Hydra build daemon.

---
  CXX    test_security_token.o
[3s[ag++ -DHAVE_CONFIG_H -I. -I..   -I/nix/store/3l4iggpn70brxyk4pkfpfgcsavlxwjl5-libxml2-2.7.6/include/libxml2 "-I../lib" -fPIC -DPIC  -c -o test_security_token.o test_security_token.cpp[b
[q[pbuilding test_semaphore.o
  CXX    test_semaphore.o
[3s[ag++ -DHAVE_CONFIG_H -I. -I..   -I/nix/store/3l4iggpn70brxyk4pkfpfgcsavlxwjl5-libxml2-2.7.6/include/libxml2 "-I../lib" -fPIC -DPIC  -c -o test_semaphore.o test_semaphore.cpp[b
[q[pbuilding test_sha1.o
  CXX    test_sha1.o
[3s[ag++ -DHAVE_CONFIG_H -I. -I..   -I/nix/store/3l4iggpn70brxyk4pkfpfgcsavlxwjl5-libxml2-2.7.6/include/libxml2 "-I../lib" -fPIC -DPIC  -c -o test_sha1.o test_sha1.cpp[b
[q[pbuilding test_slab.o
  CXX    test_slab.o
[3s[ag++ -DHAVE_CONFIG_H -I. -I..   -I/nix/store/3l4iggpn70brxyk4pkfpfgcsavlxwjl5-libxml2-2.7.6/include/libxml2 "-I../lib" -fPIC -DPIC  -c -o test_slab.o test_slab.cpp[b
[q[pbuilding test_socket.o
  CXX    test_socket.o
[3s[ag++ -DHAVE_CONFIG_H -I. -I..   -I/nix/store/3l4iggpn70brxyk4pkfpfgcsavlxwjl5-libxml2-2.7.6/include/libxml2 "-I../lib" -fPIC -DPIC  -c -o test_socket.o test_socket.cpp[b
[q[pbuilding test_socket_pair.o
  CXX    test_socket_pair.o
[3s[ag++ -DHAVE_CONFIG_H -I. -I..   -I/nix/store/3l4iggpn70brxyk4pkfpfgcsavlxwjl5-libxml2-2.7.6/include/libxml2 "-I../lib" -fPIC -DPIC  -c -o test_socket_pair.o test_socket_pair.cpp[b
[q[pbuilding test_socket_stream_creator.o
  CXX    test_socket_stream_creator.o
[3s[ag++ -DHAVE_CONFIG_H -I. -I..   -I/nix/store/3l4iggpn70brxyk4pkfpfgcsavlxwjl5-libxml2-2.7.6/include/libxml2 "-I../lib" -fPIC -DPIC  -c -o test_socket_stream_creator.o test_socket_stream_creator.cpp[b
[q[pbuilding test_ssl_socket.o
  CXX    test_ssl_socket.o
[3s[ag++ -DHAVE_CONFIG_H -I. -I..   -I/nix/store/3l4iggpn70brxyk4pkfpfgcsavlxwjl5-libxml2-2.7.6/include/libxml2 "-I../lib" -fPIC -DPIC  -c -o test_ssl_socket.o test_ssl_socket.cpp[b
[q[pbuilding test_thread.o
  CXX    test_thread.o
[3s[ag++ -DHAVE_CONFIG_H -I. -I..   -I/nix/store/3l4iggpn70brxyk4pkfpfgcsavlxwjl5-libxml2-2.7.6/include/libxml2 "-I../lib" -fPIC -DPIC  -c -o test_thread.o test_thread.cpp[b
[q[pbuilding test_unix_socket.o
  CXX    test_unix_socket.o
[3s[ag++ -DHAVE_CONFIG_H -I. -I..   -I/nix/store/3l4iggpn70brxyk4pkfpfgcsavlxwjl5-libxml2-2.7.6/include/libxml2 "-I../lib" -fPIC -DPIC  -c -o test_unix_socket.o test_unix_socket.cpp[b
[q[pbuilding test_url.o
  CXX    test_url.o
[3s[ag++ -DHAVE_CONFIG_H -I. -I..   -I/nix/store/3l4iggpn70brxyk4pkfpfgcsavlxwjl5-libxml2-2.7.6/include/libxml2 "-I../lib" -fPIC -DPIC  -c -o test_url.o test_url.cpp[b
[q[pbuilding test_utility.o
  CXX    test_utility.o
[3s[ag++ -DHAVE_CONFIG_H -I. -I..   -I/nix/store/3l4iggpn70brxyk4pkfpfgcsavlxwjl5-libxml2-2.7.6/include/libxml2 "-I../lib" -fPIC -DPIC  -c -o test_utility.o test_utility.cpp[b
[q[pbuilding test_validator.o
  CXX    test_validator.o
[3s[ag++ -DHAVE_CONFIG_H -I. -I..   -I/nix/store/3l4iggpn70brxyk4pkfpfgcsavlxwjl5-libxml2-2.7.6/include/libxml2 "-I../lib" -fPIC -DPIC  -c -o test_validator.o test_validator.cpp[b
test_validator.cpp: In member function 'void TestValidator::testGetPermissionMaskImpl()':
test_validator.cpp:67: error: no matching function for call to 'assertEquals(int, NULL, CppUnit::SourceLine, const char [1])'
make[2]: *** [test_validator.o] Error 1
make[2]: Leaving directory `/tmp/nix-build-y3n5nzzg16l2rlxh44qy5m4003m1ix4z-myserver-tarball-0pre65ae115899512a5ebde9d66bf7ebbdbcf062a956.drv-0/git-export/myserver/tests'
[q[qmake[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/nix-build-y3n5nzzg16l2rlxh44qy5m4003m1ix4z-myserver-tarball-0pre65ae115899512a5ebde9d66bf7ebbdbcf062a956.drv-0/git-export/myserver'
[q[qmake: *** [all] Error 2
[q[q[qbuild time elapsed:  0m0.029s 0m0.012s 2m58.775s 0m57.581s
builder for `/nix/store/y3n5nzzg16l2rlxh44qy5m4003m1ix4z-myserver-tarball-0pre65ae115899512a5ebde9d66bf7ebbdbcf062a956.drv' failed with exit code 2
error: build of `/nix/store/y3n5nzzg16l2rlxh44qy5m4003m1ix4z-myserver-tarball-0pre65ae115899512a5ebde9d66bf7ebbdbcf062a956.drv' failed
Shared connection to kyle closed.

build of `/nix/store/y3n5nzzg16l2rlxh44qy5m4003m1ix4z-myserver-tarball-0pre65ae115899512a5ebde9d66bf7ebbdbcf062a956.drv' on `buildfarm@kyle' failed with exit code 256



From MAILER-DAEMON Mon Apr 19 10:14:41 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O3rkH-0007QV-4q
	for mharc-myserver-commit@gnu.org; Mon, 19 Apr 2010 10:14:41 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O3rkF-0007Od-L0
	for myserver-commit@gnu.org; Mon, 19 Apr 2010 10:14:39 -0400
Received: from [140.186.70.92] (port=37318 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O3rk8-0007HX-Jg
	for myserver-commit@gnu.org; Mon, 19 Apr 2010 10:14:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3rk3-00038m-A7
	for myserver-commit@gnu.org; Mon, 19 Apr 2010 10:14:32 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:35774
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3rk3-00038h-2O
	for myserver-commit@gnu.org; Mon, 19 Apr 2010 10:14:27 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3rk3-0001Gz-1h
	for myserver-commit@gnu.org; Mon, 19 Apr 2010 14:14:27 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O3rjz-0007f4-R2
	for myserver-commit@gnu.org; Mon, 19 Apr 2010 14:14:27 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 65ae115899512a5ebde9d66bf7ebbdbcf062a956
X-Git-Newrev: 6f83a5af73d6a3d9a9abc31db0541983a2c65715
Message-Id: <E1O3rjz-0007f4-R2@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Mon, 19 Apr 2010 14:14:25 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-182-g6f83a5a
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, 19 Apr 2010 14:14:39 -0000

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

The branch, master has been updated
       via  6f83a5af73d6a3d9a9abc31db0541983a2c65715 (commit)
       via  c3612bc638e625e0f14705e460a9f2ceb0767281 (commit)
       via  67d4f13e33f8f2f51a3ab5586043b48d807eb8a6 (commit)
       via  0bafdf18183e11b25bd1309711496f7f25e4d82b (commit)
       via  c37c1d260c78dede82cc5641e601cb082a39254b (commit)
       via  ade9708329454506b9310125e543fb12b1157e8a (commit)
       via  c96eceb92e62fa207d32e30d4c5295457b45924a (commit)
       via  47a5deaee3a4d6b07352b047aaed6881630e38bd (commit)
       via  de143fa5c2c5510fe4c707f310163a88d1ee758b (commit)
      from  65ae115899512a5ebde9d66bf7ebbdbcf062a956 (commit)

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

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


commit 6f83a5af73d6a3d9a9abc31db0541983a2c65715
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 19 16:06:14 2010 +0200

    Pass --keyword=_E to `xgettext'

diff --git a/myserver/po/Makevars b/myserver/po/Makevars
index 60a44cc..48a6525 100644
--- a/myserver/po/Makevars
+++ b/myserver/po/Makevars
@@ -10,7 +10,7 @@ subdir = po
 top_builddir = ..
 
 # These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ \
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --keyword=_E \
           \
  --flag=_:1:pass-c-format\
  --flag=N_:1:pass-c-format\
diff --git a/myserver/po/Makevars.template b/myserver/po/Makevars.template
index 32692ab..dd1a896 100644
--- a/myserver/po/Makevars.template
+++ b/myserver/po/Makevars.template
@@ -8,7 +8,7 @@ subdir = po
 top_builddir = ..
 
 # These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --keyword=_E
 
 # This is the copyright holder that gets inserted into the header of the
 # $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding



commit c3612bc638e625e0f14705e460a9f2ceb0767281
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 19 15:06:48 2010 +0200

    Adjust timeout multiplier

diff --git a/myserver/src/connections_scheduler/connections_scheduler.cpp b/myserver/src/connections_scheduler/connections_scheduler.cpp
index 0fbb115..5bf6996 100644
--- a/myserver/src/connections_scheduler/connections_scheduler.cpp
+++ b/myserver/src/connections_scheduler/connections_scheduler.cpp
@@ -101,8 +101,7 @@ void ConnectionsScheduler::newData (short event, SocketHandle handle)
         return;
 
       server->notifyDeleteConnection (connection);
-
-      removeConnection (connection);
+      server->deleteConnection (connection);
     }
 }
 
@@ -468,7 +467,7 @@ void ConnectionsScheduler::addWaitingConnectionImpl (ConnectionPtr c, int lock)
 #endif
 
   if (server)
-    tv.tv_sec = server->getTimeout () / 1000;
+    tv.tv_sec = server->getTimeout () / 1000000;
   else
     tv.tv_sec = 30;
 
diff --git a/myserver/src/server/server.cpp b/myserver/src/server/server.cpp
index 528bf0f..2cb578b 100644
--- a/myserver/src/server/server.cpp
+++ b/myserver/src/server/server.cpp
@@ -870,7 +870,7 @@ int Server::initialize ()
   if (data)
     buffersize = (atol (data) > 81920) ?  atol (data) :  81920 ;
 
-  data = getData ("server.connection_timeout");
+  data = getData ("connection.timeout");
   if (data)
     connectionTimeout = MYSERVER_SEC ((u_long) atol (data));
 



commit 67d4f13e33f8f2f51a3ab5586043b48d807eb8a6
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 19 14:28:10 2010 +0200

    Use chunked transfer encoding only on HTTP/1.1

diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index e3600e9..996326b 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -398,7 +398,7 @@ int Http::getFilePermissions (string& filename, string& directory, string& file,
     }
   catch (FileNotFoundException & e)
     {
-      return raiseHTTPError (404);
+      return 404;
     }
   catch (exception & e)
     {
@@ -915,16 +915,6 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
 
       td->response.ver.assign (td->request.ver.c_str ());
 
-      /* Do not use Keep-Alive with HTTP version older than 1.1.  */
-      if (td->request.ver.compare ("HTTP/1.1"))
-        {
-          HttpRequestHeader::Entry *connection =
-                  td->request.other.get ("connection");
-
-          if (connection && connection->value->length ())
-            connection->value->assign ("close");
-        }
-
       /*
        * For methods that accept data after the HTTP header set the correct
        * pointer and create a file containing the informations after the header.
@@ -981,7 +971,8 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
           HttpRequestHeader::Entry *connection
             = td->request.other.get ("connection");
           if (connection)
-            keepalive = !stringcmpi (connection->value->c_str (), "keep-alive");
+            keepalive = !stringcmpi (connection->value->c_str (), "keep-alive")
+              && !td->request.ver.compare ("HTTP/1.1");
 
           if (! td->request.ver.compare ("HTTP/1.1")
               && (host == NULL || host->value->length () == 0))
@@ -1393,41 +1384,37 @@ int Http::raiseHTTPError (int ID)
 
       HttpErrors::getErrorMessage (ID, errorMessage);
 
-      /* Send only the header (and the body if specified).  */
-      {
-        const char* value
-          = td->securityToken.getData ("http.error_body", MYSERVER_VHOST_CONF
-                                       | MYSERVER_SERVER_CONF, NULL);
+      const char* value
+        = td->securityToken.getData ("http.error_body", MYSERVER_VHOST_CONF
+                                     | MYSERVER_SERVER_CONF, NULL);
 
-        if (value && ! strcasecmp (value, "NO"))
-          {
-            errorBodyLength = 0;
-            td->response.contentLength.assign ("0");
-          }
-        else
-          {
-            ostringstream size;
-            errorBodyMessage << ID << " - " << errorMessage << "\r\n";
-            errorBodyLength = errorBodyMessage.str ().length ();
-            size << errorBodyLength;
-            td->response.contentLength.assign (size.str ());
-          }
-      }
+      if (value && ! strcasecmp (value, "NO"))
+        {
+          errorBodyLength = 0;
+          td->response.contentLength.assign ("0");
+        }
+      else
+        {
+          ostringstream size;
+          errorBodyMessage << ID << " - " << errorMessage << "\r\n";
+          errorBodyLength = errorBodyMessage.str ().length ();
+          size << errorBodyLength;
+          td->response.contentLength.assign (size.str ());
+        }
 
-      if (HttpHeaders::sendHeader (td->response, *td->connection->socket,
-                                   *td->buffer, td))
-        return 1;
+      HttpHeaders::sendHeader (td->response, *td->connection->socket,
+                               *td->buffer, td);
 
       if (errorBodyLength)
           td->connection->socket->send (errorBodyMessage.str ().c_str (),
                                         errorBodyLength, 0);
-      return HttpDataHandler::RET_OK;
     }
   catch (exception &e)
     {
       td->connection->host->warningsLogWrite (_E ("HTTP: internal error"), &e);
       return HttpDataHandler::RET_FAILURE;
     }
+  return HttpDataHandler::RET_OK;
 }
 
 /*!
diff --git a/myserver/src/protocol/http/http_data_handler.cpp b/myserver/src/protocol/http/http_data_handler.cpp
index 216cb05..b4f8bd5 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -200,7 +200,8 @@ HttpDataHandler::checkDataChunks (HttpThreadContext* td, bool* keepalive,
   *keepalive = td->request.isKeepAlive ();
   *useChunks = false;
 
-  /* Do not use chunked transfer with old HTTP/1.0 clients.  */
+  *keepalive &= !td->request.ver.compare ("HTTP/1.1");
+
   if (*keepalive)
     {
       HttpResponseHeader::Entry *e;



commit 0bafdf18183e11b25bd1309711496f7f25e4d82b
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 19 13:06:55 2010 +0200

    Map Http handlers status codes to protocol handler codes correctly

diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index 108659a..e3600e9 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -829,6 +829,7 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
   /* Dimension of the POST data. */
   int contentLength = -1;
   DynamicHttpCommand *dynamicCommand;
+  bool keepalive = false;
 
   try
     {
@@ -891,7 +892,7 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
         return ClientsThread::INCOMPLETE_REQUEST;
 
       if (a->protocolBuffer)
-        ((HttpUserData*) a->protocolBuffer)->digestChecked = 0;
+        ((HttpUserData *) a->protocolBuffer)->digestChecked = 0;
 
       /* If the validRequest cointains an error code send it to the user.  */
       if (validRequest != 200)
@@ -947,10 +948,8 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
             {
               const char* msg = "HTTP/1.1 100 Continue\r\n\r\n";
               if (a->socket->bytesToRead () == 0)
-                {
-                  if (a->socket->send (msg, (int) strlen (msg), 0) == -1)
-                    return ClientsThread::DELETE_CONNECTION;
-                }
+                a->socket->send (msg, (int) strlen (msg), 0);
+
               return ClientsThread::INCOMPLETE_REQUEST;
             }
 
@@ -979,13 +978,20 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
            * request does not include a Host request-header.
            */
           HttpRequestHeader::Entry *host = td->request.other.get ("host");
+          HttpRequestHeader::Entry *connection
+            = td->request.other.get ("connection");
+          if (connection)
+            keepalive = !stringcmpi (connection->value->c_str (), "keep-alive");
 
           if (! td->request.ver.compare ("HTTP/1.1")
               && (host == NULL || host->value->length () == 0))
             {
               int ret = raiseHTTPError (400);
               logHTTPaccess ();
-              return ret;
+              if (ret == HttpDataHandler::RET_OK && keepalive)
+                return ClientsThread::KEEP_CONNECTION;
+              else
+                return ClientsThread::DELETE_CONNECTION;
             }
 
           /* Find the virtual host to check both host name and IP value.  */
@@ -1000,7 +1006,10 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
             {
               int ret = raiseHTTPError (400);
               logHTTPaccess ();
-              return ret;
+              if (ret == HttpDataHandler::RET_OK && keepalive)
+                return ClientsThread::KEEP_CONNECTION;
+              else
+                return ClientsThread::DELETE_CONNECTION;
             }
 
           if (td->request.uri.length () > 2 && td->request.uri[1] == '~')
@@ -1092,12 +1101,7 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
                                                                       msg, td);
                     if (handlerRet == ClientsThread::DELETE_CONNECTION)
                       {
-                        ret = ClientsThread::DELETE_CONNECTION;
-                        break;
-                      }
-                    else if (handlerRet == ClientsThread::KEEP_CONNECTION)
-                      {
-                        ret = ClientsThread::KEEP_CONNECTION;
+                        ret = HttpDataHandler::RET_FAILURE;
                         break;
                       }
                   }
@@ -1161,12 +1165,6 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
         {
         }
 
-      bool keepalive = false;
-      HttpRequestHeader::Entry *connection = td->request.other.get
-                                                       ("connection");
-      if (connection)
-        keepalive = !stringcmpi (connection->value->c_str (), "keep-alive");
-
       logHTTPaccess ();
 
       /* Map the HttpDataHandler return value to codes understood by



commit c37c1d260c78dede82cc5641e601cb082a39254b
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 19 12:53:42 2010 +0200

    Cleanup some errors check code

diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index 32321ba..108659a 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -1308,11 +1308,12 @@ int Http::raiseHTTPError (int ID)
       int errorBodyLength = 0;
       int useMessagesFiles = 1;
       HttpRequestHeader::Entry *host = td->request.other.get ("host");
-      HttpRequestHeader::Entry *connection = td->request.other.get ("connection");
-      const char *useMessagesVal = td->securityToken.getData ("http.use_error_file",
-                                                              MYSERVER_VHOST_CONF
-                                                              | MYSERVER_SERVER_CONF,
-                                                              NULL);
+      HttpRequestHeader::Entry *connection
+        = td->request.other.get ("connection");
+      const char *useMessagesVal =
+        td->securityToken.getData ("http.use_error_file", MYSERVER_VHOST_CONF
+                                   | MYSERVER_SERVER_CONF,
+                                   NULL);
       if (useMessagesVal)
         {
           if (! strcasecmp (useMessagesVal, "YES"))
@@ -1396,9 +1397,9 @@ int Http::raiseHTTPError (int ID)
 
       /* Send only the header (and the body if specified).  */
       {
-        const char* value = td->securityToken.getData ("http.error_body",
-                                                             MYSERVER_VHOST_CONF |
-                                                             MYSERVER_SERVER_CONF, NULL);
+        const char* value
+          = td->securityToken.getData ("http.error_body", MYSERVER_VHOST_CONF
+                                       | MYSERVER_SERVER_CONF, NULL);
 
         if (value && ! strcasecmp (value, "NO"))
           {
@@ -1419,19 +1420,14 @@ int Http::raiseHTTPError (int ID)
                                    *td->buffer, td))
         return 1;
 
-      if (errorBodyLength
-          && (td->connection->socket->send (errorBodyMessage.str ().c_str (),
-                                            errorBodyLength, 0) < 0))
-        {
-          td->connection->host->warningsLogWrite (_("HTTP: socket error"));
-          return HttpDataHandler::RET_FAILURE;
-        }
-
+      if (errorBodyLength)
+          td->connection->socket->send (errorBodyMessage.str ().c_str (),
+                                        errorBodyLength, 0);
       return HttpDataHandler::RET_OK;
     }
-  catch (...)
+  catch (exception &e)
     {
-      td->connection->host->warningsLogWrite (_("HTTP: internal error"));
+      td->connection->host->warningsLogWrite (_E ("HTTP: internal error"), &e);
       return HttpDataHandler::RET_FAILURE;
     }
 }
@@ -1482,10 +1478,9 @@ Internal Server Error\n\
   *td->auxiliaryBuffer << time;
   *td->auxiliaryBuffer << "\r\n\r\n";
 
-  if (td->connection->socket->send (td->auxiliaryBuffer->getBuffer (),
-                                    (u_long) td->auxiliaryBuffer->getLength (),
-                                    0) < 0)
-    return HttpDataHandler::RET_FAILURE;
+  td->connection->socket->send (td->auxiliaryBuffer->getBuffer (),
+                                (u_long) td->auxiliaryBuffer->getLength (),
+                                0);
 
   if (!td->onlyHeader)
     td->connection->socket->send (hardHTML, (u_long) strlen (hardHTML), 0);
@@ -1666,13 +1661,8 @@ int Http::sendHTTPRedirect (const char *newURL)
   getRFC822GMTTime (time, 32);
   *td->auxiliaryBuffer << time
           << "\r\n\r\n";
-  if (td->connection->socket->send (td->auxiliaryBuffer->getBuffer (),
-                                    (int) td->auxiliaryBuffer->getLength (), 0) < 0)
-    {
-      td->connection->host->warningsLogWrite (_("HTTP: socket error"));
-      return HttpDataHandler::RET_FAILURE;
-    }
-
+  td->connection->socket->send (td->auxiliaryBuffer->getBuffer (),
+                                (int) td->auxiliaryBuffer->getLength (), 0);
   return HttpDataHandler::RET_OK;
 }
 
@@ -1698,12 +1688,8 @@ int Http::sendHTTPNonModified ()
 
   *td->auxiliaryBuffer << "Date: " << time << "\r\n\r\n";
 
-  if (td->connection->socket->send (td->auxiliaryBuffer->getBuffer (),
-                                    (int) td->auxiliaryBuffer->getLength (), 0) < 0)
-    {
-      td->connection->host->warningsLogWrite (_("HTTP: socket error"));
-      return HttpDataHandler::RET_FAILURE;
-    }
+  td->connection->socket->send (td->auxiliaryBuffer->getBuffer (),
+                                (int) td->auxiliaryBuffer->getLength (), 0);
 
   return HttpDataHandler::RET_OK;
 }



commit ade9708329454506b9310125e543fb12b1157e8a
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 19 12:52:40 2010 +0200

    Add the Status header only if it has a value

diff --git a/myserver/src/protocol/http/http_headers.cpp b/myserver/src/protocol/http/http_headers.cpp
index 1bb07e2..4145db7 100644
--- a/myserver/src/protocol/http/http_headers.cpp
+++ b/myserver/src/protocol/http/http_headers.cpp
@@ -55,15 +55,15 @@ u_long HttpHeaders::buildHTTPResponseHeader (char *str,
   char *pos = str;
   const int MAX = MYSERVER_KB (8);
   if (response->httpStatus != 200)
-  {
-    if (response->errorType.length () == 0)
     {
-      HttpErrors::getErrorMessage (response->httpStatus, response->errorType);
+      if (response->errorType.length () == 0)
+        HttpErrors::getErrorMessage (response->httpStatus, response->errorType);
+
+      pos += sprintf (pos, "%s %i %s\r\n", response->ver.c_str (),
+                      response->httpStatus, response->errorType.c_str ());
+      if (response->errorType.c_str ()[0])
+        pos += sprintf (pos, "Status: %s\r\n", response->errorType.c_str ());
     }
-    pos += sprintf (str, "%s %i %s\r\nStatus: %s\r\n", response->ver.c_str (),
-                    response->httpStatus, response->errorType.c_str (),
-                    response->errorType.c_str () );
-  }
   else
     pos += sprintf (str,"%s 200 OK\r\n",response->ver.c_str ());
 



commit c96eceb92e62fa207d32e30d4c5295457b45924a
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 19 12:36:10 2010 +0200

    Do not force chunked transfer encoding when a range is specified

diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 5dc253a..310b74d 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -309,28 +309,13 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
           }
       }
 
-    bytesToSend = filesize;
     if (lastByte == 0)
-      lastByte = bytesToSend;
+      lastByte = filesize;
     else
-      {
-        /*
-         * If the client use ranges set the right value
-         * for the last byte number.
-         */
-        lastByte = std::min (lastByte + 1, bytesToSend);
-      }
+      lastByte = std::min (lastByte + 1, filesize);
 
-    /*
-     * bytesToSend is the interval between the first and the last byte.
-     */
     bytesToSend = lastByte - firstByte;
 
-    /*
-     * If fail to set the file pointer returns an internal server error.
-     */
-    file->seek (firstByte);
-
     keepalive = td->request.isKeepAlive ();
 
     td->buffer->setLength (0);
@@ -341,8 +326,8 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
         HttpResponseHeader::Entry *e;
         ostringstream buffer;
         td->response.httpStatus = 206;
-        buffer << "bytes "<< (u_long)firstByte << "-"
-               << (u_long) (lastByte - 1) << "/" << (u_long)filesize;
+        buffer << "bytes "<< (u_long) firstByte << "-"
+               << (u_long) (lastByte - 1) << "/" << (u_long) filesize;
 
         e = td->response.other.get ("content-range");
         if (e)
@@ -354,8 +339,6 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
             e->value->assign (buffer.str ());
             td->response.other.put (*(e->name), e);
           }
-
-        useChunks = true;
       }
     chain.setStream (&memStream);
     if (td->mime)
@@ -372,7 +355,6 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
       }
 
     useModifiers = chain.hasModifiersFilters ();
-
     if (!useModifiers)
       {
         ostringstream buffer;
@@ -463,6 +445,8 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
         return HttpDataHandler::RET_OK;
       }
 
+    file->seek (firstByte);
+
     if (td->appendOutputs)
       chain.setStream (&(td->outputData));
     else
@@ -545,10 +529,6 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
                                                        nbr, &(td->outputData),
                                                        &chain, td->appendOutputs,
                                                           useChunks);
-
-                HttpDataHandler::appendDataToHTTPChannel (td, 0, 0,
-                                                     &(td->outputData), &chain,
-                                                 td->appendOutputs, useChunks);
                 break;
               }
           }



commit 47a5deaee3a4d6b07352b047aaed6881630e38bd
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 19 11:45:36 2010 +0200

    HTTP/1.0 does not require host to be specified

diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index 3c8776f..32321ba 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -980,61 +980,27 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
            */
           HttpRequestHeader::Entry *host = td->request.other.get ("host");
 
-          if (host == NULL || (!td->request.ver.compare ("HTTP/1.1")
-                               && host->value->length () == 0))
+          if (! td->request.ver.compare ("HTTP/1.1")
+              && (host == NULL || host->value->length () == 0))
             {
-              raiseHTTPError (400);
-              /* If the inputData file was not closed close it.  */
-              if (td->inputData.getHandle ())
-                {
-                  td->inputData.close ();
-                  FilesUtility::deleteFile (td->inputDataPath);
-                }
-
-              /* If the outputData file was not closed close it.  */
-              if (td->outputData.getHandle ())
-                {
-                  td->outputData.close ();
-                  FilesUtility::deleteFile (td->outputDataPath);
-                }
+              int ret = raiseHTTPError (400);
               logHTTPaccess ();
-              return ClientsThread::DELETE_CONNECTION;
+              return ret;
             }
-          else
-            {
-              /* Find the virtual host to check both host name and IP value.  */
-              Vhost* newHost = Server::getInstance ()->getVhosts ()->getVHost (host ?
-                                                           host->value->c_str () : "",
-                                            a->getLocalIpAddr (), a->getLocalPort ());
-              if (a->host)
-                a->host->removeRef ();
-
-              a->host = newHost;
-              if (a->host == NULL)
-                {
-                  Server::getInstance ()->log (MYSERVER_LOG_MSG_ERROR,
-                                    _("Invalid virtual host requested from %s"),
-                                               a->getIpAddr ());
 
-                  raiseHTTPError (400);
-                  /*
-                   *If the inputData file was not closed close it.
-                   */
-                  if (td->inputData.getHandle ())
-                    {
-                      td->inputData.close ();
-                      FilesUtility::deleteFile (td->inputDataPath);
-                    }
+          /* Find the virtual host to check both host name and IP value.  */
+          Vhost* newHost = Server::getInstance ()->getVhosts ()->getVHost (host ?
+                                                       host->value->c_str () : "",
+                                         a->getLocalIpAddr (), a->getLocalPort ());
+          if (a->host)
+            a->host->removeRef ();
 
-                   /* If the outputData file was not closed close it.  */
-                  if (td->outputData.getHandle ())
-                    {
-                      td->outputData.close ();
-                      FilesUtility::deleteFile (td->outputDataPath);
-                    }
-                  logHTTPaccess ();
-                  return ClientsThread::DELETE_CONNECTION;
-                }
+          a->host = newHost;
+          if (a->host == NULL)
+            {
+              int ret = raiseHTTPError (400);
+              logHTTPaccess ();
+              return ret;
             }
 
           if (td->request.uri.length () > 2 && td->request.uri[1] == '~')



commit de143fa5c2c5510fe4c707f310163a88d1ee758b
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 19 11:45:03 2010 +0200

    Handle seek errors

diff --git a/myserver/src/base/file/file.cpp b/myserver/src/base/file/file.cpp
index bc67e92..c16cb66 100644
--- a/myserver/src/base/file/file.cpp
+++ b/myserver/src/base/file/file.cpp
@@ -300,7 +300,7 @@ u_long File::getFileSize ()
 int File::seek (u_long initialByte)
 {
   u_long ret;
-  ret = lseek (handle, initialByte, SEEK_SET);
+  ret = checked::checkError (lseek (handle, initialByte, SEEK_SET));
   return (ret != initialByte ) ? 1 : 0;
 }
 

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

Summary of changes:
 myserver/po/Makevars                               |    2 +-
 myserver/po/Makevars.template                      |    2 +-
 myserver/src/base/file/file.cpp                    |    2 +-
 .../connections_scheduler.cpp                      |    5 +-
 myserver/src/http_handler/http_file/http_file.cpp  |   32 +---
 myserver/src/protocol/http/http.cpp                |  203 +++++++-------------
 myserver/src/protocol/http/http_data_handler.cpp   |    3 +-
 myserver/src/protocol/http/http_headers.cpp        |   14 +-
 myserver/src/server/server.cpp                     |    2 +-
 9 files changed, 91 insertions(+), 174 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Mon Apr 19 18:06:14 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O3z6c-0005iF-Ap
	for mharc-myserver-commit@gnu.org; Mon, 19 Apr 2010 18:06:14 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O3z6b-0005hl-2i
	for myserver-commit@gnu.org; Mon, 19 Apr 2010 18:06:13 -0400
Received: from [140.186.70.92] (port=42914 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O3z6Z-0005hd-Jv
	for myserver-commit@gnu.org; Mon, 19 Apr 2010 18:06:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3z6Y-0007Oc-6Q
	for myserver-commit@gnu.org; Mon, 19 Apr 2010 18:06:11 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:35308
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3z6Y-0007OW-4T
	for myserver-commit@gnu.org; Mon, 19 Apr 2010 18:06:10 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O3z6X-00079c-DR
	for myserver-commit@gnu.org; Mon, 19 Apr 2010 22:06:09 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O3z6U-00031a-8A
	for myserver-commit@gnu.org; Mon, 19 Apr 2010 22:06:09 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 6f83a5af73d6a3d9a9abc31db0541983a2c65715
X-Git-Newrev: 9f4b84ec3a460ab500526b18d7d2649e8c5a3b46
Message-Id: <E1O3z6U-00031a-8A@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Mon, 19 Apr 2010 22:06:08 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-184-g9f4b84e
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, 19 Apr 2010 22:06:13 -0000

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

The branch, master has been updated
       via  9f4b84ec3a460ab500526b18d7d2649e8c5a3b46 (commit)
       via  890538007da5154d89a632abac3891048074821d (commit)
      from  6f83a5af73d6a3d9a9abc31db0541983a2c65715 (commit)

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

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


commit 9f4b84ec3a460ab500526b18d7d2649e8c5a3b46
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Tue Apr 20 00:03:27 2010 +0200

    Serve the first HTTP request in the pipeline

diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index 996326b..f76b06a 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -830,6 +830,7 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
   int contentLength = -1;
   DynamicHttpCommand *dynamicCommand;
   bool keepalive = false;
+  bool pipelineData = false;
 
   try
     {
@@ -1067,7 +1068,7 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
                   u_long toCopy = nbtr - td->nHeaderChars;
 
                   a->getConnectionBuffer ()->setBuffer (data, toCopy);
-                  return ClientsThread::INCOMPLETE_REQUEST_NO_WAIT;
+                  pipelineData = true;
                 }
             }
 
@@ -1161,7 +1162,12 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
       /* Map the HttpDataHandler return value to codes understood by
          ClientsThread.  */
       if (ret == HttpDataHandler::RET_OK && keepalive)
-        return ClientsThread::KEEP_CONNECTION;
+        {
+          if (pipelineData)
+            return ClientsThread::INCOMPLETE_REQUEST_NO_WAIT;
+
+          return ClientsThread::KEEP_CONNECTION;
+        }
       else
         return ClientsThread::DELETE_CONNECTION;
 
@@ -1173,6 +1179,8 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
       logHTTPaccess ();
       return ClientsThread::DELETE_CONNECTION;
     }
+
+  return ClientsThread::KEEP_CONNECTION;
 }
 
 /*!



commit 890538007da5154d89a632abac3891048074821d
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Tue Apr 20 00:02:47 2010 +0200

    If data is available don't wait for new one

diff --git a/myserver/src/server/clients_thread.cpp b/myserver/src/server/clients_thread.cpp
index e4fc0af..3989647 100644
--- a/myserver/src/server/clients_thread.cpp
+++ b/myserver/src/server/clients_thread.cpp
@@ -265,8 +265,9 @@ int ClientsThread::controlConnections ()
   busy = true;
   dataRead = c->getConnectionBuffer ()->getLength ();
 
-  err = c->socket->recv (&((char*)(buffer.getBuffer ()))[dataRead],
-                        MYSERVER_KB (8) - dataRead - 1, 0);
+  if (! c->isForceControl ())
+    err = c->socket->recv (&((char*)(buffer.getBuffer ()))[dataRead],
+                           MYSERVER_KB (8) - dataRead - 1, 0);
 
   if (err == -1 && !server->deleteConnection (c))
     return 0;

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

Summary of changes:
 myserver/src/protocol/http/http.cpp    |   12 ++++++++++--
 myserver/src/server/clients_thread.cpp |    5 +++--
 2 files changed, 13 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Fri Apr 23 11:38:08 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O5KxD-0001Na-Vi
	for mharc-myserver-commit@gnu.org; Fri, 23 Apr 2010 11:38:08 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O5KxB-0001Mo-DC
	for myserver-commit@gnu.org; Fri, 23 Apr 2010 11:38:05 -0400
Received: from [140.186.70.92] (port=38098 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O5Kx5-0001Je-7u
	for myserver-commit@gnu.org; Fri, 23 Apr 2010 11:38:04 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O5Kwl-0006uw-Ia
	for myserver-commit@gnu.org; Fri, 23 Apr 2010 11:37:59 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:33546
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O5Kwk-0006un-VK
	for myserver-commit@gnu.org; Fri, 23 Apr 2010 11:37:39 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O5Kwk-0004p0-CH
	for myserver-commit@gnu.org; Fri, 23 Apr 2010 15:37:38 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O5Kwk-0004gp-AH
	for myserver-commit@gnu.org; Fri, 23 Apr 2010 15:37:38 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 9f4b84ec3a460ab500526b18d7d2649e8c5a3b46
X-Git-Newrev: de1e03f67392000d5fa6af46bd8a61e028fe8cee
Message-Id: <E1O5Kwk-0004gp-AH@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Fri, 23 Apr 2010 15:37:38 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-185-gde1e03f
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, 23 Apr 2010 15:38:05 -0000

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

The branch, master has been updated
       via  de1e03f67392000d5fa6af46bd8a61e028fe8cee (commit)
      from  9f4b84ec3a460ab500526b18d7d2649e8c5a3b46 (commit)

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

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


commit de1e03f67392000d5fa6af46bd8a61e028fe8cee
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 22 19:22:27 2010 +0200

    Add test for `getBacktrace'

diff --git a/myserver/include/base/exceptions/exceptions.h b/myserver/include/base/exceptions/exceptions.h
index cb74cb1..65c659b 100644
--- a/myserver/include/base/exceptions/exceptions.h
+++ b/myserver/include/base/exceptions/exceptions.h
@@ -71,7 +71,7 @@ class AbstractServerException: public exception
 
 # ifdef HAVE_BACKTRACE_SYMBOLS
           btString = (char **) gnulib::malloc (sizeof(char *) *w);
-          btString = backtrace_symbols(buffer, w);
+          btString = backtrace_symbols (buffer, w);
 # endif
         }
 
diff --git a/myserver/tests/test_exceptions.cpp b/myserver/tests/test_exceptions.cpp
index a6ad610..fa81b09 100644
--- a/myserver/tests/test_exceptions.cpp
+++ b/myserver/tests/test_exceptions.cpp
@@ -34,6 +34,7 @@ class TestExceptions : public CppUnit::TestFixture
   CPPUNIT_TEST (testWrongCloseDir);
   CPPUNIT_TEST (testWrongCwd);
   CPPUNIT_TEST (testErrno);
+  CPPUNIT_TEST (testGetBacktrace);
   CPPUNIT_TEST_SUITE_END ();
 
   DIR *foodir;
@@ -65,6 +66,22 @@ public:
       }
   }
 
+  void testGetBacktrace ()
+  {
+    try
+      {
+        errno = EINVAL;
+        checked::raiseException ();
+
+        CPPUNIT_FAIL ("Exception not raised");
+      }
+    catch (AbstractServerException & e)
+      {
+        char **bt = e.getBacktrace ();
+        CPPUNIT_ASSERT (bt);
+      }
+  }
+
   void testErrno ()
   {
     bool success = false;

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

Summary of changes:
 myserver/include/base/exceptions/exceptions.h |    2 +-
 myserver/tests/test_exceptions.cpp            |   17 +++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Fri Apr 23 16:44:58 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O5PkA-0007DA-JH
	for mharc-myserver-commit@gnu.org; Fri, 23 Apr 2010 16:44:58 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O5Pk9-0007CX-Gg
	for myserver-commit@gnu.org; Fri, 23 Apr 2010 16:44:57 -0400
Received: from [140.186.70.92] (port=45375 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O5Pk7-0007BJ-Ht
	for myserver-commit@gnu.org; Fri, 23 Apr 2010 16:44:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O5Pk6-0002HJ-AV
	for myserver-commit@gnu.org; Fri, 23 Apr 2010 16:44:55 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:59968
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O5Pk5-0002Gy-90
	for myserver-commit@gnu.org; Fri, 23 Apr 2010 16:44:54 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O5Pk4-0008W0-DR
	for myserver-commit@gnu.org; Fri, 23 Apr 2010 20:44:52 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O5Pk0-0004z8-LG
	for myserver-commit@gnu.org; Fri, 23 Apr 2010 20:44:52 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: de1e03f67392000d5fa6af46bd8a61e028fe8cee
X-Git-Newrev: 37f99ceb3c2e10533d58aa60afcbde9ba78bfc5f
Message-Id: <E1O5Pk0-0004z8-LG@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Fri, 23 Apr 2010 20:44:51 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-186-g37f99ce
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, 23 Apr 2010 20:44:58 -0000

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

The branch, master has been updated
       via  37f99ceb3c2e10533d58aa60afcbde9ba78bfc5f (commit)
      from  de1e03f67392000d5fa6af46bd8a61e028fe8cee (commit)

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

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


commit 37f99ceb3c2e10533d58aa60afcbde9ba78bfc5f
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 23 22:45:29 2010 +0200

    Backtrace is returned only if HAVE_BACKTRACE_SYMBOLS is defined

diff --git a/myserver/tests/test_exceptions.cpp b/myserver/tests/test_exceptions.cpp
index fa81b09..362ba48 100644
--- a/myserver/tests/test_exceptions.cpp
+++ b/myserver/tests/test_exceptions.cpp
@@ -78,7 +78,9 @@ public:
     catch (AbstractServerException & e)
       {
         char **bt = e.getBacktrace ();
+#ifdef HAVE_BACKTRACE_SYMBOLS
         CPPUNIT_ASSERT (bt);
+#endif
       }
   }
 

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

Summary of changes:
 myserver/tests/test_exceptions.cpp |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Sun Apr 25 11:23:09 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O63fp-0002wl-8B
	for mharc-myserver-commit@gnu.org; Sun, 25 Apr 2010 11:23:09 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O63fo-0002wR-1t
	for myserver-commit@gnu.org; Sun, 25 Apr 2010 11:23:08 -0400
Received: from [140.186.70.92] (port=50333 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O63fm-0002vl-Dd
	for myserver-commit@gnu.org; Sun, 25 Apr 2010 11:23:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O63fk-0006UQ-Ck
	for myserver-commit@gnu.org; Sun, 25 Apr 2010 11:23:05 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:51216
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O63fk-0006UK-AZ
	for myserver-commit@gnu.org; Sun, 25 Apr 2010 11:23:04 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O63fj-0005VS-Tj
	for myserver-commit@gnu.org; Sun, 25 Apr 2010 15:23:03 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O63fi-0006NS-IO
	for myserver-commit@gnu.org; Sun, 25 Apr 2010 15:23:03 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 37f99ceb3c2e10533d58aa60afcbde9ba78bfc5f
X-Git-Newrev: bee7894ad4585bca94d75cd71570d123dafad41e
Message-Id: <E1O63fi-0006NS-IO@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Sun, 25 Apr 2010 15:23:03 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-188-gbee7894
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, 25 Apr 2010 15:23:08 -0000

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

The branch, master has been updated
       via  bee7894ad4585bca94d75cd71570d123dafad41e (commit)
       via  0e1c4a5cb74c549092cb7be82c723f7596d084ad (commit)
      from  37f99ceb3c2e10533d58aa60afcbde9ba78bfc5f (commit)

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

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


commit bee7894ad4585bca94d75cd71570d123dafad41e
Merge: 0e1c4a5 37f99ce
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sun Apr 25 17:23:04 2010 +0200

    Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/myserver




commit 0e1c4a5cb74c549092cb7be82c723f7596d084ad
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sun Apr 25 17:22:12 2010 +0200

    Fix some invalid file descriptors tests
    
    A file descriptor is invalid when its value is negative.

diff --git a/myserver/src/base/process/process_server_manager.cpp b/myserver/src/base/process/process_server_manager.cpp
index b7d49b2..fe3395d 100644
--- a/myserver/src/base/process/process_server_manager.cpp
+++ b/myserver/src/base/process/process_server_manager.cpp
@@ -567,7 +567,7 @@ int ProcessServerManager::connect (Socket* sock,
   MYSERVER_SOCKADDRIN serverSock = { 0 };
   socklen_t nLength = sizeof (MYSERVER_SOCKADDRIN);
 
-  if (server->socket.getHandle ())
+  if (server->socket.getHandle () >= 0)
     server->socket.getsockname ((MYSERVER_SOCKADDR*) &serverSock, (int*) &nLength);
 
   if (!serverSock.ss_family || serverSock.ss_family == AF_INET || !server->isLocal)
diff --git a/myserver/src/http_handler/cgi/cgi.cpp b/myserver/src/http_handler/cgi/cgi.cpp
index 5ace184..843751b 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -281,7 +281,7 @@ int Cgi::send (HttpThreadContext* td, const char* scriptpath,
       cgiProc.terminateProcess ();
 
       /* Delete the file only if it was created by the CGI module.  */
-      if (!td->inputData.getHandle ())
+      if (td->inputData.getHandle () >= 0)
         FilesUtility::deleteFile (td->inputDataPath.c_str ());
     }
   catch (exception & e)
diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index f76b06a..6ce88b0 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -1140,14 +1140,14 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
       try
         {
           /* If the inputData file was not closed close it.  */
-          if (td->inputData.getHandle ())
+          if (td->inputData.getHandle () >= 0)
             {
               td->inputData.close ();
               FilesUtility::deleteFile (td->inputDataPath);
             }
 
           /* If the outputData file was not closed close it.  */
-          if (td->outputData.getHandle ())
+          if (td->outputData.getHandle () >= 0)
             {
               td->outputData.close ();
               FilesUtility::deleteFile (td->outputDataPath);

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

Summary of changes:
 .../src/base/process/process_server_manager.cpp    |    2 +-
 myserver/src/http_handler/cgi/cgi.cpp              |    2 +-
 myserver/src/protocol/http/http.cpp                |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Sun Apr 25 20:07:07 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O6Bqs-0002UN-SV
	for mharc-myserver-commit@gnu.org; Sun, 25 Apr 2010 20:07:06 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O6Bqr-0002TW-HF
	for myserver-commit@gnu.org; Sun, 25 Apr 2010 20:07:05 -0400
Received: from [140.186.70.92] (port=49239 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O6Bqq-0002Sk-6y
	for myserver-commit@gnu.org; Sun, 25 Apr 2010 20:07:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O6Bqp-0005l1-1x
	for myserver-commit@gnu.org; Sun, 25 Apr 2010 20:07:03 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:38619
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O6Bqo-0005kt-VB
	for myserver-commit@gnu.org; Sun, 25 Apr 2010 20:07:02 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O6Bqo-0003NV-3q
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 00:07:02 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O6Bqk-0002gC-Qa
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 00:07:02 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: bee7894ad4585bca94d75cd71570d123dafad41e
X-Git-Newrev: 9cb5674a5d98bf1243c89222ca375cbf42ce31b1
Message-Id: <E1O6Bqk-0002gC-Qa@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Mon, 26 Apr 2010 00:07:01 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-190-g9cb5674
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, 26 Apr 2010 00:07:05 -0000

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

The branch, master has been updated
       via  9cb5674a5d98bf1243c89222ca375cbf42ce31b1 (commit)
       via  ba2d54f65056063ac8024d92fe2d2bac756e9682 (commit)
      from  bee7894ad4585bca94d75cd71570d123dafad41e (commit)

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

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


commit 9cb5674a5d98bf1243c89222ca375cbf42ce31b1
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 26 02:02:34 2010 +0200

    Avoid a premature 404 with resources not mapped directly to the file system
    
    A handler can be registered to handle requests to resources that are not
    present on the file system, hence avoid to return immediately a 404 error
    status.

diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index 6ce88b0..22799cb 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -128,7 +128,6 @@ int Http::optionsHTTPRESOURCE (string& filename, int yetmapped)
         }
 
       ret = Http::preprocessHttpRequest (filename, yetmapped, &permissions);
-
       if (ret != 200)
         return raiseHTTPError (ret);
 
@@ -293,16 +292,24 @@ int Http::getFilePermissions (string& filename, string& directory, string& file,
             return ret;
         }
 
-      if (FilesUtility::isLink (td->filenamePath.c_str ()))
+      bool isDirectory = false;
+      try
         {
-          const char *perm = td->securityToken.getData ("symlinks.follow",
+          if (FilesUtility::isLink (td->filenamePath.c_str ()))
+            {
+              const char *perm = td->securityToken.getData ("symlinks.follow",
                               MYSERVER_VHOST_CONF | MYSERVER_SERVER_CONF, "NO");
 
-          if (!perm || strcasecmp (perm, "YES"))
-            return raiseHTTPError (401);
+              if (!perm || strcasecmp (perm, "YES"))
+                return 401;
+            }
+
+          isDirectory = FilesUtility::isDirectory (filenamePath.c_str ());
         }
+      catch (FileNotFoundException & e)
+        {}
 
-      if (FilesUtility::isDirectory (filenamePath.c_str ()))
+      if (isDirectory)
         directory.assign (filenamePath);
       else
         FilesUtility::splitPath (filenamePath, directory, file);
@@ -524,14 +531,10 @@ int Http::preprocessHttpRequest (string& filename, int yetmapped,
 
       td->mime = mimeLoc ? mimeLoc : getMIME (td->filenamePath);
     }
-  catch (FileNotFoundException & e)
-    {
-      return 404;
-    }
   catch (exception & e)
     {
       td->connection->host->warningsLogWrite (_E ("HTTP: internal error"), &e);
-      return 404;
+      return 500;
     }
   catch (...)
     {
@@ -690,7 +693,16 @@ Http::sendHTTPResource (string& uri, int systemrequest, int onlyHeader,
       if (systemrequest)
         td->filenamePath.assign (uri);
 
-      if (!td->mime && FilesUtility::isDirectory (td->filenamePath.c_str ()))
+      bool isDirectory = false;
+
+      try
+        {
+          isDirectory = FilesUtility::isDirectory (td->filenamePath.c_str ());
+        }
+      catch (FileNotFoundException & e)
+        {}
+
+      if (!td->mime && isDirectory)
         return processDefaultFile (uri, td->permissions, onlyHeader);
 
       /* If not specified differently, set the default content type to text/html.  */



commit ba2d54f65056063ac8024d92fe2d2bac756e9682
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 26 01:48:57 2010 +0200

    Remove arbitrary limit to don't parse nodes without children

diff --git a/myserver/src/conf/vhost/xml_vhost_handler.cpp b/myserver/src/conf/vhost/xml_vhost_handler.cpp
index 539aca3..32fa61b 100644
--- a/myserver/src/conf/vhost/xml_vhost_handler.cpp
+++ b/myserver/src/conf/vhost/xml_vhost_handler.cpp
@@ -332,12 +332,6 @@ int XmlVhostHandler::load (const char *filename)
           XmlConf::build (lcur, vh->getHashedDataTrees (),
                           vh->getHashedData ());
 
-          if (!lcur->children || !lcur->children->content)
-            {
-              lcur = lcur->next;
-              continue;
-            }
-
           if (!xmlStrcmp (lcur->name, (const xmlChar *) "HOST"))
             {
               int useRegex = 0;

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

Summary of changes:
 myserver/src/conf/vhost/xml_vhost_handler.cpp |    6 ----
 myserver/src/protocol/http/http.cpp           |   36 ++++++++++++++++--------
 2 files changed, 24 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Mon Apr 26 04:43:26 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O6JuY-00040W-Eq
	for mharc-myserver-commit@gnu.org; Mon, 26 Apr 2010 04:43:26 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O6JuW-000408-Jv
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 04:43:24 -0400
Received: from [140.186.70.92] (port=36899 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O6JuV-0003zZ-0k
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 04:43:23 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O6JuT-0002u7-Q1
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 04:43:22 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:46528
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O6JuT-0002u1-Mm
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 04:43:21 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O6JuT-00016c-6r
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 08:43:21 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O6JuS-0002HJ-5L
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 08:43:21 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 9cb5674a5d98bf1243c89222ca375cbf42ce31b1
X-Git-Newrev: af1d954f8762ad8d998073e623cc8fdbe9ee3549
Message-Id: <E1O6JuS-0002HJ-5L@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Mon, 26 Apr 2010 08:43:20 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-191-gaf1d954
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, 26 Apr 2010 08:43:24 -0000

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

The branch, master has been updated
       via  af1d954f8762ad8d998073e623cc8fdbe9ee3549 (commit)
      from  9cb5674a5d98bf1243c89222ca375cbf42ce31b1 (commit)

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

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


commit af1d954f8762ad8d998073e623cc8fdbe9ee3549
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 26 10:43:23 2010 +0200

    Ensure the same type is used in the comparison

diff --git a/myserver/tests/test_validator.cpp b/myserver/tests/test_validator.cpp
index b535f7c..2c5d187 100644
--- a/myserver/tests/test_validator.cpp
+++ b/myserver/tests/test_validator.cpp
@@ -65,7 +65,7 @@ public:
     string val ("value");
     SecurityToken secToken;
     CPPUNIT_ASSERT_EQUAL (validator->getPermissionMaskImpl (&secToken, NULL,
-                                                            NULL), NULL);
+                                                            NULL), 0);
 
   }
 

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

Summary of changes:
 myserver/tests/test_validator.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Mon Apr 26 06:58:34 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O6M1K-00077T-K4
	for mharc-myserver-commit@gnu.org; Mon, 26 Apr 2010 06:58:34 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O6M1I-000773-SG
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 06:58:32 -0400
Received: from [140.186.70.92] (port=45218 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O6M1G-00076R-W1
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 06:58:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O6M1F-0007Dg-98
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 06:58:30 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:56492
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O6M1F-0007Db-74
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 06:58:29 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O6M1E-0002jt-At
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 10:58:28 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O6M1D-0002ww-Lh
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 10:58:28 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: af1d954f8762ad8d998073e623cc8fdbe9ee3549
X-Git-Newrev: 02495f9e5b945025cd4485ce714a5693611f0e52
Message-Id: <E1O6M1D-0002ww-Lh@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Mon, 26 Apr 2010 10:58:27 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-193-g02495f9
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, 26 Apr 2010 10:58:33 -0000

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

The branch, master has been updated
       via  02495f9e5b945025cd4485ce714a5693611f0e52 (commit)
       via  336e1da213ee540a90cd5c3d9badcea8ea9e050a (commit)
      from  af1d954f8762ad8d998073e623cc8fdbe9ee3549 (commit)

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

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


commit 02495f9e5b945025cd4485ce714a5693611f0e52
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 26 11:27:49 2010 +0200

    Map an errno to an exception only when the symbol is defined

diff --git a/myserver/src/base/exceptions/checked.cpp b/myserver/src/base/exceptions/checked.cpp
index f5f0a27..94b7f00 100644
--- a/myserver/src/base/exceptions/checked.cpp
+++ b/myserver/src/base/exceptions/checked.cpp
@@ -19,6 +19,8 @@
 */
 #include <include/base/exceptions/checked.h>
 
+#include <errno.h>
+
 namespace checked
 {
   int accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
@@ -250,441 +252,659 @@ namespace checked
   {
     switch(errno)
       {
+#ifdef E2BIG
       case E2BIG:
         throw ArgumentListException ();
         break;
+#endif
 
+#ifdef EACCES
       case EACCES:
         throw PermissionDeniedException ();
         break;
+#endif
 
+#ifdef EADDRINUSE
       case EADDRINUSE:
         throw AddressException ();
         break;
+#endif
 
+#ifdef EADDRNOTAVAIL
       case EADDRNOTAVAIL:
         throw AddressException ();
         break;
+#endif
 
+#ifdef EAFNOSUPPORT
       case EAFNOSUPPORT:
         throw ProtocolException ();
         break;
+#endif
 
+#ifdef EAGAIN
       case EAGAIN:
         throw InvalidResourceException ();
         break;
+#endif
 
+#ifdef EALREADY
       case EALREADY:
         throw ProgressException ();
         break;
+#endif
 
+#ifdef EBADE
       case EBADE:
         throw InvalidExchangeException ();
         break;
+#endif
 
+#ifdef EBADF
       case EBADF:
         throw BadDescriptorException ();
         break;
+#endif
 
+#ifdef EBADFD
       case EBADFD:
         throw BadDescriptorException ();
         break;
+#endif
 
+#ifdef EBADMSG
       case EBADMSG:
         throw MessageException ();
         break;
+#endif
 
+#ifdef EBADR
       case EBADR:
         throw RequestCodeException ();
         break;
+#endif
 
+#ifdef EBADRQC
       case EBADRQC:
         throw RequestCodeException ();
         break;
+#endif
 
+#ifdef EBADSLT
       case EBADSLT:
         throw SlotException ();
         break;
+#endif
 
+#ifdef EBUSY
       case EBUSY:
         throw BusyResourceException ();
         break;
+#endif
 
+#ifdef ECANCELED
       case ECANCELED:
         throw CancelException ();
         break;
+#endif
 
+#ifdef ECHILD
       case ECHILD:
         throw ProcessException ();
         break;
+#endif
 
+#ifdef ECHRNG
       case ECHRNG:
         throw ChannelOutOfRangeException ();
         break;
+#endif
 
+#ifdef ECOMM
       case ECOMM:
         throw SendException ();
         break;
+#endif
 
+#ifdef ECONNABORTED
       case ECONNABORTED:
         throw AbortedConnectionException ();
         break;
+#endif
 
+#ifdef ECONNREFUSED
       case ECONNREFUSED:
         throw RefusedConnectionException ();
         break;
+#endif
 
+#ifdef ECONNRESET
       case ECONNRESET:
         throw ResetException ();
         break;
+#endif
 
+#ifdef EDEADLK
       case EDEADLK:
         throw DeadlockException ();
         break;
+#endif
 
+#ifdef EDESTADDRREQ
       case EDESTADDRREQ:
         throw AddressException ();
         break;
+#endif
 
+#ifdef EDOM
       case EDOM:
         throw MathException ();
         break;
+#endif
 
+#ifdef EDQUOT
       case EDQUOT:
         throw DiskQuotaException ();
         break;
+#endif
 
+#ifdef EEXIST
       case EEXIST:
         throw FileExistsException ();
         break;
+#endif
 
+#ifdef EFAULT
       case EFAULT:
         throw FaultException ();
         break;
+#endif
 
+#ifdef EFBIG
       case EFBIG:
         throw FileTooLargeException ();
         break;
+#endif
 
+#ifdef EHOSTDOWN
       case EHOSTDOWN:
         throw HostDownException ();
         break;
+#endif
 
+#ifdef EHOSTUNREACH
       case EHOSTUNREACH:
         throw UnreachHostException ();
         break;
+#endif
 
+#ifdef EIDRM
       case EIDRM:
         throw IdentifierException ();
         break;
+#endif
 
+#ifdef EILSEQ
       case EILSEQ:
         throw ByteException ();
         break;
+#endif
 
+#ifdef EINPROGRESS
       case EINPROGRESS:
         throw ProgressException ();
         break;
+#endif
 
+#ifdef EINTR
       case EINTR:
         throw FunctionException ();
         break;
+#endif
 
+#ifdef EINVAL
       case EINVAL:
         throw ArgumentListException ();
         break;
+#endif
 
+#ifdef EIO
       case EIO:
         throw IOException ();
         break;
+#endif
 
+#ifdef EISCONN
       case EISCONN:
         throw SocketException ();
         break;
+#endif
 
+#ifdef EISDIR
       case EISDIR:
         throw DirectoryException ();
         break;
+#endif
 
+#ifdef EISNAM
       case EISNAM:
         throw NamedFileException ();
         break;
+#endif
 
+#ifdef EKEYEXPIRED
       case EKEYEXPIRED:
         throw KeyException ();
         break;
+#endif
 
+#ifdef EKEYREJECTED
       case EKEYREJECTED:
         throw KeyException ();
         break;
+#endif
 
+#ifdef EKEYREVOKED
       case EKEYREVOKED:
         throw KeyException ();
         break;
+#endif
 
+#ifdef EL2HLT
       case EL2HLT:
         throw HaltException ();
         break;
+#endif
 
+#ifdef EL2NSYNC
       case EL2NSYNC:
         throw HaltException ();
         break;
+#endif
 
+#ifdef EL3HLT
       case EL3HLT:
         throw HaltException ();
         break;
+#endif
 
+#ifdef ELIBACC
       case ELIBACC:
         throw LibraryException ();
         break;
+#endif
 
+#ifdef ELIBBAD
       case ELIBBAD:
         throw LibraryException ();
         break;
+#endif
 
+#ifdef ELIBMAX
       case ELIBMAX:
         throw LibraryException ();
         break;
+#endif
 
+#ifdef ELIBSCN
       case ELIBSCN:
         throw LibraryException ();
         break;
+#endif
 
+#ifdef ELIBEXEC
       case ELIBEXEC:
         throw LibraryException ();
         break;
+#endif
 
+#ifdef ELOOP
       case ELOOP:
         throw LinkException ();
         break;
+#endif
 
+#ifdef EMEDIUMTYPE
       case EMEDIUMTYPE:
         throw MediaException ();
         break;
+#endif
 
+#ifdef EMFILE
       case EMFILE:
         throw TooManyFileException ();
         break;
+#endif
 
+#ifdef EMLINK
       case EMLINK:
         throw LinkException ();
         break;
+#endif
 
+#ifdef EMSGSIZE
       case EMSGSIZE:
         throw MessageException ();
         break;
+#endif
 
+#ifdef EMULTIHOP
       case EMULTIHOP:
         throw MultihopException ();
         break;
+#endif
 
+#ifdef ENAMETOOLONG
       case ENAMETOOLONG:
         throw FileTooLongException ();
         break;
+#endif
 
+#ifdef ENETRESET
       case ENETRESET:
         throw NetworkException ();
         break;
+#endif
 
+#ifdef ENETUNREACH
       case ENETUNREACH:
         throw NetworkException ();
         break;
+#endif
 
+#ifdef ENFILE
       case ENFILE:
         throw FilesystemException ();
         break;
+#endif
 
+#ifdef ENOBUFS
       case ENOBUFS:
         throw BufferOverflowException ();
         break;
+#endif
 
+#ifdef ENODATA
       case ENODATA:
         throw StreamException ();
         break;
+#endif
 
+#ifdef ENODEV
       case ENODEV:
         throw DeviceException ();
         break;
+#endif
 
+#ifdef ENOENT
       case ENOENT:
         throw FileNotFoundException ();
         break;
+#endif
 
+#ifdef ENOEXEC
       case ENOEXEC:
         throw ExecFormatException ();
         break;
+#endif
 
+#ifdef ENOKEY
       case ENOKEY:
         throw KeyException ();
         break;
+#endif
 
+#ifdef ENOLINK
       case ENOLINK:
         throw LinkException ();
         break;
+#endif
 
+#ifdef ENOMEDIUM
       case ENOMEDIUM:
         throw MediaException ();
         break;
+#endif
 
+#ifdef ENOMEM
       case ENOMEM:
         throw MemoryOverflowException ();
         break;
+#endif
 
+#ifdef ENOMSG
       case ENOMSG:
         throw MessageException ();
         break;
+#endif
 
+#ifdef ENONET
       case ENONET:
         throw NetworkException ();
         break;
+#endif
 
+#ifdef ENOSPC
       case ENOSPC:
         throw OverflowException ();
         break;
+#endif
 
+#ifdef ENOSR
       case ENOSR:
         throw StreamException ();
         break;
+#endif
 
+#ifdef ENOSTR
       case ENOSTR:
         throw StreamException ();
         break;
+#endif
 
+#ifdef ENOSYS
       case ENOSYS:
         throw FunctionException ();
         break;
+#endif
 
+#ifdef ENOTBLK
       case ENOTBLK:
         throw BlockingException ();
         break;
+#endif
 
+#ifdef ENOTCONN
       case ENOTCONN:
         throw SocketException ();
         break;
+#endif
 
+#ifdef ENOTDIR
       case ENOTDIR:
         throw DirectoryException ();
         break;
+#endif
 
+#ifdef ENOTEMPTY
       case ENOTEMPTY:
         throw DirectoryException ();
         break;
+#endif
 
+#ifdef ENOTSOCK
       case ENOTSOCK:
         throw SocketException ();
         break;
+#endif
 
+#ifdef ENOTTY
       case ENOTTY:
         throw IOException ();
         break;
+#endif
 
+#ifdef ENOTUNIQ
       case ENOTUNIQ:
         throw NetworkException ();
         break;
+#endif
 
+#ifdef ENXIO
       case ENXIO:
         throw DeviceException ();
         break;
+#endif
 
+#ifdef EOVERFLOW
       case EOVERFLOW:
         throw OverflowException ();
         break;
+#endif
 
+#ifdef EPERM
       case EPERM:
         throw PermissionDeniedException ();
         break;
+#endif
 
+#ifdef EPFNOSUPPORT
       case EPFNOSUPPORT:
         throw ProtocolException ();
         break;
+#endif
 
+#ifdef EPIPE
       case EPIPE:
         throw PipeException ();
         break;
+#endif
 
+#ifdef EPROTO
       case EPROTO:
         throw ProtocolException ();
         break;
+#endif
 
+#ifdef EPROTONOSUPPORT
       case EPROTONOSUPPORT:
         throw ProtocolException ();
         break;
+#endif
 
+#ifdef EPROTOTYPE
       case EPROTOTYPE:
         throw ProtocolException ();
         break;
+#endif
 
+#ifdef ERANGE
       case ERANGE:
         throw OverflowException ();
         break;
+#endif
 
+#ifdef EREMCHG
       case EREMCHG:
         throw AddressException ();
         break;
+#endif
 
+#ifdef EREMOTEIO
       case EREMOTEIO:
         throw IOException ();
         break;
+#endif
 
+#ifdef ERESTART
       case ERESTART:
         throw FunctionException ();
         break;
+#endif
 
+#ifdef EROFS
       case EROFS:
         throw FilesystemException ();
         break;
+#endif
 
+#ifdef ESHUTDOWN
       case ESHUTDOWN:
         throw SendException ();
         break;
+#endif
 
+#ifdef ESPIPE
       case ESPIPE:
         throw PipeException ();
         break;
+#endif
 
+#ifdef ESOCKTNOSUPPORT
       case ESOCKTNOSUPPORT:
         throw SocketException ();
         break;
+#endif
 
+#ifdef ESRCH
       case ESRCH:
         throw ProcessException ();
         break;
+#endif
 
+#ifdef ESTALE
       case ESTALE:
         throw GenericFileException ();
         break;
+#endif
 
+#ifdef ESTRPIPE
       case ESTRPIPE:
         throw PipeException ();
         break;
+#endif
 
+#ifdef ETIME
       case ETIME:
         throw TimerException ();
         break;
+#endif
 
+#ifdef ETIMEDOUT
       case ETIMEDOUT:
         throw TimerException ();
         break;
+#endif
 
+#ifdef ETXTBSY
       case ETXTBSY:
         throw BusyResourceException ();
         break;
+#endif
 
+#ifdef EUNATCH
       case EUNATCH:
         throw ProtocolException ();
         break;
+#endif
 
+#ifdef EUSERS
       case EUSERS:
         throw UserException ();
         break;
+#endif
 
+#ifdef EXDEV
       case EXDEV:
         throw LinkException ();
         break;
+#endif
 
+#ifdef EXFULL
       case EXFULL:
         throw InvalidExchangeException ();
         break;
+#endif
 
       default:
         throw UnknownException ();



commit 336e1da213ee540a90cd5c3d9badcea8ea9e050a
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 26 11:19:35 2010 +0200

    Use standard macro definitions names for include's presence

diff --git a/myserver/SConstruct b/myserver/SConstruct
index 4d7e9e1..75803c6 100644
--- a/myserver/SConstruct
+++ b/myserver/SConstruct
@@ -172,8 +172,8 @@ if  not env.GetOption('clean'):
     if conf.CheckFunc("localtime_r"):
         conf.Define('LOCALTIME_R', 1)
 
-    if conf.CheckFunc("sendfile"):
-        conf.Define('SENDFILE', 1)
+    if conf.CheckHeader("sys/sendfile.h"):
+        conf.Define('HAVE_SYS_SENDFILE_H', 1)
 
     if conf.CheckFunc("setgroups"):
         conf.Define('SETGROUPS', 1)
@@ -189,12 +189,6 @@ if  not env.GetOption('clean'):
     if conf.CheckHeader("stdint.h"):
         conf.Define('STDINT_H', 1)
 
-    if conf.CheckHeader("argp.h"):
-        conf.Define('ARGP', 1)
-
-    if conf.CheckHeader("error.h"):
-        conf.Define('ERROR_H', 1)
-
     if conf.CheckHeader("stdlib.h"):
         conf.Define('STDLIB_H', 1)
 
@@ -220,7 +214,7 @@ if  not env.GetOption('clean'):
         conf.Define('UNISTD_H', 1)
 
     if conf.CheckHeader("grp.h"):
-        conf.Define('GRP', 1)
+        conf.Define('HAVE_GRP_H', 1)
 
     if conf.CheckHeader("dlfcn.h"):
         conf.Define('DLFCN_H', 1)
diff --git a/myserver/configure.ac b/myserver/configure.ac
index eb22297..99f58c6 100644
--- a/myserver/configure.ac
+++ b/myserver/configure.ac
@@ -87,14 +87,7 @@ AC_ARG_ENABLE([tests], [--disable-tests Disable the tests suite],
 AC_ARG_ENABLE([gui], [--enable-gui Build and install GUI application],
 		     enable_gui="yes", enable_gui="")
 
-
-AC_CHECK_HEADER([argp.h], AC_DEFINE(ARGP, 1,
-			  [Define if GNU argp tools are available]))
-AC_CHECK_HEADER([error.h], AC_DEFINE(ERRORH, 1,
-			   [Define if the error.h file is present]))
-AC_CHECK_HEADER([grp.h], AC_DEFINE(GRP, 1, [Define if grp.h is available]))
-AC_CHECK_HEADER([sys/sendfile.h], AC_DEFINE(SENDFILE, 1,
-				  [Define if the sendfile syscall is present]))
+AC_CHECK_HEADERS([execinfo.h grp.h sys/sendfile.h])
 
 gl_INIT
 
diff --git a/myserver/include/base/exceptions/exceptions.h b/myserver/include/base/exceptions/exceptions.h
index 65c659b..3cbae58 100644
--- a/myserver/include/base/exceptions/exceptions.h
+++ b/myserver/include/base/exceptions/exceptions.h
@@ -23,7 +23,11 @@
 
 # include <exception>
 # include <errno.h>
-# include <execinfo.h>
+
+# ifdef HAVE_EXECINFO_H
+#  include <execinfo.h>
+# endif
+
 # include <stdlib.h>
 # include <string.h>
 
diff --git a/myserver/src/base/file/file.cpp b/myserver/src/base/file/file.cpp
index c16cb66..95db601 100644
--- a/myserver/src/base/file/file.cpp
+++ b/myserver/src/base/file/file.cpp
@@ -35,7 +35,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include <math.h>
 #include <time.h>
 
-#ifdef SENDFILE
+#ifdef HAVE_SYS_SENDFILE_H
 # include <fcntl.h>
 # include <stdlib.h>
 # include <stdio.h>
@@ -45,7 +45,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 # include <unistd.h>
 #endif
 
-
 #include <string>
 #include <sstream>
 
@@ -376,7 +375,7 @@ int File::read (char* buffer, u_long buffersize, u_long* nbr)
 int File::fastCopyToSocket (Socket *dest, u_long firstByte, MemBuf *buf, u_long *nbw)
 {
   *nbw = 0;
-#ifdef SENDFILE
+#ifdef HAVE_SYS_SENDFILE_H
   off_t offset = firstByte;
   size_t fileSize = getFileSize ();
   while (1)
diff --git a/myserver/src/base/process/process.cpp b/myserver/src/base/process/process.cpp
index e8c992e..94d3d5a 100644
--- a/myserver/src/base/process/process.cpp
+++ b/myserver/src/base/process/process.cpp
@@ -37,7 +37,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #  include <pwd.h>
 # endif
 
-# ifdef GRP
+# ifdef HAVE_GRP_H
 #  include <grp.h>
 # endif
 
@@ -359,7 +359,7 @@ gid_t Process::getGid (const char *grp)
         return gid;
     }
 
-# ifdef GRP
+# ifdef HAVE_GRP_H
   struct group *g = getgrnam (grp);
   if (g != NULL)
     return g->gr_gid;
diff --git a/myserver/src/base/utility.cpp b/myserver/src/base/utility.cpp
index 45c42b1..35b4f59 100644
--- a/myserver/src/base/utility.cpp
+++ b/myserver/src/base/utility.cpp
@@ -20,14 +20,17 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "myserver.h"
 #include <include/base/utility.h>
 #include <include/base/string/securestr.h>
+
 extern "C"
 {
 #include <chdir-long.h>
 }
+
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include "nproc.h"
+
 #ifndef WIN32
 # include <unistd.h>
 # include <signal.h>
@@ -35,10 +38,6 @@ extern "C"
 # include <sys/wait.h>
 # include <sys/time.h>
 # include <errno.h>
-
-# ifdef ERRORH
-#  include <error.h>
-# endif
 #endif
 
 #include <include/base/exceptions/checked.h>

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

Summary of changes:
 myserver/SConstruct                           |   12 +-
 myserver/configure.ac                         |    9 +-
 myserver/include/base/exceptions/exceptions.h |    6 +-
 myserver/src/base/exceptions/checked.cpp      |  220 +++++++++++++++++++++++++
 myserver/src/base/file/file.cpp               |    5 +-
 myserver/src/base/process/process.cpp         |    4 +-
 myserver/src/base/utility.cpp                 |    7 +-
 7 files changed, 236 insertions(+), 27 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Mon Apr 26 07:55:31 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O6MuR-0002XG-C8
	for mharc-myserver-commit@gnu.org; Mon, 26 Apr 2010 07:55:31 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O6MuP-0002Ww-Ej
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 07:55:29 -0400
Received: from [140.186.70.92] (port=56546 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O6MuL-0002Vv-AS
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 07:55:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <e.dolstra@tudelft.nl>) id 1O6MuJ-000824-Lj
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 07:55:25 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:38453)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <e.dolstra@tudelft.nl>) id 1O6MuJ-00081s-EC
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 07:55:23 -0400
Received: from hydra (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.12.11/8.12.8) with SMTP id
	o3QBtL5h002451
	for <myserver-commit@gnu.org>; Mon, 26 Apr 2010 13:55:21 +0200
Message-Id: <201004261155.o3QBtL5h002451@proliant.st.ewi.tudelft.nl>
Received: by hydra (sSMTP sendmail emulation); Mon, 26 Apr 2010 13:55:21 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
Date: Mon, 26 Apr 2010 13:55:21 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
Subject: [myserver-commit] Hydra job gnu:myserver-master:tarball build
	374693 SUCCEEDED
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, 26 Apr 2010 11:55:29 -0000

Hi,

This is to let you know that Hydra build 374693 of job gnu:myserver-master:tarball has changed from FAILED to SUCCEEDED.

Complete build information can be found on this page: http://hydra.nixos.org/build/374693

A summary of the build information follows:

Build ID:              | 374693
Nix name:              | myserver-tarball-0preaf1d954f8762ad8d998073e623cc8fdbe9ee3549
Short description:     | Build of a source distribution from a checkout
Maintainer(s):         | myserver-commit@gnu.org
System:                | x86_64-linux
Derivation store path: | /nix/store/nabvqfjxdldal2n729i857ki0ac9acnj-myserver-tarball-0preaf1d954f8762ad8d998073e623cc8fdbe9ee3549.drv
Output store path:     | /nix/store/rkm80pdvwr00rsyrb9dsaaadr9kdrwbp-myserver-tarball-0preaf1d954f8762ad8d998073e623cc8fdbe9ee3549
Time added:            | 2010-04-26 13:55:21
Build started:         | 2010-04-26 12:59:43
Build finished:        | 2010-04-26 13:55:21
Duration:              | 3338s

The build inputs were:

Name        | Type | Value
------------+------+---------------------------------------------------------------------------
myserverSrc | git  | git://git.sv.gnu.org/myserver.git:af1d954f8762ad8d998073e623cc8fdbe9ee3549
hydraConfig | svn  | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:21286
gnulibSrc   | git  | git://git.sv.gnu.org/gnulib.git:ad8f11251eeef41965bd7a358516325238117971
nixpkgs     | svn  | https://svn.nixos.org/repos/nix/nixpkgs/trunk:21318

Regards,

The Hydra build daemon.



From MAILER-DAEMON Mon Apr 26 08:23:59 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O6NLz-0008Ic-MA
	for mharc-myserver-commit@gnu.org; Mon, 26 Apr 2010 08:23:59 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O6NLy-0008Hf-91
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 08:23:58 -0400
Received: from [140.186.70.92] (port=36750 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O6NLw-0008HR-9L
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 08:23:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <francesco.pipita@gmail.com>) id 1O6NLu-00040O-IU
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 08:23:56 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:33137
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <francesco.pipita@gmail.com>) id 1O6NLu-00040J-GH
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 08:23:54 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <francesco.pipita@gmail.com>) id 1O6NLu-0003ny-8z
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 12:23:54 +0000
Received: from francesco_pipita by vcs-noshell.in.savannah.gnu.org with local
	(Exim 4.69) (envelope-from <francesco_pipita@savannah.gnu.org>)
	id 1O6NLt-00083v-BF
	for myserver-commit@gnu.org; Mon, 26 Apr 2010 12:23:54 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 02495f9e5b945025cd4485ce714a5693611f0e52
X-Git-Newrev: da4c4695dacdc94e22a3f21e3abd946cbac15f6e
Message-Id: <E1O6NLt-00083v-BF@vcs-noshell.in.savannah.gnu.org>
From: Francesco Pipita <francesco.pipita@gmail.com>
Date: Mon, 26 Apr 2010 12:23:53 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-197-gda4c469
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, 26 Apr 2010 12:23:58 -0000

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

The branch, master has been updated
       via  da4c4695dacdc94e22a3f21e3abd946cbac15f6e (commit)
       via  c5feef014752ff113cfe2ac5995d317c363530c5 (commit)
       via  fc866506229720498f1a7afd4254bef208fbde9f (commit)
       via  b8cad10007ab27ec1d48444659f34d8b4a309072 (commit)
      from  02495f9e5b945025cd4485ce714a5693611f0e52 (commit)

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

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


commit da4c4695dacdc94e22a3f21e3abd946cbac15f6e
Merge: c5feef0 02495f9
Author: Francesco Pipita <francesco.pipita@gmail.com>
Date:   Mon Apr 26 14:23:20 2010 +0200

    Merge branch 'master' of ssh://git.sv.gnu.org/srv/git/myserver




commit c5feef014752ff113cfe2ac5995d317c363530c5
Author: Francesco Pipita <francesco.pipita@gmail.com>
Date:   Mon Apr 26 14:14:23 2010 +0200

    Handle the LogManager shutdown correctly.

diff --git a/myserver/include/log/log_manager.h b/myserver/include/log/log_manager.h
index a22f72d..31230af 100644
--- a/myserver/include/log/log_manager.h
+++ b/myserver/include/log/log_manager.h
@@ -23,6 +23,7 @@
 
 # include <map>
 # include <string>
+# include <set>
 
 # include <include/base/sync/mutex.h>
 # include <include/filter/filters_factory.h>
diff --git a/myserver/src/log/log_manager.cpp b/myserver/src/log/log_manager.cpp
index 0fcb350..8ec355f 100644
--- a/myserver/src/log/log_manager.cpp
+++ b/myserver/src/log/log_manager.cpp
@@ -137,8 +137,6 @@ LogManager::add (const void *owner, string type, string location,
           return failure;
         }
 
-      ostringstream oss;
-
       oldSize = logStreamOwners[location].size ();
       if (!containsOwner (owner))
         {
@@ -271,26 +269,37 @@ LogManager::remove (const void *owner)
           return 1;
         }
 
+      set<string> toRemove;
+
       map<string, map<string, LogStream*> >* m = &owners[owner];
       map<string, map<string, LogStream*> >::iterator it_1;
+
       for (it_1 = m->begin (); it_1 != m->end (); it_1++)
         {
           map<string, LogStream*> *t = &it_1->second;
           map<string, LogStream*>::iterator it_2;
           for (it_2 = t->begin (); it_2 != t->end (); it_2++)
             {
-              logStreamOwners[it_2->first].remove (owner);
-              if (!logStreamOwners[it_2->first].size ())
-                {
-                  delete it_2->second;
-                  logStreams.erase (it_2->first);
-                  logStreamOwners.erase (it_2->first);
-                }
+              toRemove.insert (it_2->first);
             }
           t->clear ();
         }
+
       m->clear ();
       owners.erase (owner);
+
+      set<string>::iterator i;
+      for (i = toRemove.begin (); i != toRemove.end (); i++)
+        {
+          logStreamOwners[*i].remove (owner);
+          if (!logStreamOwners[*i].size ())
+            {
+              delete logStreams[*i];
+              logStreams.erase (*i);
+              logStreamOwners.erase (*i);
+            }
+        }
+
       failure = 0;
     }
   catch (...)



commit fc866506229720498f1a7afd4254bef208fbde9f
Author: Francesco Pipita <francesco.pipita@gmail.com>
Date:   Sun Apr 25 15:42:03 2010 +0200

    Code refactoring.

diff --git a/myserver/include/log/log_manager.h b/myserver/include/log/log_manager.h
index 23aed94..a22f72d 100644
--- a/myserver/include/log/log_manager.h
+++ b/myserver/include/log/log_manager.h
@@ -43,7 +43,7 @@ public:
   ~LogManager ();
   int add (const void *owner, string type, string location,
            list<string>& filters, u_long cycle, 
-           int sharedStreamWarningOn = 1);
+           int suppressWarnings = 0);
   int remove (const void *owner);
 
   int log (const void* owner, string & message, bool appendNL = false,
diff --git a/myserver/src/log/log_manager.cpp b/myserver/src/log/log_manager.cpp
index cb793bc..0fcb350 100644
--- a/myserver/src/log/log_manager.cpp
+++ b/myserver/src/log/log_manager.cpp
@@ -116,7 +116,7 @@ LogManager::clear ()
 int
 LogManager::add (const void *owner, string type, string location,
                  list<string>& filters, u_long cycle, 
-                 int sharedStreamWarningOn)
+                 int suppressWarnings)
 {
   int failure = 1;
   int oldSize;
@@ -160,7 +160,7 @@ LogManager::add (const void *owner, string type, string location,
   mutex->unlock ();
 
   if (!failure && newSize > oldSize && Server::getInstance () &&
-      sharedStreamWarningOn)
+      !suppressWarnings)
     return Server::getInstance ()->log (MYSERVER_LOG_MSG_WARNING,
                                      _("The %s log is shared among %i objects"),
                                         location.c_str (), newSize);
diff --git a/myserver/tests/test_log_manager.cpp b/myserver/tests/test_log_manager.cpp
index e8da8a4..df1fca1 100644
--- a/myserver/tests/test_log_manager.cpp
+++ b/myserver/tests/test_log_manager.cpp
@@ -735,7 +735,7 @@ public:
 
     lm->add (this, "test", "file://foo", filters, 0);
 
-    CPPUNIT_ASSERT (!lm->add (&anObject, "test", "file://foo", filters, 0, 0));
+    CPPUNIT_ASSERT (!lm->add (&anObject, "test", "file://foo", filters, 0, 1));
   }
 
   void testAddLogStreamSharedByTheSameObject ()
@@ -751,7 +751,7 @@ public:
 
     lm->add (this, "test", "file://foo", filters, 0);
 
-    CPPUNIT_ASSERT (! lm->add (this, "test1", "file://foo", filters, 0, 0));
+    CPPUNIT_ASSERT (! lm->add (this, "test1", "file://foo", filters, 0, 1));
   }
 
   void testGetLogStreamSharedByDistinctObjects ()
@@ -771,7 +771,7 @@ public:
       }
 
     lm->add (this, "test", "file://foo", filters, 0);
-    lm->add (&anObject, "test", "file://foo", filters, 0, 0);
+    lm->add (&anObject, "test", "file://foo", filters, 0, 1);
     lm->getOwnersList ("file://foo", &l);
     lm->get (this, "test", "file://foo", &ls);
     lm->get (&anObject, "test", "file://foo", &ls1);
@@ -819,8 +819,8 @@ public:
       }
 
     lm->add (this, "test", "file://foo", filters, 0);
-    lm->add (&anObject, "test1", "file://foo", filters, 0, 0);
-    lm->add (&anotherObject, "test2", "file://foo", filters, 0, 0);
+    lm->add (&anObject, "test1", "file://foo", filters, 0, 1);
+    lm->add (&anotherObject, "test2", "file://foo", filters, 0, 1);
     lm->remove (this);
     lm->remove (&anObject);
 



commit b8cad10007ab27ec1d48444659f34d8b4a309072
Author: Francesco Pipita <francesco.pipita@gmail.com>
Date:   Sun Apr 25 14:00:25 2010 +0200

    Suppress the shared stream warning messages when running tests.

diff --git a/myserver/include/log/log_manager.h b/myserver/include/log/log_manager.h
index 99cca17..23aed94 100644
--- a/myserver/include/log/log_manager.h
+++ b/myserver/include/log/log_manager.h
@@ -42,7 +42,8 @@ public:
   LogManager (FiltersFactory* ff, LoggingLevel level = MYSERVER_LOG_MSG_INFO);
   ~LogManager ();
   int add (const void *owner, string type, string location,
-           list<string>& filters, u_long cycle);
+           list<string>& filters, u_long cycle, 
+           int sharedStreamWarningOn = 1);
   int remove (const void *owner);
 
   int log (const void* owner, string & message, bool appendNL = false,
diff --git a/myserver/src/log/log_manager.cpp b/myserver/src/log/log_manager.cpp
index 61c714e..cb793bc 100644
--- a/myserver/src/log/log_manager.cpp
+++ b/myserver/src/log/log_manager.cpp
@@ -115,7 +115,8 @@ LogManager::clear ()
  */
 int
 LogManager::add (const void *owner, string type, string location,
-                 list<string>& filters, u_long cycle)
+                 list<string>& filters, u_long cycle, 
+                 int sharedStreamWarningOn)
 {
   int failure = 1;
   int oldSize;
@@ -158,7 +159,8 @@ LogManager::add (const void *owner, string type, string location,
 
   mutex->unlock ();
 
-  if (!failure && newSize > oldSize && Server::getInstance ())
+  if (!failure && newSize > oldSize && Server::getInstance () &&
+      sharedStreamWarningOn)
     return Server::getInstance ()->log (MYSERVER_LOG_MSG_WARNING,
                                      _("The %s log is shared among %i objects"),
                                         location.c_str (), newSize);
diff --git a/myserver/tests/test_log_manager.cpp b/myserver/tests/test_log_manager.cpp
index 21fa5e0..e8da8a4 100644
--- a/myserver/tests/test_log_manager.cpp
+++ b/myserver/tests/test_log_manager.cpp
@@ -735,7 +735,7 @@ public:
 
     lm->add (this, "test", "file://foo", filters, 0);
 
-    CPPUNIT_ASSERT (!lm->add (&anObject, "test", "file://foo", filters, 0));
+    CPPUNIT_ASSERT (!lm->add (&anObject, "test", "file://foo", filters, 0, 0));
   }
 
   void testAddLogStreamSharedByTheSameObject ()
@@ -751,7 +751,7 @@ public:
 
     lm->add (this, "test", "file://foo", filters, 0);
 
-    CPPUNIT_ASSERT (! lm->add (this, "test1", "file://foo", filters, 0));
+    CPPUNIT_ASSERT (! lm->add (this, "test1", "file://foo", filters, 0, 0));
   }
 
   void testGetLogStreamSharedByDistinctObjects ()
@@ -771,7 +771,7 @@ public:
       }
 
     lm->add (this, "test", "file://foo", filters, 0);
-    lm->add (&anObject, "test", "file://foo", filters, 0);
+    lm->add (&anObject, "test", "file://foo", filters, 0, 0);
     lm->getOwnersList ("file://foo", &l);
     lm->get (this, "test", "file://foo", &ls);
     lm->get (&anObject, "test", "file://foo", &ls1);
@@ -795,7 +795,7 @@ public:
       }
 
     lm->add (this, "test", "file://foo", filters, 0);
-    lm->add (this, "test1", "file://foo", filters, 0);
+    lm->add (this, "test1", "file://foo", filters, 0, 1);
     lm->getOwnersList ("file://foo", &l);
     lm->get (this, "test", "file://foo", &ls);
     lm->get (this, "test1", "file://foo", &ls1);
@@ -819,8 +819,8 @@ public:
       }
 
     lm->add (this, "test", "file://foo", filters, 0);
-    lm->add (&anObject, "test1", "file://foo", filters, 0);
-    lm->add (&anotherObject, "test2", "file://foo", filters, 0);
+    lm->add (&anObject, "test1", "file://foo", filters, 0, 0);
+    lm->add (&anotherObject, "test2", "file://foo", filters, 0, 0);
     lm->remove (this);
     lm->remove (&anObject);
 

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

Summary of changes:
 myserver/include/log/log_manager.h  |    4 +++-
 myserver/src/log/log_manager.cpp    |   33 ++++++++++++++++++++++-----------
 myserver/tests/test_log_manager.cpp |   12 ++++++------
 3 files changed, 31 insertions(+), 18 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Tue Apr 27 20:23:33 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O6v3t-0003dp-Gb
	for mharc-myserver-commit@gnu.org; Tue, 27 Apr 2010 20:23:33 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O6v3r-0003dg-Mc
	for myserver-commit@gnu.org; Tue, 27 Apr 2010 20:23:31 -0400
Received: from [140.186.70.92] (port=44699 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O6v3q-0003dV-FP
	for myserver-commit@gnu.org; Tue, 27 Apr 2010 20:23:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <e.dolstra@tudelft.nl>) id 1O6v3p-0007U6-89
	for myserver-commit@gnu.org; Tue, 27 Apr 2010 20:23:30 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:39537)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <e.dolstra@tudelft.nl>) id 1O6v3o-0007U1-Vi
	for myserver-commit@gnu.org; Tue, 27 Apr 2010 20:23:29 -0400
Received: from hydra (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.12.11/8.12.8) with SMTP id
	o3S0NREi031179
	for <myserver-commit@gnu.org>; Wed, 28 Apr 2010 02:23:27 +0200
Message-Id: <201004280023.o3S0NREi031179@proliant.st.ewi.tudelft.nl>
Received: by hydra (sSMTP sendmail emulation); Wed, 28 Apr 2010 02:23:27 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
Date: Wed, 28 Apr 2010 02:23:27 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
Subject: [myserver-commit] Hydra job gnu:myserver-master:manual build 382021
	FAILED
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, 28 Apr 2010 00:23:32 -0000

Hi,

This is to let you know that Hydra build 382021 of job gnu:myserver-master:manual has changed from FAILED to FAILED.

Complete build information can be found on this page: http://hydra.nixos.org/build/382021

The last 50 lines of the build log are shown at the bottom of this email.

A summary of the build information follows:

Build ID:              | 382021
Nix name:              | myserver-manual-0.9.2
Short description:     | Native Nix build on x86_64-linux
Maintainer(s):         | myserver-commit@gnu.org
System:                | x86_64-linux
Derivation store path: | /nix/store/bdrnmhpblhw6b3rz13z9hq4wx6krc182-myserver-manual-0.9.2.drv
Output store path:     | /nix/store/v1n3hqs7cklw2m6z6prvgaxm8n00l3cm-myserver-manual-0.9.2
Time added:            | 2010-04-28 02:23:17
Build started:         | 2010-04-28 02:23:15
Build finished:        | 2010-04-28 02:23:17
Duration:              | 2s

The build inputs were:

Name        | Type  | Value
------------+-------+-------------------------------------------------------------
hydraConfig | svn   | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:21345
nixpkgs     | svn   | https://svn.nixos.org/repos/nix/nixpkgs/trunk:21354
tarball     | build | 381757

Regards,

The Hydra build daemon.

---



From MAILER-DAEMON Wed Apr 28 19:11:44 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O7GPw-0000Sd-J8
	for mharc-myserver-commit@gnu.org; Wed, 28 Apr 2010 19:11:44 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O7GPu-0000R1-OX
	for myserver-commit@gnu.org; Wed, 28 Apr 2010 19:11:42 -0400
Received: from [140.186.70.92] (port=40988 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O7GPs-0000PE-Rf
	for myserver-commit@gnu.org; Wed, 28 Apr 2010 19:11:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O7GPr-0006PP-A0
	for myserver-commit@gnu.org; Wed, 28 Apr 2010 19:11:40 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:41118
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O7GPr-0006PI-6O
	for myserver-commit@gnu.org; Wed, 28 Apr 2010 19:11:39 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O7GPq-0004dr-JV
	for myserver-commit@gnu.org; Wed, 28 Apr 2010 23:11:38 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O7GPm-00006w-VA
	for myserver-commit@gnu.org; Wed, 28 Apr 2010 23:11:38 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: da4c4695dacdc94e22a3f21e3abd946cbac15f6e
X-Git-Newrev: 4e59d2772ef1687ae184a1f5179679882af45bda
Message-Id: <E1O7GPm-00006w-VA@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Wed, 28 Apr 2010 23:11:37 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-202-g4e59d27
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, 28 Apr 2010 23:11:42 -0000

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

The branch, master has been updated
       via  4e59d2772ef1687ae184a1f5179679882af45bda (commit)
       via  88fd12d5e199b803b1264bf245284ed606080d45 (commit)
       via  cf2936ece5fb9b9f0dc6f9d1b7f7f6c439efc9ad (commit)
       via  6f0a48c0ad4e070e7bf4cbdcebcbe71c74225cb5 (commit)
       via  8835c592264ae90296b4cc793c6f3be342f60dfc (commit)
      from  da4c4695dacdc94e22a3f21e3abd946cbac15f6e (commit)

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

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


commit 4e59d2772ef1687ae184a1f5179679882af45bda
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 29 01:09:35 2010 +0200

    HTTP checks if the file a symlink after it has been opened
    
    Same rationale as commit 88fd12d5e199b803b1264bf245284ed606080d45

diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 310b74d..8018654 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -37,6 +37,17 @@ using namespace std;
 #endif
 
 
+/* FIXME: move somewhere else, duplicated in ftp.cpp.  */
+static bool
+areSymlinkAllowed (HttpThreadContext *td)
+{
+  const char *perm = td->securityToken.getData ("symlinks.follow",
+                                                MYSERVER_VHOST_CONF
+                                                | MYSERVER_SERVER_CONF,
+                                                "NO");
+  return strcasecmp (perm, "YES") == 0;
+}
+
 /*!
   Main function to handle the HTTP PUT command.
  */
@@ -57,8 +68,9 @@ int HttpFile::putFile (HttpThreadContext* td, string& filename)
         File file;
         try
           {
+            int symFlags = areSymlinkAllowed (td) ? 0 : File::NO_FOLLOW_SYMLINK;
             file.openFile (td->filenamePath.c_str (), File::OPEN_IF_EXISTS
-                           | File::WRITE);
+                           | File::WRITE | symFlags);
           }
         catch (exception & e)
           {
@@ -108,8 +120,9 @@ int HttpFile::putFile (HttpThreadContext* td, string& filename)
         File file;
         try
           {
+            int symFlags = areSymlinkAllowed (td) ? 0 : File::NO_FOLLOW_SYMLINK;
             file.openFile (td->filenamePath.c_str (), File::FILE_CREATE_ALWAYS
-                           | File::WRITE);
+                           | File::WRITE | symFlags);
           }
         catch (exception & e)
           {
@@ -272,7 +285,9 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
 
       try
         {
-          file = Server::getInstance ()->getCachedFiles ()->open (filenamePath);
+          int symFlags = areSymlinkAllowed (td) ? 0 : File::NO_FOLLOW_SYMLINK;
+          file = Server::getInstance ()->getCachedFiles ()->open (filenamePath,
+                                                                  symFlags);
           if (! file)
             return td->http->raiseHTTPError (500);
         }
diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index 22799cb..5551af4 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -295,15 +295,6 @@ int Http::getFilePermissions (string& filename, string& directory, string& file,
       bool isDirectory = false;
       try
         {
-          if (FilesUtility::isLink (td->filenamePath.c_str ()))
-            {
-              const char *perm = td->securityToken.getData ("symlinks.follow",
-                              MYSERVER_VHOST_CONF | MYSERVER_SERVER_CONF, "NO");
-
-              if (!perm || strcasecmp (perm, "YES"))
-                return 401;
-            }
-
           isDirectory = FilesUtility::isDirectory (filenamePath.c_str ());
         }
       catch (FileNotFoundException & e)



commit 88fd12d5e199b803b1264bf245284ed606080d45
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 29 00:59:02 2010 +0200

    FTP checks if the file a symlink while it is opened
    
    Fix a race condition that a symlink could be opened even in the case
    symlinks following is disabled.

diff --git a/myserver/include/protocol/ftp/ftp.h b/myserver/include/protocol/ftp/ftp.h
index 9bc982e..631e65e 100644
--- a/myserver/include/protocol/ftp/ftp.h
+++ b/myserver/include/protocol/ftp/ftp.h
@@ -98,7 +98,7 @@ struct FtpThreadContext
   SecurityToken st;
 };
 
-class Ftp:public Protocol
+class Ftp : public Protocol
 {
 public:
   Ftp ();
@@ -197,6 +197,7 @@ public:
   std::string m_sFilePath;
   bool m_bappend;
   Ftp *m_pFtp;
+  SecurityToken *st;
 };
 
 int getFtpReply (int nReplyCode, std::string & sReply);
@@ -209,7 +210,7 @@ void yyerror (YYLTYPE * pLoc, Ftp * pContext, const char *msg);
 /*!
  *Adapter class to make Ftp reentrant.
  */
-class FtpProtocol:public Protocol
+class FtpProtocol : public Protocol
 {
 public:
   FtpProtocol ()
diff --git a/myserver/src/protocol/ftp/ftp.cpp b/myserver/src/protocol/ftp/ftp.cpp
index 28373f8..59c23b3 100644
--- a/myserver/src/protocol/ftp/ftp.cpp
+++ b/myserver/src/protocol/ftp/ftp.cpp
@@ -47,6 +47,19 @@ static DEFINE_THREAD (SendImageFile, pParam);
 static DEFINE_THREAD (ReceiveAsciiFile, pParam);
 static DEFINE_THREAD (ReceiveImageFile, pParam);
 
+
+/* FIXME: move somewhere else, duplicated in http_file.cpp.  */
+static bool
+areSymlinkAllowed (SecurityToken *st)
+{
+  const char *perm = st->getData ("symlinks.follow",
+                                  MYSERVER_VHOST_CONF
+                                  | MYSERVER_SERVER_CONF,
+                                  "NO");
+  return strcasecmp (perm, "YES") == 0;
+}
+
+
 void setFtpHost (FtpHost & out, const FtpHost & in)
 {
   out.h1 = in.h1;
@@ -614,6 +627,7 @@ void Ftp::retrstor (bool bretr, bool bappend, const std::string & sPath)
   pData->m_bappend = bappend || pFtpuserData->m_nrestartOffset > 0;
   pData->m_sFilePath = sLocalPath;
   pData->m_pFtp = this;
+  pData->st = &td.st;
 
   pFtpuserData->m_sCurrentFileName = "";
   pFtpuserData->m_nFileSize = 0;
@@ -721,9 +735,11 @@ DEFINE_THREAD (SendAsciiFile, pParam)
 #endif
         }
 
+      int symFlags = areSymlinkAllowed (pWt->st) ? 0
+                                                 : File::NO_FOLLOW_SYMLINK;
       file =
         Server::getInstance ()->getCachedFiles ()->open (pWt->m_sFilePath.
-                                                         c_str ());
+                                                         c_str (), symFlags);
       if (file == NULL)
         {
           ftpReply (pConnection, 451);
@@ -959,9 +975,11 @@ DEFINE_THREAD (SendImageFile, pParam)
 #endif
         }
 
+      int symFlags = areSymlinkAllowed (pWt->st) ? 0
+                                                 : File::NO_FOLLOW_SYMLINK;
       file =
         Server::getInstance ()->getCachedFiles ()->open (pWt->m_sFilePath.
-                                                         c_str ());
+                                                         c_str (), symFlags);
       if (file == NULL)
         {
           ftpReply (pConnection, 451);
@@ -1151,6 +1169,8 @@ DEFINE_THREAD (ReceiveAsciiFile, pParam)
         flags = File::APPEND | File::WRITE;
       else
         flags = File::FILE_CREATE_ALWAYS | File::WRITE;
+      flags |= areSymlinkAllowed (pWt->st) ? 0 : File::NO_FOLLOW_SYMLINK;
+
       if (file.openFile (pWt->m_sFilePath.c_str (), flags))
         {
           ftpReply (pConnection, 451);
@@ -1349,6 +1369,8 @@ DEFINE_THREAD (ReceiveImageFile, pParam)
         flags = File::APPEND | File::WRITE;
       else
         flags = File::FILE_CREATE_ALWAYS | File::WRITE;
+      flags |= areSymlinkAllowed (pWt->st) ? 0 : File::NO_FOLLOW_SYMLINK;
+
       if (file.openFile (pWt->m_sFilePath.c_str (), flags))
         {
           ftpReply (pConnection, 451);
@@ -2500,7 +2522,9 @@ void Ftp::size (const std::string & sPath)
     }
 
   File f;
-  if (f.openFile (sLocalPath.c_str (), File::OPEN_IF_EXISTS | File::READ))
+  int flags = File::OPEN_IF_EXISTS | File::READ;
+  flags |= areSymlinkAllowed (&td.st) ? 0 : File::NO_FOLLOW_SYMLINK;
+  if (f.openFile (sLocalPath.c_str (), flags))
     {
       ftpReply (550);
       return;



commit cf2936ece5fb9b9f0dc6f9d1b7f7f6c439efc9ad
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 29 00:52:55 2010 +0200

    Now `CachedFileFactory::open' accepts a new `flags' parameter

diff --git a/myserver/include/base/files_cache/cached_file_factory.h b/myserver/include/base/files_cache/cached_file_factory.h
index fe1ce94..f012a62 100644
--- a/myserver/include/base/files_cache/cached_file_factory.h
+++ b/myserver/include/base/files_cache/cached_file_factory.h
@@ -30,6 +30,8 @@
 # include <string>
 # include <list>
 
+# include <sys/stat.h>
+
 using namespace std;
 
 class CachedFileFactory
@@ -45,7 +47,7 @@ public:
   u_long getUsedSize (){return usedSize;}
   u_long getUsed (){return used;}
 
-  File *open (const char* file);
+  File *open (const char* file, int flags = 0);
   void nullReferences (CachedFileBuffer* cfb);
 
   void setMaxSize (u_long maxSize);
@@ -78,7 +80,8 @@ protected:
 
   struct CachedFileFactoryRecord
   {
-    CachedFileBuffer* buffer;
+    struct stat fstat;
+
     /*! Number of times the cache record was used.  */
     u_long used;
 
@@ -93,6 +96,8 @@ protected:
 
     /*! This entry is not valid and will be removed when refCount = 0.  */
     bool invalidCache;
+
+    CachedFileBuffer* buffer;
   };
 
   list<CachedFileFactoryRecord*> buffersToRemove;
diff --git a/myserver/src/base/files_cache/cached_file_factory.cpp b/myserver/src/base/files_cache/cached_file_factory.cpp
index 2ea785e..4b85055 100644
--- a/myserver/src/base/files_cache/cached_file_factory.cpp
+++ b/myserver/src/base/files_cache/cached_file_factory.cpp
@@ -129,11 +129,13 @@ void CachedFileFactory::initialize (u_long size)
 }
 
 /*!
- *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 filename The file name.
- */
-File* CachedFileFactory::open (const char* filename)
+  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 filename The file name.
+  \param flags Additional flags, actually only File::NO_FOLLOW_SYMLINK is
+  supported.
+*/
+File* CachedFileFactory::open (const char* filename, int flags)
 {
   CachedFileFactoryRecord *record;
   CachedFileBuffer *buffer;
@@ -144,34 +146,33 @@ File* CachedFileFactory::open (const char* filename)
 
   try
     {
-
-      ticks = getTicks ();
       record = buffers.get (filename);
       buffer = record ? record->buffer : 0;
 
       used++;
 
-      /*!
-       * If the file on the file system has a different mtime then don't use
-       * the cache, in this way when opened instance of this file will be closed
-       * the null reference callback can be called and the file reloaded.
-       */
+      /*
+        If the file on the file system has a different mtime then don't use
+        the cache, in this way when opened instance of this file will be closed
+        the null reference callback can be called and the file reloaded.
+      */
       if (record)
         {
-          if (ticks - record->lastModTimeCheck > MYSERVER_SEC (5))
-            {
-              record->invalidCache = FilesUtility::getLastModTime (filename)
-                != record->mtime;
-              record->lastModTimeCheck = ticks;
-            }
+          record->invalidCache = FilesUtility::getLastModTime (filename)
+            != record->mtime;
+          record->lastModTimeCheck = ticks;
+
+          bool noSymlink = (! (flags & File::NO_FOLLOW_SYMLINK))
+            && S_ISLNK (record->fstat.st_mode);
 
-          if (record->invalidCache)
+          if (record->invalidCache || noSymlink)
             {
               mutex.unlock ();
 
               File *file = new File ();
-              if (file->openFile (filename, File::OPEN_IF_EXISTS |
-                                  File::READ))
+              flags = flags & File::NO_FOLLOW_SYMLINK;
+              if (file->openFile (filename, File::OPEN_IF_EXISTS | flags
+                                  | File::READ))
                 {
                   delete file;
                   return NULL;
@@ -184,7 +185,9 @@ File* CachedFileFactory::open (const char* filename)
         {
           u_long fileSize;
           File *file = new File ();
-          if (file->openFile (filename, File::OPEN_IF_EXISTS | File::READ))
+          flags = flags & File::NO_FOLLOW_SYMLINK;
+          if (file->openFile (filename, File::OPEN_IF_EXISTS | flags
+                              | File::READ))
             {
               mutex.unlock ();
               delete file;
@@ -202,30 +205,16 @@ File* CachedFileFactory::open (const char* filename)
           else
             {
               record = new CachedFileFactoryRecord ();
-              if (!record)
-                {
-                  delete record;
-                  file->close ();
-                  delete file;
-                  mutex.unlock ();
-                  return 0;
-                }
-
               buffer = new CachedFileBuffer (file);
               record->mtime = file->getLastModTime ();
+              file->fstat (&record->fstat);
               file->close  ();
               delete file;
 
-              if (!buffer)
-                {
-                  delete record;
-                  mutex.unlock ();
-                  return 0;
-                }
               buffer->setFactoryToNotify (this);
               record->created = ticks;
               record->buffer = buffer;
-              buffers.put ((char *)filename, record);
+              buffers.put ((char *) filename, record);
               usedSize += fileSize;
             }
         }



commit 6f0a48c0ad4e070e7bf4cbdcebcbe71c74225cb5
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 29 00:51:30 2010 +0200

    Add new `fstat' method to the `File' class

diff --git a/myserver/include/base/file/file.h b/myserver/include/base/file/file.h
index 1f5668c..df77f65 100644
--- a/myserver/include/base/file/file.h
+++ b/myserver/include/base/file/file.h
@@ -23,9 +23,9 @@
 # include "myserver.h"
 # include <include/filter/stream.h>
 # include <string>
-
 # include <include/base/socket/socket.h>
 # include <include/base/mem_buff/mem_buff.h>
+# include <sys/stat.h>
 
 using namespace std;
 
@@ -81,6 +81,8 @@ public:
 
   int truncate (u_long size = 0);
 
+  void fstat (struct stat *fstat);
+
   /*! Get the options mask used with openFile.  */
   u_long getOpenOptions (){return opt;}
 protected:
diff --git a/myserver/src/base/file/file.cpp b/myserver/src/base/file/file.cpp
index 9ece6b7..ceb65ac 100644
--- a/myserver/src/base/file/file.cpp
+++ b/myserver/src/base/file/file.cpp
@@ -131,6 +131,15 @@ int File::truncate (u_long size)
 }
 
 /*!
+ Do a fstat on the file.
+ \param fstat stat structure to fill.
+*/
+void File::fstat (struct stat *fstat)
+{
+  checked::fstat (handle, fstat);
+}
+
+/*!
  *Open (or create if not exists) a file, but must explicitly use read and/or
  *write flags and open flag.
  *\param nfilename Filename to open.



commit 8835c592264ae90296b4cc793c6f3be342f60dfc
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Wed Apr 28 22:50:56 2010 +0200

    Now `File::openFile' accepts a new flag `NO_FOLLOW_SYMLINK'

diff --git a/myserver/include/base/file/file.h b/myserver/include/base/file/file.h
index 016e308..1f5668c 100644
--- a/myserver/include/base/file/file.h
+++ b/myserver/include/base/file/file.h
@@ -42,6 +42,7 @@ public:
   static const u_long APPEND;
   static const u_long FILE_CREATE_ALWAYS;
   static const u_long NO_INHERIT;
+  static const u_long NO_FOLLOW_SYMLINK;
 
   File ();
   File (char *,int);
diff --git a/myserver/src/base/file/file.cpp b/myserver/src/base/file/file.cpp
index 95db601..9ece6b7 100644
--- a/myserver/src/base/file/file.cpp
+++ b/myserver/src/base/file/file.cpp
@@ -60,6 +60,7 @@ const u_long File::OPEN_IF_EXISTS = (1 << 6);
 const u_long File::APPEND = (1 << 7);
 const u_long File::FILE_CREATE_ALWAYS = (1 << 8);
 const u_long File::NO_INHERIT = (1 << 9);
+const u_long File::NO_FOLLOW_SYMLINK = (1 << 10);
 
 
 /*!
@@ -150,9 +151,11 @@ int File::openFile (const char* nfilename, u_long opt)
   else if (opt & File::WRITE)
     flags = O_WRONLY;
 
+  if (opt & File::NO_FOLLOW_SYMLINK)
+    flags = O_NOFOLLOW;
+
   /* FIXME: how avoid a stat?  */
   bool exists = stat (filename.c_str (), &fStats) == 0;
-
   if (opt & File::OPEN_IF_EXISTS && !exists)
     return 1;
 
@@ -162,7 +165,8 @@ int File::openFile (const char* nfilename, u_long opt)
   if (exists)
     handle = checked::open (filename.c_str (), O_APPEND | flags);
   else
-    handle = checked::open (filename.c_str (), O_CREAT | flags, S_IRUSR | S_IWUSR);
+    handle = checked::open (filename.c_str (), O_CREAT | flags,
+                            S_IRUSR | S_IWUSR);
 
   try
     {

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

Summary of changes:
 myserver/include/base/file/file.h                  |    5 +-
 .../include/base/files_cache/cached_file_factory.h |    9 ++-
 myserver/include/protocol/ftp/ftp.h                |    5 +-
 myserver/src/base/file/file.cpp                    |   17 +++++-
 .../src/base/files_cache/cached_file_factory.cpp   |   65 ++++++++-----------
 myserver/src/http_handler/http_file/http_file.cpp  |   21 ++++++-
 myserver/src/protocol/ftp/ftp.cpp                  |   30 ++++++++-
 myserver/src/protocol/http/http.cpp                |    9 ---
 8 files changed, 101 insertions(+), 60 deletions(-)


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Thu Apr 29 04:34:54 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O7PCw-0003jp-6a
	for mharc-myserver-commit@gnu.org; Thu, 29 Apr 2010 04:34:54 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O7PCu-0003jD-Ki
	for myserver-commit@gnu.org; Thu, 29 Apr 2010 04:34:52 -0400
Received: from [140.186.70.92] (port=37095 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O7PCo-0003gA-Cr
	for myserver-commit@gnu.org; Thu, 29 Apr 2010 04:34:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O7PCi-0003FD-Ns
	for myserver-commit@gnu.org; Thu, 29 Apr 2010 04:34:46 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:33178
	helo=internal.in.savannah.gnu.org)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O7PCi-0003F0-KQ
	for myserver-commit@gnu.org; Thu, 29 Apr 2010 04:34:40 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by internal.in.savannah.gnu.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1O7PCh-0002w6-Ve
	for myserver-commit@gnu.org; Thu, 29 Apr 2010 08:34:40 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.69) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1O7PCg-0007zg-BO
	for myserver-commit@gnu.org; Thu, 29 Apr 2010 08:34:39 +0000
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 4e59d2772ef1687ae184a1f5179679882af45bda
X-Git-Newrev: df7c9552587fa0774a3c736685a5d95fc7e84422
Message-Id: <E1O7PCg-0007zg-BO@vcs-noshell.in.savannah.gnu.org>
From: Giuseppe Scrivano <gscrivano@gnu.org>
Date: Thu, 29 Apr 2010 08:34:39 +0000
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. 0_9_2-203-gdf7c955
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, 29 Apr 2010 08:34:52 -0000

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

The branch, master has been updated
       via  df7c9552587fa0774a3c736685a5d95fc7e84422 (commit)
      from  4e59d2772ef1687ae184a1f5179679882af45bda (commit)

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

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


commit df7c9552587fa0774a3c736685a5d95fc7e84422
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 29 10:01:00 2010 +0200

    Use translations by `translationproject.org'

diff --git a/myserver/bootstrap.conf b/myserver/bootstrap.conf
index 0bfad5d..93ef4bd 100644
--- a/myserver/bootstrap.conf
+++ b/myserver/bootstrap.conf
@@ -19,7 +19,6 @@
 
 gnulib_name=libgnu
 gnulib_tool_option_extras=
-SKIP_PO=t
 
 # gnulib modules used by this package.
 gnulib_modules="
diff --git a/myserver/po/ChangeLog b/myserver/po/ChangeLog
deleted file mode 100644
index 9ea0b32..0000000
--- a/myserver/po/ChangeLog
+++ /dev/null
@@ -1,12 +0,0 @@
-2009-08-19  gettextize  <bug-gnu-gettext@gnu.org>
-
-	* Makefile.in.in: New file, from gettext-0.17.
-	* boldquot.sed: New file, from gettext-0.17.
-	* en@boldquot.header: New file, from gettext-0.17.
-	* en@quot.header: New file, from gettext-0.17.
-	* insert-header.sin: New file, from gettext-0.17.
-	* quot.sed: New file, from gettext-0.17.
-	* remove-potcdate.sin: New file, from gettext-0.17.
-	* Rules-quot: New file, from gettext-0.17.
-	* POTFILES.in: New file.
-
diff --git a/myserver/po/Makefile.in.in b/myserver/po/Makefile.in.in
deleted file mode 100644
index 5022b8b..0000000
--- a/myserver/po/Makefile.in.in
+++ /dev/null
@@ -1,403 +0,0 @@
-# Makefile for PO directory in any package using GNU gettext.
-# Copyright (C) 1995-1997, 2000-2006 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
-#
-# This file can be copied and used freely without restrictions.  It can
-# be used in projects which are not available under the GNU General Public
-# License but which still want to provide support for the GNU gettext
-# functionality.
-# Please note that the actual code of GNU gettext is covered by the GNU
-# General Public License and is *not* in the public domain.
-#
-# Origin: gettext-0.16
-
-PACKAGE = @PACKAGE@
-VERSION = @VERSION@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-
-SHELL = /bin/sh
-@SET_MAKE@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-datarootdir = @datarootdir@
-datadir = @datadir@
-localedir = @localedir@
-gettextsrcdir = $(datadir)/gettext/po
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-
-# We use $(mkdir_p).
-# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
-# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
-# @install_sh@ does not start with $(SHELL), so we add it.
-# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
-# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
-# versions, $(mkinstalldirs) and $(install_sh) are unused.
-mkinstalldirs = $(SHELL) @install_sh@ -d
-install_sh = $(SHELL) @install_sh@
-MKDIR_P = @MKDIR_P@
-mkdir_p = @mkdir_p@
-
-GMSGFMT_ = @GMSGFMT@
-GMSGFMT_no = @GMSGFMT@
-GMSGFMT_yes = @GMSGFMT_015@
-GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
-MSGFMT_ = @MSGFMT@
-MSGFMT_no = @MSGFMT@
-MSGFMT_yes = @MSGFMT_015@
-MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
-XGETTEXT_ = @XGETTEXT@
-XGETTEXT_no = @XGETTEXT@
-XGETTEXT_yes = @XGETTEXT_015@
-XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
-MSGMERGE = msgmerge
-MSGMERGE_UPDATE = @MSGMERGE@ --update
-MSGINIT = msginit
-MSGCONV = msgconv
-MSGFILTER = msgfilter
-
-POFILES = @POFILES@
-GMOFILES = @GMOFILES@
-UPDATEPOFILES = @UPDATEPOFILES@
-DUMMYPOFILES = @DUMMYPOFILES@
-DISTFILES.common = Makefile.in.in remove-potcdate.sin \
-$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
-DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
-$(POFILES) $(GMOFILES) \
-$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
-
-POTFILES = \
-
-CATALOGS = @CATALOGS@
-
-# Makevars gets inserted here. (Don't remove this line!)
-
-.SUFFIXES:
-.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
-
-.po.mo:
-	@echo "$(MSGFMT) -c -o $@ $<"; \
-	$(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
-
-.po.gmo:
-	@lang=`echo $* | sed -e 's,.*/,,'`; \
-	test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-	echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
-	cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
-
-.sin.sed:
-	sed -e '/^#/d' $< > t-$@
-	mv t-$@ $@
-
-
-all: all-@USE_NLS@
-
-all-yes: stamp-po
-all-no:
-
-# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
-# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
-# we don't want to bother translators with empty POT files). We assume that
-# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
-# In this case, stamp-po is a nop (i.e. a phony target).
-
-# stamp-po is a timestamp denoting the last time at which the CATALOGS have
-# been loosely updated. Its purpose is that when a developer or translator
-# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
-# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
-# invocations of "make" will do nothing. This timestamp would not be necessary
-# if updating the $(CATALOGS) would always touch them; however, the rule for
-# $(POFILES) has been designed to not touch files that don't need to be
-# changed.
-stamp-po: $(srcdir)/$(DOMAIN).pot
-	test ! -f $(srcdir)/$(DOMAIN).pot || \
-	  test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
-	@test ! -f $(srcdir)/$(DOMAIN).pot || { \
-	  echo "touch stamp-po" && \
-	  echo timestamp > stamp-poT && \
-	  mv stamp-poT stamp-po; \
-	}
-
-# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
-# otherwise packages like GCC can not be built if only parts of the source
-# have been downloaded.
-
-# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
-# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
-$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
-	if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
-	  msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
-	else \
-	  msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
-	fi; \
-	$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
-	  --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
-	  --files-from=$(srcdir)/POTFILES.in \
-	  --copyright-holder='$(COPYRIGHT_HOLDER)' \
-	  --msgid-bugs-address="$$msgid_bugs_address"
-	test ! -f $(DOMAIN).po || { \
-	  if test -f $(srcdir)/$(DOMAIN).pot; then \
-	    sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
-	    sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
-	    if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
-	      rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
-	    else \
-	      rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
-	      mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
-	    fi; \
-	  else \
-	    mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
-	  fi; \
-	}
-
-# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
-# every "make" invocation, only create it when it is missing.
-# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
-$(srcdir)/$(DOMAIN).pot:
-	$(MAKE) $(DOMAIN).pot-update
-
-# This target rebuilds a PO file if $(DOMAIN).pot has changed.
-# Note that a PO file is not touched if it doesn't need to be changed.
-$(POFILES): $(srcdir)/$(DOMAIN).pot
-	@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
-	if test -f "$(srcdir)/$${lang}.po"; then \
-	  test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-	  echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
-	  cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
-	else \
-	  $(MAKE) $${lang}.po-create; \
-	fi
-
-
-install: install-exec install-data
-install-exec:
-install-data: install-data-@USE_NLS@
-	if test "$(PACKAGE)" = "gettext-tools"; then \
-	  $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
-	  for file in $(DISTFILES.common) Makevars.template; do \
-	    $(INSTALL_DATA) $(srcdir)/$$file \
-			    $(DESTDIR)$(gettextsrcdir)/$$file; \
-	  done; \
-	  for file in Makevars; do \
-	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
-	  done; \
-	else \
-	  : ; \
-	fi
-install-data-no: all
-install-data-yes: all
-	$(mkdir_p) $(DESTDIR)$(datadir)
-	@catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
-	  dir=$(localedir)/$$lang/LC_MESSAGES; \
-	  $(mkdir_p) $(DESTDIR)$$dir; \
-	  if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
-	  $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
-	  echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
-	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
-	    if test -n "$$lc"; then \
-	      if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
-	        link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
-	        mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
-	        mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
-	        (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
-	         for file in *; do \
-	           if test -f $$file; then \
-	             ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
-	           fi; \
-	         done); \
-	        rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
-	      else \
-	        if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
-	          :; \
-	        else \
-	          rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
-	          mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
-	        fi; \
-	      fi; \
-	      rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
-	      ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
-	      ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
-	      cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
-	      echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
-	    fi; \
-	  done; \
-	done
-
-install-strip: install
-
-installdirs: installdirs-exec installdirs-data
-installdirs-exec:
-installdirs-data: installdirs-data-@USE_NLS@
-	if test "$(PACKAGE)" = "gettext-tools"; then \
-	  $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
-	else \
-	  : ; \
-	fi
-installdirs-data-no:
-installdirs-data-yes:
-	$(mkdir_p) $(DESTDIR)$(datadir)
-	@catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
-	  dir=$(localedir)/$$lang/LC_MESSAGES; \
-	  $(mkdir_p) $(DESTDIR)$$dir; \
-	  for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
-	    if test -n "$$lc"; then \
-	      if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
-	        link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
-	        mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
-	        mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
-	        (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
-	         for file in *; do \
-	           if test -f $$file; then \
-	             ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
-	           fi; \
-	         done); \
-	        rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
-	      else \
-	        if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
-	          :; \
-	        else \
-	          rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
-	          mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
-	        fi; \
-	      fi; \
-	    fi; \
-	  done; \
-	done
-
-# Define this as empty until I found a useful application.
-installcheck:
-
-uninstall: uninstall-exec uninstall-data
-uninstall-exec:
-uninstall-data: uninstall-data-@USE_NLS@
-	if test "$(PACKAGE)" = "gettext-tools"; then \
-	  for file in $(DISTFILES.common) Makevars.template; do \
-	    rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
-	  done; \
-	else \
-	  : ; \
-	fi
-uninstall-data-no:
-uninstall-data-yes:
-	catalogs='$(CATALOGS)'; \
-	for cat in $$catalogs; do \
-	  cat=`basename $$cat`; \
-	  lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
-	  for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
-	    rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
-	  done; \
-	done
-
-check: all
-
-info dvi ps pdf html tags TAGS ctags CTAGS ID:
-
-mostlyclean:
-	rm -f remove-potcdate.sed
-	rm -f stamp-poT
-	rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
-	rm -fr *.o
-
-clean: mostlyclean
-
-distclean: clean
-	rm -f Makefile Makefile.in POTFILES *.mo
-
-maintainer-clean: distclean
-	@echo "This command is intended for maintainers to use;"
-	@echo "it deletes files that may require special tools to rebuild."
-	rm -f stamp-po $(GMOFILES)
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
-dist distdir:
-	$(MAKE) update-po
-	@$(MAKE) dist2
-# This is a separate target because 'update-po' must be executed before.
-dist2: stamp-po $(DISTFILES)
-	dists="$(DISTFILES)"; \
-	if test "$(PACKAGE)" = "gettext-tools"; then \
-	  dists="$$dists Makevars.template"; \
-	fi; \
-	if test -f $(srcdir)/$(DOMAIN).pot; then \
-	  dists="$$dists $(DOMAIN).pot stamp-po"; \
-	fi; \
-	if test -f $(srcdir)/ChangeLog; then \
-	  dists="$$dists ChangeLog"; \
-	fi; \
-	for i in 0 1 2 3 4 5 6 7 8 9; do \
-	  if test -f $(srcdir)/ChangeLog.$$i; then \
-	    dists="$$dists ChangeLog.$$i"; \
-	  fi; \
-	done; \
-	if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
-	for file in $$dists; do \
-	  if test -f $$file; then \
-	    cp -p $$file $(distdir) || exit 1; \
-	  else \
-	    cp -p $(srcdir)/$$file $(distdir) || exit 1; \
-	  fi; \
-	done
-
-update-po: Makefile
-	$(MAKE) $(DOMAIN).pot-update
-	test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
-	$(MAKE) update-gmo
-
-# General rule for creating PO files.
-
-.nop.po-create:
-	@lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
-	echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
-	exit 1
-
-# General rule for updating PO files.
-
-.nop.po-update:
-	@lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
-	if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
-	tmpdir=`pwd`; \
-	echo "$$lang:"; \
-	test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
-	echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
-	cd $(srcdir); \
-	if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
-	  if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
-	    rm -f $$tmpdir/$$lang.new.po; \
-	  else \
-	    if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
-	      :; \
-	    else \
-	      echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
-	      exit 1; \
-	    fi; \
-	  fi; \
-	else \
-	  echo "msgmerge for $$lang.po failed!" 1>&2; \
-	  rm -f $$tmpdir/$$lang.new.po; \
-	fi
-
-$(DUMMYPOFILES):
-
-update-gmo: Makefile $(GMOFILES)
-	@:
-
-Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
-	cd $(top_builddir) \
-	  && $(SHELL) ./config.status $(subdir)/$@.in po-directories
-
-force:
-
-# Tell versions [3.59,3.63) of GNU make not to export all variables.
-# Otherwise a system limit (for SysV at least) may be exceeded.
-.NOEXPORT:
diff --git a/myserver/po/Makevars b/myserver/po/Makevars
deleted file mode 100644
index 48a6525..0000000
--- a/myserver/po/Makevars
+++ /dev/null
@@ -1,48 +0,0 @@
-# -*- buffer-read-only: t -*- vi: set ro:
-# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Makefile variables for PO directory in any package using GNU gettext.
-
-# Usually the message domain is the same as the package name.
-DOMAIN = $(PACKAGE)
-
-# These two variables depend on the location of this directory.
-subdir = po
-top_builddir = ..
-
-# These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --keyword=_E \
-          \
- --flag=_:1:pass-c-format\
- --flag=N_:1:pass-c-format\
- --flag=error:3:c-format --flag=error_at_line:5:c-format\
- $${end_of_xgettext_options+}
-
-# This is the copyright holder that gets inserted into the header of the
-# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
-# package.  (Note that the msgstr strings, extracted from the package's
-# sources, belong to the copyright holder of the package.)  Translators are
-# expected to transfer the copyright for their translations to this person
-# or entity, or to disclaim their copyright.  The empty string stands for
-# the public domain; in this case the translators are expected to disclaim
-# their copyright.
-COPYRIGHT_HOLDER = Free Software Foundation, Inc.
-
-# This is the email address or URL to which the translators shall report
-# bugs in the untranslated strings:
-# - Strings which are not entire sentences, see the maintainer guidelines
-#   in the GNU gettext documentation, section 'Preparing Strings'.
-# - Strings which use unclear terms or require additional context to be
-#   understood.
-# - Strings which make invalid assumptions about notation of date, time or
-#   money.
-# - Pluralisation problems.
-# - Incorrect English spelling.
-# - Incorrect formatting.
-# It can be your email address, or a mailing list address where translators
-# can write to without being subscribed, or the URL of a web page through
-# which the translators can contact you.
-MSGID_BUGS_ADDRESS = bug-myserver@gnu.org
-
-# This is the list of locale categories, beyond LC_MESSAGES, for which the
-# message catalogs shall be used.  It is usually empty.
-EXTRA_LOCALE_CATEGORIES = 
diff --git a/myserver/po/Makevars.template b/myserver/po/Makevars.template
deleted file mode 100644
index dd1a896..0000000
--- a/myserver/po/Makevars.template
+++ /dev/null
@@ -1,41 +0,0 @@
-# Makefile variables for PO directory in any package using GNU gettext.
-
-# Usually the message domain is the same as the package name.
-DOMAIN = $(PACKAGE)
-
-# These two variables depend on the location of this directory.
-subdir = po
-top_builddir = ..
-
-# These options get passed to xgettext.
-XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ --keyword=_E
-
-# This is the copyright holder that gets inserted into the header of the
-# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
-# package.  (Note that the msgstr strings, extracted from the package's
-# sources, belong to the copyright holder of the package.)  Translators are
-# expected to transfer the copyright for their translations to this person
-# or entity, or to disclaim their copyright.  The empty string stands for
-# the public domain; in this case the translators are expected to disclaim
-# their copyright.
-COPYRIGHT_HOLDER = Free Software Foundation, Inc.
-
-# This is the email address or URL to which the translators shall report
-# bugs in the untranslated strings:
-# - Strings which are not entire sentences, see the maintainer guidelines
-#   in the GNU gettext documentation, section 'Preparing Strings'.
-# - Strings which use unclear terms or require additional context to be
-#   understood.
-# - Strings which make invalid assumptions about notation of date, time or
-#   money.
-# - Pluralisation problems.
-# - Incorrect English spelling.
-# - Incorrect formatting.
-# It can be your email address, or a mailing list address where translators
-# can write to without being subscribed, or the URL of a web page through
-# which the translators can contact you.
-MSGID_BUGS_ADDRESS =
-
-# This is the list of locale categories, beyond LC_MESSAGES, for which the
-# message catalogs shall be used.  It is usually empty.
-EXTRA_LOCALE_CATEGORIES =
diff --git a/myserver/po/POTFILES.in b/myserver/po/POTFILES.in
index 2e3ddc1..6d0eebd 100644
--- a/myserver/po/POTFILES.in
+++ b/myserver/po/POTFILES.in
@@ -5,6 +5,8 @@ src/base/crypt/crypt_algo_manager.cpp
 src/base/crypt/md5.cpp
 src/base/crypt/sha1.cpp
 src/base/dynamic_lib/dynamiclib.cpp
+src/base/exceptions/checked.cpp
+src/base/exceptions/exceptions.cpp
 src/base/file/file.cpp
 src/base/file/files_utility.cpp
 src/base/files_cache/cached_file_buffer.cpp
@@ -111,6 +113,7 @@ src/protocol/http/http.cpp
 src/protocol/http/http_data_handler.cpp
 src/protocol/http/http_data_read.cpp
 src/protocol/http/http_errors.cpp
+src/protocol/http/http_header.cpp
 src/protocol/http/http_headers.cpp
 src/protocol/http/http_req_security_domain.cpp
 src/protocol/http/http_request.cpp
diff --git a/myserver/po/Rules-quot b/myserver/po/Rules-quot
deleted file mode 100644
index 9c2a995..0000000
--- a/myserver/po/Rules-quot
+++ /dev/null
@@ -1,47 +0,0 @@
-# Special Makefile rules for English message catalogs with quotation marks.
-
-DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
-
-.SUFFIXES: .insert-header .po-update-en
-
-en@quot.po-create:
-	$(MAKE) en@quot.po-update
-en@boldquot.po-create:
-	$(MAKE) en@boldquot.po-update
-
-en@quot.po-update: en@quot.po-update-en
-en@boldquot.po-update: en@boldquot.po-update-en
-
-.insert-header.po-update-en:
-	@lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
-	if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
-	tmpdir=`pwd`; \
-	echo "$$lang:"; \
-	ll=`echo $$lang | sed -e 's/@.*//'`; \
-	LC_ALL=C; export LC_ALL; \
-	cd $(srcdir); \
-	if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \
-	  if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
-	    rm -f $$tmpdir/$$lang.new.po; \
-	  else \
-	    if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
-	      :; \
-	    else \
-	      echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
-	      exit 1; \
-	    fi; \
-	  fi; \
-	else \
-	  echo "creation of $$lang.po failed!" 1>&2; \
-	  rm -f $$tmpdir/$$lang.new.po; \
-	fi
-
-en@quot.insert-header: insert-header.sin
-	sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
-
-en@boldquot.insert-header: insert-header.sin
-	sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
-
-mostlyclean: mostlyclean-quot
-mostlyclean-quot:
-	rm -f *.insert-header
diff --git a/myserver/po/boldquot.sed b/myserver/po/boldquot.sed
deleted file mode 100644
index 4b937aa..0000000
--- a/myserver/po/boldquot.sed
+++ /dev/null
@@ -1,10 +0,0 @@
-s/"\([^"]*\)"/“\1”/g
-s/`\([^`']*\)'/‘\1’/g
-s/ '\([^`']*\)' / ‘\1’ /g
-s/ '\([^`']*\)'$/ ‘\1’/g
-s/^'\([^`']*\)' /‘\1’ /g
-s/“”/""/g
-s/“/“[1m/g
-s/”/[0m”/g
-s/‘/‘[1m/g
-s/’/[0m’/g
diff --git a/myserver/po/en@boldquot.header b/myserver/po/en@boldquot.header
deleted file mode 100644
index fedb6a0..0000000
--- a/myserver/po/en@boldquot.header
+++ /dev/null
@@ -1,25 +0,0 @@
-# All this catalog "translates" are quotation characters.
-# The msgids must be ASCII and therefore cannot contain real quotation
-# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
-# and double quote (0x22). These substitutes look strange; see
-# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
-#
-# This catalog translates grave accent (0x60) and apostrophe (0x27) to
-# left single quotation mark (U+2018) and right single quotation mark (U+2019).
-# It also translates pairs of apostrophe (0x27) to
-# left single quotation mark (U+2018) and right single quotation mark (U+2019)
-# and pairs of quotation mark (0x22) to
-# left double quotation mark (U+201C) and right double quotation mark (U+201D).
-#
-# When output to an UTF-8 terminal, the quotation characters appear perfectly.
-# When output to an ISO-8859-1 terminal, the single quotation marks are
-# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
-# grave/acute accent (by libiconv), and the double quotation marks are
-# transliterated to 0x22.
-# When output to an ASCII terminal, the single quotation marks are
-# transliterated to apostrophes, and the double quotation marks are
-# transliterated to 0x22.
-#
-# This catalog furthermore displays the text between the quotation marks in
-# bold face, assuming the VT100/XTerm escape sequences.
-#
diff --git a/myserver/po/en@quot.header b/myserver/po/en@quot.header
deleted file mode 100644
index a9647fc..0000000
--- a/myserver/po/en@quot.header
+++ /dev/null
@@ -1,22 +0,0 @@
-# All this catalog "translates" are quotation characters.
-# The msgids must be ASCII and therefore cannot contain real quotation
-# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
-# and double quote (0x22). These substitutes look strange; see
-# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
-#
-# This catalog translates grave accent (0x60) and apostrophe (0x27) to
-# left single quotation mark (U+2018) and right single quotation mark (U+2019).
-# It also translates pairs of apostrophe (0x27) to
-# left single quotation mark (U+2018) and right single quotation mark (U+2019)
-# and pairs of quotation mark (0x22) to
-# left double quotation mark (U+201C) and right double quotation mark (U+201D).
-#
-# When output to an UTF-8 terminal, the quotation characters appear perfectly.
-# When output to an ISO-8859-1 terminal, the single quotation marks are
-# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
-# grave/acute accent (by libiconv), and the double quotation marks are
-# transliterated to 0x22.
-# When output to an ASCII terminal, the single quotation marks are
-# transliterated to apostrophes, and the double quotation marks are
-# transliterated to 0x22.
-#
diff --git a/myserver/po/insert-header.sin b/myserver/po/insert-header.sin
deleted file mode 100644
index b26de01..0000000
--- a/myserver/po/insert-header.sin
+++ /dev/null
@@ -1,23 +0,0 @@
-# Sed script that inserts the file called HEADER before the header entry.
-#
-# At each occurrence of a line starting with "msgid ", we execute the following
-# commands. At the first occurrence, insert the file. At the following
-# occurrences, do nothing. The distinction between the first and the following
-# occurrences is achieved by looking at the hold space.
-/^msgid /{
-x
-# Test if the hold space is empty.
-s/m/m/
-ta
-# Yes it was empty. First occurrence. Read the file.
-r HEADER
-# Output the file's contents by reading the next line. But don't lose the
-# current line while doing this.
-g
-N
-bb
-:a
-# The hold space was nonempty. Following occurrences. Do nothing.
-x
-:b
-}
diff --git a/myserver/po/quot.sed b/myserver/po/quot.sed
deleted file mode 100644
index 0122c46..0000000
--- a/myserver/po/quot.sed
+++ /dev/null
@@ -1,6 +0,0 @@
-s/"\([^"]*\)"/“\1”/g
-s/`\([^`']*\)'/‘\1’/g
-s/ '\([^`']*\)' / ‘\1’ /g
-s/ '\([^`']*\)'$/ ‘\1’/g
-s/^'\([^`']*\)' /‘\1’ /g
-s/“”/""/g
diff --git a/myserver/po/remove-potcdate.sin b/myserver/po/remove-potcdate.sin
deleted file mode 100644
index 2436c49..0000000
--- a/myserver/po/remove-potcdate.sin
+++ /dev/null
@@ -1,19 +0,0 @@
-# Sed script that remove the POT-Creation-Date line in the header entry
-# from a POT file.
-#
-# The distinction between the first and the following occurrences of the
-# pattern is achieved by looking at the hold space.
-/^"POT-Creation-Date: .*"$/{
-x
-# Test if the hold space is empty.
-s/P/P/
-ta
-# Yes it was empty. First occurrence. Remove the line.
-g
-d
-bb
-:a
-# The hold space was nonempty. Following occurrences. Do nothing.
-x
-:b
-}

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

Summary of changes:
 myserver/bootstrap.conf         |    1 -
 myserver/po/ChangeLog           |   12 --
 myserver/po/Makefile.in.in      |  403 ---------------------------------------
 myserver/po/Makevars            |   48 -----
 myserver/po/Makevars.template   |   41 ----
 myserver/po/POTFILES.in         |    3 +
 myserver/po/Rules-quot          |   47 -----
 myserver/po/boldquot.sed        |   10 -
 myserver/po/en@boldquot.header  |   25 ---
 myserver/po/en@quot.header      |   22 --
 myserver/po/insert-header.sin   |   23 ---
 myserver/po/quot.sed            |    6 -
 myserver/po/remove-potcdate.sin |   19 --
 13 files changed, 3 insertions(+), 657 deletions(-)
 delete mode 100644 myserver/po/ChangeLog
 delete mode 100644 myserver/po/Makefile.in.in
 delete mode 100644 myserver/po/Makevars
 delete mode 100644 myserver/po/Makevars.template
 delete mode 100644 myserver/po/Rules-quot
 delete mode 100644 myserver/po/boldquot.sed
 delete mode 100644 myserver/po/en@boldquot.header
 delete mode 100644 myserver/po/en@quot.header
 delete mode 100644 myserver/po/insert-header.sin
 delete mode 100644 myserver/po/quot.sed
 delete mode 100644 myserver/po/remove-potcdate.sin


hooks/post-receive
-- 
GNU MyServer



From MAILER-DAEMON Thu Apr 29 05:47:38 2010
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1O7QLK-000728-MU
	for mharc-myserver-commit@gnu.org; Thu, 29 Apr 2010 05:47:38 -0400
Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1O7QLI-00070n-QF
	for myserver-commit@gnu.org; Thu, 29 Apr 2010 05:47:36 -0400
Received: from [140.186.70.92] (port=48997 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1O7QLH-0006zg-8r
	for myserver-commit@gnu.org; Thu, 29 Apr 2010 05:47:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <e.dolstra@tudelft.nl>) id 1O7QLF-0005rP-AL
	for myserver-commit@gnu.org; Thu, 29 Apr 2010 05:47:35 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:41397)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <e.dolstra@tudelft.nl>) id 1O7QLE-0005rD-Vi
	for myserver-commit@gnu.org; Thu, 29 Apr 2010 05:47:33 -0400
Received: from hydra (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.12.11/8.12.8) with SMTP id
	o3T9lVdg028168
	for <myserver-commit@gnu.org>; Thu, 29 Apr 2010 11:47:31 +0200
Message-Id: <201004290947.o3T9lVdg028168@proliant.st.ewi.tudelft.nl>
Received: by hydra (sSMTP sendmail emulation); Thu, 29 Apr 2010 11:47:31 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
Date: Thu, 29 Apr 2010 11:47:31 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
Subject: [myserver-commit] Hydra job gnu:myserver-master:manual build 387400
	FAILED
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, 29 Apr 2010 09:47:37 -0000

Hi,

This is to let you know that Hydra build 387400 of job gnu:myserver-master:manual has changed from FAILED to FAILED.

Complete build information can be found on this page: http://hydra.nixos.org/build/387400

The last 50 lines of the build log are shown at the bottom of this email.

A summary of the build information follows:

Build ID:              | 387400
Nix name:              | myserver-manual-0.9.2
Short description:     | Native Nix build on x86_64-linux
Maintainer(s):         | myserver-commit@gnu.org
System:                | x86_64-linux
Derivation store path: | /nix/store/4qnyc1h2yvp29b7yy6znzk6a7qmcvw5q-myserver-manual-0.9.2.drv
Output store path:     | /nix/store/p4lqm43zzkbp7ynkc8ni6f3yrvkm630w-myserver-manual-0.9.2
Time added:            | 2010-04-29 11:47:31
Build started:         | 2010-04-29 11:46:20
Build finished:        | 2010-04-29 11:47:31
Duration:              | 71s

The build inputs were:

Name        | Type  | Value
------------+-------+-------------------------------------------------------------
hydraConfig | svn   | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:21345
nixpkgs     | svn   | https://svn.nixos.org/repos/nix/nixpkgs/trunk:21421
tarball     | build | 387290

Regards,

The Hydra build daemon.

---
config.status: creating src/base/thread/Makefile
config.status: creating src/base/unix_socket/Makefile
config.status: creating src/protocol/Makefile
config.status: creating src/protocol/ftp/Makefile
config.status: creating src/protocol/control/Makefile
config.status: creating src/protocol/https/Makefile
config.status: creating src/protocol/http/Makefile
config.status: creating src/protocol/http/env/Makefile
config.status: creating src/protocol/gopher/Makefile
config.status: creating src/filter/Makefile
config.status: creating src/filter/gzip/Makefile
config.status: creating src/plugin/Makefile
config.status: creating src/server/Makefile
config.status: creating src/GUI/Makefile
config.status: creating tests/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing po-directories commands
config.status: creating po/POTFILES
config.status: creating po/Makefile
[q[pbuilding
[pmake: Entering directory `/tmp/nix-build-4qnyc1h2yvp29b7yy6znzk6a7qmcvw5q-myserver-manual-0.9.2.drv-0/myserver-0.9.2/documentation'
[pbuilding html-recursive
[pmake[1]: Entering directory `/tmp/nix-build-4qnyc1h2yvp29b7yy6znzk6a7qmcvw5q-myserver-manual-0.9.2.drv-0/myserver-0.9.2/documentation'
[pbuilding myserver.html
[3s[arm -rf myserver.htp[b
[3s[aif /bin/sh /tmp/nix-build-4qnyc1h2yvp29b7yy6znzk6a7qmcvw5q-myserver-manual-0.9.2.drv-0/myserver-0.9.2/build-aux/missing --run makeinfo --html   -I . \
	 -o myserver.htp myserver.texi; \
	then \
	  rm -rf myserver.html; \
	  if test ! -d myserver.htp && test -d myserver; then \
	    mv myserver myserver.html; else mv myserver.htp myserver.html; fi; \
	else \
	  if test ! -d myserver.htp && test -d myserver; then \
	    rm -rf myserver; else rm -Rf myserver.htp myserver.html; fi; \
	  exit 1; \
	fi[b
myserver.texi:119: @include `security.texi': No such file or directory.
myserver.texi:138: @include `log_management.texi': No such file or directory.
makeinfo: Removing output file `/tmp/nix-build-4qnyc1h2yvp29b7yy6znzk6a7qmcvw5q-myserver-manual-0.9.2.drv-0/myserver-0.9.2/documentation/myserver.htp/index.html' due to errors; use --force to preserve.
make[1]: *** [myserver.html] Error 1
make[1]: Leaving directory `/tmp/nix-build-4qnyc1h2yvp29b7yy6znzk6a7qmcvw5q-myserver-manual-0.9.2.drv-0/myserver-0.9.2/documentation'
[q[qmake: *** [html-recursive] Error 1
make: Leaving directory `/tmp/nix-build-4qnyc1h2yvp29b7yy6znzk6a7qmcvw5q-myserver-manual-0.9.2.drv-0/myserver-0.9.2/documentation'
[q[q[q[qbuild time elapsed:  0m0.021s 0m0.010s 0m26.553s 0m18.682s
builder for `/nix/store/4qnyc1h2yvp29b7yy6znzk6a7qmcvw5q-myserver-manual-0.9.2.drv' failed with exit code 2
error: build of `/nix/store/4qnyc1h2yvp29b7yy6znzk6a7qmcvw5q-myserver-manual-0.9.2.drv' failed
Shared connection to kenny closed.

build of `/nix/store/4qnyc1h2yvp29b7yy6znzk6a7qmcvw5q-myserver-manual-0.9.2.drv' on `buildfarm@kenny' failed with exit code 256



