From MAILER-DAEMON Tue Apr 12 04:22:57 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Q9YsD-00043o-2c
	for mharc-myserver-commit@gnu.org; Tue, 12 Apr 2011 04:22:57 -0400
Received: from eggs.gnu.org ([140.186.70.92]:47012)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1Q9YsA-00043h-Si
	for myserver-commit@gnu.org; Tue, 12 Apr 2011 04:22:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1Q9Ys9-0000Ka-JC
	for myserver-commit@gnu.org; Tue, 12 Apr 2011 04:22:54 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:37103)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1Q9Ys9-0000KP-AB
	for myserver-commit@gnu.org; Tue, 12 Apr 2011 04:22:53 -0400
Received: from lucifer (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.14.4/8.14.4) with SMTP id
	p3C8Mpg5026583
	for <myserver-commit@gnu.org>; Tue, 12 Apr 2011 10:22:51 +0200
Message-Id: <201104120822.p3C8Mpg5026583@proliant.st.ewi.tudelft.nl>
Received: by lucifer (sSMTP sendmail emulation);
	Tue, 12 Apr 2011 10:22:51 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
X-Hydra-Instance: lucifer
X-Hydra-Project: gnu
X-Hydra-Jobset: myserver-master
X-Hydra-Job: tarball
Date: Tue, 12 Apr 2011 10:22:51 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 130.161.158.3
Subject: [myserver-commit] Hydra job gnu:myserver-master:tarball build
	1041327: Failed
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 12 Apr 2011 08:22:56 -0000

Hi,

This is to let you know that Hydra build 1041327 of job gnu:myserver-master:tarball has changed from 'Success' to 'Failed'.

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

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:              | 1041327
Nix name:              | myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442
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/qxsya4fvzh3adqhy471g142qzhfp4gvz-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442.drv
Output store path:     | /nix/store/g9ydvvgmisw8rjdrp2ibdmbir29by0sw-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442
Time added:            | 2011-04-12 10:22:51
Build started:         | 2011-04-12 10:18:18
Build finished:        | 2011-04-12 10:22:51
Duration:              | 273s

The build inputs were:

Name        | Type | Value
------------+------+---------------------------------------------------------------------------
myserverSrc | git  | git://git.sv.gnu.org/myserver.git:d43d99348dacaf75cd659a7dbc3bfad826e62442
hydraConfig | svn  | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:26691
gnulibSrc   | git  | git://git.sv.gnu.org/gnulib.git:ca6143b425589c3a64bd28efd7af14463f96d576
nixpkgs     | svn  | https://svn.nixos.org/repos/nix/nixpkgs/trunk:26798

Regards,

The Hydra build daemon.

---
[3s[a/bin/sh ../../libtool --silent --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2 -I"../../lib" -I"../../lib" -I"../.." -fPIC -DPIC  -c -o protocol.lo protocol.cpp[b
[q[pbuilding protocols_manager.lo
  CXX    protocols_manager.lo
[3s[a/bin/sh ../../libtool --silent --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2 -I"../../lib" -I"../../lib" -I"../.." -fPIC -DPIC  -c -o protocols_manager.lo protocols_manager.cpp[b
[q[pbuilding url.lo
  CXX    url.lo
[3s[a/bin/sh ../../libtool --silent --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2 -I"../../lib" -I"../../lib" -I"../.." -fPIC -DPIC  -c -o url.lo url.cpp[b
[q[pbuilding libprotocol.la
  CXXLD  libprotocol.la
[qmake[4]: Leaving directory `/tmp/nix-build-qxsya4fvzh3adqhy471g142qzhfp4gvz-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442.drv-0/git-export/myserver/src/protocol'
[q[qmake[3]: Leaving directory `/tmp/nix-build-qxsya4fvzh3adqhy471g142qzhfp4gvz-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442.drv-0/git-export/myserver/src/protocol'
[qMaking all in server
[pmake[3]: Entering directory `/tmp/nix-build-qxsya4fvzh3adqhy471g142qzhfp4gvz-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442.drv-0/git-export/myserver/src/server'
[pbuilding all-recursive
[pmake[4]: Entering directory `/tmp/nix-build-qxsya4fvzh3adqhy471g142qzhfp4gvz-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442.drv-0/git-export/myserver/src/server'
[pbuilding clients_thread.lo
  CXX    clients_thread.lo
[3s[a/bin/sh ../../libtool --silent --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2 -I"../../lib" -I"../../lib" -I"../.." -fPIC -DPIC  -c -o clients_thread.lo clients_thread.cpp[b
[q[pbuilding server.lo
  CXX    server.lo
[3s[a/bin/sh ../../libtool --silent --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2 -I"../../lib" -I"../../lib" -I"../.." -fPIC -DPIC  -c -o server.lo server.cpp[b
[q[pbuilding libserver.la
  CXXLD  libserver.la
[qmake[4]: Leaving directory `/tmp/nix-build-qxsya4fvzh3adqhy471g142qzhfp4gvz-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442.drv-0/git-export/myserver/src/server'
[q[qmake[3]: Leaving directory `/tmp/nix-build-qxsya4fvzh3adqhy471g142qzhfp4gvz-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442.drv-0/git-export/myserver/src/server'
[qMaking all in GUI
[pmake[3]: Entering directory `/tmp/nix-build-qxsya4fvzh3adqhy471g142qzhfp4gvz-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442.drv-0/git-export/myserver/src/GUI'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/tmp/nix-build-qxsya4fvzh3adqhy471g142qzhfp4gvz-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442.drv-0/git-export/myserver/src/GUI'
[q[pmake[3]: Entering directory `/tmp/nix-build-qxsya4fvzh3adqhy471g142qzhfp4gvz-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442.drv-0/git-export/myserver/src'
[pbuilding libmyserver.la
  CCLD   libmyserver.la
copying selected object files to avoid basename conflicts...
[q[pbuilding myserver-myserver.o
  CXX    myserver-myserver.o
[3s[ag++ -DHAVE_CONFIG_H -I. -I..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2 -I"../lib" -I"../lib" -I".." -fPIC -DPIC  -DHOST_STR=\"x86_64-unknown-linux-gnu\" -DPREFIX=\"/tmp/nix-build-qxsya4fvzh3adqhy471g142qzhfp4gvz-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442.drv-0/tmp_prefix\" -fPIC -DPIC  -c -o myserver-myserver.o `test -f 'myserver.cpp' || echo './'`myserver.cpp[b
[q[pbuilding myserver
  CXXLD  myserver
/nix/store/9b3q62czfh5zld9zg2p8sbk65hkbvpzi-binutils-2.21/bin/ld: cannot find -lgmp
collect2: ld returned 1 exit status
make[3]: *** [myserver] Error 1
make[3]: Leaving directory `/tmp/nix-build-qxsya4fvzh3adqhy471g142qzhfp4gvz-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442.drv-0/git-export/myserver/src'
[q[qmake[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/nix-build-qxsya4fvzh3adqhy471g142qzhfp4gvz-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442.drv-0/git-export/myserver/src'
[q[qmake[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/nix-build-qxsya4fvzh3adqhy471g142qzhfp4gvz-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442.drv-0/git-export/myserver'
[q[qmake: *** [all] Error 2
[q[q[qbuild time elapsed:  0m0.028s 0m0.014s 2m18.555s 0m44.907s
[pCopying build directory to /nix/store/g9ydvvgmisw8rjdrp2ibdmbir29by0sw-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442/nix-build-qxsya4fvzh3adqhy471g142qzhfp4gvz-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442.drv-0
[qbuild failed with exit code 2 (ignored)


From MAILER-DAEMON Tue Apr 12 13:18:33 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Q9hEX-0000Mo-3m
	for mharc-myserver-commit@gnu.org; Tue, 12 Apr 2011 13:18:33 -0400
Received: from eggs.gnu.org ([140.186.70.92]:39677)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1Q9hEU-0000M8-FK
	for myserver-commit@gnu.org; Tue, 12 Apr 2011 13:18:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1Q9hES-0003Ox-5X
	for myserver-commit@gnu.org; Tue, 12 Apr 2011 13:18:30 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:38239)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1Q9hER-0003Or-Rv
	for myserver-commit@gnu.org; Tue, 12 Apr 2011 13:18:28 -0400
Received: from lucifer (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.14.4/8.14.4) with SMTP id
	p3CHIPpU031356
	for <myserver-commit@gnu.org>; Tue, 12 Apr 2011 19:18:25 +0200
Message-Id: <201104121718.p3CHIPpU031356@proliant.st.ewi.tudelft.nl>
Received: by lucifer (sSMTP sendmail emulation);
	Tue, 12 Apr 2011 19:18:25 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
X-Hydra-Instance: lucifer
X-Hydra-Project: gnu
X-Hydra-Jobset: myserver-master
X-Hydra-Job: tarball
Date: Tue, 12 Apr 2011 19:18:25 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 130.161.158.3
Subject: [myserver-commit] Hydra job gnu:myserver-master:tarball build
	1042447: Success
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 12 Apr 2011 17:18:31 -0000

Hi,

This is to let you know that Hydra build 1042447 of job gnu:myserver-master:tarball has changed from 'Failed' to 'Success'.

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

A summary of the build information follows:

Build ID:              | 1042447
Nix name:              | myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442
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/mbr7bb4q97908y7qiyww4jbn5kdj4j27-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442.drv
Output store path:     | /nix/store/am5cchf69ppawygzawjyapyiabk6nzwn-myserver-tarball-0pred43d99348dacaf75cd659a7dbc3bfad826e62442
Time added:            | 2011-04-12 19:18:24
Build started:         | 2011-04-12 19:12:08
Build finished:        | 2011-04-12 19:18:24
Duration:              | 376s

The build inputs were:

Name        | Type | Value
------------+------+---------------------------------------------------------------------------
myserverSrc | git  | git://git.sv.gnu.org/myserver.git:d43d99348dacaf75cd659a7dbc3bfad826e62442
hydraConfig | svn  | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:26691
gnulibSrc   | git  | git://git.sv.gnu.org/gnulib.git:fb799692f5bb43310424977e0ca15599fc68d776
nixpkgs     | svn  | https://svn.nixos.org/repos/nix/nixpkgs/trunk:26810

Regards,

The Hydra build daemon.


From MAILER-DAEMON Thu Apr 14 14:54:16 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QARgG-0005Rx-2M
	for mharc-myserver-commit@gnu.org; Thu, 14 Apr 2011 14:54:16 -0400
Received: from eggs.gnu.org ([140.186.70.92]:39317)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QARgE-0005Rr-4B
	for myserver-commit@gnu.org; Thu, 14 Apr 2011 14:54:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QARgD-0003T6-Dk
	for myserver-commit@gnu.org; Thu, 14 Apr 2011 14:54:14 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:42560)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QARgD-0003Sv-Ao
	for myserver-commit@gnu.org; Thu, 14 Apr 2011 14:54:13 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QARgC-0003CM-KP
	for myserver-commit@gnu.org; Thu, 14 Apr 2011 18:54:12 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QARgC-0005pQ-7B
	for myserver-commit@gnu.org; Thu, 14 Apr 2011 18:54:12 +0000
Date: Thu, 14 Apr 2011 18:54:12 +0000
Message-Id: <E1QARgC-0005pQ-7B@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: d43d99348dacaf75cd659a7dbc3bfad826e62442
X-Git-Newrev: 825e5c521789a197babeea53fb14539814e399de
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-439-g825e5c5
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/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, 14 Apr 2011 18:54:15 -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  825e5c521789a197babeea53fb14539814e399de (commit)
      from  d43d99348dacaf75cd659a7dbc3bfad826e62442 (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 825e5c521789a197babeea53fb14539814e399de
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 14 20:47:05 2011 +0200

    doc: Fix SSL virtual host example.

diff --git a/myserver/documentation/ssl_certificates.texi b/myserver/documentation/ssl_certificates.texi
index dbe9705..324840d 100644
--- a/myserver/documentation/ssl_certificates.texi
+++ b/myserver/documentation/ssl_certificates.texi
@@ -60,15 +60,19 @@ the following lines in the @file{virtualhosts.xml} file:
 
 @example
 <VHOST>
-  <NAME>Every connection</NAME>
+  <NAME>Every SSL connection</NAME>
   <PORT>443</PORT>
   <SSL_PRIVATEKEY>certificates/cert.key</SSL_PRIVATEKEY>
   <SSL_CERTIFICATE>certificates/cert.pem</SSL_CERTIFICATE>
   <PROTOCOL>HTTPS</PROTOCOL>
   <DOCROOT>web</DOCROOT>
   <SYSROOT>system</SYSROOT>
-  <ACCESSLOG>logs/myServer.log</ACCESSLOG>
-  <WARNINGLOG>logs/myServer.err</WARNINGLOG>
+    <ACCESSLOG>
+      <STREAM location="file://logs/myServer.log" cycle="1048576"/>
+	  </ACCESSLOG>
+    <WARNINGLOG>
+      <STREAM location="file://logs/myServer.err" cycle="1048576"/>
+    </WARNINGLOG>
 </VHOST>
 @end example
 

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

Summary of changes:
 myserver/documentation/ssl_certificates.texi |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Thu Apr 14 16:59:17 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QATdF-0002vG-62
	for mharc-myserver-commit@gnu.org; Thu, 14 Apr 2011 16:59:17 -0400
Received: from eggs.gnu.org ([140.186.70.92]:37395)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QATdD-0002v9-6O
	for myserver-commit@gnu.org; Thu, 14 Apr 2011 16:59:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QATdC-0001lE-Ah
	for myserver-commit@gnu.org; Thu, 14 Apr 2011 16:59:15 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:43249)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QATdC-0001lA-5I
	for myserver-commit@gnu.org; Thu, 14 Apr 2011 16:59:14 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QATdB-0004d0-JF
	for myserver-commit@gnu.org; Thu, 14 Apr 2011 20:59:13 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QATdB-0003ov-HA
	for myserver-commit@gnu.org; Thu, 14 Apr 2011 20:59:13 +0000
Date: Thu, 14 Apr 2011 20:59:13 +0000
Message-Id: <E1QATdB-0003ov-HA@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 825e5c521789a197babeea53fb14539814e399de
X-Git-Newrev: 5119cca140dad223a8a00673d0acd43c443019e9
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-440-g5119cca
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/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, 14 Apr 2011 20:59: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  5119cca140dad223a8a00673d0acd43c443019e9 (commit)
      from  825e5c521789a197babeea53fb14539814e399de (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 5119cca140dad223a8a00673d0acd43c443019e9
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 14 22:54:00 2011 +0200

    ssl: ensure rawSend consumes the whole buffer before return.

diff --git a/myserver/src/base/socket/ssl_socket.cpp b/myserver/src/base/socket/ssl_socket.cpp
index ea96157..f7e4e8f 100644
--- a/myserver/src/base/socket/ssl_socket.cpp
+++ b/myserver/src/base/socket/ssl_socket.cpp
@@ -99,17 +99,22 @@ int SslSocket::shutdown (int how)
  */
 int SslSocket::rawSend (const char* buffer, int len, int flags)
 {
+  int sent = 0;
   int err;
   do
     {
-      err = SSL_write (sslConnection, buffer, len);
-    }while ((err <= 0) &&
-            (SSL_get_error (sslConnection, err) == SSL_ERROR_WANT_WRITE
-             || SSL_get_error (sslConnection, err) == SSL_ERROR_WANT_READ));
-  if (err <= 0)
+      err = SSL_write (sslConnection, buffer + sent, len - sent);
+      if (err > 0)
+        sent += err;
+    }
+  while ((err <= 0
+          && SSL_get_error (sslConnection, err) == SSL_ERROR_WANT_WRITE)
+         || (err > 0 && sent < len));
+
+  if (err < 0)
     return -1;
   else
-    return err;
+    return sent;
 }
 
 /*!

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

Summary of changes:
 myserver/src/base/socket/ssl_socket.cpp |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Fri Apr 15 08:01:08 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QAhi0-0002E4-Hw
	for mharc-myserver-commit@gnu.org; Fri, 15 Apr 2011 08:01:08 -0400
Received: from eggs.gnu.org ([140.186.70.92]:47792)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QAhhu-0002Dv-6d
	for myserver-commit@gnu.org; Fri, 15 Apr 2011 08:01:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QAhhs-0001Ew-UR
	for myserver-commit@gnu.org; Fri, 15 Apr 2011 08:01:02 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:38958)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QAhhs-0001Es-SS
	for myserver-commit@gnu.org; Fri, 15 Apr 2011 08:01:00 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QAhhr-0006WV-VD
	for myserver-commit@gnu.org; Fri, 15 Apr 2011 12:01:00 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QAhhq-0004VE-86
	for myserver-commit@gnu.org; Fri, 15 Apr 2011 12:00:59 +0000
Date: Fri, 15 Apr 2011 12:00:58 +0000
Message-Id: <E1QAhhq-0004VE-86@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 5119cca140dad223a8a00673d0acd43c443019e9
X-Git-Newrev: dc30ec7b59ce804f22a4341348c734ec3ca3fca4
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-442-gdc30ec7
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/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, 15 Apr 2011 12:01:07 -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  dc30ec7b59ce804f22a4341348c734ec3ca3fca4 (commit)
       via  81ca73a88a3f91aec7e0f86b12c61728b3f8e8ff (commit)
      from  5119cca140dad223a8a00673d0acd43c443019e9 (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 dc30ec7b59ce804f22a4341348c734ec3ca3fca4
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 15 14:00:53 2011 +0200

    HttpFile: log correctly the number of written bytes.

diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index b9365fc..320cd06 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -333,7 +333,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
       }
 
     useModifiers = chain.hasModifiersFilters ();
-    if (!useModifiers)
+    if (! useModifiers)
       {
         ostringstream buffer;
         buffer << bytesToSend;
@@ -459,8 +459,10 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
         if (bytesToSend)
           {
             /* Read from the file the bytes to send.  */
-            size_t size = std::min (bytesToSend,
-                                    td->buffer->getRealLength () / 2);
+            size_t size = std::min (td->buffer->getRealLength (), bytesToSend);
+
+            if (useModifiers)
+              size = std::min (size, td->auxiliaryBuffer->getRealLength () / 2);
 
             file->read (td->buffer->getBuffer (), size, &nbr);
             if (nbr == 0)
@@ -471,10 +473,11 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
 
             bytesToSend -= nbr;
 
-            appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                           nbr, &(td->outputData), &chain, td->appendOutputs,
-                               useChunks, td->buffer->getRealLength (), &memStream);
-            dataSent += nbr;
+            dataSent += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
+                                                 nbr, &(td->outputData), &chain,
+                                                 td->appendOutputs, useChunks,
+                                                 td->buffer->getRealLength (),
+                                                 &memStream);
           }
         else /* if (bytesToSend) */
           {
@@ -482,6 +485,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
             if (!useChunks)
               {
                 chain.flush (&nbw);
+                dataSent += nbw;
                 break;
               }
             else
@@ -501,11 +505,10 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
                 memStream.read (td->buffer->getBuffer (),
                                 td->buffer->getRealLength (), &nbr);
 
-                HttpDataHandler::appendDataToHTTPChannel (td,
-                                                       td->buffer->getBuffer (),
-                                                       nbr, &(td->outputData),
-                                                       &chain, td->appendOutputs,
-                                                          useChunks);
+                dataSent += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
+                                                     nbr, &(td->outputData),
+                                                     &chain, td->appendOutputs,
+                                                     useChunks);
                 break;
               }
           }



commit 81ca73a88a3f91aec7e0f86b12c61728b3f8e8ff
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 15 13:32:58 2011 +0200

    appendDataToHTTPChannel returns the count of bytes successfully written.

diff --git a/myserver/include/protocol/http/http_data_handler.h b/myserver/include/protocol/http/http_data_handler.h
index 58f40f8..c60821a 100644
--- a/myserver/include/protocol/http/http_data_handler.h
+++ b/myserver/include/protocol/http/http_data_handler.h
@@ -50,25 +50,25 @@ public:
   HttpDataHandler ();
   virtual ~HttpDataHandler ();
 
-  static void checkDataChunks (HttpThreadContext*, bool*, bool*);
+  static void checkDataChunks (HttpThreadContext *, bool *, bool *);
 
-  static int appendDataToHTTPChannel (HttpThreadContext* td,
-                                      char* buffer,
-                                      u_long size,
-                                      File* appendFile,
-                                      FiltersChain* chain,
-                                      bool append,
-                                      bool useChunks,
-                                      u_long realBufferSize,
-                                      MemoryStream *tmpStream);
+  static size_t appendDataToHTTPChannel (HttpThreadContext* td,
+                                         char *buffer,
+                                         size_t size,
+                                         File *appendFile,
+                                         FiltersChain *chain,
+                                         bool append,
+                                         bool useChunks,
+                                         size_t realBufferSize,
+                                         MemoryStream *tmpStream);
 
-  static int appendDataToHTTPChannel (HttpThreadContext* td,
-                                      char* buffer,
-                                      u_long size,
-                                      File* appendFile,
-                                      FiltersChain* chain,
-                                      bool append,
-                                      bool useChunks);
+  static size_t appendDataToHTTPChannel (HttpThreadContext* td,
+                                         char *buffer,
+                                         size_t size,
+                                         File *appendFile,
+                                         FiltersChain* chain,
+                                         bool append,
+                                         bool useChunks);
 
 };
 
diff --git a/myserver/src/protocol/http/http_data_handler.cpp b/myserver/src/protocol/http/http_data_handler.cpp
index df211b8..04401ea 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -75,15 +75,15 @@ int HttpDataHandler::unLoad ()
   \param tmpStream A support on memory read/write stream used
   internally by the function.
  */
-int HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext* td,
-                                              char* buffer,
-                                              u_long size,
-                                              File* appendFile,
-                                              FiltersChain* chain,
-                                              bool append,
-                                              bool useChunks,
-                                              u_long realBufferSize,
-                                              MemoryStream *tmpStream)
+size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
+                                                 char *buffer,
+                                                 size_t size,
+                                                 File *appendFile,
+                                                 FiltersChain *chain,
+                                                 bool append,
+                                                 bool useChunks,
+                                                 size_t realBufferSize,
+                                                 MemoryStream *tmpStream)
 {
   size_t nbr, nbw;
   Stream *oldStream = chain->getStream ();
@@ -101,25 +101,12 @@ int HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext* td,
    */
   chain->setStream (tmpStream);
 
-  if (chain->write (buffer, size, &nbw))
-    {
-      td->connection->host->warningsLogWrite (_("Http: internal error"));
-      return 1;
-    }
+  chain->write (buffer, size, &nbw);
 
-
-  if (tmpStream->read (buffer, realBufferSize, &nbr))
-    {
-      td->connection->host->warningsLogWrite (_("Http: internal error"));
-      return 1;
-    }
+  tmpStream->read (buffer, realBufferSize, &nbr);
 
   chain->setStream (oldStream);
 
-  /*
-   *Use of chain->getStream () is needed to write directly on the
-   *final stream.
-   */
   return appendDataToHTTPChannel (td, buffer, nbr, appendFile, chain, append,
                                   useChunks);
 }
@@ -135,58 +122,46 @@ int HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext* td,
   \param append Append to the file?
   \param useChunks Can we use HTTP chunks to send data?
  */
-int
-HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext* td, char* buffer,
-                           u_long size, File* appendFile, FiltersChain* chain,
+size_t
+HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext* td,
+                                          char *buffer,
+                                          size_t size,
+                                          File *appendFile,
+                                          FiltersChain *chain,
                                           bool append, bool useChunks)
 {
-  size_t nbw;
-
+  size_t tmp, nbw = 0;
   if (chain->hasModifiersFilters ())
     {
       td->connection->host->warningsLogWrite (_("Http: internal error"));
-      return 1;
+      return 0;
     }
 
   if (append)
-    return appendFile->writeToFile (buffer, size, &nbw);
-  else
     {
-      if (useChunks)
-        {
-          ostringstream chunkHeader;
-          size_t flushNbw = 0;
-          chunkHeader << hex << size << "\r\n";
-
-          if (chain->flush (&flushNbw))
-            {
-              td->connection->host->warningsLogWrite (_("Http: internal error"));
-              return 1;
-            }
-
-          if (chain->getStream ()->write (chunkHeader.str ().c_str (),
-                                          chunkHeader.str ().length (), &nbw))
-            {
-              td->connection->host->warningsLogWrite (_("Http: internal error"));
-              return 1;
-            }
-        }
+      appendFile->writeToFile (buffer, size, &nbw);
+      return nbw;
+    }
 
-      if (size && chain->write (buffer, size, &nbw))
-        {
-          td->connection->host->warningsLogWrite (_("Http: internal error"));
-          return 1;
-        }
+  if (useChunks)
+    {
+      ostringstream chunkHeader;
+      size_t flushNbw = 0;
+      chunkHeader << hex << size << "\r\n";
 
-      if (useChunks && chain->getStream ()->write ("\r\n", 2, &nbw))
-        {
-          td->connection->host->warningsLogWrite (_("Http: internal error"));
-          return 1;
-        }
+      chain->flush (&flushNbw);
 
-      return 0;
+      chain->getStream ()->write (chunkHeader.str ().c_str (),
+                                  chunkHeader.str ().length (), &tmp);
     }
-  return 1;
+
+  if (size)
+    chain->write (buffer, size, &nbw);
+
+  if (useChunks)
+    chain->getStream ()->write ("\r\n", 2, &tmp);
+
+  return nbw;
 }
 
 /*!

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

Summary of changes:
 myserver/include/protocol/http/http_data_handler.h |   34 ++++----
 myserver/src/http_handler/http_file/http_file.cpp  |   27 +++---
 myserver/src/protocol/http/http_data_handler.cpp   |  101 ++++++++------------
 3 files changed, 70 insertions(+), 92 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Fri Apr 15 19:37:48 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QAsaC-0003FG-67
	for mharc-myserver-commit@gnu.org; Fri, 15 Apr 2011 19:37:48 -0400
Received: from eggs.gnu.org ([140.186.70.92]:54586)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QAsa9-0003Ef-Hd
	for myserver-commit@gnu.org; Fri, 15 Apr 2011 19:37:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QAsa7-0002tq-Pa
	for myserver-commit@gnu.org; Fri, 15 Apr 2011 19:37:45 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:57137)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QAsa7-0002tm-NS
	for myserver-commit@gnu.org; Fri, 15 Apr 2011 19:37:43 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QAsa7-000642-6L
	for myserver-commit@gnu.org; Fri, 15 Apr 2011 23:37:43 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QAsa6-0008Oi-LT
	for myserver-commit@gnu.org; Fri, 15 Apr 2011 23:37:43 +0000
Date: Fri, 15 Apr 2011 23:37:42 +0000
Message-Id: <E1QAsa6-0008Oi-LT@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: dc30ec7b59ce804f22a4341348c734ec3ca3fca4
X-Git-Newrev: 063ead33c30f1eb2d4babc3dfbe2627946f8100a
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-443-g063ead3
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/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, 15 Apr 2011 23:37:47 -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  063ead33c30f1eb2d4babc3dfbe2627946f8100a (commit)
      from  dc30ec7b59ce804f22a4341348c734ec3ca3fca4 (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 063ead33c30f1eb2d4babc3dfbe2627946f8100a
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 16 01:37:37 2011 +0200

    gnutls: do not use the openssl wrapped APIs <experimental>.

diff --git a/myserver/configure.ac b/myserver/configure.ac
index 1ff3e18..3b63618 100644
--- a/myserver/configure.ac
+++ b/myserver/configure.ac
@@ -209,11 +209,6 @@ fi
 AC_CHECK_LIB(gpg-error, gpg_err_init)
 AC_CHECK_LIB(gcrypt, gcry_control)
 AC_CHECK_LIB(gnutls, main)
-AC_CHECK_LIB(gnutls-openssl, main)
-
-if test x$ac_cv_lib_gnutls_openssl_main != xyes; then
-   AC_MSG_ERROR([Cannot find ssl libraries, gnutls is required])
-fi
 
 dnl Looking for zlib
 AC_CHECK_LIB(z, uncompress, have_libz=yes)
diff --git a/myserver/include/base/socket/ssl_socket.h b/myserver/include/base/socket/ssl_socket.h
index 3907c39..138e381 100644
--- a/myserver/include/base/socket/ssl_socket.h
+++ b/myserver/include/base/socket/ssl_socket.h
@@ -38,11 +38,10 @@ class SslSocket : public Socket
 {
 public:
 
-  int setSSLContext (SSL_CTX*);
+  int setSSLContext (gnutls_certificate_credentials_t, gnutls_priority_t);
   int sslAccept ();
 
   int freeSSL ();
-  SSL* getSSLConnection ();
 
   virtual int close ();
   virtual int shutdown (int how);
@@ -65,14 +64,10 @@ public:
   virtual ~SslSocket ();
 
 protected:
-  bool externalContext;
-  Socket* sock;
-  SSL *sslConnection;
-  SSL_CTX *sslContext;
-  const X509 *clientCert;
-
-  /*! This is used only by clients sockets.  */
-  SSL_METHOD* sslMethod;
+  gnutls_certificate_credentials_t cred;
+  gnutls_session_t session;
+  gnutls_priority_t priority;
+  Socket *sock;
 };
 
 
diff --git a/myserver/include/base/ssl/ssl.h b/myserver/include/base/ssl/ssl.h
index d70d0a7..86232ac 100644
--- a/myserver/include/base/ssl/ssl.h
+++ b/myserver/include/base/ssl/ssl.h
@@ -35,20 +35,21 @@ public:
   int initialize ();
   int free ();
 
-  SSL_CTX* getContext (){return context;}
-  SSL_METHOD* getMethod (){return method;}
+  gnutls_certificate_credentials_t getCredentials (){return cred;}
+  gnutls_priority_t getPriorityCache (){return priority_cache;}
 
-  string& getCertificateFile (){return certificateFile;}
-  string& getPrivateKeyFile (){return privateKeyFile;}
-  string& getPassword (){return password;}
+  string &getCertificateFile (){return certificateFile;}
+  string &getPrivateKeyFile (){return privateKeyFile;}
+  string &getPassword (){return password;}
 
-  void setCertificateFile (string& c){certificateFile.assign (c);}
-  void setPrivateKeyFile (string& pk){privateKeyFile.assign (pk);}
+  void setCertificateFile (string &c){certificateFile.assign (c);}
+  void setPrivateKeyFile (string &pk){privateKeyFile.assign (pk);}
   void setPassword (string& p){password.assign (p);}
 
 private:
-  SSL_CTX* context;
-  SSL_METHOD* method;
+  gnutls_priority_t priority_cache;
+  gnutls_dh_params_t dh_params;
+  gnutls_certificate_credentials_t cred;
 
   string certificateFile;
   string privateKeyFile;
diff --git a/myserver/include/conf/vhost/vhost.h b/myserver/include/conf/vhost/vhost.h
index 5556ff1..a4748f9 100644
--- a/myserver/include/conf/vhost/vhost.h
+++ b/myserver/include/conf/vhost/vhost.h
@@ -102,7 +102,8 @@ public:
   /*! Generate the RSA key for the SSL context. */
   void generateRsaKey ();
 
-  SSL_CTX* getSSLContext ();
+  gnutls_certificate_credentials_t getSSLContext (){return sslContext.getCredentials ();}
+  gnutls_priority_t getSSLPriorityCache (){return sslContext.getPriorityCache ();}
 
   /*! Get the list of hosts allowed.*/
   list<StringRegex*>* getHostList ()
diff --git a/myserver/src/base/socket/ssl_socket.cpp b/myserver/src/base/socket/ssl_socket.cpp
index f7e4e8f..ffaf6b0 100644
--- a/myserver/src/base/socket/ssl_socket.cpp
+++ b/myserver/src/base/socket/ssl_socket.cpp
@@ -37,7 +37,6 @@
 # include <arpa/inet.h>
 #endif
 
-
 #include <sstream>
 
 using namespace std;
@@ -47,24 +46,16 @@ using namespace std;
  */
 SslSocket::SslSocket (Socket* sock) : Socket (sock)
 {
+  session = NULL;
   this->sock = sock;
   this->fd = sock->getHandle ();
-  sslConnection = 0;
-  sslContext = 0;
-  clientCert = 0;
-  sslMethod = 0;
-  externalContext = false;
 }
 
 SslSocket::SslSocket ()
 {
+  session = NULL;
   this->sock = NULL;
   this->fd = -1;
-  sslConnection = 0;
-  sslContext = 0;
-  clientCert = 0;
-  sslMethod = 0;
-  externalContext = false;
 }
 
 SslSocket::~SslSocket ()
@@ -86,9 +77,7 @@ int SslSocket::close ()
  */
 int SslSocket::shutdown (int how)
 {
-  if (sslConnection)
-    SSL_shutdown (sslConnection);
-
+  gnutls_bye (session, GNUTLS_SHUT_WR);
   return checked::shutdown (fd, how);
 }
 
@@ -103,16 +92,15 @@ int SslSocket::rawSend (const char* buffer, int len, int flags)
   int err;
   do
     {
-      err = SSL_write (sslConnection, buffer + sent, len - sent);
+      err = gnutls_record_send (session, buffer, len);
       if (err > 0)
         sent += err;
     }
-  while ((err <= 0
-          && SSL_get_error (sslConnection, err) == SSL_ERROR_WANT_WRITE)
+  while (err == GNUTLS_E_INTERRUPTED || err == GNUTLS_E_AGAIN
          || (err > 0 && sent < len));
 
   if (err < 0)
-    return -1;
+    return err;
   else
     return sent;
 }
@@ -122,6 +110,8 @@ int SslSocket::rawSend (const char* buffer, int len, int flags)
  */
 int SslSocket::connect (MYSERVER_SOCKADDR* sa, int na)
 {
+  int ret;
+
   if ( sa == NULL || (sa->ss_family != AF_INET && sa->ss_family != AF_INET6) )
     return 1;
   if ( (sa->ss_family == AF_INET && na != sizeof (sockaddr_in))
@@ -131,52 +121,42 @@ int SslSocket::connect (MYSERVER_SOCKADDR* sa, int na)
        )
     return 1;
 
-  sslMethod = SSLv23_client_method ();
-  /*! Create the local context. */
-  sslContext = SSL_CTX_new (sslMethod);
-  if (sslContext == 0)
-    return -1;
+  gnutls_init (&session, GNUTLS_CLIENT);
+
+  gnutls_priority_set_direct (session, "PERFORMANCE:+ANON-DH:!ARCFOUR-128",
+                              NULL);
+
+  gnutls_certificate_allocate_credentials (&cred);
+  gnutls_credentials_set (session, GNUTLS_CRD_CERTIFICATE, cred);
 
   /*! Do the TCP connection.  */
-  if (checked::connect (fd, (sockaddr *) sa, na))
-    {
-      SSL_CTX_free (sslContext);
-      sslContext = 0;
-      return -1;
-    }
-  sslConnection = SSL_new (sslContext);
-  if (sslConnection == 0)
-    {
-      SSL_CTX_free (sslContext);
-      sslContext = 0;
-      return -1;
-    }
+  checked::connect (fd, (sockaddr *) sa, na);
 
-#ifdef WIN32
-  SSL_set_fd (sslConnection, FD_TO_SOCKET (fd));
-#else
-  SSL_set_fd (sslConnection, fd);
+#ifndef FD_TO_SOCKET
+# define FD_TO_SOCKET(x) (x)
 #endif
 
-  if (SSL_connect (sslConnection) < 0)
+  gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) FD_TO_SOCKET (fd));
+
+#undef FD_TO_SOCKET
+
+  do
     {
-      SSL_CTX_free (sslContext);
-      sslContext = 0;
-      return -1;
+      ret = gnutls_handshake (session);
     }
+  while (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED);
 
-  externalContext = false;
-  return 0;
+  return ret;
 }
 
 /*!
   Set the SSL context.
  */
-int SslSocket::setSSLContext (SSL_CTX* context)
+int SslSocket::setSSLContext (gnutls_certificate_credentials_t cred,
+                              gnutls_priority_t priority)
 {
-  sslContext = context;
-  externalContext = true;
-  return 1;
+  this->cred = cred;
+  this->priority = priority;
 }
 
 /*!
@@ -184,28 +164,10 @@ int SslSocket::setSSLContext (SSL_CTX* context)
  */
 int SslSocket::freeSSL ()
 {
-  /*! free up the SSL context. */
-  if (sslConnection)
-    {
-      SSL_free (sslConnection);
-      sslConnection = 0;
-    }
-
-  if (sslContext && !externalContext)
-    {
-      SSL_CTX_free (sslContext);
-      sslContext = 0;
-    }
-  return 1;
-}
-
-
-/*!
-  Returns the SSL connection.
- */
-SSL* SslSocket::getSSLConnection ()
-{
-  return sslConnection;
+  if (session != NULL)
+    gnutls_deinit (session);
+  session = NULL;
+  return 0;
 }
 
 /*!
@@ -214,48 +176,28 @@ SSL* SslSocket::getSSLConnection ()
  */
 int SslSocket::sslAccept ()
 {
-  int sslAccept;
-  if (sslContext == 0)
-    return -1;
-
-  if (sslConnection)
-    freeSSL ();
+  int ret;
+  gnutls_init (&session, GNUTLS_SERVER);
+  gnutls_credentials_set (session, GNUTLS_CRD_CERTIFICATE, cred);
+  gnutls_certificate_server_set_request (session, GNUTLS_CERT_REQUEST);
+  gnutls_session_enable_compatibility_mode (session);
+  gnutls_priority_set (session, priority);
+  gnutls_credentials_set (session, GNUTLS_CRD_CERTIFICATE, cred);
+
+#ifndef FD_TO_SOCKET
+# define FD_TO_SOCKET(x) (x)
+#endif
 
-  sslConnection = SSL_new (sslContext);
-  if (sslConnection == 0)
-    {
-      freeSSL ();
-      return -1;
-    }
+  gnutls_transport_set_ptr (session, (gnutls_transport_ptr_t) FD_TO_SOCKET (fd));
 
-#ifdef WIN32
-  if (SSL_set_fd (sslConnection, FD_TO_SOCKET (fd)) == 0)
-#else
-  if (SSL_set_fd (sslConnection, fd) == 0)
-#endif
-    {
-      shutdown (2);
-      freeSSL ();
-      return -1;
-    }
+#undef FD_TO_SOCKET
 
   do
     {
-      sslAccept = SSL_accept (sslConnection);
-    }
-  while (sslAccept != 1
-         && SSL_get_error (sslConnection, sslAccept) == SSL_ERROR_WANT_READ);
-
-  if (sslAccept != 1)
-    {
-      shutdown (2);
-      freeSSL ();
-      return -1;
+      ret = gnutls_handshake (session);
     }
-
-  clientCert = SSL_get_peer_certificate (sslConnection);
-
-  return 0;
+  while (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED);
+  return ret;
 }
 
 
@@ -267,30 +209,18 @@ int SslSocket::recv (char* buffer, int len, int flags)
 {
   int err = 0;
 
-  if (sslConnection)
+  for (;;)
     {
-      for (;;)
+      do
         {
-          int sslError;
-          err = SSL_read (sslConnection, buffer, len);
-
-          if (err > 0)
-            break;
-
-          sslError = SSL_get_error (sslConnection, err);
-
-          if ((sslError != SSL_ERROR_WANT_READ)
-              && (sslError != SSL_ERROR_WANT_WRITE))
-            break;
+          err = gnutls_record_recv (session, buffer, len);
         }
-
-      if (err <= 0)
-        return -1;
-      else
-        return err;
+      while (err == GNUTLS_E_INTERRUPTED || err == GNUTLS_E_AGAIN);
+      if (err > 0)
+        break;
     }
 
-  return 0;
+  return err;
 }
 
 /*!
@@ -298,10 +228,9 @@ int SslSocket::recv (char* buffer, int len, int flags)
  */
 u_long SslSocket::bytesToRead ()
 {
-  u_long nBytesToRead = 0;
-
-  nBytesToRead = SSL_pending (sslConnection);
+  size_t nBytesToRead = 0;
 
+  nBytesToRead = gnutls_record_check_pending(session);
   if (nBytesToRead)
     return nBytesToRead;
 
diff --git a/myserver/src/base/ssl/ssl.cpp b/myserver/src/base/ssl/ssl.cpp
index c2dfb3b..eb5a8b9 100644
--- a/myserver/src/base/ssl/ssl.cpp
+++ b/myserver/src/base/ssl/ssl.cpp
@@ -48,9 +48,8 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL;
 
 SslContext::SslContext ()
 {
-  context = 0;
-  method = 0;
-
+  cred = NULL;
+  priority_cache = NULL;
   certificateFile.assign ("");
   privateKeyFile.assign ("");
 }
@@ -60,50 +59,45 @@ SslContext::SslContext ()
  */
 int SslContext::initialize ()
 {
-  context = 0;
-  method = 0;
-  method = SSLv23_server_method ();
-  context = SSL_CTX_new (method);
-
-  if (!context)
-    return -1;
   /*
     The specified file doesn't exist.
    */
-  if (FilesUtility::nodeExists (certificateFile.c_str ()) == 0)
+  if (FilesUtility::nodeExists (certificateFile.c_str ()) == 0
+      || FilesUtility::nodeExists (privateKeyFile) == 0)
     return -1;
 
-  if (SSL_CTX_use_certificate_file (context, certificateFile.c_str (),
-                                    SSL_FILETYPE_PEM) != 1)
-    return -1;
+  gnutls_priority_init (&priority_cache, "NORMAL", NULL);
 
-  /*
-    The specified file doesn't exist.
-   */
-  if (FilesUtility::nodeExists (privateKeyFile) == 0)
-    return -1;
+  gnutls_certificate_allocate_credentials (&cred);
 
-  if (SSL_CTX_use_PrivateKey_file (context, privateKeyFile.c_str (),
-                                  SSL_FILETYPE_PEM) != 1)
-    return -1;
+  gnutls_certificate_set_x509_trust_file (cred, certificateFile.c_str (),
+                                          SSL_FILETYPE_PEM);
+
+  /*TODO*/
+  gnutls_certificate_set_x509_crl_file (cred, "", GNUTLS_X509_FMT_PEM);
+
+  gnutls_certificate_set_x509_key_file (cred, certificateFile.c_str (),
+                                        privateKeyFile.c_str (),
+                                        GNUTLS_X509_FMT_PEM);
+
+
+  gnutls_dh_params_init (&dh_params);
+  gnutls_dh_params_generate2 (dh_params, 1024);
+  gnutls_certificate_set_dh_params (cred, dh_params);
 
   return 1;
 }
 
 int SslContext::free ()
 {
-  int ret = 0;
-  if (context)
-    {
-      SSL_CTX_free (context);
-      ret = 1;
-      context = 0;
-    }
-  else
-    ret = 0;
-  certificateFile.assign ("");
-  privateKeyFile.assign ("");
-  return ret;
+  if (cred)
+    gnutls_certificate_free_credentials (cred);
+  cred = NULL;
+
+  if (priority_cache)
+    gnutls_priority_deinit (priority_cache);
+  priority_cache = NULL;
+  return 0;
 }
 
 #if !HAVE_LIBGCRYPT || !HAVE_PTHREAD
diff --git a/myserver/src/conf/vhost/vhost.cpp b/myserver/src/conf/vhost/vhost.cpp
index b24b15d..be85b35 100644
--- a/myserver/src/conf/vhost/vhost.cpp
+++ b/myserver/src/conf/vhost/vhost.cpp
@@ -484,14 +484,6 @@ int Vhost::initializeSSL ()
 }
 
 /*!
-  Get the SSL context.
- */
-SSL_CTX* Vhost::getSSLContext ()
-{
-  return sslContext.getContext ();
-}
-
-/*!
   Clean the memory used by the SSL context.
  */
 int Vhost::freeSSL ()
diff --git a/myserver/src/server/server.cpp b/myserver/src/server/server.cpp
index 94837ff..9c001cd 100644
--- a/myserver/src/server/server.cpp
+++ b/myserver/src/server/server.cpp
@@ -127,7 +127,6 @@ int Server::loadLibraries ()
   XmlParser::startXML ();
   myserver_safetime_init ();
 
-  gnutls_global_init ();
   if (Socket::startupSocketLib () != 0)
     {
       log (MYSERVER_LOG_MSG_ERROR, _("Error loading the socket library"));
@@ -1205,12 +1204,12 @@ ConnectionPtr Server::addConnectionToList (Socket* s,
   if (doSSLhandshake)
     {
       int ret = 0;
-      SSL_CTX* ctx = newConnection->host->getSSLContext ();
       SslSocket *sslSocket = new SslSocket (s);
 
-      sslSocket->setSSLContext (ctx);
-      ret = sslSocket->sslAccept ();
+      sslSocket->setSSLContext (newConnection->host->getSSLContext (),
+                                newConnection->host->getSSLPriorityCache ());
 
+      ret = sslSocket->sslAccept ();
       if (ret < 0)
         {
           connectionsPoolLock.lock ();
diff --git a/myserver/tests/test_ssl_socket.cpp b/myserver/tests/test_ssl_socket.cpp
index 22e14f2..3566840 100644
--- a/myserver/tests/test_ssl_socket.cpp
+++ b/myserver/tests/test_ssl_socket.cpp
@@ -132,9 +132,12 @@ public:
 
   void testRecv ()
   {
+    gnutls_priority_t priority_cache;
+    gnutls_dh_params_t dh_params;
+    gnutls_certificate_credentials_t cred;
+
     Socket *obj = new Socket;
     SslSocket *sslObj = NULL;
-    SSL_CTX *ctx = NULL;;
     ThreadID tid;
 
     int optvalReuseAddr = 1;
@@ -154,19 +157,21 @@ public:
                                       (const char*) &optvalReuseAddr,
                                       sizeof (optvalReuseAddr)) != -1);
 
-    ctx = SSL_CTX_new (SSLv23_server_method ());
 
-    if (SSL_CTX_use_certificate_file (ctx, TESTSERVERPEM, SSL_FILETYPE_PEM) != 1)
-    {
-      SSL_CTX_free (ctx);
-      CPPUNIT_ASSERT (false);
-    }
+    gnutls_certificate_allocate_credentials (&cred);
+    gnutls_priority_init (&priority_cache, "NORMAL", NULL);
+
+    gnutls_dh_params_init (&dh_params);
+    gnutls_dh_params_generate2 (dh_params, 1024);
+    gnutls_certificate_set_dh_params (cred, dh_params);
+
+    gnutls_certificate_set_x509_trust_file (cred, TESTSERVERPEM,
+                                            SSL_FILETYPE_PEM);
+
+    gnutls_certificate_set_x509_key_file (cred, TESTSERVERPEM,
+                                          TESTSERVERKEY,
+                                          GNUTLS_X509_FMT_PEM);
 
-    if (SSL_CTX_use_PrivateKey_file (ctx, TESTSERVERKEY, SSL_FILETYPE_PEM) != 1)
-    {
-      SSL_CTX_free (ctx);
-      CPPUNIT_ASSERT (false);
-    }
 
     /* If the port is used by another program, try a few others.  */
     do
@@ -189,16 +194,15 @@ public:
     Socket s = obj->accept (&sockIn, &sockInLen);
 
     sslObj = new SslSocket (&s);
-    sslObj->setSSLContext (ctx);
+    sslObj->setSSLContext (cred, priority_cache);
 
     int ret = sslObj->sslAccept ();
     if (ret < 0)
-    {
-      delete obj;
-      delete sslObj;
-      SSL_CTX_free (ctx);
-      CPPUNIT_ASSERT (false);
-    }
+      {
+        delete obj;
+        delete sslObj;
+        CPPUNIT_ASSERT (false);
+      }
 
     char buf[32] = {0};
 
@@ -212,12 +216,13 @@ public:
 
     CPPUNIT_ASSERT (obj->close () != -1);
 
-    SSL_CTX_free (ctx);
-
     Thread::join (tid);
     if (!arg.success)
       throw arg.reason;
 
+    gnutls_certificate_free_credentials (cred);
+    gnutls_priority_deinit (priority_cache);
+
     delete obj;
     delete sslObj;
   }

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

Summary of changes:
 myserver/configure.ac                     |    5 -
 myserver/include/base/socket/ssl_socket.h |   15 +--
 myserver/include/base/ssl/ssl.h           |   19 ++--
 myserver/include/conf/vhost/vhost.h       |    3 +-
 myserver/src/base/socket/ssl_socket.cpp   |  189 +++++++++--------------------
 myserver/src/base/ssl/ssl.cpp             |   62 +++++-----
 myserver/src/conf/vhost/vhost.cpp         |    8 --
 myserver/src/server/server.cpp            |    7 +-
 myserver/tests/test_ssl_socket.cpp        |   47 ++++---
 9 files changed, 133 insertions(+), 222 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Sat Apr 16 06:22:38 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QB2eE-0005v8-HX
	for mharc-myserver-commit@gnu.org; Sat, 16 Apr 2011 06:22:38 -0400
Received: from eggs.gnu.org ([140.186.70.92]:43705)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QB2e9-0005uu-1Q
	for myserver-commit@gnu.org; Sat, 16 Apr 2011 06:22:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QB2e8-0003En-0D
	for myserver-commit@gnu.org; Sat, 16 Apr 2011 06:22:32 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:35794)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QB2e7-0003Eh-PZ
	for myserver-commit@gnu.org; Sat, 16 Apr 2011 06:22:31 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QB2e7-0004tO-GF
	for myserver-commit@gnu.org; Sat, 16 Apr 2011 10:22:31 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QB2e7-0005vl-9K
	for myserver-commit@gnu.org; Sat, 16 Apr 2011 10:22:31 +0000
Date: Sat, 16 Apr 2011 10:22:31 +0000
Message-Id: <E1QB2e7-0005vl-9K@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 063ead33c30f1eb2d4babc3dfbe2627946f8100a
X-Git-Newrev: c1ca053610c4758298e126d3db3b04e802f0c0c2
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-444-gc1ca053
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/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, 16 Apr 2011 10:22: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  c1ca053610c4758298e126d3db3b04e802f0c0c2 (commit)
      from  063ead33c30f1eb2d4babc3dfbe2627946f8100a (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 c1ca053610c4758298e126d3db3b04e802f0c0c2
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 16 11:59:35 2011 +0200

    ssl: Use C++ exceptions to signal errors.

diff --git a/myserver/src/base/socket/ssl_socket.cpp b/myserver/src/base/socket/ssl_socket.cpp
index ffaf6b0..8be8479 100644
--- a/myserver/src/base/socket/ssl_socket.cpp
+++ b/myserver/src/base/socket/ssl_socket.cpp
@@ -41,6 +41,23 @@
 
 using namespace std;
 
+class SslException : public exception
+{
+public:
+  SslException (int error)
+  {
+    this->error = error;
+  }
+
+  virtual const char *what () const throw ()
+  {
+    return gnutls_strerror (error);
+  }
+
+protected:
+  int error;
+};
+
 /*!
   Constructor of the class.
  */
@@ -77,8 +94,15 @@ int SslSocket::close ()
  */
 int SslSocket::shutdown (int how)
 {
-  gnutls_bye (session, GNUTLS_SHUT_WR);
-  return checked::shutdown (fd, how);
+  int ret;
+
+  ret = gnutls_bye (session, GNUTLS_SHUT_WR);
+  if (ret < 0)
+    throw SslException (ret);
+
+  checked::shutdown (fd, how);
+
+  return ret;
 }
 
 /*!
@@ -89,20 +113,20 @@ int SslSocket::shutdown (int how)
 int SslSocket::rawSend (const char* buffer, int len, int flags)
 {
   int sent = 0;
-  int err;
+  int ret;
   do
     {
-      err = gnutls_record_send (session, buffer, len);
-      if (err > 0)
-        sent += err;
+      ret = gnutls_record_send (session, buffer, len);
+      if (ret > 0)
+        sent += ret;
     }
-  while (err == GNUTLS_E_INTERRUPTED || err == GNUTLS_E_AGAIN
-         || (err > 0 && sent < len));
+  while (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN
+         || (ret > 0 && sent < len));
+
+  if (ret < 0)
+    throw SslException (ret);
 
-  if (err < 0)
-    return err;
-  else
-    return sent;
+  return sent;
 }
 
 /*!
@@ -146,6 +170,9 @@ int SslSocket::connect (MYSERVER_SOCKADDR* sa, int na)
     }
   while (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED);
 
+  if (ret < 0)
+    throw SslException (ret);
+
   return ret;
 }
 
@@ -197,6 +224,10 @@ int SslSocket::sslAccept ()
       ret = gnutls_handshake (session);
     }
   while (ret == GNUTLS_E_AGAIN || ret == GNUTLS_E_INTERRUPTED);
+
+  if (ret < 0)
+    throw SslException (ret);
+
   return ret;
 }
 
@@ -207,20 +238,23 @@ int SslSocket::sslAccept ()
  */
 int SslSocket::recv (char* buffer, int len, int flags)
 {
-  int err = 0;
+  int ret = 0;
 
   for (;;)
     {
       do
         {
-          err = gnutls_record_recv (session, buffer, len);
+          ret = gnutls_record_recv (session, buffer, len);
         }
-      while (err == GNUTLS_E_INTERRUPTED || err == GNUTLS_E_AGAIN);
-      if (err > 0)
+      while (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN);
+      if (ret > 0)
         break;
     }
 
-  return err;
+  if (ret < 0)
+    throw SslException (ret);
+
+  return ret;
 }
 
 /*!
@@ -230,7 +264,7 @@ u_long SslSocket::bytesToRead ()
 {
   size_t nBytesToRead = 0;
 
-  nBytesToRead = gnutls_record_check_pending(session);
+  nBytesToRead = gnutls_record_check_pending (session);
   if (nBytesToRead)
     return nBytesToRead;
 
@@ -247,4 +281,3 @@ int SslSocket::dataAvailable (int sec, int usec)
 
   return Socket::dataAvailable (sec, usec);
 }
-

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

Summary of changes:
 myserver/src/base/socket/ssl_socket.cpp |   71 ++++++++++++++++++++++--------
 1 files changed, 52 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Sat Apr 16 10:06:20 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QB68h-0005CA-Vx
	for mharc-myserver-commit@gnu.org; Sat, 16 Apr 2011 10:06:19 -0400
Received: from eggs.gnu.org ([140.186.70.92]:48000)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QB68f-0005BZ-QE
	for myserver-commit@gnu.org; Sat, 16 Apr 2011 10:06:18 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QB68e-0003Om-OD
	for myserver-commit@gnu.org; Sat, 16 Apr 2011 10:06:17 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:54017)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QB68e-0003Og-LZ
	for myserver-commit@gnu.org; Sat, 16 Apr 2011 10:06:16 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QB68d-0007Rr-VX
	for myserver-commit@gnu.org; Sat, 16 Apr 2011 14:06:16 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QB68d-0004R3-JJ
	for myserver-commit@gnu.org; Sat, 16 Apr 2011 14:06:15 +0000
Date: Sat, 16 Apr 2011 14:06:15 +0000
Message-Id: <E1QB68d-0004R3-JJ@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: c1ca053610c4758298e126d3db3b04e802f0c0c2
X-Git-Newrev: 572d85a6ce2effbad40e81483b23028a8aeeae7f
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-447-g572d85a
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/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, 16 Apr 2011 14:06:18 -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  572d85a6ce2effbad40e81483b23028a8aeeae7f (commit)
       via  48105b1c35517030c91dc4f893c9ecaa6b405681 (commit)
       via  8fd040c4a934bc53c2e841231fe9b555bf59047e (commit)
      from  c1ca053610c4758298e126d3db3b04e802f0c0c2 (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 572d85a6ce2effbad40e81483b23028a8aeeae7f
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 16 16:06:10 2011 +0200

    Http: don't write directly to the socket when appendOutputs on fatal errors.

diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index d37ca13..0e24a2f 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -1329,9 +1329,7 @@ int Http::raiseHTTPError (int ID)
         }
 
       if (td->lastError)
-        {
-          return sendHTTPhardError500 ();
-        }
+        return sendHTTPhardError500 ();
 
       td->lastError = ID;
 
@@ -1477,12 +1475,15 @@ Internal Server Error\n\
   *td->auxiliaryBuffer << time;
   *td->auxiliaryBuffer << "\r\n\r\n";
 
-  td->connection->socket->send (td->auxiliaryBuffer->getBuffer (),
-                                (u_long) td->auxiliaryBuffer->getLength (),
-                                0);
+  if (! td->appendOutputs)
+    {
+      td->connection->socket->send (td->auxiliaryBuffer->getBuffer (),
+                                    td->auxiliaryBuffer->getLength (),
+                                    0);
 
-  if (!td->onlyHeader)
-    td->connection->socket->send (hardHTML, (u_long) strlen (hardHTML), 0);
+      if (! td->onlyHeader)
+        td->connection->socket->send (hardHTML, strlen (hardHTML), 0);
+    }
 
   return HttpDataHandler::RET_FAILURE;
 }



commit 48105b1c35517030c91dc4f893c9ecaa6b405681
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 16 16:02:18 2011 +0200

    Remove unused variable.

diff --git a/myserver/src/base/home_dir/home_dir.cpp b/myserver/src/base/home_dir/home_dir.cpp
index 62c3743..e1d3670 100644
--- a/myserver/src/base/home_dir/home_dir.cpp
+++ b/myserver/src/base/home_dir/home_dir.cpp
@@ -246,14 +246,11 @@ int HomeDir::getHomeDir (string& userName, string& out)
   return FilesUtility::nodeExists (out.c_str ()) ? 0 : 1;
 #elif HAVE_GETPWNAM
   struct passwd *p;
-  int ret = 0;
 
   loadMutex.lock ();
   errno = 0;
   p = ::getpwnam (userName.c_str ());
-  if (p == NULL)
-    ret = 1;
-  else
+  if (p != NULL)
     out.assign (p->pw_dir);
 
   loadMutex.unlock ();



commit 8fd040c4a934bc53c2e841231fe9b555bf59047e
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 16 16:02:03 2011 +0200

    Drop the `recursive error' message.

diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index c99e8b2..d37ca13 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -1330,7 +1330,6 @@ int Http::raiseHTTPError (int ID)
 
       if (td->lastError)
         {
-          td->connection->host->warningsLogWrite (_("HTTP: recursive error"));
           return sendHTTPhardError500 ();
         }
 

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

Summary of changes:
 myserver/src/base/home_dir/home_dir.cpp |    5 +----
 myserver/src/protocol/http/http.cpp     |   18 +++++++++---------
 2 files changed, 10 insertions(+), 13 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Mon Apr 18 08:03:07 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QBnAZ-0005Og-30
	for mharc-myserver-commit@gnu.org; Mon, 18 Apr 2011 08:03:07 -0400
Received: from eggs.gnu.org ([140.186.70.92]:54394)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QBnAS-0005BX-Sv
	for myserver-commit@gnu.org; Mon, 18 Apr 2011 08:03:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QBnAO-0000UI-82
	for myserver-commit@gnu.org; Mon, 18 Apr 2011 08:03:00 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:36951)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QBnAO-0000U9-12
	for myserver-commit@gnu.org; Mon, 18 Apr 2011 08:02:56 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QBnAM-00059i-UY
	for myserver-commit@gnu.org; Mon, 18 Apr 2011 12:02:55 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QBnAK-0007ly-SM
	for myserver-commit@gnu.org; Mon, 18 Apr 2011 12:02:54 +0000
Date: Mon, 18 Apr 2011 12:02:53 +0000
Message-Id: <E1QBnAK-0007ly-SM@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 572d85a6ce2effbad40e81483b23028a8aeeae7f
X-Git-Newrev: 1c4cd853a49d7667660140b4ba323ee9ffc98f0f
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-448-g1c4cd85
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/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, 18 Apr 2011 12:03: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  1c4cd853a49d7667660140b4ba323ee9ffc98f0f (commit)
      from  572d85a6ce2effbad40e81483b23028a8aeeae7f (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 1c4cd853a49d7667660140b4ba323ee9ffc98f0f
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 18 13:48:31 2011 +0200

    Change type of Server::ipAddresses to string.

diff --git a/myserver/include/server/server.h b/myserver/include/server/server.h
index 2b525db..345ecf7 100644
--- a/myserver/include/server/server.h
+++ b/myserver/include/server/server.h
@@ -233,7 +233,7 @@ private:
   u_long buffersize;
 
   /* Buffer that contains all the local machine IP values.  */
-  string *ipAddresses;
+  string ipAddresses;
   char serverName[HOST_NAME_MAX + 1];
   string* path;
   int initialize ();
diff --git a/myserver/src/server/server.cpp b/myserver/src/server/server.cpp
index 9c001cd..551b631 100644
--- a/myserver/src/server/server.cpp
+++ b/myserver/src/server/server.cpp
@@ -77,7 +77,6 @@ Server::Server () : connectionsPool (100),
   serverReady = false;
   throttlingRate = 0;
   path = 0;
-  ipAddresses = 0;
   vhostHandler = NULL;
   purgeThreadsThreshold = 1;
   freeThreads = 0;
@@ -151,9 +150,6 @@ Server::~Server ()
     delete path;
   path = 0;
 
-  if (ipAddresses)
-    delete ipAddresses;
-
   if (logManager)
     delete logManager;
 
@@ -262,13 +258,9 @@ int Server::postLoad ()
   log (MYSERVER_LOG_MSG_INFO, _("Host name: %s"), serverName);
 
   /* Find the IP addresses of the local machine.  */
-  if (ipAddresses)
-    delete ipAddresses;
-  ipAddresses = new string ();
-
   try
     {
-      Socket::getLocalIPsList (*ipAddresses);
+      Socket::getLocalIPsList (ipAddresses);
     }
   catch (exception & e)
     {
@@ -276,7 +268,7 @@ int Server::postLoad ()
       return -1;
     }
 
-  log (MYSERVER_LOG_MSG_INFO, _("IP: %s"), ipAddresses->c_str ());
+  log (MYSERVER_LOG_MSG_INFO, _("IP: %s"), ipAddresses.c_str ());
 
   log (MYSERVER_LOG_MSG_INFO, _("Detected %i CPUs"), (int) getCPUCount ());
 
@@ -743,8 +735,6 @@ int Server::terminate ()
 
   freeHashedData ();
 
-  ipAddresses = NULL;
-
   if (vhostHandler)
     delete vhostHandler;
   vhostHandler = NULL;
@@ -1392,7 +1382,7 @@ void Server::getThreadsNumberInformation (u_long *num, u_long *max,
  */
 const char *Server::getAddresses ()
 {
-  return ipAddresses ? ipAddresses->c_str () : "";
+  return ipAddresses.c_str ();
 }
 
 /*!

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

Summary of changes:
 myserver/include/server/server.h |    2 +-
 myserver/src/server/server.cpp   |   16 +++-------------
 2 files changed, 4 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Mon Apr 18 08:16:16 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QBnNI-0007gn-GV
	for mharc-myserver-commit@gnu.org; Mon, 18 Apr 2011 08:16:16 -0400
Received: from eggs.gnu.org ([140.186.70.92]:56878)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QBnND-0007ge-GW
	for myserver-commit@gnu.org; Mon, 18 Apr 2011 08:16:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QBnN6-0003XB-Jz
	for myserver-commit@gnu.org; Mon, 18 Apr 2011 08:16:11 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:33294)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QBnN6-0003Wj-BV
	for myserver-commit@gnu.org; Mon, 18 Apr 2011 08:16:04 -0400
Received: from lucifer (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.14.4/8.14.4) with SMTP id
	p3ICG1Vi027887
	for <myserver-commit@gnu.org>; Mon, 18 Apr 2011 14:16:01 +0200
Message-Id: <201104181216.p3ICG1Vi027887@proliant.st.ewi.tudelft.nl>
Received: by lucifer (sSMTP sendmail emulation);
	Mon, 18 Apr 2011 14:16:01 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
X-Hydra-Instance: lucifer
X-Hydra-Project: gnu
X-Hydra-Jobset: myserver-master
X-Hydra-Job: build
Date: Mon, 18 Apr 2011 14:16:01 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 130.161.158.3
Subject: [myserver-commit] Hydra job gnu:myserver-master:build build
	1048195: Failed
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/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, 18 Apr 2011 12:16:16 -0000

Hi,

This is to let you know that Hydra build 1048195 of job gnu:myserver-master:build has changed from 'Failed' to 'Failed'.

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

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:              | 1048195
Nix name:              | myserver-0.9.2.448-1c4c
Short description:     | Native Nix build on i686-linux
Maintainer(s):         | myserver-commit@gnu.org
System:                | i686-linux
Derivation store path: | /nix/store/lb11mhkig23j0by462306izp63ds5hch-myserver-0.9.2.448-1c4c.drv
Output store path:     | /nix/store/a3nlgsnxczxlvb9gzfzcb4piwgqd9byg-myserver-0.9.2.448-1c4c
Time added:            | 2011-04-18 14:16:01
Build started:         | 2011-04-18 14:12:53
Build finished:        | 2011-04-18 14:16:01
Duration:              | 188s

The build inputs were:

Name        | Type   | Value
------------+--------+-------------------------------------------------------------
hydraConfig | svn    | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:26838
nixpkgs     | svn    | https://svn.nixos.org/repos/nix/nixpkgs/trunk:26873
system      | string | i686-linux
tarball     | build  | 1048194

Regards,

The Hydra build daemon.

---
TestConnection::testTries. : OK
TestConnection::testPort. : OK
TestConnection::testLogin. : OK
TestConnection::testPassword. : OK
TestConnection::testForceControl. : OK
TestConnection::testToRemove. : OK
TestConnection::testScheduled. : OK
TestConnection::testPriority. : OK
TestConnectionsScheduler::testAddNewConnection. : OK
TestConnectionsScheduler::testGetNumTotalConnections. : OK
TestConnectionsScheduler::testAddNewReadyConnection. : OK
TestConnectionsScheduler::testGetConnections. : OK
TestConnectionsScheduler::testVisitor. : OK
TestCryptAlgoManager::testRegister. : OK
TestCryptAlgoManager::testCheck. : OK
TestCryptAlgoManager::testNoExists. : OK
TestExceptions::testWrongCwd. : OK
TestExceptions::testErrno. : OK
TestExceptions::testGetBacktrace. : OK
TestFile::testCreateTemporaryFile. : OK
TestFile::testCreateTemporaryDelayedFile. : OK
TestFile::testOnFile. : OK
TestFile::testBinary. : OK
TestFile::testTruncate. : OK
TestFile::testCreationTime. : OK
TestFile::testLastAccessTime. : OK
TestFile::testLastModTime. : OK
TestFile::testSeek. : OK
TestFileStream::testCycleLog. : OK
TestFileStream::testReOpen. : OK
TestFileStreamCreator::testCreation. : OK
TestFilesUtility::testGetPathRecursionLevel. : OK
TestFilesUtility::testSplitPath. : OK
TestFilesUtility::testSplitPathString. : OK
TestFilesUtility::testSplitPathLength. : OK
TestFilesUtility::testGetFileExt. : OK
TestFilterChain::testGzipChain. : OK
TestFilterChain::testIsEmpty. : OK
TestFilterChain::testAcceptDuplicates. : OK
TestFilterChain::testStream. : OK
TestFilterChain::testIsFilterPresent. : OK
TestFilterChain::testRemoveFilter. : OK
TestForkServer::testExecuteProcessmake[2]: *** [check-am] Segmentation fault
make[2]: Leaving directory `/tmp/nix-build-lb11mhkig23j0by462306izp63ds5hch-myserver-0.9.2.448-1c4c.drv-0/myserver-0.9.2.448-1c4c/tests'
[q[qmake[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/tmp/nix-build-lb11mhkig23j0by462306izp63ds5hch-myserver-0.9.2.448-1c4c.drv-0/myserver-0.9.2.448-1c4c'
[q[qmake: *** [check] Error 2
[q[q[qbuild time elapsed:  0m0.022s 0m0.013s 2m6.776s 0m30.201s
[pCopying build directory to /nix/store/a3nlgsnxczxlvb9gzfzcb4piwgqd9byg-myserver-0.9.2.448-1c4c/nix-build-lb11mhkig23j0by462306izp63ds5hch-myserver-0.9.2.448-1c4c.drv-0
[qbuild failed with exit code 2 (ignored)


From MAILER-DAEMON Mon Apr 18 08:16:45 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QBnNl-0007i7-So
	for mharc-myserver-commit@gnu.org; Mon, 18 Apr 2011 08:16:45 -0400
Received: from eggs.gnu.org ([140.186.70.92]:57003)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QBnNg-0007ht-QK
	for myserver-commit@gnu.org; Mon, 18 Apr 2011 08:16:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QBnNc-0003ah-HA
	for myserver-commit@gnu.org; Mon, 18 Apr 2011 08:16:40 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:33295)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QBnNb-0003aW-Vi
	for myserver-commit@gnu.org; Mon, 18 Apr 2011 08:16:36 -0400
Received: from lucifer (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.14.4/8.14.4) with SMTP id
	p3ICGYPF027930
	for <myserver-commit@gnu.org>; Mon, 18 Apr 2011 14:16:34 +0200
Message-Id: <201104181216.p3ICGYPF027930@proliant.st.ewi.tudelft.nl>
Received: by lucifer (sSMTP sendmail emulation);
	Mon, 18 Apr 2011 14:16:34 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
X-Hydra-Instance: lucifer
X-Hydra-Project: gnu
X-Hydra-Jobset: myserver-master
X-Hydra-Job: build
Date: Mon, 18 Apr 2011 14:16:34 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 130.161.158.3
Subject: [myserver-commit] Hydra job gnu:myserver-master:build build
	1048199: Failed
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/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, 18 Apr 2011 12:16:44 -0000

Hi,

This is to let you know that Hydra build 1048199 of job gnu:myserver-master:build has changed from 'Failed' to 'Failed'.

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

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:              | 1048199
Nix name:              | myserver-0.9.2.448-1c4c
Short description:     | Native Nix build on x86_64-linux
Maintainer(s):         | myserver-commit@gnu.org
System:                | x86_64-linux
Derivation store path: | /nix/store/af7skhvf09cqwll91fjg1gdf8jhb5zly-myserver-0.9.2.448-1c4c.drv
Output store path:     | /nix/store/vlw8if0kbzv1r4vcgpr7cywwwqfcrsx0-myserver-0.9.2.448-1c4c
Time added:            | 2011-04-18 14:16:34
Build started:         | 2011-04-18 14:12:53
Build finished:        | 2011-04-18 14:16:34
Duration:              | 221s

The build inputs were:

Name        | Type   | Value
------------+--------+-------------------------------------------------------------
hydraConfig | svn    | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:26838
nixpkgs     | svn    | https://svn.nixos.org/repos/nix/nixpkgs/trunk:26873
system      | string | x86_64-linux
tarball     | build  | 1048194

Regards,

The Hydra build daemon.

---
TestSecurityToken::testPassword. : OK
TestSecurityToken::testValues. : OK
TestSecurityToken::testDirectory. : OK
TestSecurityToken::testSysDirectory. : OK
TestSecurityToken::testResource. : OK
TestSecurityToken::testMask. : OK
TestSecurityToken::testProvidedMask. : OK
TestSecurityToken::testNeededPassword. : OK
TestSecurityToken::testDone. : OK
TestSecurityToken::testAuthenticated. : OK
TestSecurityToken::testServer. : OK
TestSecurityToken::testVhost. : OK
TestSemaphore::testUnlockLock. : OK
TestSemaphore::testConstructor. : OK
TestSemaphore::testIsInitialized. : OK
TestSemaphore::testGetHandle. : OK
TestSha1::testHash. : OK
TestSha1::testHashMemBuf. : OK
TestSlab::testGet. : OK
TestSlab::testForcedGet. : OK
TestSlab::testCapacity. : OK
TestSlab::testInit. : OK
TestSocket::testGethostname. : OK
TestSocket::testRecv. : OK
TestSocket::testGetLocalIPsList. : assertionF
TestSocketPair::testCreateClose. : OK
TestSocketPair::testInverted. : OK
TestSocketPair::testWriteRead. : OK
TestSocketStreamCreator::testCreation. : OK
TestSocketStreamCreator::testGetPort. : OK
TestSocketStreamCreator::testGetHost. : OK
TestSslSocket::testRecv. : OK
TestStringUtils::testTranslateEscapeString. : OK
TestStringUtils::testHexToInt. : OK
TestStringUtils::testHexVal. : OK
TestStringUtils::testTrim. : OK
TestStringUtils::testTrimLeft. : OK
TestStringUtils::testTrimRight. : OK
TestStringUtils::testGetTime. : OK
TestStringUtils::testGetRFC822GMTTime. : OK
TestThread::testThreadCreate. : OK
TestThread::testThreadTerminate. : OK
TestUnixSocket::testBindmake[2]: *** [check-am] Segmentation fault
make[2]: Leaving directory `/tmp/nix-build-af7skhvf09cqwll91fjg1gdf8jhb5zly-myserver-0.9.2.448-1c4c.drv-0/myserver-0.9.2.448-1c4c/tests'
[q[qmake[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/tmp/nix-build-af7skhvf09cqwll91fjg1gdf8jhb5zly-myserver-0.9.2.448-1c4c.drv-0/myserver-0.9.2.448-1c4c'
[q[qmake: *** [check] Error 2
[q[q[qbuild time elapsed:  0m0.025s 0m0.009s 2m38.809s 0m48.084s
[pCopying build directory to /nix/store/vlw8if0kbzv1r4vcgpr7cywwwqfcrsx0-myserver-0.9.2.448-1c4c/nix-build-af7skhvf09cqwll91fjg1gdf8jhb5zly-myserver-0.9.2.448-1c4c.drv-0
[qbuild failed with exit code 2 (ignored)


From MAILER-DAEMON Tue Apr 19 09:28:24 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QCAye-0000dw-5z
	for mharc-myserver-commit@gnu.org; Tue, 19 Apr 2011 09:28:24 -0400
Received: from eggs.gnu.org ([140.186.70.92]:60912)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCAyb-0000dW-8k
	for myserver-commit@gnu.org; Tue, 19 Apr 2011 09:28:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCAyZ-0001o7-U6
	for myserver-commit@gnu.org; Tue, 19 Apr 2011 09:28:21 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:47593)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCAyZ-0001o3-Pm
	for myserver-commit@gnu.org; Tue, 19 Apr 2011 09:28:19 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QCAyZ-0005pq-LA
	for myserver-commit@gnu.org; Tue, 19 Apr 2011 13:28:19 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QCAyZ-0007pD-30
	for myserver-commit@gnu.org; Tue, 19 Apr 2011 13:28:19 +0000
Date: Tue, 19 Apr 2011 13:28:19 +0000
Message-Id: <E1QCAyZ-0007pD-30@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 1c4cd853a49d7667660140b4ba323ee9ffc98f0f
X-Git-Newrev: 9b9b1181303f4a6f1dad059de3afc14ae92e4cf4
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-449-g9b9b118
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Apr 2011 13:28:22 -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  9b9b1181303f4a6f1dad059de3afc14ae92e4cf4 (commit)
      from  1c4cd853a49d7667660140b4ba323ee9ffc98f0f (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 9b9b1181303f4a6f1dad059de3afc14ae92e4cf4
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Tue Apr 19 15:28:16 2011 +0200

    Fail immediately if an exception happens while responding to the client

diff --git a/myserver/src/http_handler/cgi/cgi.cpp b/myserver/src/http_handler/cgi/cgi.cpp
index c823431..35cd862 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -272,11 +272,10 @@ int Cgi::send (HttpThreadContext* td, const char* scriptpath,
     }
   catch (exception & e)
     {
-      td->connection->host->warningsLogWrite (_E ("Cgi: internal error"), &e);
       stdOutFile.close ();
       stdInFile.close ();
       chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
 
   return HttpDataHandler::RET_OK;
diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index d834782..0d932cb 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -71,7 +71,7 @@ int FastCgi::send (HttpThreadContext* td, const char* scriptpath,
 
   clock_t initialTicks;
 
-  FastCgiServer* server = 0;
+  FastCgiServer *server = NULL;
   int id;
   ostringstream cmdLine;
   string moreArg;
@@ -296,10 +296,8 @@ int FastCgi::send (HttpThreadContext* td, const char* scriptpath,
     }
   catch (exception & e)
     {
-      td->connection->host->warningsLogWrite (_E ("FastCGI: internal error"),
-                                              &e);
       chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
 
   return ret;
diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp b/myserver/src/http_handler/http_dir/http_dir.cpp
index 62ca29d..6f977a8 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -628,13 +628,10 @@ int HttpDir::send (HttpThreadContext* td,
     }
   catch (exception & e)
     {
-      /* Return an internal server error. */
-      td->outputData.close ();
       chain.clearAllFilters ();
-      td->connection->host->warningsLogWrite (_E ("HttpDir: internal error"),
-                                              &e);
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
+
   chain.clearAllFilters ();
   return HttpDataHandler::RET_OK;
 }
diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 320cd06..b7d665a 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -132,7 +132,7 @@ int HttpFile::putFile (HttpThreadContext* td, string& filename)
     {
       td->connection->host->warningsLogWrite (_E ("HttpFile: internal error"),
                                               &e);
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     };
 }
 
@@ -149,20 +149,20 @@ int HttpFile::deleteFile (HttpThreadContext* td,
       if (! (td->permissions & MYSERVER_PERMISSION_DELETE))
         return td->http->sendAuth ();
 
-      if (FilesUtility::nodeExists (td->filenamePath))
+      if (! FilesUtility::nodeExists (td->filenamePath))
+        return td->http->raiseHTTPError (204);
+      else
         {
           FilesUtility::deleteFile (td->filenamePath.c_str ());
           return td->http->raiseHTTPError (202);
         }
-      else
-        return td->http->raiseHTTPError (204);
     }
   catch (exception & e)
     {
       td->connection->host->warningsLogWrite
         (_E ("HttpFile: cannot delete file %s"),
          td->filenamePath.c_str (), &e);
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     };
 }
 
@@ -520,15 +520,9 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
   }
   catch (exception & e)
     {
-      if (file)
-        {
-          file->close ();
-          delete file;
-        }
+      td->sentData += dataSent;
       chain.clearAllFilters ();
-      td->connection->host->warningsLogWrite (_E ("HttpFile: internal error"),
-                                              &e);
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
 
   /* For logging activity.  */
diff --git a/myserver/src/http_handler/isapi/isapi.cpp b/myserver/src/http_handler/isapi/isapi.cpp
index ed2b062..b8b5f6f 100644
--- a/myserver/src/http_handler/isapi/isapi.cpp
+++ b/myserver/src/http_handler/isapi/isapi.cpp
@@ -928,10 +928,8 @@ int Isapi::send (HttpThreadContext* td,
     }
   catch (exception & e)
     {
-      td->connection->host->warningsLogWrite (_E ("ISAPI: internal error"),
-                                              &e);
       connTable[connIndex].chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
 
   return retvalue;
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp b/myserver/src/http_handler/mscgi/mscgi.cpp
index c90814c..f63bec8 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -151,7 +151,7 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
   catch (exception & e)
     {
       td->connection->host->warningsLogWrite (_E ("Msgi: internal error"), &e);
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
 
   return HttpDataHandler::RET_OK;
diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index a3d5719..c8fc684 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -150,7 +150,7 @@ int Proxy::send (HttpThreadContext *td, const char* scriptpath,
         addConnection (con, destUrl.getHost ().c_str (), destUrl.getPort (),
                        false);
       chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
 
   return HttpDataHandler::RET_OK;
diff --git a/myserver/src/http_handler/scgi/scgi.cpp b/myserver/src/http_handler/scgi/scgi.cpp
index 9d7bcbb..3bab92a 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -196,9 +196,8 @@ int Scgi::send (HttpThreadContext* td, const char* scriptpath,
     }
   catch (exception & e)
     {
-      td->connection->host->warningsLogWrite (_E ("SCGI: internal error"), &e);
       chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
 
   return HttpDataHandler::RET_OK;
diff --git a/myserver/src/http_handler/wincgi/wincgi.cpp b/myserver/src/http_handler/wincgi/wincgi.cpp
index 942054d..cb4e990 100644
--- a/myserver/src/http_handler/wincgi/wincgi.cpp
+++ b/myserver/src/http_handler/wincgi/wincgi.cpp
@@ -254,12 +254,10 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
         }
       catch (exception & e)
         {
-          td->connection->host->warningsLogWrite (_E ("WinCGI: error executing %s"),
-                                                  scriptpath, &e);
           FilesUtility::deleteFile (outFilePath);
           FilesUtility::deleteFile (dataFilePath);
           chain.clearAllFilters ();
-          return td->http->raiseHTTPError (500);
+          return HttpDataHandler::RET_FAILURE;
         }
 
       OutFileHandle.openFile (outFilePath, File::FILE_OPEN_ALWAYS | File::READ);
@@ -367,10 +365,8 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
     }
   catch (exception & e)
     {
-      td->connection->host->warningsLogWrite (_E ("WinCGI: internal error"),
-                                              &e);
       chain.clearAllFilters ();
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
   return HttpDataHandler::RET_OK;
 #else
diff --git a/myserver/src/protocol/http/webdav/webdav.cpp b/myserver/src/protocol/http/webdav/webdav.cpp
index 3e2c852..1217060 100644
--- a/myserver/src/protocol/http/webdav/webdav.cpp
+++ b/myserver/src/protocol/http/webdav/webdav.cpp
@@ -346,15 +346,15 @@ int WebDAV::propfind (HttpThreadContext* td)
             break;
         }
 
-      if (useChunks && chain.getStream ()->write ("0\r\n\r\n", 5, &nbw2))
-        return HttpDataHandler::RET_FAILURE;
+      if (useChunks)
+        chain.getStream ()->write ("0\r\n\r\n", 5, &nbw2);
 
       return HttpDataHandler::RET_OK;
     }
   catch (exception & e)
     {
       td->connection->host->warningsLogWrite ( _E ("WebDAV: Internal Error"), &e);
-      return td->http->raiseHTTPError (500);
+      return HttpDataHandler::RET_FAILURE;
     }
 }
 

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

Summary of changes:
 myserver/src/http_handler/cgi/cgi.cpp             |    3 +--
 myserver/src/http_handler/fastcgi/fastcgi.cpp     |    6 ++----
 myserver/src/http_handler/http_dir/http_dir.cpp   |    7 ++-----
 myserver/src/http_handler/http_file/http_file.cpp |   20 +++++++-------------
 myserver/src/http_handler/isapi/isapi.cpp         |    4 +---
 myserver/src/http_handler/mscgi/mscgi.cpp         |    2 +-
 myserver/src/http_handler/proxy/proxy.cpp         |    2 +-
 myserver/src/http_handler/scgi/scgi.cpp           |    3 +--
 myserver/src/http_handler/wincgi/wincgi.cpp       |    8 ++------
 myserver/src/protocol/http/webdav/webdav.cpp      |    6 +++---
 10 files changed, 21 insertions(+), 40 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Tue Apr 19 09:34:30 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QCB4Y-00030R-FG
	for mharc-myserver-commit@gnu.org; Tue, 19 Apr 2011 09:34:30 -0400
Received: from eggs.gnu.org ([140.186.70.92]:55623)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCB4W-0002zg-0J
	for myserver-commit@gnu.org; Tue, 19 Apr 2011 09:34:28 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCB4V-00038j-4K
	for myserver-commit@gnu.org; Tue, 19 Apr 2011 09:34:27 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:54877)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCB4V-00038e-2Y
	for myserver-commit@gnu.org; Tue, 19 Apr 2011 09:34:27 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QCB4U-0005uc-Tb
	for myserver-commit@gnu.org; Tue, 19 Apr 2011 13:34:27 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QCB4U-0008VM-IU
	for myserver-commit@gnu.org; Tue, 19 Apr 2011 13:34:26 +0000
Date: Tue, 19 Apr 2011 13:34:26 +0000
Message-Id: <E1QCB4U-0008VM-IU@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 9b9b1181303f4a6f1dad059de3afc14ae92e4cf4
X-Git-Newrev: 7b7e4bb2e858b296d909f6caec59b641b4aeb1bb
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-450-g7b7e4bb
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 19 Apr 2011 13:34: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  7b7e4bb2e858b296d909f6caec59b641b4aeb1bb (commit)
      from  9b9b1181303f4a6f1dad059de3afc14ae92e4cf4 (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 7b7e4bb2e858b296d909f6caec59b641b4aeb1bb
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Tue Apr 19 15:34:22 2011 +0200

    Do not free the SSL context on Socket::close.

diff --git a/myserver/src/base/socket/ssl_socket.cpp b/myserver/src/base/socket/ssl_socket.cpp
index 8be8479..36369cf 100644
--- a/myserver/src/base/socket/ssl_socket.cpp
+++ b/myserver/src/base/socket/ssl_socket.cpp
@@ -86,7 +86,7 @@ SslSocket::~SslSocket ()
  */
 int SslSocket::close ()
 {
-  return freeSSL ();
+  return Socket::close ();
 }
 
 /*!

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

Summary of changes:
 myserver/src/base/socket/ssl_socket.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Wed Apr 20 16:46:44 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QCeIO-0007zG-LM
	for mharc-myserver-commit@gnu.org; Wed, 20 Apr 2011 16:46:44 -0400
Received: from eggs.gnu.org ([140.186.70.92]:57103)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCeIL-0007z0-I0
	for myserver-commit@gnu.org; Wed, 20 Apr 2011 16:46:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCeIJ-0008EA-99
	for myserver-commit@gnu.org; Wed, 20 Apr 2011 16:46:41 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:33941)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCeIJ-0008E0-6R
	for myserver-commit@gnu.org; Wed, 20 Apr 2011 16:46:39 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QCeII-0002If-Sx
	for myserver-commit@gnu.org; Wed, 20 Apr 2011 20:46:39 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QCeII-00054q-56
	for myserver-commit@gnu.org; Wed, 20 Apr 2011 20:46:38 +0000
Date: Wed, 20 Apr 2011 20:46:38 +0000
Message-Id: <E1QCeII-00054q-56@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 7b7e4bb2e858b296d909f6caec59b641b4aeb1bb
X-Git-Newrev: 3e8bb384d3a08b9c356d70359679faef771ea022
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-458-g3e8bb38
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/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, 20 Apr 2011 20:46:44 -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  3e8bb384d3a08b9c356d70359679faef771ea022 (commit)
       via  b38ba649b7d8862e841396fc9d359a261606081c (commit)
       via  4a675d37a3eff66d9625c58118fb2fd913c5b6ff (commit)
       via  fd528f4a51e37a1e6112ceddea797289b2aed284 (commit)
       via  c00a108c12ba3b7caa270b0bdb7f873493b53654 (commit)
       via  4f1cf0e830aa539df90b171a270da94ec0911daf (commit)
       via  21e5a557c864a207310430739103f33522c2206e (commit)
       via  8ffe0bec866e743e11ec36f162fd2dbcfb39f13d (commit)
      from  7b7e4bb2e858b296d909f6caec59b641b4aeb1bb (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 3e8bb384d3a08b9c356d70359679faef771ea022
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Wed Apr 20 22:45:53 2011 +0200

    WebDAV: report correctly the number of sent bytes.

diff --git a/myserver/src/protocol/http/webdav/webdav.cpp b/myserver/src/protocol/http/webdav/webdav.cpp
index 1217060..41bf189 100644
--- a/myserver/src/protocol/http/webdav/webdav.cpp
+++ b/myserver/src/protocol/http/webdav/webdav.cpp
@@ -335,13 +335,11 @@ int WebDAV::propfind (HttpThreadContext* td)
           if (nbr == 0)
             break;
 
-          HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                    nbr, &(td->outputData),
-                                                    &chain, td->appendOutputs,
-                                                    useChunks);
-
-          td->sentData += nbr;
-
+          td->sentData +=
+            HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
+                                                      nbr, &(td->outputData),
+                                                      &chain, td->appendOutputs,
+                                                      useChunks);
           if (nbr != td->buffer->getRealLength ())
             break;
         }
@@ -656,14 +654,11 @@ int WebDAV::lock (HttpThreadContext* td)
           if (nbr == 0)
             break;
 
-          HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                    nbr, &(td->outputData),
-                                                    &chain, td->appendOutputs,
-                                                    useChunks);
-          td->sentData += nbr;
-
-          if (nbr != td->buffer->getRealLength ())
-            break;
+          td->sentData +=
+            HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
+                                                      nbr, &(td->outputData),
+                                                      &chain, td->appendOutputs,
+                                                      useChunks);
         }
 
       if (useChunks && chain.getStream ()->write ("0\r\n\r\n", 5, &nbw2))



commit b38ba649b7d8862e841396fc9d359a261606081c
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Wed Apr 20 22:43:51 2011 +0200

    SCGI: report correctly the number of sent bytes.

diff --git a/myserver/src/http_handler/scgi/scgi.cpp b/myserver/src/http_handler/scgi/scgi.cpp
index 3bab92a..ac31d70 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -216,7 +216,6 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
   u_long headerSize = 0;
   u_long tmpHeaderSize = 0;
   size_t nbw, nbr;
-  u_long sentData = 0;
   HttpThreadContext* td = ctx->td;
 
   checkDataChunks (td, &keepalive, &useChunks);
@@ -267,14 +266,10 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
     return HttpDataHandler::RET_OK;
 
   if (read - headerSize)
-    appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer () + headerSize,
-                             read - headerSize,
-                             &(td->outputData),
-                             chain,
-                             td->appendOutputs,
-                             useChunks);
-
-  sentData += read - headerSize;
+    td->sentData +=
+      appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer () + headerSize,
+                             read - headerSize, &(td->outputData), chain,
+                               td->appendOutputs, useChunks);
 
   if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
     {
@@ -284,24 +279,18 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
                                 td->auxiliaryBuffer->getRealLength (),
                                 0);
 
-          if (!nbr || (nbr == (size_t)-1))
+          if (!nbr || (nbr == (size_t) -1))
             break;
 
-          appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                   nbr,
-                                   &(td->outputData),
-                                   chain,
-                                   td->appendOutputs,
-                                   useChunks);
-
-          sentData += nbr;
+          td->sentData +=
+            appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
+                                     nbr, &(td->outputData), chain,
+                                     td->appendOutputs, useChunks);
         }
 
       if (!td->appendOutputs && useChunks)
         chain->getStream ()->write ("0\r\n\r\n", 5, &nbw);
     }
-  /* For logging activity.  */
-  td->sentData += sentData;
 
   return HttpDataHandler::RET_OK;
 }



commit 4a675d37a3eff66d9625c58118fb2fd913c5b6ff
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Wed Apr 20 22:41:27 2011 +0200

    Proxy: report correctly the number of sent bytes.

diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index c8fc684..4c908da 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -277,7 +277,6 @@ int Proxy::readPayLoad (HttpThreadContext* td,
 
   size_t nbr = 0, nbw = 0, length = 0, inPos = 0;
   u_long bufferDataSize = 0;
-  u_long written = 0;
 
   /* Only the chunked transfer encoding is supported.  */
   if (serverTransferEncoding && serverTransferEncoding->compare ("chunked"))
@@ -314,12 +313,11 @@ int Proxy::readPayLoad (HttpThreadContext* td,
               if (!nbr)
                 break;
 
-              HttpDataHandler::appendDataToHTTPChannel (td,
+              td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                                        td->buffer->getBuffer (),
                                                        nbr, &(td->outputData),
                                                        out, td->appendOutputs,
                                                        useChunks);
-              written += nbr;
             }
         }
     }
@@ -348,11 +346,9 @@ int Proxy::readPayLoad (HttpThreadContext* td,
           if (length)
             length -= nbr;
 
-          HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
+          td->sentData += HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
                                                     nbr, &(td->outputData), out,
                                                     td->appendOutputs, useChunks);
-          written += nbr;
-
           if (timedOut || contentLength && length == 0)
             break;
         }



commit fd528f4a51e37a1e6112ceddea797289b2aed284
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Wed Apr 20 22:38:28 2011 +0200

    MsCgi: report correctly the number of sent bytes.

diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp b/myserver/src/http_handler/mscgi/mscgi.cpp
index f63bec8..dcca885 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -141,10 +141,6 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
       if (!data.error)
         return HttpDataHandler::RET_FAILURE;
 
-      ostringstream tmp;
-      tmp << td->sentData;
-      td->response.contentLength.assign (tmp.str ());
-
       chain.clearAllFilters ();
 
     }
@@ -171,15 +167,14 @@ int MsCgi::write (const char* data, u_long len, MsCgiData* mcd)
   if (mcd->onlyHeader)
     return 0;
 
-  HttpDataHandler::appendDataToHTTPChannel (mcd->td,
-                                            (char*) data,
-                                            len,
-                                            &(mcd->td->outputData),
-                                            mcd->filtersChain,
-                                            mcd->td->appendOutputs,
-                                            mcd->useChunks);
-
-  mcd->td->sentData +=len;
+  mcd->td->sentData +=
+    HttpDataHandler::appendDataToHTTPChannel (mcd->td,
+                                              mcd->td->auxiliaryBuffer->getBuffer (),
+                                              mcd->td->auxiliaryBuffer->getLength (),
+                                              &(mcd->td->outputData),
+                                              mcd->filtersChain,
+                                              mcd->td->appendOutputs,
+                                              mcd->useChunks);
   return 0;
 }
 



commit c00a108c12ba3b7caa270b0bdb7f873493b53654
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Wed Apr 20 22:29:10 2011 +0200

    HttpFile: report sent bytes correctly.

diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index b7d665a..5f5249c 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -442,7 +442,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
 
         memStream.refresh ();
         if (nbr)
-          HttpDataHandler::appendDataToHTTPChannel (td,
+          dataSent += HttpDataHandler::appendDataToHTTPChannel (td,
                                                     td->buffer->getBuffer (),
                                                     nbr, &(td->outputData),
                                                     &chain, td->appendOutputs,



commit 4f1cf0e830aa539df90b171a270da94ec0911daf
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Wed Apr 20 22:27:21 2011 +0200

    HttpDir: report sent bytes correctly.

diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp b/myserver/src/http_handler/http_dir/http_dir.cpp
index 6f977a8..c16bc10 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -326,7 +326,6 @@ int HttpDir::send (HttpThreadContext* td,
   FiltersChain chain;
   int lastSlash = 0;
   bool useChunks = false;
-  u_long sentData = 0;
   char* bufferloop;
   const char* cssFile;
   bool keepalive = false;
@@ -438,12 +437,10 @@ int HttpDir::send (HttpThreadContext* td,
 
       *td->auxiliaryBuffer << "</head>\r\n";
 
-      appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                               td->auxiliaryBuffer->getLength (),
-                               &(td->outputData), &chain,
-                               td->appendOutputs, useChunks);
-
-      sentData = td->auxiliaryBuffer->getLength ();
+      td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
+                                           td->auxiliaryBuffer->getLength (),
+                                           &(td->outputData), &chain,
+                                           td->appendOutputs, useChunks);
 
       filename = directory;
       td->auxiliaryBuffer->setLength (0);
@@ -456,12 +453,10 @@ int HttpDir::send (HttpThreadContext* td,
                                                  ? lastIndex + 1: 0];
       *td->auxiliaryBuffer << "</h1>\r\n<hr />\r\n";
 
-      appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                               td->auxiliaryBuffer->getLength (),
-                               &(td->outputData), &chain,
-                               td->appendOutputs, useChunks);
-
-      sentData += td->auxiliaryBuffer->getLength ();
+      td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
+                                           td->auxiliaryBuffer->getLength (),
+                                           &(td->outputData), &chain,
+                                           td->appendOutputs, useChunks);
 
       fd.findfirst (filename.c_str ());
 
@@ -474,13 +469,10 @@ int HttpDir::send (HttpThreadContext* td,
 
       generateHeader (*td->auxiliaryBuffer, sortType, sortReverse, formatString);
 
-      appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                               td->auxiliaryBuffer->getLength (),
-                               &(td->outputData), &chain,
-                               td->appendOutputs, useChunks);
-
-      sentData += td->auxiliaryBuffer->getLength ();
-
+      td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
+                                               td->auxiliaryBuffer->getLength (),
+                                               &(td->outputData), &chain,
+                                               td->appendOutputs, useChunks);
       td->auxiliaryBuffer->setLength (0);
 
       if (FilesUtility::getPathRecursionLevel (td->request.uri) >= 1)
@@ -514,12 +506,10 @@ int HttpDir::send (HttpThreadContext* td,
 
           *td->auxiliaryBuffer << "</tr>\r\n";
 
-          appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                   td->auxiliaryBuffer->getLength (),
-                                   &(td->outputData), &chain,
-                                   td->appendOutputs, useChunks);
-
-          sentData += td->auxiliaryBuffer->getLength ();
+          td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
+                                                   td->auxiliaryBuffer->getLength (),
+                                                   &(td->outputData), &chain,
+                                                   td->appendOutputs, useChunks);
         }
 
       /* Put all files in a vector.  */
@@ -578,12 +568,10 @@ int HttpDir::send (HttpThreadContext* td,
           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->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
+                                                   td->auxiliaryBuffer->getLength (),
+                                                   &(td->outputData), &chain,
+                                                   td->appendOutputs, useChunks);
         }
 
       td->auxiliaryBuffer->setLength (0);
@@ -605,13 +593,10 @@ int HttpDir::send (HttpThreadContext* td,
           *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);
-
-
-      sentData += td->auxiliaryBuffer->getLength ();
+      td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
+                                               td->auxiliaryBuffer->getLength (),
+                                               &(td->outputData), &chain,
+                                               td->appendOutputs, useChunks);
 
       *td->auxiliaryBuffer << end_str;
       /* Changes the \ character in the / character.  */
@@ -622,9 +607,6 @@ int HttpDir::send (HttpThreadContext* td,
 
       if (!td->appendOutputs && useChunks)
         chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
-
-      /* For logging activity.  */
-      td->sentData += sentData;
     }
   catch (exception & e)
     {



commit 21e5a557c864a207310430739103f33522c2206e
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Wed Apr 20 22:18:52 2011 +0200

    CGI: report correctly the number of sent bytes.

diff --git a/myserver/src/http_handler/cgi/cgi.cpp b/myserver/src/http_handler/cgi/cgi.cpp
index 35cd862..58e6f43 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -288,7 +288,6 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
                    Process &cgiProc, bool onlyHeader, bool nph)
 {
   size_t nbw = 0;
-  size_t nbw2 = 0;
   size_t nBytesRead = 0;
   u_long procStartTime;
   bool useChunks = false;
@@ -314,6 +313,7 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
     {
       FiltersFactory *ff = Server::getInstance ()->getFiltersFactory ();
       ff->chain (&chain, td->mime->filters, td->connection->socket, &nbw, 1);
+      td->sentData += nbw;
     }
 
   /* Send the rest of the data until we can read from the pipe.  */
@@ -343,24 +343,19 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
         break;
 
       if (nBytesRead)
-        HttpDataHandler::appendDataToHTTPChannel (td,
+      td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                                   td->auxiliaryBuffer->getBuffer (),
                                                   nBytesRead,
                                                   &(td->outputData),
                                                   &chain,
                                                   td->appendOutputs,
                                                   useChunks);
-
-      nbw += nBytesRead;
     }
 
   /* Send the last null chunk if needed.  */
-  if (useChunks && chain.getStream ()->write ("0\r\n\r\n", 5, &nbw2))
+  if (useChunks && chain.getStream ()->write ("0\r\n\r\n", 5, &nbw))
     return HttpDataHandler::RET_FAILURE;
 
-  /* Update the Content-length field for logging activity.  */
-  td->sentData += nbw;
-
   return HttpDataHandler::RET_OK;
 }
 
@@ -482,15 +477,13 @@ int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile, FiltersChain &chai
   if (headerOffset - headerSize)
     {
       /* Flush the buffer.  Data from the header parsing can be present.  */
-      HttpDataHandler::appendDataToHTTPChannel (td,
+      td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                td->auxiliaryBuffer->getBuffer () + headerSize,
                                                     headerOffset - headerSize,
                                                     &(td->outputData),
                                                     &chain,
                                                     td->appendOutputs,
-                                                useChunks);
-
-      td->sentData += headerOffset - headerSize;
+                                                    useChunks);
     }
 
   return 0;
diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index 0d932cb..9b012b7 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -620,7 +620,7 @@ int FastCgi::sendData (FcgiContext* con, u_long dim, u_long timeout,
   if (onlyHeader)
     return 1;
 
-  HttpDataHandler::appendDataToHTTPChannel (con->td,
+  size_t nbw = HttpDataHandler::appendDataToHTTPChannel (con->td,
                                             con->td->buffer->getBuffer (),
                                             con->td->buffer->getLength (),
                                             &(con->td->outputData),
@@ -628,8 +628,7 @@ int FastCgi::sendData (FcgiContext* con, u_long dim, u_long timeout,
                                             con->td->appendOutputs,
                                             con->useChunks);
 
-  con->td->sentData += con->td->buffer->getLength ();
-
+  con->td->sentData += nbw;
   return 0;
 }
 
@@ -712,14 +711,14 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain* chain, bool* response
   /* Flush the buffer if remaining data is present.  */
   if (size - headerSize)
     {
-      HttpDataHandler::appendDataToHTTPChannel (con->td,
+      size_t nbw = 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;
+      con->td->sentData += nbw;
     }
 
   return 0;



commit 8ffe0bec866e743e11ec36f162fd2dbcfb39f13d
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Wed Apr 20 22:17:26 2011 +0200

    Remove install-sh

diff --git a/myserver/install-sh b/myserver/install-sh
deleted file mode 100755
index 6781b98..0000000
--- a/myserver/install-sh
+++ /dev/null
@@ -1,520 +0,0 @@
-#!/bin/sh
-# install - install a program, script, or datafile
-
-scriptversion=2009-04-28.21; # UTC
-
-# This originates from X11R5 (mit/util/scripts/install.sh), which was
-# later released in X11R6 (xc/config/util/install.sh) with the
-# following copyright and license.
-#
-# Copyright (C) 1994 X Consortium
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to
-# deal in the Software without restriction, including without limitation the
-# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-# sell copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
-# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the X Consortium shall not
-# be used in advertising or otherwise to promote the sale, use or other deal-
-# ings in this Software without prior written authorization from the X Consor-
-# tium.
-#
-#
-# FSF changes to this file are in the public domain.
-#
-# Calling this script install-sh is preferred over install.sh, to prevent
-# `make' implicit rules from creating a file called install from it
-# when there is no Makefile.
-#
-# This script is compatible with the BSD install script, but was written
-# from scratch.
-
-nl='
-'
-IFS=" ""	$nl"
-
-# set DOITPROG to echo to test this script
-
-# Don't use :- since 4.3BSD and earlier shells don't like it.
-doit=${DOITPROG-}
-if test -z "$doit"; then
-  doit_exec=exec
-else
-  doit_exec=$doit
-fi
-
-# Put in absolute file names if you don't have them in your path;
-# or use environment vars.
-
-chgrpprog=${CHGRPPROG-chgrp}
-chmodprog=${CHMODPROG-chmod}
-chownprog=${CHOWNPROG-chown}
-cmpprog=${CMPPROG-cmp}
-cpprog=${CPPROG-cp}
-mkdirprog=${MKDIRPROG-mkdir}
-mvprog=${MVPROG-mv}
-rmprog=${RMPROG-rm}
-stripprog=${STRIPPROG-strip}
-
-posix_glob='?'
-initialize_posix_glob='
-  test "$posix_glob" != "?" || {
-    if (set -f) 2>/dev/null; then
-      posix_glob=
-    else
-      posix_glob=:
-    fi
-  }
-'
-
-posix_mkdir=
-
-# Desired mode of installed file.
-mode=0755
-
-chgrpcmd=
-chmodcmd=$chmodprog
-chowncmd=
-mvcmd=$mvprog
-rmcmd="$rmprog -f"
-stripcmd=
-
-src=
-dst=
-dir_arg=
-dst_arg=
-
-copy_on_change=false
-no_target_directory=
-
-usage="\
-Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
-   or: $0 [OPTION]... SRCFILES... DIRECTORY
-   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
-   or: $0 [OPTION]... -d DIRECTORIES...
-
-In the 1st form, copy SRCFILE to DSTFILE.
-In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
-In the 4th, create DIRECTORIES.
-
-Options:
-     --help     display this help and exit.
-     --version  display version info and exit.
-
-  -c            (ignored)
-  -C            install only if different (preserve the last data modification time)
-  -d            create directories instead of installing files.
-  -g GROUP      $chgrpprog installed files to GROUP.
-  -m MODE       $chmodprog installed files to MODE.
-  -o USER       $chownprog installed files to USER.
-  -s            $stripprog installed files.
-  -t DIRECTORY  install into DIRECTORY.
-  -T            report an error if DSTFILE is a directory.
-
-Environment variables override the default commands:
-  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
-  RMPROG STRIPPROG
-"
-
-while test $# -ne 0; do
-  case $1 in
-    -c) ;;
-
-    -C) copy_on_change=true;;
-
-    -d) dir_arg=true;;
-
-    -g) chgrpcmd="$chgrpprog $2"
-	shift;;
-
-    --help) echo "$usage"; exit $?;;
-
-    -m) mode=$2
-	case $mode in
-	  *' '* | *'	'* | *'
-'*	  | *'*'* | *'?'* | *'['*)
-	    echo "$0: invalid mode: $mode" >&2
-	    exit 1;;
-	esac
-	shift;;
-
-    -o) chowncmd="$chownprog $2"
-	shift;;
-
-    -s) stripcmd=$stripprog;;
-
-    -t) dst_arg=$2
-	shift;;
-
-    -T) no_target_directory=true;;
-
-    --version) echo "$0 $scriptversion"; exit $?;;
-
-    --)	shift
-	break;;
-
-    -*)	echo "$0: invalid option: $1" >&2
-	exit 1;;
-
-    *)  break;;
-  esac
-  shift
-done
-
-if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
-  # When -d is used, all remaining arguments are directories to create.
-  # When -t is used, the destination is already specified.
-  # Otherwise, the last argument is the destination.  Remove it from $@.
-  for arg
-  do
-    if test -n "$dst_arg"; then
-      # $@ is not empty: it contains at least $arg.
-      set fnord "$@" "$dst_arg"
-      shift # fnord
-    fi
-    shift # arg
-    dst_arg=$arg
-  done
-fi
-
-if test $# -eq 0; then
-  if test -z "$dir_arg"; then
-    echo "$0: no input file specified." >&2
-    exit 1
-  fi
-  # It's OK to call `install-sh -d' without argument.
-  # This can happen when creating conditional directories.
-  exit 0
-fi
-
-if test -z "$dir_arg"; then
-  trap '(exit $?); exit' 1 2 13 15
-
-  # Set umask so as not to create temps with too-generous modes.
-  # However, 'strip' requires both read and write access to temps.
-  case $mode in
-    # Optimize common cases.
-    *644) cp_umask=133;;
-    *755) cp_umask=22;;
-
-    *[0-7])
-      if test -z "$stripcmd"; then
-	u_plus_rw=
-      else
-	u_plus_rw='% 200'
-      fi
-      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
-    *)
-      if test -z "$stripcmd"; then
-	u_plus_rw=
-      else
-	u_plus_rw=,u+rw
-      fi
-      cp_umask=$mode$u_plus_rw;;
-  esac
-fi
-
-for src
-do
-  # Protect names starting with `-'.
-  case $src in
-    -*) src=./$src;;
-  esac
-
-  if test -n "$dir_arg"; then
-    dst=$src
-    dstdir=$dst
-    test -d "$dstdir"
-    dstdir_status=$?
-  else
-
-    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
-    # might cause directories to be created, which would be especially bad
-    # if $src (and thus $dsttmp) contains '*'.
-    if test ! -f "$src" && test ! -d "$src"; then
-      echo "$0: $src does not exist." >&2
-      exit 1
-    fi
-
-    if test -z "$dst_arg"; then
-      echo "$0: no destination specified." >&2
-      exit 1
-    fi
-
-    dst=$dst_arg
-    # Protect names starting with `-'.
-    case $dst in
-      -*) dst=./$dst;;
-    esac
-
-    # If destination is a directory, append the input filename; won't work
-    # if double slashes aren't ignored.
-    if test -d "$dst"; then
-      if test -n "$no_target_directory"; then
-	echo "$0: $dst_arg: Is a directory" >&2
-	exit 1
-      fi
-      dstdir=$dst
-      dst=$dstdir/`basename "$src"`
-      dstdir_status=0
-    else
-      # Prefer dirname, but fall back on a substitute if dirname fails.
-      dstdir=`
-	(dirname "$dst") 2>/dev/null ||
-	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-	     X"$dst" : 'X\(//\)[^/]' \| \
-	     X"$dst" : 'X\(//\)$' \| \
-	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
-	echo X"$dst" |
-	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)[^/].*/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\/\)$/{
-		   s//\1/
-		   q
-		 }
-		 /^X\(\/\).*/{
-		   s//\1/
-		   q
-		 }
-		 s/.*/./; q'
-      `
-
-      test -d "$dstdir"
-      dstdir_status=$?
-    fi
-  fi
-
-  obsolete_mkdir_used=false
-
-  if test $dstdir_status != 0; then
-    case $posix_mkdir in
-      '')
-	# Create intermediate dirs using mode 755 as modified by the umask.
-	# This is like FreeBSD 'install' as of 1997-10-28.
-	umask=`umask`
-	case $stripcmd.$umask in
-	  # Optimize common cases.
-	  *[2367][2367]) mkdir_umask=$umask;;
-	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
-	  *[0-7])
-	    mkdir_umask=`expr $umask + 22 \
-	      - $umask % 100 % 40 + $umask % 20 \
-	      - $umask % 10 % 4 + $umask % 2
-	    `;;
-	  *) mkdir_umask=$umask,go-w;;
-	esac
-
-	# With -d, create the new directory with the user-specified mode.
-	# Otherwise, rely on $mkdir_umask.
-	if test -n "$dir_arg"; then
-	  mkdir_mode=-m$mode
-	else
-	  mkdir_mode=
-	fi
-
-	posix_mkdir=false
-	case $umask in
-	  *[123567][0-7][0-7])
-	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
-	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
-	    ;;
-	  *)
-	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
-	    if (umask $mkdir_umask &&
-		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-	    then
-	      if test -z "$dir_arg" || {
-		   # Check for POSIX incompatibilities with -m.
-		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-		   # other-writeable bit of parent directory when it shouldn't.
-		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
-		   case $ls_ld_tmpdir in
-		     d????-?r-*) different_mode=700;;
-		     d????-?--*) different_mode=755;;
-		     *) false;;
-		   esac &&
-		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
-		   }
-		 }
-	      then posix_mkdir=:
-	      fi
-	      rmdir "$tmpdir/d" "$tmpdir"
-	    else
-	      # Remove any dirs left behind by ancient mkdir implementations.
-	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-	    fi
-	    trap '' 0;;
-	esac;;
-    esac
-
-    if
-      $posix_mkdir && (
-	umask $mkdir_umask &&
-	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
-      )
-    then :
-    else
-
-      # The umask is ridiculous, or mkdir does not conform to POSIX,
-      # or it failed possibly due to a race condition.  Create the
-      # directory the slow way, step by step, checking for races as we go.
-
-      case $dstdir in
-	/*) prefix='/';;
-	-*) prefix='./';;
-	*)  prefix='';;
-      esac
-
-      eval "$initialize_posix_glob"
-
-      oIFS=$IFS
-      IFS=/
-      $posix_glob set -f
-      set fnord $dstdir
-      shift
-      $posix_glob set +f
-      IFS=$oIFS
-
-      prefixes=
-
-      for d
-      do
-	test -z "$d" && continue
-
-	prefix=$prefix$d
-	if test -d "$prefix"; then
-	  prefixes=
-	else
-	  if $posix_mkdir; then
-	    (umask=$mkdir_umask &&
-	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
-	    # Don't fail if two instances are running concurrently.
-	    test -d "$prefix" || exit 1
-	  else
-	    case $prefix in
-	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
-	      *) qprefix=$prefix;;
-	    esac
-	    prefixes="$prefixes '$qprefix'"
-	  fi
-	fi
-	prefix=$prefix/
-      done
-
-      if test -n "$prefixes"; then
-	# Don't fail if two instances are running concurrently.
-	(umask $mkdir_umask &&
-	 eval "\$doit_exec \$mkdirprog $prefixes") ||
-	  test -d "$dstdir" || exit 1
-	obsolete_mkdir_used=true
-      fi
-    fi
-  fi
-
-  if test -n "$dir_arg"; then
-    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
-    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
-    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
-      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
-  else
-
-    # Make a couple of temp file names in the proper directory.
-    dsttmp=$dstdir/_inst.$$_
-    rmtmp=$dstdir/_rm.$$_
-
-    # Trap to clean up those temp files at exit.
-    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
-
-    # Copy the file name to the temp name.
-    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
-
-    # and set any options; do chmod last to preserve setuid bits.
-    #
-    # If any of these fail, we abort the whole thing.  If we want to
-    # ignore errors from any of these, just make sure not to ignore
-    # errors from the above "$doit $cpprog $src $dsttmp" command.
-    #
-    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
-    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
-    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
-    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
-
-    # If -C, don't bother to copy if it wouldn't change the file.
-    if $copy_on_change &&
-       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
-       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
-
-       eval "$initialize_posix_glob" &&
-       $posix_glob set -f &&
-       set X $old && old=:$2:$4:$5:$6 &&
-       set X $new && new=:$2:$4:$5:$6 &&
-       $posix_glob set +f &&
-
-       test "$old" = "$new" &&
-       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
-    then
-      rm -f "$dsttmp"
-    else
-      # Rename the file to the real destination.
-      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
-
-      # The rename failed, perhaps because mv can't rename something else
-      # to itself, or perhaps because mv is so ancient that it does not
-      # support -f.
-      {
-	# Now remove or move aside any old file at destination location.
-	# We try this two ways since rm can't unlink itself on some
-	# systems and the destination file might be busy for other
-	# reasons.  In this case, the final cleanup might fail but the new
-	# file should still install successfully.
-	{
-	  test ! -f "$dst" ||
-	  $doit $rmcmd -f "$dst" 2>/dev/null ||
-	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
-	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
-	  } ||
-	  { echo "$0: cannot unlink or rename $dst" >&2
-	    (exit 1); exit 1
-	  }
-	} &&
-
-	# Now rename the file to the real destination.
-	$doit $mvcmd "$dsttmp" "$dst"
-      }
-    fi || exit 1
-
-    trap '' 0
-  fi
-done
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
-# time-stamp-end: "; # UTC"
-# End:

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

Summary of changes:
 myserver/install-sh                               |  520 ---------------------
 myserver/src/http_handler/cgi/cgi.cpp             |   17 +-
 myserver/src/http_handler/fastcgi/fastcgi.cpp     |    9 +-
 myserver/src/http_handler/http_dir/http_dir.cpp   |   66 +--
 myserver/src/http_handler/http_file/http_file.cpp |    2 +-
 myserver/src/http_handler/mscgi/mscgi.cpp         |   21 +-
 myserver/src/http_handler/proxy/proxy.cpp         |    8 +-
 myserver/src/http_handler/scgi/scgi.cpp           |   29 +-
 myserver/src/protocol/http/webdav/webdav.cpp      |   25 +-
 9 files changed, 63 insertions(+), 634 deletions(-)
 delete mode 100755 myserver/install-sh


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Wed Apr 20 16:53:08 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QCeOa-0008RL-Lp
	for mharc-myserver-commit@gnu.org; Wed, 20 Apr 2011 16:53:08 -0400
Received: from eggs.gnu.org ([140.186.70.92]:54008)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCeOY-0008Ou-TU
	for myserver-commit@gnu.org; Wed, 20 Apr 2011 16:53:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCeOY-0000lO-4d
	for myserver-commit@gnu.org; Wed, 20 Apr 2011 16:53:06 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:32919)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCeOY-0000lK-35
	for myserver-commit@gnu.org; Wed, 20 Apr 2011 16:53:06 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QCeOX-0002MN-RN
	for myserver-commit@gnu.org; Wed, 20 Apr 2011 20:53:05 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QCeOX-0005jC-Pm
	for myserver-commit@gnu.org; Wed, 20 Apr 2011 20:53:05 +0000
Date: Wed, 20 Apr 2011 20:53:05 +0000
Message-Id: <E1QCeOX-0005jC-Pm@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 3e8bb384d3a08b9c356d70359679faef771ea022
X-Git-Newrev: 7e5d49f284419bf46882f76976ee6018b0597e43
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-459-g7e5d49f
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/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, 20 Apr 2011 20:53:07 -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  7e5d49f284419bf46882f76976ee6018b0597e43 (commit)
      from  3e8bb384d3a08b9c356d70359679faef771ea022 (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 7e5d49f284419bf46882f76976ee6018b0597e43
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Wed Apr 20 22:49:52 2011 +0200

    Do dot undefine some functions which don't cause conflicts anymore

diff --git a/myserver/tests/main.cpp b/myserver/tests/main.cpp
index 97bc9d3..c1acc85 100644
--- a/myserver/tests/main.cpp
+++ b/myserver/tests/main.cpp
@@ -18,9 +18,6 @@
 #include "myserver.h"
 #include <include/server/server.h>
 
-#undef open
-#undef close
-
 #include <cppunit/TextOutputter.h>
 #include <cppunit/CompilerOutputter.h>
 #include <cppunit/XmlOutputter.h>
diff --git a/myserver/tests/test_hashmap.cpp b/myserver/tests/test_hashmap.cpp
index b7da838..8195a3c 100644
--- a/myserver/tests/test_hashmap.cpp
+++ b/myserver/tests/test_hashmap.cpp
@@ -17,8 +17,6 @@
 
 #include "myserver.h"
 
-#undef remove
-
 #include <include/base/hash_map/hash_map.h>
 
 #include <cppunit/CompilerOutputter.h>

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

Summary of changes:
 myserver/tests/main.cpp         |    3 ---
 myserver/tests/test_hashmap.cpp |    2 --
 2 files changed, 0 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Wed Apr 20 17:03:36 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QCeYi-0001TJ-9V
	for mharc-myserver-commit@gnu.org; Wed, 20 Apr 2011 17:03:36 -0400
Received: from eggs.gnu.org ([140.186.70.92]:55145)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QCeYg-0001ST-CK
	for myserver-commit@gnu.org; Wed, 20 Apr 2011 17:03:35 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QCeYf-0002Mz-75
	for myserver-commit@gnu.org; Wed, 20 Apr 2011 17:03:34 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:46311)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QCeYe-0002Ml-LE
	for myserver-commit@gnu.org; Wed, 20 Apr 2011 17:03:33 -0400
Received: from lucifer (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.14.4/8.14.4) with SMTP id
	p3KL3SOQ002811
	for <myserver-commit@gnu.org>; Wed, 20 Apr 2011 23:03:30 +0200
Message-Id: <201104202103.p3KL3SOQ002811@proliant.st.ewi.tudelft.nl>
Received: by lucifer (sSMTP sendmail emulation);
	Wed, 20 Apr 2011 23:03:28 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
X-Hydra-Instance: lucifer
X-Hydra-Project: gnu
X-Hydra-Jobset: myserver-master
X-Hydra-Job: build
Date: Wed, 20 Apr 2011 23:03:28 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 130.161.158.3
Subject: [myserver-commit] Hydra job gnu:myserver-master:build build
	1050566: Failed
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/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, 20 Apr 2011 21:03:35 -0000

Hi,

This is to let you know that Hydra build 1050566 of job gnu:myserver-master:build has changed from 'Failed' to 'Failed'.

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

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:              | 1050566
Nix name:              | myserver-0.9.2.459-7e5d
Short description:     | Native Nix build on i686-linux
Maintainer(s):         | myserver-commit@gnu.org
System:                | i686-linux
Derivation store path: | /nix/store/73ndg2k36sgbk4y2nhii1ngphjg23w3f-myserver-0.9.2.459-7e5d.drv
Output store path:     | /nix/store/24myd8zk4s1plcarqdqpvr9289cz8dsz-myserver-0.9.2.459-7e5d
Time added:            | 2011-04-20 23:03:28
Build started:         | 2011-04-20 23:00:19
Build finished:        | 2011-04-20 23:03:28
Duration:              | 189s

The build inputs were:

Name        | Type   | Value
------------+--------+-------------------------------------------------------------
hydraConfig | svn    | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:26838
nixpkgs     | svn    | https://svn.nixos.org/repos/nix/nixpkgs/trunk:26912
system      | string | i686-linux
tarball     | build  | 1050554

Regards,

The Hydra build daemon.

---
TestConnection::testTries. : OK
TestConnection::testPort. : OK
TestConnection::testLogin. : OK
TestConnection::testPassword. : OK
TestConnection::testForceControl. : OK
TestConnection::testToRemove. : OK
TestConnection::testScheduled. : OK
TestConnection::testPriority. : OK
TestConnectionsScheduler::testAddNewConnection. : OK
TestConnectionsScheduler::testGetNumTotalConnections. : OK
TestConnectionsScheduler::testAddNewReadyConnection. : OK
TestConnectionsScheduler::testGetConnections. : OK
TestConnectionsScheduler::testVisitor. : OK
TestCryptAlgoManager::testRegister. : OK
TestCryptAlgoManager::testCheck. : OK
TestCryptAlgoManager::testNoExists. : OK
TestExceptions::testWrongCwd. : OK
TestExceptions::testErrno. : OK
TestExceptions::testGetBacktrace. : OK
TestFile::testCreateTemporaryFile. : OK
TestFile::testCreateTemporaryDelayedFile. : OK
TestFile::testOnFile. : OK
TestFile::testBinary. : OK
TestFile::testTruncate. : OK
TestFile::testCreationTime. : OK
TestFile::testLastAccessTime. : OK
TestFile::testLastModTime. : OK
TestFile::testSeek. : OK
TestFileStream::testCycleLog. : OK
TestFileStream::testReOpen. : OK
TestFileStreamCreator::testCreation. : OK
TestFilesUtility::testGetPathRecursionLevel. : OK
TestFilesUtility::testSplitPath. : OK
TestFilesUtility::testSplitPathString. : OK
TestFilesUtility::testSplitPathLength. : OK
TestFilesUtility::testGetFileExt. : OK
TestFilterChain::testGzipChain. : OK
TestFilterChain::testIsEmpty. : OK
TestFilterChain::testAcceptDuplicates. : OK
TestFilterChain::testStream. : OK
TestFilterChain::testIsFilterPresent. : OK
TestFilterChain::testRemoveFilter. : OK
TestForkServer::testExecuteProcessmake[2]: *** [check-am] Segmentation fault
make[2]: Leaving directory `/tmp/nix-build-73ndg2k36sgbk4y2nhii1ngphjg23w3f-myserver-0.9.2.459-7e5d.drv-0/myserver-0.9.2.459-7e5d/tests'
[q[qmake[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/tmp/nix-build-73ndg2k36sgbk4y2nhii1ngphjg23w3f-myserver-0.9.2.459-7e5d.drv-0/myserver-0.9.2.459-7e5d'
[q[qmake: *** [check] Error 2
[q[q[qbuild time elapsed:  0m0.021s 0m0.010s 2m5.452s 0m20.398s
[pCopying build directory to /nix/store/24myd8zk4s1plcarqdqpvr9289cz8dsz-myserver-0.9.2.459-7e5d/nix-build-73ndg2k36sgbk4y2nhii1ngphjg23w3f-myserver-0.9.2.459-7e5d.drv-0
[qbuild failed with exit code 2 (ignored)


From MAILER-DAEMON Wed Apr 20 17:05:17 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QCeaL-0001aZ-8i
	for mharc-myserver-commit@gnu.org; Wed, 20 Apr 2011 17:05:17 -0400
Received: from eggs.gnu.org ([140.186.70.92]:42919)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QCeaF-0001Y7-S7
	for myserver-commit@gnu.org; Wed, 20 Apr 2011 17:05:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QCeaE-0002cx-TY
	for myserver-commit@gnu.org; Wed, 20 Apr 2011 17:05:11 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:46315)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QCeaE-0002cs-J3
	for myserver-commit@gnu.org; Wed, 20 Apr 2011 17:05:10 -0400
Received: from lucifer (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.14.4/8.14.4) with SMTP id
	p3KL59mV003061
	for <myserver-commit@gnu.org>; Wed, 20 Apr 2011 23:05:09 +0200
Message-Id: <201104202105.p3KL59mV003061@proliant.st.ewi.tudelft.nl>
Received: by lucifer (sSMTP sendmail emulation);
	Wed, 20 Apr 2011 23:05:09 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
X-Hydra-Instance: lucifer
X-Hydra-Project: gnu
X-Hydra-Jobset: myserver-master
X-Hydra-Job: build
Date: Wed, 20 Apr 2011 23:05:09 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 130.161.158.3
Subject: [myserver-commit] Hydra job gnu:myserver-master:build build
	1050564: Failed
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/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, 20 Apr 2011 21:05:16 -0000

Hi,

This is to let you know that Hydra build 1050564 of job gnu:myserver-master:build has changed from 'Failed' to 'Failed'.

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

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:              | 1050564
Nix name:              | myserver-0.9.2.459-7e5d
Short description:     | Native Nix build on x86_64-linux
Maintainer(s):         | myserver-commit@gnu.org
System:                | x86_64-linux
Derivation store path: | /nix/store/hrrzgavnwn68s4rmm82414j5yvjmh9x1-myserver-0.9.2.459-7e5d.drv
Output store path:     | /nix/store/9c1i6mn3rz0mxyswl22apngv9k37gnfj-myserver-0.9.2.459-7e5d
Time added:            | 2011-04-20 23:05:08
Build started:         | 2011-04-20 23:00:19
Build finished:        | 2011-04-20 23:05:08
Duration:              | 289s

The build inputs were:

Name        | Type   | Value
------------+--------+-------------------------------------------------------------
hydraConfig | svn    | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:26838
nixpkgs     | svn    | https://svn.nixos.org/repos/nix/nixpkgs/trunk:26912
system      | string | x86_64-linux
tarball     | build  | 1050554

Regards,

The Hydra build daemon.

---


!!!FAILURES!!!
Test Results:
Run:  288   Failures: 1   Errors: 6


1) test: TestForkServer::testExecuteProcess (E)
uncaught exception of type AddressException
- Address already in use


2) test: TestForkServer::testStartKillLoop (E)
uncaught exception of type AddressException
- Address already in use


3) test: TestSocket::testGetLocalIPsList (F) line: 162 test_socket.cpp
forced failure
- No such file or directory


4) test: TestSslSocket::testRecv (E)
uncaught exception of type BadDescriptorException
- Bad file descriptor


5) test: TestUnixSocket::testBind (E)
uncaught exception of type AddressException
- Address already in use


6) test: TestUnixSocket::testClient (E)
uncaught exception of type AddressException
- Address already in use


7) test: TestUnixSocket::testReadWriteHandle (E)
uncaught exception of type AddressException
- Address already in use


make[2]: *** [check-am] Error 1
make[2]: Leaving directory `/tmp/nix-build-hrrzgavnwn68s4rmm82414j5yvjmh9x1-myserver-0.9.2.459-7e5d.drv-0/myserver-0.9.2.459-7e5d/tests'
[q[qmake[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/tmp/nix-build-hrrzgavnwn68s4rmm82414j5yvjmh9x1-myserver-0.9.2.459-7e5d.drv-0/myserver-0.9.2.459-7e5d'
[q[qmake: *** [check] Error 2
[q[q[qbuild time elapsed:  0m0.020s 0m0.011s 3m7.535s 0m35.214s
[pCopying build directory to /nix/store/9c1i6mn3rz0mxyswl22apngv9k37gnfj-myserver-0.9.2.459-7e5d/nix-build-hrrzgavnwn68s4rmm82414j5yvjmh9x1-myserver-0.9.2.459-7e5d.drv-0
[qbuild failed with exit code 2 (ignored)


From MAILER-DAEMON Thu Apr 21 07:24:49 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QCs09-0000cb-FT
	for mharc-myserver-commit@gnu.org; Thu, 21 Apr 2011 07:24:49 -0400
Received: from eggs.gnu.org ([140.186.70.92]:43905)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCs06-0000cO-UT
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 07:24:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCs05-0008T8-V8
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 07:24:46 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:57367)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCs05-0008T2-SP
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 07:24:45 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QCs05-0003sq-Fc
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 11:24:45 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QCs04-0007Bm-L8
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 11:24:45 +0000
Date: Thu, 21 Apr 2011 11:24:44 +0000
Message-Id: <E1QCs04-0007Bm-L8@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 7e5d49f284419bf46882f76976ee6018b0597e43
X-Git-Newrev: 61d1323797634e78122daeb2535f05a432468aaf
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-460-g61d1323
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Apr 2011 11:24: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  61d1323797634e78122daeb2535f05a432468aaf (commit)
      from  7e5d49f284419bf46882f76976ee6018b0597e43 (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 61d1323797634e78122daeb2535f05a432468aaf
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 21 13:24:25 2011 +0200

    Mscgi: send data correctly.

diff --git a/myserver/include/http_handler/mscgi/mscgi.h b/myserver/include/http_handler/mscgi/mscgi.h
index 4b97db7..1e9f601 100644
--- a/myserver/include/http_handler/mscgi/mscgi.h
+++ b/myserver/include/http_handler/mscgi/mscgi.h
@@ -60,7 +60,7 @@ public:
                     const char* cmdLine = 0, bool execute = false,
                     bool onlyHeader = false);
 
-  int write (const char*, u_long, MsCgiData*);
+  int write (const char*, size_t, MsCgiData*);
   int sendHeader (MsCgiData*);
 
 private:
diff --git a/myserver/include/http_handler/mscgi/mscgi_manager.h b/myserver/include/http_handler/mscgi/mscgi_manager.h
index 52241c7..aedcbf5 100644
--- a/myserver/include/http_handler/mscgi/mscgi_manager.h
+++ b/myserver/include/http_handler/mscgi/mscgi_manager.h
@@ -51,8 +51,8 @@ class MscgiManager
   void getenv (const char*, char*, u_long*);
   char* getParam (const char*);
   char* postParam (const char*);
-  int write (const char*);
-  int write (const void*, int);
+  int write (const char *);
+  int write (const void *, size_t);
  private:
   HttpThreadContext* td;
   MsCgiData* cgidata;
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp b/myserver/src/http_handler/mscgi/mscgi.cpp
index dcca885..d721b9a 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -70,7 +70,7 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
   data.server = Server::getInstance ();
   data.mscgi = this;
   data.useChunks = false;
-  data.onlyHeader = onlyHeader ? true : false;
+  data.onlyHeader = onlyHeader;
   data.error = false;
   data.filtersChain = &chain;
   data.headerSent = false;
@@ -156,7 +156,7 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
 /*!
   Send a chunk of data to the client.
  */
-int MsCgi::write (const char* data, u_long len, MsCgiData* mcd)
+int MsCgi::write (const char* data, size_t len, MsCgiData* mcd)
 {
   if (mcd->error)
     return 1;
@@ -169,8 +169,7 @@ int MsCgi::write (const char* data, u_long len, MsCgiData* mcd)
 
   mcd->td->sentData +=
     HttpDataHandler::appendDataToHTTPChannel (mcd->td,
-                                              mcd->td->auxiliaryBuffer->getBuffer (),
-                                              mcd->td->auxiliaryBuffer->getLength (),
+                                              (char *) data, len,
                                               &(mcd->td->outputData),
                                               mcd->filtersChain,
                                               mcd->td->appendOutputs,
diff --git a/myserver/src/http_handler/mscgi/mscgi_manager.cpp b/myserver/src/http_handler/mscgi/mscgi_manager.cpp
index 67db9aa..106d5b7 100644
--- a/myserver/src/http_handler/mscgi/mscgi_manager.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi_manager.cpp
@@ -39,7 +39,7 @@ int MscgiManager::write (const char* str)
 /*!
   Write binary to the stdout.
  */
-int MscgiManager::write (const void* data, int len)
+int MscgiManager::write (const void* data, size_t len)
 {
   return cgidata->mscgi->write ((const char*) data, len, cgidata);
 }

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

Summary of changes:
 myserver/include/http_handler/mscgi/mscgi.h        |    2 +-
 .../include/http_handler/mscgi/mscgi_manager.h     |    4 ++--
 myserver/src/http_handler/mscgi/mscgi.cpp          |    7 +++----
 myserver/src/http_handler/mscgi/mscgi_manager.cpp  |    2 +-
 4 files changed, 7 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Thu Apr 21 07:56:31 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QCsUp-00060r-1v
	for mharc-myserver-commit@gnu.org; Thu, 21 Apr 2011 07:56:31 -0400
Received: from eggs.gnu.org ([140.186.70.92]:48925)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCsUl-00060j-LQ
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 07:56:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCsUj-0004Nh-Hu
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 07:56:27 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:49810)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCsUj-0004Nd-FP
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 07:56:25 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QCsUj-0004I9-B2
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 11:56:25 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QCsUi-0003SQ-Vs
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 11:56:25 +0000
Date: Thu, 21 Apr 2011 11:56:25 +0000
Message-Id: <E1QCsUi-0003SQ-Vs@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 61d1323797634e78122daeb2535f05a432468aaf
X-Git-Newrev: 4610bc1c88c48d4a096060685876ef7ae3f60035
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-461-g4610bc1
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Apr 2011 11:56: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  4610bc1c88c48d4a096060685876ef7ae3f60035 (commit)
      from  61d1323797634e78122daeb2535f05a432468aaf (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 4610bc1c88c48d4a096060685876ef7ae3f60035
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 21 13:45:12 2011 +0200

    Http: drop support to output to a temporary file
    
    Now HTTP handlers don't have to care if data should be written to a
    temporary file.

diff --git a/myserver/include/protocol/http/http_data_handler.h b/myserver/include/protocol/http/http_data_handler.h
index c60821a..b0b6e89 100644
--- a/myserver/include/protocol/http/http_data_handler.h
+++ b/myserver/include/protocol/http/http_data_handler.h
@@ -55,9 +55,7 @@ public:
   static size_t appendDataToHTTPChannel (HttpThreadContext* td,
                                          char *buffer,
                                          size_t size,
-                                         File *appendFile,
                                          FiltersChain *chain,
-                                         bool append,
                                          bool useChunks,
                                          size_t realBufferSize,
                                          MemoryStream *tmpStream);
@@ -65,9 +63,7 @@ public:
   static size_t appendDataToHTTPChannel (HttpThreadContext* td,
                                          char *buffer,
                                          size_t size,
-                                         File *appendFile,
                                          FiltersChain* chain,
-                                         bool append,
                                          bool useChunks);
 
 };
diff --git a/myserver/include/protocol/http/http_thread_context.h b/myserver/include/protocol/http/http_thread_context.h
index 0b2202c..a72fccf 100644
--- a/myserver/include/protocol/http/http_thread_context.h
+++ b/myserver/include/protocol/http/http_thread_context.h
@@ -50,9 +50,7 @@ class MimeRecord;
  */
 struct HttpThreadContext
 {
-  bool appendOutputs;
-
-  /*! Set by raiseHTTPError.  */
+  /*! Http::raiseHTTPError sets this.  */
   int lastError;
 
   /*! Is the client asking only for the header?  */
@@ -83,7 +81,6 @@ struct HttpThreadContext
   HashMap<string,string*> other;
   char identity[32];
   File inputData;
-  File outputData;
   int authScheme;
   Http *http;
   MimeRecord *mime;
diff --git a/myserver/src/http_handler/cgi/cgi.cpp b/myserver/src/http_handler/cgi/cgi.cpp
index 58e6f43..d244283 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -346,9 +346,7 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
       td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                                   td->auxiliaryBuffer->getBuffer (),
                                                   nBytesRead,
-                                                  &(td->outputData),
                                                   &chain,
-                                                  td->appendOutputs,
                                                   useChunks);
     }
 
@@ -453,11 +451,6 @@ int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile, FiltersChain &chai
         HttpHeaders::buildHTTPResponseHeaderStruct (td->auxiliaryBuffer->getBuffer (),
                                                     &td->response,
                                                     &(td->nBytesToRead));
-      /*
-       *If we have not to append the output send data
-       *directly to the client.
-       */
-      if (!td->appendOutputs)
         {
           string* location = td->response.getValue ("Location", NULL);
 
@@ -480,9 +473,7 @@ int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile, FiltersChain &chai
       td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                td->auxiliaryBuffer->getBuffer () + headerSize,
                                                     headerOffset - headerSize,
-                                                    &(td->outputData),
                                                     &chain,
-                                                    td->appendOutputs,
                                                     useChunks);
     }
 
diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index 9b012b7..196b777 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -623,10 +623,7 @@ int FastCgi::sendData (FcgiContext* con, u_long dim, u_long timeout,
   size_t nbw = HttpDataHandler::appendDataToHTTPChannel (con->td,
                                             con->td->buffer->getBuffer (),
                                             con->td->buffer->getLength (),
-                                            &(con->td->outputData),
-                                            chain,
-                                            con->td->appendOutputs,
-                                            con->useChunks);
+                                            chain, con->useChunks);
 
   con->td->sentData += nbw;
   return 0;
@@ -689,7 +686,6 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain* chain, bool* response
         }
     }
 
-  if (!con->td->appendOutputs)
     {
       string *location = con->td->response.getValue ("Location", NULL);
       if (location)
@@ -714,9 +710,7 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain* chain, bool* response
       size_t nbw = HttpDataHandler::appendDataToHTTPChannel (con->td,
                                                 con->td->buffer->getBuffer () + headerSize,
                                                 size - headerSize,
-                                                &(con->td->outputData),
                                                 chain,
-                                                con->td->appendOutputs,
                                                 con->useChunks);
       con->td->sentData += nbw;
     }
diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp b/myserver/src/http_handler/http_dir/http_dir.cpp
index c16bc10..fd666d0 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -379,7 +379,6 @@ int HttpDir::send (HttpThreadContext* td,
                                                         "is not valid"), ignPattern);
 
               fd.findclose ();
-              td->outputData.close ();
               chain.clearAllFilters ();
               return td->http->raiseHTTPError (500);
             }
@@ -439,8 +438,7 @@ int HttpDir::send (HttpThreadContext* td,
 
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                            td->auxiliaryBuffer->getLength (),
-                                           &(td->outputData), &chain,
-                                           td->appendOutputs, useChunks);
+                                           &chain, useChunks);
 
       filename = directory;
       td->auxiliaryBuffer->setLength (0);
@@ -455,8 +453,7 @@ int HttpDir::send (HttpThreadContext* td,
 
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                            td->auxiliaryBuffer->getLength (),
-                                           &(td->outputData), &chain,
-                                           td->appendOutputs, useChunks);
+                                           &chain, useChunks);
 
       fd.findfirst (filename.c_str ());
 
@@ -471,8 +468,7 @@ int HttpDir::send (HttpThreadContext* td,
 
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                                td->auxiliaryBuffer->getLength (),
-                                               &(td->outputData), &chain,
-                                               td->appendOutputs, useChunks);
+                                               &chain, useChunks);
       td->auxiliaryBuffer->setLength (0);
 
       if (FilesUtility::getPathRecursionLevel (td->request.uri) >= 1)
@@ -508,8 +504,7 @@ int HttpDir::send (HttpThreadContext* td,
 
           td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                                    td->auxiliaryBuffer->getLength (),
-                                                   &(td->outputData), &chain,
-                                                   td->appendOutputs, useChunks);
+                                                   &chain, useChunks);
         }
 
       /* Put all files in a vector.  */
@@ -570,8 +565,7 @@ int HttpDir::send (HttpThreadContext* td,
           generateElement (*td->auxiliaryBuffer, file, linkPrefix, formatString);
           td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                                    td->auxiliaryBuffer->getLength (),
-                                                   &(td->outputData), &chain,
-                                                   td->appendOutputs, useChunks);
+                                                   &chain, useChunks);
         }
 
       td->auxiliaryBuffer->setLength (0);
@@ -595,8 +589,7 @@ int HttpDir::send (HttpThreadContext* td,
       *td->auxiliaryBuffer << "</address>\r\n</body>\r\n</html>\r\n";
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                                td->auxiliaryBuffer->getLength (),
-                                               &(td->outputData), &chain,
-                                               td->appendOutputs, useChunks);
+                                               &chain, useChunks);
 
       *td->auxiliaryBuffer << end_str;
       /* Changes the \ character in the / character.  */
@@ -605,7 +598,7 @@ int HttpDir::send (HttpThreadContext* td,
         if (*bufferloop == '\\')
           *bufferloop = '/';
 
-      if (!td->appendOutputs && useChunks)
+      if (useChunks)
         chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
     }
   catch (exception & e)
diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 5f5249c..69bd63a 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -406,7 +406,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
       Check if there are all the conditions to use a direct copy from the
       file to the socket.
     */
-    if (!useChunks && chain.isEmpty () && !td->appendOutputs
+    if (!useChunks && chain.isEmpty ()
         && !(td->http->getProtocolOptions () & Protocol::SSL))
       {
         size_t nbw = 0;
@@ -425,10 +425,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
 
     file->seek (firstByte);
 
-    if (td->appendOutputs)
-      chain.setStream (&(td->outputData));
-    else
-      chain.setStream (td->connection->socket);
+    chain.setStream (td->connection->socket);
 
     /*
       Flush initial data.  This is data that filters could have added
@@ -444,9 +441,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
         if (nbr)
           dataSent += HttpDataHandler::appendDataToHTTPChannel (td,
                                                     td->buffer->getBuffer (),
-                                                    nbr, &(td->outputData),
-                                                    &chain, td->appendOutputs,
-                                                    useChunks);
+                                                    nbr, &chain, useChunks);
       } /* memStream.availableToRead ().  */
 
     /* Flush the rest of the file.  */
@@ -474,8 +469,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
             bytesToSend -= nbr;
 
             dataSent += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                 nbr, &(td->outputData), &chain,
-                                                 td->appendOutputs, useChunks,
+                                                 nbr, &chain, useChunks,
                                                  td->buffer->getRealLength (),
                                                  &memStream);
           }
@@ -506,9 +500,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
                                 td->buffer->getRealLength (), &nbr);
 
                 dataSent += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                     nbr, &(td->outputData),
-                                                     &chain, td->appendOutputs,
-                                                     useChunks);
+                                                     nbr, &chain, useChunks);
                 break;
               }
           }
diff --git a/myserver/src/http_handler/isapi/isapi.cpp b/myserver/src/http_handler/isapi/isapi.cpp
index b8b5f6f..d14e5ea 100644
--- a/myserver/src/http_handler/isapi/isapi.cpp
+++ b/myserver/src/http_handler/isapi/isapi.cpp
@@ -279,31 +279,28 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
             (ConnInfo->td->buffer->getBuffer (), &ConnInfo->td->response,
              &(ConnInfo->td->nBytesToRead));
 
-          if (!ConnInfo->td->appendOutputs)
+          if (keepalive)
             {
-              if (keepalive)
+              HttpResponseHeader::Entry *e;
+              e = ConnInfo->td->response.other.get ("transfer-encoding");
+              if (e)
+                e->value.assign ("chunked");
+              else
                 {
-                  HttpResponseHeader::Entry *e;
-                  e = ConnInfo->td->response.other.get ("transfer-encoding");
-                  if (e)
-                    e->value.assign ("chunked");
-                  else
-                    {
-                      e = new HttpResponseHeader::Entry ();
-                      e->name.assign ("transfer-encoding");
-                      e->value.assign ("chunked");
-                      ConnInfo->td->response.other.put (e->name, e);
-                    }
+                  e = new HttpResponseHeader::Entry ();
+                  e->name.assign ("transfer-encoding");
+                  e->value.assign ("chunked");
+                  ConnInfo->td->response.other.put (e->name, e);
                 }
-              else
-                ConnInfo->td->response.setValue ("connection", "Close");
-
-              if (HttpHeaders::sendHeader (ConnInfo->td->response,
-                                           *ConnInfo->td->connection->socket,
-                                           *ConnInfo->td->auxiliaryBuffer,
-                                           ConnInfo->td))
-                return HttpDataHandler::RET_FAILURE;
             }
+          else
+            ConnInfo->td->response.setValue ("connection", "Close");
+
+          if (HttpHeaders::sendHeader (ConnInfo->td->response,
+                                       *ConnInfo->td->connection->socket,
+                                       *ConnInfo->td->auxiliaryBuffer,
+                                       ConnInfo->td))
+            return HttpDataHandler::RET_FAILURE;
           /*! Save the headerSent status. */
           ConnInfo->headerSent=1;
 
@@ -317,7 +314,7 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
           if (len)
             {
               /*! With keep-alive connections use chunks.*/
-              if (keepalive && (!ConnInfo->td->appendOutputs))
+              if (keepalive)
                 {
                   sprintf (chunkSize, "%x\r\n", len);
                   if (ConnInfo->chain.getStream ()->write (chunkSize,
@@ -325,23 +322,13 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
                     return HttpDataHandler::RET_FAILURE;
                 }
 
-              if (ConnInfo->td->appendOutputs)
-                {
-                  if (ConnInfo->td->outputData.writeToFile ((char*)(buffer + headerSize),
-                                                            len, &nbw))
-                    return HttpDataHandler::RET_FAILURE;
-                  ConnInfo->dataSent += nbw;
-                }
-              else
-                {
-                  if (ConnInfo->chain.write ((char*)(buffer + headerSize),
-                                             len, &nbw))
-                    return HttpDataHandler::RET_FAILURE;
-                  ConnInfo->dataSent += nbw;
-                }
+              if (ConnInfo->chain.write ((char*)(buffer + headerSize),
+                                         len, &nbw))
+                return HttpDataHandler::RET_FAILURE;
+              ConnInfo->dataSent += nbw;
 
               /*! Send the chunk footer.  */
-              if (keepalive && (!ConnInfo->td->appendOutputs))
+              if (keepalive)
                 {
                   if (ConnInfo->chain.getStream ()->write ("\r\n", 2, &nbw))
                     return HttpDataHandler::RET_FAILURE;
@@ -351,7 +338,7 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
     }
   else/*!Continue to send data chunks*/
     {
-      if (keepalive  && (!ConnInfo->td->appendOutputs))
+      if (keepalive)
         {
           sprintf (chunkSize, "%x\r\n", *lpdwBytes);
           nbw = ConnInfo->connection->socket->send (chunkSize,
@@ -360,20 +347,11 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
             return HttpDataHandler::RET_FAILURE;
         }
 
-      if (ConnInfo->td->appendOutputs)
-        {
-          if (ConnInfo->td->outputData.writeToFile ((char*)Buffer,*lpdwBytes, &nbw))
-            return HttpDataHandler::RET_FAILURE;
-          ConnInfo->dataSent += nbw;
-        }
-      else
-        {
-          if (ConnInfo->chain.write ((char*)Buffer,*lpdwBytes, &nbw))
-            return HttpDataHandler::RET_FAILURE;
-          ConnInfo->dataSent += nbw;
-        }
+      if (ConnInfo->chain.write ((char*)Buffer,*lpdwBytes, &nbw))
+        return HttpDataHandler::RET_FAILURE;
+      ConnInfo->dataSent += nbw;
 
-      if (keepalive  && (!ConnInfo->td->appendOutputs))
+      if (keepalive)
         {
           nbw = ConnInfo->connection->socket->send ("\r\n", 2, 0);
           if ((nbw == (size_t)-1) || (!nbw))
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp b/myserver/src/http_handler/mscgi/mscgi.cpp
index d721b9a..ee6d22b 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -135,7 +135,7 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
           return td->http->raiseHTTPError (data.errorPage);
         }
 
-      if (!td->appendOutputs && data.useChunks && !data.error)
+      if (data.useChunks && !data.error)
         chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
 
       if (!data.error)
@@ -170,9 +170,7 @@ int MsCgi::write (const char* data, size_t len, MsCgiData* mcd)
   mcd->td->sentData +=
     HttpDataHandler::appendDataToHTTPChannel (mcd->td,
                                               (char *) data, len,
-                                              &(mcd->td->outputData),
                                               mcd->filtersChain,
-                                              mcd->td->appendOutputs,
                                               mcd->useChunks);
   return 0;
 }
diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index 4c908da..b48f306 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -315,9 +315,7 @@ int Proxy::readPayLoad (HttpThreadContext* td,
 
               td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                                        td->buffer->getBuffer (),
-                                                       nbr, &(td->outputData),
-                                                       out, td->appendOutputs,
-                                                       useChunks);
+                                                       nbr, out, useChunks);
             }
         }
     }
@@ -347,8 +345,7 @@ int Proxy::readPayLoad (HttpThreadContext* td,
             length -= nbr;
 
           td->sentData += HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                    nbr, &(td->outputData), out,
-                                                    td->appendOutputs, useChunks);
+                                                    nbr, out, useChunks);
           if (timedOut || contentLength && length == 0)
             break;
         }
diff --git a/myserver/src/http_handler/scgi/scgi.cpp b/myserver/src/http_handler/scgi/scgi.cpp
index ac31d70..1158582 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -268,8 +268,7 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
   if (read - headerSize)
     td->sentData +=
       appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer () + headerSize,
-                             read - headerSize, &(td->outputData), chain,
-                               td->appendOutputs, useChunks);
+                             read - headerSize, chain, useChunks);
 
   if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
     {
@@ -284,11 +283,10 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
 
           td->sentData +=
             appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                     nbr, &(td->outputData), chain,
-                                     td->appendOutputs, useChunks);
+                                     nbr, chain, useChunks);
         }
 
-      if (!td->appendOutputs && useChunks)
+      if (useChunks)
         chain->getStream ()->write ("0\r\n\r\n", 5, &nbw);
     }
 
diff --git a/myserver/src/http_handler/wincgi/wincgi.cpp b/myserver/src/http_handler/wincgi/wincgi.cpp
index cb4e990..e96b278 100644
--- a/myserver/src/http_handler/wincgi/wincgi.cpp
+++ b/myserver/src/http_handler/wincgi/wincgi.cpp
@@ -105,11 +105,11 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
       chain.setStream (td->connection->socket);
       if (td->mime)
         {
-          size_t nbw2;
           Server::getInstance ()->getFiltersFactory ()->chain (&chain,
                                                           td->mime->filters,
                                                         td->connection->socket,
-                                                               &nbw2, 1);
+                                                               &nbw, 1);
+          td->sentData += nbw;
         }
 
       /* The WinCGI protocol uses a .ini file to send data to the new process.  */
@@ -300,42 +300,23 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
        */
       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;
-            }
+      HttpHeaders::sendHeader (td->response, *chain.getStream (),
+                               *td->buffer, td);
 
-          size_t written;
-          chain.write ((char*)(buffer + headerSize), nBytesRead - headerSize,
-                       &written);
-          nbw += written;
-        }
-      else
+      if (onlyHeader)
         {
-          size_t nbw2;
-          HttpHeaders::buildHTTPResponseHeader (td->buffer->getBuffer (),
-                                                &td->response);
-          if (onlyHeader)
-            {
-              chain.clearAllFilters ();
-              return HttpDataHandler::RET_OK;
-            }
-
-          td->outputData.writeToFile ((char*) (buffer + headerSize),
-                                      nBytesRead - headerSize,
-                                      &nbw2);
-          nbw += nbw2;
+          OutFileHandle.close ();
+          FilesUtility::deleteFile (outFilePath);
+          FilesUtility::deleteFile (dataFilePath);
+          chain.clearAllFilters ();
+          return HttpDataHandler::RET_OK;
         }
 
+      size_t written;
+      chain.write ((char*)(buffer + headerSize), nBytesRead - headerSize,
+                   &written);
+      td->dataSent += written;
+
       if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
         {
           /* Flush the rest of the file.  */
@@ -346,17 +327,11 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
               if (! nBytesRead)
                 break;
 
-              if (td->appendOutputs)
-                td->outputData.writeToFile (buffer, nBytesRead, &nbw);
-              else
-                {
-                  size_t nbw2;
-                  chain.write ((char*) buffer, nBytesRead, &nbw2);
-                }
+              chain.write ((char*) buffer, nBytesRead, &nbw);
+              td->sentData += nbw;
             }
           while (nBytesRead);
         }
-      td->sentData += nbw;
 
       chain.clearAllFilters ();
       OutFileHandle.close ();
diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index 0e24a2f..8b17b16 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -849,7 +849,6 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
       td->id = id;
       td->lastError = 0;
       td->http = this;
-      td->appendOutputs = false;
       td->onlyHeader = false;
       td->filenamePath.assign ("");
       td->mime = NULL;
@@ -1159,7 +1158,6 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
       try
         {
           td->inputData.close ();
-          td->outputData.close ();
         }
       catch (GenericFileException & e)
         {
@@ -1183,8 +1181,6 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
   catch (...)
     {
       td->inputData.close ();
-      td->outputData.close ();
-
       td->connection->host->warningsLogWrite (_("HTTP: internal error"));
       raiseHTTPError (500);
       logHTTPaccess ();
@@ -1475,15 +1471,12 @@ Internal Server Error\n\
   *td->auxiliaryBuffer << time;
   *td->auxiliaryBuffer << "\r\n\r\n";
 
-  if (! td->appendOutputs)
-    {
-      td->connection->socket->send (td->auxiliaryBuffer->getBuffer (),
-                                    td->auxiliaryBuffer->getLength (),
-                                    0);
+  td->connection->socket->send (td->auxiliaryBuffer->getBuffer (),
+                                td->auxiliaryBuffer->getLength (),
+                                0);
 
-      if (! td->onlyHeader)
-        td->connection->socket->send (hardHTML, strlen (hardHTML), 0);
-    }
+  if (! td->onlyHeader)
+    td->connection->socket->send (hardHTML, strlen (hardHTML), 0);
 
   return HttpDataHandler::RET_FAILURE;
 }
diff --git a/myserver/src/protocol/http/http_data_handler.cpp b/myserver/src/protocol/http/http_data_handler.cpp
index 04401ea..355ee34 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -66,9 +66,7 @@ int HttpDataHandler::unLoad ()
   \param td The HTTP thread context.
   \param buffer Data to send.
   \param size Size of the buffer.
-  \param appendFile The file where append if in append mode.
   \param chain Where send data if not append.
-  \param append Append to the file?
   \param useChunks Can we use HTTP chunks to send data?
   \param realBufferSize The real dimension of the buffer that can be
   used by this method.
@@ -78,9 +76,7 @@ int HttpDataHandler::unLoad ()
 size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
                                                  char *buffer,
                                                  size_t size,
-                                                 File *appendFile,
                                                  FiltersChain *chain,
-                                                 bool append,
                                                  bool useChunks,
                                                  size_t realBufferSize,
                                                  MemoryStream *tmpStream)
@@ -89,8 +85,7 @@ size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
   Stream *oldStream = chain->getStream ();
 
   if (!chain->hasModifiersFilters ())
-    return appendDataToHTTPChannel (td, buffer, size, appendFile, chain, append,
-                                    useChunks);
+    return appendDataToHTTPChannel (td, buffer, size, chain, useChunks);
 
   /*
     This function can't append directly to the chain because we can't
@@ -107,8 +102,7 @@ size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
 
   chain->setStream (oldStream);
 
-  return appendDataToHTTPChannel (td, buffer, nbr, appendFile, chain, append,
-                                  useChunks);
+  return appendDataToHTTPChannel (td, buffer, nbr, chain, useChunks);
 }
 
 /*!
@@ -117,18 +111,15 @@ size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
   \param td The HTTP thread context.
   \param buffer Data to send.
   \param size Size of the buffer.
-  \param appendFile The file where append if in append mode.
   \param chain Where send data if not append.
-  \param append Append to the file?
   \param useChunks Can we use HTTP chunks to send data?
  */
 size_t
-HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext* td,
+HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
                                           char *buffer,
                                           size_t size,
-                                          File *appendFile,
                                           FiltersChain *chain,
-                                          bool append, bool useChunks)
+                                          bool useChunks)
 {
   size_t tmp, nbw = 0;
   if (chain->hasModifiersFilters ())
@@ -137,12 +128,6 @@ HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext* td,
       return 0;
     }
 
-  if (append)
-    {
-      appendFile->writeToFile (buffer, size, &nbw);
-      return nbw;
-    }
-
   if (useChunks)
     {
       ostringstream chunkHeader;
diff --git a/myserver/src/protocol/http/http_headers.cpp b/myserver/src/protocol/http/http_headers.cpp
index 45be2f3..375f74c 100644
--- a/myserver/src/protocol/http/http_headers.cpp
+++ b/myserver/src/protocol/http/http_headers.cpp
@@ -901,7 +901,7 @@ int HttpHeaders::sendHeader (HttpResponseHeader &response, Stream &stream,
                              MemBuf &memBuf, HttpThreadContext *ctx)
 {
   int ret = 0;
-  if (ctx == NULL || (!ctx->appendOutputs && !ctx->headerSent))
+  if (ctx == NULL || (!ctx->headerSent))
     {
       size_t nbw;
       u_long len = buildHTTPResponseHeader (memBuf.getBuffer (), &response);
diff --git a/myserver/src/protocol/http/webdav/webdav.cpp b/myserver/src/protocol/http/webdav/webdav.cpp
index 41bf189..b15b801 100644
--- a/myserver/src/protocol/http/webdav/webdav.cpp
+++ b/myserver/src/protocol/http/webdav/webdav.cpp
@@ -337,9 +337,7 @@ int WebDAV::propfind (HttpThreadContext* td)
 
           td->sentData +=
             HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                      nbr, &(td->outputData),
-                                                      &chain, td->appendOutputs,
-                                                      useChunks);
+                                                      nbr, &chain, useChunks);
           if (nbr != td->buffer->getRealLength ())
             break;
         }
@@ -656,9 +654,7 @@ int WebDAV::lock (HttpThreadContext* td)
 
           td->sentData +=
             HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                      nbr, &(td->outputData),
-                                                      &chain, td->appendOutputs,
-                                                      useChunks);
+                                                      nbr, &chain, useChunks);
         }
 
       if (useChunks && chain.getStream ()->write ("0\r\n\r\n", 5, &nbw2))

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

Summary of changes:
 myserver/include/protocol/http/http_data_handler.h |    4 -
 .../include/protocol/http/http_thread_context.h    |    5 +-
 myserver/src/http_handler/cgi/cgi.cpp              |    9 --
 myserver/src/http_handler/fastcgi/fastcgi.cpp      |    8 +--
 myserver/src/http_handler/http_dir/http_dir.cpp    |   21 ++----
 myserver/src/http_handler/http_file/http_file.cpp  |   18 +---
 myserver/src/http_handler/isapi/isapi.cpp          |   80 +++++++-------------
 myserver/src/http_handler/mscgi/mscgi.cpp          |    4 +-
 myserver/src/http_handler/proxy/proxy.cpp          |    7 +-
 myserver/src/http_handler/scgi/scgi.cpp            |    8 +-
 myserver/src/http_handler/wincgi/wincgi.cpp        |   59 ++++----------
 myserver/src/protocol/http/http.cpp                |   17 +---
 myserver/src/protocol/http/http_data_handler.cpp   |   23 +-----
 myserver/src/protocol/http/http_headers.cpp        |    2 +-
 myserver/src/protocol/http/webdav/webdav.cpp       |    8 +--
 15 files changed, 78 insertions(+), 195 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Thu Apr 21 08:56:56 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QCtRI-0005cK-8x
	for mharc-myserver-commit@gnu.org; Thu, 21 Apr 2011 08:56:56 -0400
Received: from eggs.gnu.org ([140.186.70.92]:53967)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCtRF-0005bz-Tg
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 08:56:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCtRE-0006HV-6s
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 08:56:53 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:46148)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCtRE-0006HQ-2R
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 08:56:52 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QCtRD-0004zz-9h
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 12:56:51 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QCtRC-0003Cj-HA
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 12:56:51 +0000
Date: Thu, 21 Apr 2011 12:56:50 +0000
Message-Id: <E1QCtRC-0003Cj-HA@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 4610bc1c88c48d4a096060685876ef7ae3f60035
X-Git-Newrev: 5352cc50040b0108c1fa8cbe609a1050fbb3741a
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-463-g5352cc5
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Apr 2011 12:56:55 -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  5352cc50040b0108c1fa8cbe609a1050fbb3741a (commit)
       via  9c287473e334a716cd5d5be8a32c9eaa1e90d5ea (commit)
      from  4610bc1c88c48d4a096060685876ef7ae3f60035 (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 5352cc50040b0108c1fa8cbe609a1050fbb3741a
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 21 14:56:29 2011 +0200

    HttpThreadContext: remove some attributes and use size_t to store lengths.

diff --git a/myserver/include/protocol/http/http_headers.h b/myserver/include/protocol/http/http_headers.h
index 725f86c..d72a9a9 100644
--- a/myserver/include/protocol/http/http_headers.h
+++ b/myserver/include/protocol/http/http_headers.h
@@ -49,20 +49,20 @@ class HttpHeaders
 {
 public:
   static int buildHTTPRequestHeaderStruct (const char* input,
-                                           u_long inputSize,
-                                           u_long* nHeaderChars,
+                                           size_t inputSize,
+                                           size_t* headerSize,
                                            HttpRequestHeader *request,
                                            Connection* connection);
 
   static int buildHTTPResponseHeaderStruct (const char *input,
                                             HttpResponseHeader *response,
-                                            u_long* nbtr);
+                                            size_t* nbtr);
 
   static int sendHeader (HttpResponseHeader &response, Stream &stream,
                          MemBuf &memBuf, HttpThreadContext *ctx);
 
-  static int validHTTPRequest (const char*, u_long, u_long*, u_long*);
-  static int validHTTPResponse (const char*, u_long*, u_long*);
+  static int validHTTPRequest (const char *, size_t, size_t *, size_t *);
+  static int validHTTPResponse (const char *, size_t *, size_t *);
 
   static void resetHTTPRequest (HttpRequestHeader *request);
   static void resetHTTPResponse (HttpResponseHeader *response);
@@ -70,8 +70,8 @@ public:
   static void buildDefaultHTTPResponseHeader (HttpResponseHeader*);
   static void buildDefaultHTTPRequestHeader (HttpRequestHeader*);
 
-  static u_long buildHTTPResponseHeader (char*, HttpResponseHeader*);
-  static u_long buildHTTPRequestHeader (char*, HttpRequestHeader*);
+  static size_t buildHTTPResponseHeader (char *, HttpResponseHeader*);
+  static size_t buildHTTPRequestHeader (char *, HttpRequestHeader*);
 
 protected:
   static int readReqAuthLine (HttpRequestHeader *request,
diff --git a/myserver/include/protocol/http/http_thread_context.h b/myserver/include/protocol/http/http_thread_context.h
index a72fccf..1a87cf9 100644
--- a/myserver/include/protocol/http/http_thread_context.h
+++ b/myserver/include/protocol/http/http_thread_context.h
@@ -59,13 +59,14 @@ struct HttpThreadContext
   /*! Was the HTTP header already flushed to the client?  */
   bool headerSent;
 
+  /*! Size of the request header in `buffer'. */
+  size_t headerSize;
+
   ConnectionPtr connection;
   MemBuf *buffer;
   MemBuf *auxiliaryBuffer;
-  u_long buffersize;
   u_long id;
-  u_long nBytesToRead;
-  u_long nHeaderChars;
+  size_t nBytesToRead;
   HttpResponseHeader response;
   HttpRequestHeader request;
   string filenamePath;
diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index b48f306..e9ca531 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -162,8 +162,8 @@ int Proxy::send (HttpThreadContext *td, const char* scriptpath,
 int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
                           FiltersChain &out, bool onlyHeader, bool *kaClient)
 {
-  u_long read = 0;
-  u_long headerLength;
+  size_t read = 0;
+  size_t headerLength;
   int ret;
   size_t nbw;
   bool useChunks = false;
@@ -276,7 +276,6 @@ int Proxy::readPayLoad (HttpThreadContext* td,
   size_t contentLength = 0;
 
   size_t nbr = 0, nbw = 0, length = 0, inPos = 0;
-  u_long bufferDataSize = 0;
 
   /* Only the chunked transfer encoding is supported.  */
   if (serverTransferEncoding && serverTransferEncoding->compare ("chunked"))
@@ -291,10 +290,6 @@ int Proxy::readPayLoad (HttpThreadContext* td,
 
   length = contentLength;
 
-  bufferDataSize = (td->nBytesToRead < td->buffer->getRealLength () - 1
-                    ? td->nBytesToRead
-                    : td->buffer->getRealLength () - 1 ) - td->nHeaderChars;
-
   /* If it is specified a transfer encoding read data using it.  */
   if (serverTransferEncoding)
     {
diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index 8b17b16..df48dea 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -144,7 +144,7 @@ int Http::traceHTTPRESOURCE (string& filename, bool mapped)
 {
   int ret;
   char tmpStr[12];
-  int contentLength = (int) td->nHeaderChars;
+  int contentLength = (int) td->headerSize;
   string time;
   int permissions;
   try
@@ -843,7 +843,6 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
     {
       td->buffer = a->getActiveThread ()->getBuffer ();
       td->auxiliaryBuffer = a->getActiveThread ()->getAuxiliaryBuffer ();
-      td->buffersize = a->getActiveThread ()->getBufferSize ();
       td->nBytesToRead = nbtr;
       td->connection = a;
       td->id = id;
@@ -892,7 +891,7 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
       validRequest =
         HttpHeaders::buildHTTPRequestHeaderStruct (td->buffer->getBuffer (),
                                                    td->buffer->getRealLength (),
-                                                   &(td->nHeaderChars),
+                                                   &(td->headerSize),
                                                    &(td->request),
                                                    td->connection);
 
@@ -937,7 +936,7 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
           int httpErrorCode;
           int readPostRet;
           /* Be sure that the client can handle the 100 status code.  */
-          if (nbtr == td->nHeaderChars && td->request.contentLength.compare ("0")
+          if (nbtr == td->headerSize && td->request.contentLength.compare ("0")
               && td->request.ver.compare ("HTTP/1.0"))
             {
               const char* msg = "HTTP/1.1 100 Continue\r\n\r\n";
@@ -1060,16 +1059,16 @@ int Http::controlConnection (ConnectionPtr a, char*, char*, u_long, u_long,
               u_long bufferStrLen = strlen (td->buffer->getBuffer ());
               u_long remainingData = 0;
 
-              if (bufferStrLen - td->nHeaderChars >= MYSERVER_KB (8))
+              if (bufferStrLen - td->headerSize >= MYSERVER_KB (8))
                 remainingData = MYSERVER_KB (8);
               else
-                remainingData = bufferStrLen - td->nHeaderChars;
+                remainingData = bufferStrLen - td->headerSize;
 
               if (remainingData)
                 {
                   const char *data = (td->buffer->getBuffer ()
-                                      + td->nHeaderChars);
-                  u_long toCopy = nbtr - td->nHeaderChars;
+                                      + td->headerSize);
+                  u_long toCopy = nbtr - td->headerSize;
 
                   a->getConnectionBuffer ()->setBuffer (data, toCopy);
                   pipelineData = true;
diff --git a/myserver/src/protocol/http/http_data_read.cpp b/myserver/src/protocol/http/http_data_read.cpp
index a381cf4..2a7289f 100644
--- a/myserver/src/protocol/http/http_data_read.cpp
+++ b/myserver/src/protocol/http/http_data_read.cpp
@@ -265,7 +265,7 @@ int HttpDataRead::readPostData (HttpThreadContext* td, int* httpRetCode)
   else if (contentType->value.length () == 0)
     contentType->value.assign ("application/x-www-form-urlencoded");
 
-  td->request.uriOptsPtr = &(td->buffer->getBuffer ())[td->nHeaderChars];
+  td->request.uriOptsPtr = &(td->buffer->getBuffer ())[td->headerSize];
   td->buffer->getBuffer ()[td->nBytesToRead < td->buffer->getRealLength () - 1
                            ? td->nBytesToRead : td->buffer->getRealLength ()-1] = '\0';
 
@@ -314,7 +314,7 @@ int HttpDataRead::readPostData (HttpThreadContext* td, int* httpRetCode)
 
   bufferDataSize = (td->nBytesToRead < td->buffer->getRealLength () - 1
                     ? td->nBytesToRead
-                    : td->buffer->getRealLength () - 1 ) - td->nHeaderChars;
+                    : td->buffer->getRealLength () - 1 ) - td->headerSize;
 
   /* If it is specified a transfer encoding read data using it.  */
   if (encoding)
diff --git a/myserver/src/protocol/http/http_headers.cpp b/myserver/src/protocol/http/http_headers.cpp
index 375f74c..4198769 100644
--- a/myserver/src/protocol/http/http_headers.cpp
+++ b/myserver/src/protocol/http/http_headers.cpp
@@ -44,7 +44,7 @@
 
   \return The number of bytes written to STR.
  */
-u_long HttpHeaders::buildHTTPResponseHeader (char *str,
+size_t HttpHeaders::buildHTTPResponseHeader (char *str,
                                              HttpResponseHeader* response)
 {
   /*
@@ -116,7 +116,7 @@ u_long HttpHeaders::buildHTTPResponseHeader (char *str,
 
   \return The number of bytes written to STR.
  */
-u_long HttpHeaders::buildHTTPRequestHeader (char * str,
+size_t HttpHeaders::buildHTTPRequestHeader (char * str,
                                             HttpRequestHeader* request)
 {
   char *pos = str;
@@ -259,12 +259,12 @@ void HttpHeaders::resetHTTPResponse (HttpResponseHeader *response)
   \param nLinesptr is a value of the lines number in the HEADER.
   \param ncharsptr is a value of the characters number in the HEADER.
  */
-int HttpHeaders::validHTTPResponse (const char *res, u_long *nLinesptr,
-                                    u_long *ncharsptr)
+int HttpHeaders::validHTTPResponse (const char *res, size_t *nLinesptr,
+                                    size_t *ncharsptr)
 {
-  u_long i;
-  u_long nLinechars = 0;
-  u_long nLines = 0;
+  size_t i;
+  size_t nLinechars = 0;
+  size_t nLines = 0;
 
   if (res == 0)
     return 0;
@@ -312,13 +312,13 @@ int HttpHeaders::validHTTPResponse (const char *res, u_long *nLinesptr,
   Any other returned value is the HTTP error.
   \param input buffer with the HTTP header.
   \param inputSize Size of the buffer
-  \param nHeaderChars Real size of the header.
+  \param headerSize Real size of the header.
   \param request HTTP request structure to fullfill with data.
   \param connection The current connection.
 */
 int HttpHeaders::buildHTTPRequestHeaderStruct (const char *input,
-                                               u_long inputSize,
-                                               u_long *nHeaderChars,
+                                               size_t inputSize,
+                                               size_t *headerSize,
                                                HttpRequestHeader *request,
                                                Connection *connection)
 {
@@ -333,9 +333,9 @@ int HttpHeaders::buildHTTPRequestHeaderStruct (const char *input,
     control if this is a regular request.
     The HTTP header ends with a \r\n\r\n sequence.
    */
-  u_long i = 0,j = 0;
+  size_t i = 0,j = 0;
   int max = 0;
-  u_long nLines, maxTotchars;
+  size_t nLines, maxTotchars;
   int validRequest;
   const int commandSize = 96;
   const int maxUri = HTTP_REQUEST_URI_DIM + 200 ;
@@ -404,7 +404,7 @@ int HttpHeaders::buildHTTPRequestHeaderStruct (const char *input,
       if (nLineControlled == 1)
         {
           int containOpts = 0;
-          u_long lenToken = tokenOff;
+          size_t lenToken = tokenOff;
           /*
             The first line has the form:
             GET /index.html HTTP/1.1
@@ -604,9 +604,9 @@ int HttpHeaders::buildHTTPRequestHeaderStruct (const char *input,
       token += tokenOff + 2;
       tokenOff = getCharInString (token, ":", maxTotchars);
     }
-  while (((u_long) (token - input) < maxTotchars) && token[0] != '\r');
+  while (((size_t) (token - input) < maxTotchars) && token[0] != '\r');
 
-  *nHeaderChars = maxTotchars;
+  *headerSize = maxTotchars;
   return 200;
 }
 
@@ -719,7 +719,7 @@ int HttpHeaders::readReqAuthLine (HttpRequestHeader *request,
 
   if (! request->auth.compare ("Basic"))
     {
-      u_long i;
+      size_t i;
       const char *base64 = &token[6];
       int len = getEndLine (base64, 64);
       const char *tmp = base64 + len - 1;
@@ -904,7 +904,7 @@ int HttpHeaders::sendHeader (HttpResponseHeader &response, Stream &stream,
   if (ctx == NULL || (!ctx->headerSent))
     {
       size_t nbw;
-      u_long len = buildHTTPResponseHeader (memBuf.getBuffer (), &response);
+      size_t len = buildHTTPResponseHeader (memBuf.getBuffer (), &response);
       ret = stream.write (memBuf.getBuffer (), len, &nbw);
 
       if (ctx)
@@ -926,7 +926,7 @@ int HttpHeaders::sendHeader (HttpResponseHeader &response, Stream &stream,
 */
 int HttpHeaders::buildHTTPResponseHeaderStruct (const char *input,
                                                 HttpResponseHeader *response,
-                                                u_long *nbtr)
+                                                size_t *nbtr)
 {
   /*
     Brief description.
@@ -940,8 +940,8 @@ int HttpHeaders::buildHTTPResponseHeaderStruct (const char *input,
     control if this is a regular response.
    */
   char *newInput;
-  u_long nLines,maxTotchars;
-  u_long validResponse;
+  size_t nLines,maxTotchars;
+  size_t validResponse;
   const char cmdSeps[]   = ": ,\t\n\r\0";
 
   int containStatusLine=0;
@@ -1084,7 +1084,7 @@ int HttpHeaders::buildHTTPResponseHeaderStruct (const char *input,
       }
     token = strtok (NULL, cmdSeps);
   }
-  while (token && ((u_long)(token - input) < maxTotchars));
+  while (token && ((size_t)(token - input) < maxTotchars));
 
   *nbtr = maxTotchars;
   delete [] input;
@@ -1101,13 +1101,13 @@ int HttpHeaders::buildHTTPResponseHeaderStruct (const char *input,
   \param nLinesptr Lines in the header.
   \param ncharsptr Characters in the header.
  */
-int HttpHeaders::validHTTPRequest (const char *req, u_long size,
-                                  u_long* nLinesptr, u_long* ncharsptr)
+int HttpHeaders::validHTTPRequest (const char *req, size_t size,
+                                  size_t* nLinesptr, size_t* ncharsptr)
 {
-  u_long i = 0;
-  u_long nLinechars = 0;
+  size_t i = 0;
+  size_t nLinechars = 0;
   nLinechars = 0;
-  u_long nLines = 0;
+  size_t nLines = 0;
 
   if (req == 0)
     return 400;
diff --git a/myserver/src/protocol/http/http_thread_context.cpp b/myserver/src/protocol/http/http_thread_context.cpp
index 24b6313..dd62990 100644
--- a/myserver/src/protocol/http/http_thread_context.cpp
+++ b/myserver/src/protocol/http/http_thread_context.cpp
@@ -29,14 +29,14 @@
  */
 const char* HttpThreadContext::getData (const char *name)
 {
-  Vhost *vh = (Vhost*)connection->host;
-
   string *ret = other.get (string (name));
-
   if (ret)
     return ret->c_str ();
-  else
-    return vh ? vh->getData (name) : NULL;
+
+  if (connection->host)
+    return connection->host->getData (name);
+
+  return NULL;
 }
 
 /*!
diff --git a/myserver/tests/test_http_request.cpp b/myserver/tests/test_http_request.cpp
index c1a7bcc..53e191b 100644
--- a/myserver/tests/test_http_request.cpp
+++ b/myserver/tests/test_http_request.cpp
@@ -63,7 +63,7 @@ public:
   {
     HttpRequestHeader header;
     Connection connection;
-    u_long requestLength;
+    size_t requestLength;
     const char * requestStr;
     int ret;
 #define BUILD_KEEPALIVE_REQ(X) "GET / HTTP/1.1\r\n" \
@@ -108,8 +108,8 @@ public:
     HttpRequestHeader header;
     Connection connection;
     const char * requestStr = "GET /resource?args HTTP/1.1\r\nHost: localhost\r\n\r\n";
-    u_long  bufferLength = strlen (requestStr);
-    u_long requestLength;
+    size_t  bufferLength = strlen (requestStr);
+    size_t requestLength;
     int ret = HttpHeaders::buildHTTPRequestHeaderStruct (requestStr,
                                                         bufferLength,
                                                         &requestLength,
@@ -132,8 +132,8 @@ public:
     HttpRequestHeader header;
     Connection connection;
     const char * requestStr;
-    u_long  bufferLength;
-    u_long requestLength;
+    size_t  bufferLength;
+    size_t requestLength;
     int ret;
 
     requestStr = "GET /resource HTTP/1.1\r\nHost: localhost\r\nRange: bytes=10-20\r\n\r\n";
@@ -172,8 +172,8 @@ public:
   {
     const char *request = "GET / HTTP/1.1\r\nHost: localhost\r\n\r\n";
     int ret;
-    u_long nLines;
-    u_long nChars;
+    size_t nLines;
+    size_t nChars;
     ret = HttpHeaders::validHTTPRequest (request,
                                         strlen (request),
                                         &nLines,
@@ -186,8 +186,8 @@ public:
   {
     const char *incompleteRequest = "GET / HTTP/1.1\r\nHost: localhost";
     int ret;
-    u_long nLines;
-    u_long nChars;
+    size_t nLines;
+    size_t nChars;
     ret = HttpHeaders::validHTTPRequest (incompleteRequest,
                                         strlen (incompleteRequest),
                                         &nLines,
@@ -202,8 +202,8 @@ public:
     HttpRequestHeader header;
     Connection connection;
     const char *requestStr;
-    u_long  bufferLength;
-    u_long requestLength;
+    size_t  bufferLength;
+    size_t requestLength;
     int ret;
 
     requestStr = "GET /resource HTTP/1.1\r\nHost: localhost\r\n" \
@@ -240,8 +240,8 @@ public:
     HttpRequestHeader header;
     Connection connection;
     const char *requestStr;
-    u_long  bufferLength;
-    u_long requestLength;
+    size_t  bufferLength;
+    size_t requestLength;
     int ret;
 
     requestStr = "GET /resource HTTP/1.1\r\nHost: localhost\r\n" \
diff --git a/myserver/tests/test_http_response.cpp b/myserver/tests/test_http_response.cpp
index 9123efd..fa95687 100644
--- a/myserver/tests/test_http_response.cpp
+++ b/myserver/tests/test_http_response.cpp
@@ -58,7 +58,7 @@ public:
   {
     HttpResponseHeader header;
     const char * responseStr = "HTTP/1.1 200 Success\r\nContent-Length: 0\r\n\r\n";
-    u_long nbtr;
+    size_t nbtr;
     int ret = HttpHeaders::buildHTTPResponseHeaderStruct (responseStr,
                                                          &header,
                                                          &nbtr);
@@ -71,7 +71,7 @@ public:
   void testJoinField ()
   {
     HttpResponseHeader header;
-    u_long nbtr;
+    size_t nbtr;
     const char * responseStr =
       "HTTP/1.1 200 Success\r\n\
 Content-Length: 0\r\n\
@@ -94,8 +94,8 @@ ToJoin: b\r\n";
   {
     HttpResponseHeader header;
     const char * responseStr = "HTTP/1.1 200 Success\r\nContent-Length: 0\r\n\r\n";
-    u_long nLinesptr;
-    u_long ncharsptr;
+    size_t nLinesptr;
+    size_t ncharsptr;
 
     int ret = HttpHeaders::validHTTPResponse (responseStr,
                                              &nLinesptr,
@@ -108,8 +108,8 @@ ToJoin: b\r\n";
   {
     HttpResponseHeader header;
     const char * responseStr = "Not really HTTP response";
-    u_long nLinesptr;
-    u_long ncharsptr;
+    size_t nLinesptr;
+    size_t ncharsptr;
     int ret;
 
     ret = HttpHeaders::validHTTPResponse (responseStr,
@@ -160,8 +160,8 @@ ToJoin: b\r\n";
     HttpResponseHeader response;
     response.setValue ("foo", "bar");
     response.setValue ("baz", "foo");
-    u_long len = HttpHeaders::buildHTTPResponseHeader (buffer, &response);
-    CPPUNIT_ASSERT_EQUAL (len, (u_long) strlen (buffer));
+    size_t len = HttpHeaders::buildHTTPResponseHeader (buffer, &response);
+    CPPUNIT_ASSERT_EQUAL (len, strlen (buffer));
   }
 };
 



commit 9c287473e334a716cd5d5be8a32c9eaa1e90d5ea
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 21 14:54:12 2011 +0200

    SslSocket: ensure the wrapped socket is properly `close'd.

diff --git a/myserver/src/base/socket/ssl_socket.cpp b/myserver/src/base/socket/ssl_socket.cpp
index 36369cf..69a0082 100644
--- a/myserver/src/base/socket/ssl_socket.cpp
+++ b/myserver/src/base/socket/ssl_socket.cpp
@@ -78,7 +78,6 @@ SslSocket::SslSocket ()
 SslSocket::~SslSocket ()
 {
   freeSSL ();
-  fd = -1;
 }
 
 /*!
@@ -86,7 +85,14 @@ SslSocket::~SslSocket ()
  */
 int SslSocket::close ()
 {
-  return Socket::close ();
+  int ret;
+  if (sock)
+    ret = sock->close ();
+  else
+    ret = Socket::close ();
+
+  this->fd = -1;
+  return ret;
 }
 
 /*!

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

Summary of changes:
 myserver/include/protocol/http/http_headers.h      |   14 +++---
 .../include/protocol/http/http_thread_context.h    |    7 ++-
 myserver/src/base/socket/ssl_socket.cpp            |   10 +++-
 myserver/src/http_handler/proxy/proxy.cpp          |    9 +---
 myserver/src/protocol/http/http.cpp                |   15 +++---
 myserver/src/protocol/http/http_data_read.cpp      |    4 +-
 myserver/src/protocol/http/http_headers.cpp        |   52 ++++++++++----------
 myserver/src/protocol/http/http_thread_context.cpp |   10 ++--
 myserver/tests/test_http_request.cpp               |   26 +++++-----
 myserver/tests/test_http_response.cpp              |   16 +++---
 10 files changed, 82 insertions(+), 81 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Thu Apr 21 09:16:30 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QCtkE-0000tt-Lm
	for mharc-myserver-commit@gnu.org; Thu, 21 Apr 2011 09:16:30 -0400
Received: from eggs.gnu.org ([140.186.70.92]:40805)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QCtkC-0000th-Fy
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 09:16:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QCtkB-0001Dj-22
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 09:16:28 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:42337)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QCtkA-0001Df-RA
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 09:16:27 -0400
Received: from lucifer (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.14.4/8.14.4) with SMTP id
	p3LDGNqd005400
	for <myserver-commit@gnu.org>; Thu, 21 Apr 2011 15:16:23 +0200
Message-Id: <201104211316.p3LDGNqd005400@proliant.st.ewi.tudelft.nl>
Received: by lucifer (sSMTP sendmail emulation);
	Thu, 21 Apr 2011 15:16:23 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
X-Hydra-Instance: lucifer
X-Hydra-Project: gnu
X-Hydra-Jobset: myserver-master
X-Hydra-Job: build
Date: Thu, 21 Apr 2011 15:16:23 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 130.161.158.3
Subject: [myserver-commit] Hydra job gnu:myserver-master:build build
	1050845: Failed
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Apr 2011 13:16:29 -0000

Hi,

This is to let you know that Hydra build 1050845 of job gnu:myserver-master:build has changed from 'Failed' to 'Failed'.

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

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:              | 1050845
Nix name:              | myserver-0.9.2.463-5352
Short description:     | Native Nix build on x86_64-linux
Maintainer(s):         | myserver-commit@gnu.org
System:                | x86_64-linux
Derivation store path: | /nix/store/5yj27xxrk8k8l0mj4n8wxlsfnmx3r2a0-myserver-0.9.2.463-5352.drv
Output store path:     | /nix/store/i9s5ljzviihhbsh7mwla9aw3hkyz1mq7-myserver-0.9.2.463-5352
Time added:            | 2011-04-21 15:16:23
Build started:         | 2011-04-21 15:12:30
Build finished:        | 2011-04-21 15:16:23
Duration:              | 233s

The build inputs were:

Name        | Type   | Value
------------+--------+-------------------------------------------------------------
hydraConfig | svn    | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:26838
nixpkgs     | svn    | https://svn.nixos.org/repos/nix/nixpkgs/trunk:26915
system      | string | x86_64-linux
tarball     | build  | 1050773

Regards,

The Hydra build daemon.

---
7fdcd589b000-7fdcd5a9a000 ---p 00076000 08:02 1159444                    /nix/store/63p55l5dm9wyb6z5x5j953kybhp7ckvm-libgcrypt-1.4.6/lib/libgcrypt.so.11.6.0
7fdcd5a9a000-7fdcd5a9e000 rw-p 00075000 08:02 1159444                    /nix/store/63p55l5dm9wyb6z5x5j953kybhp7ckvm-libgcrypt-1.4.6/lib/libgcrypt.so.11.6.0
7fdcd5a9e000-7fdcd5ab6000 r-xp 00000000 08:02 17290081                   /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libpthread-2.12.2.so
7fdcd5ab6000-7fdcd5cb5000 ---p 00018000 08:02 17290081                   /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libpthread-2.12.2.so
7fdcd5cb5000-7fdcd5cb6000 r--p 00017000 08:02 17290081                   /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libpthread-2.12.2.so
7fdcd5cb6000-7fdcd5cb7000 rw-p 00018000 08:02 17290081                   /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libpthread-2.12.2.so
7fdcd5cb7000-7fdcd5cbb000 rw-p 00000000 00:00 0
7fdcd5cbb000-7fdcd5cd3000 r-xp 00000000 08:02 18258965                   /nix/store/pv49msy9ylg9zhhf35fa9lkssgb8d5qx-zlib-1.2.5/lib/libz.so.1.2.5
7fdcd5cd3000-7fdcd5ed2000 ---p 00018000 08:02 18258965                   /nix/store/pv49msy9ylg9zhhf35fa9lkssgb8d5qx-zlib-1.2.5/lib/libz.so.1.2.5
7fdcd5ed2000-7fdcd5ed3000 rw-p 00017000 08:02 18258965                   /nix/store/pv49msy9ylg9zhhf35fa9lkssgb8d5qx-zlib-1.2.5/lib/libz.so.1.2.5
7fdcd5ed3000-7fdcd5fa1000 r-xp 00000000 08:02 13140983                   /nix/store/s76axdlcsw634wi0ykbx32sjvmnadk2s-gnutls-2.12.2/lib/libgnutls.so.26.18.10
7fdcd5fa1000-7fdcd61a0000 ---p 000ce000 08:02 13140983                   /nix/store/s76axdlcsw634wi0ykbx32sjvmnadk2s-gnutls-2.12.2/lib/libgnutls.so.26.18.10
7fdcd61a0000-7fdcd61a8000 rw-p 000cd000 08:02 13140983                   /nix/store/s76axdlcsw634wi0ykbx32sjvmnadk2s-gnutls-2.12.2/lib/libgnutls.so.26.18.10
7fdcd61a8000-7fdcd62f0000 r-xp 00000000 08:02 17885247                   /nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/lib/libxml2.so.2.7.7
7fdcd62f0000-7fdcd64ef000 ---p 00148000 08:02 17885247                   /nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/lib/libxml2.so.2.7.7
7fdcd64ef000-7fdcd64f9000 rw-p 00147000 08:02 17885247                   /nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/lib/libxml2.so.2.7.7
7fdcd64f9000-7fdcd64fa000 rw-p 00000000 00:00 0
7fdcd64fa000-7fdcd652c000 r-xp 00000000 08:02 2910999                    /nix/store/ihcg4sd4an1snj6ra13v8k6js48vnnxw-libidn-1.20/lib/libidn.so.11.6.3
7fdcd652c000-7fdcd672b000 ---p 00032000 08:02 2910999                    /nix/store/ihcg4sd4an1snj6ra13v8k6js48vnnxw-libidn-1.20/lib/libidn.so.11.6.3
7fdcd672b000-7fdcd672c000 rw-p 00031000 08:02 2910999                    /nix/store/ihcg4sd4an1snj6ra13v8k6js48vnnxw-libidn-1.20/lib/libidn.so.11.6.3
7fdcd672c000-7fdcd676e000 r-xp 00000000 08:02 1643608                    /nix/store/64qvc3kzmpdskx3fn9x09sdshjz0wpvj-cppunit-1.12.0/lib/libcppunit-1.12.so.0.0.0
7fdcd676e000-7fdcd696e000 ---p 00042000 08:02 1643608                    /nix/store/64qvc3kzmpdskx3fn9x09sdshjz0wpvj-cppunit-1.12.0/lib/libcppunit-1.12.so.0.0.0
7fdcd696e000-7fdcd6971000 rw-p 00042000 08:02 1643608                    /nix/store/64qvc3kzmpdskx3fn9x09sdshjz0wpvj-cppunit-1.12.0/lib/libcppunit-1.12.so.0.0.0
7fdcd6971000-7fdcd69c4000 r-xp 00000000 08:02 10146189                   /nix/store/ji6py9m9w2ray1bmpkmgig9llj1i2ggf-gmp-4.3.2/lib/libgmp.so.3.5.2
7fdcd69c4000-7fdcd6bc3000 ---p 00053000 08:02 10146189                   /nix/store/ji6py9m9w2ray1bmpkmgig9llj1i2ggf-gmp-4.3.2/lib/libgmp.so.3.5.2
7fdcd6bc3000-7fdcd6bc5000 rw-p 00052000 08:02 10146189                   /nix/store/ji6py9m9w2ray1bmpkmgig9llj1i2ggf-gmp-4.3.2/lib/libgmp.so.3.5.2
7fdcd6bc5000-7fdcd6bd5000 r-xp 00000000 08:02 6358780                    /nix/store/clk7dqh7lqn6hsamy0r9fzb78h08dj8i-libtasn1-2.9/lib/libtasn1.so.3.1.11
7fdcd6bd5000-7fdcd6dd4000 ---p 00010000 08:02 6358780                    /nix/store/clk7dqh7lqn6hsamy0r9fzb78h08dj8i-libtasn1-2.9/lib/libtasn1.so.3.1.11
7fdcd6dd4000-7fdcd6dd5000 rw-p 0000f000 08:02 6358780                    /nix/store/clk7dqh7lqn6hsamy0r9fzb78h08dj8i-libtasn1-2.9/lib/libtasn1.so.3.1.11
7fdcd6dd5000-7fdcd6eb8000 r-xp 00000000 08:02 6149963                    /nix/store/3r8kfi33y3lbrsvlx8vzwm74h8178y35-gcc-4.5.1/lib64/libstdc++.so.6.0.14
7fdcd6eb8000-7fdcd70b7000 ---p 000e3000 08:02 6149963                    /nix/store/3r8kfi33y3lbrsvlx8vzwm74h8178y35-gcc-4.5.1/lib64/libstdc++.so.6.0.14
7fdcd70b7000-7fdcd70bf000 r--p 000e2000 08:02 6149963                    /nix/store/3r8kfi33y3lbrsvlx8vzwm74h8178y35-gcc-4.5.1/lib64/libstdc++.so.6.0.14
7fdcd70bf000-7fdcd70c1000 rw-p 000ea000 08:02 6149963                    /nix/store/3r8kfi33y3lbrsvlx8vzwm74h8178y35-gcc-4.5.1/lib64/libstdc++.so.6.0.14
7fdcd70c1000-7fdcd70d6000 rw-p 00000000 00:00 0
7fdcd70d6000-7fdcd70f4000 r-xp 00000000 08:02 17290021                   /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/ld-2.12.2.so
7fdcd72e3000-7fdcd72f4000 rw-p 00000000 00:00 0
7fdcd72f4000-7fdcd72f5000 r--p 0001e000 08:02 17290021                   /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/ld-2.12.2.so
7fdcd72f5000-7fdcd72f6000 rw-p 0001f000 08:02 17290021                   /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/ld-2.12.2.so
7fdcd72f6000-7fdcd72f7000 rw-p 00000000 00:00 0
7fff842d4000-7fff842ea000 rw-p 00000000 00:00 0                          [stack]
7fff8432a000-7fff8432b000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
.make[2]: *** [check-am] Aborted
make[2]: Leaving directory `/tmp/nix-build-5yj27xxrk8k8l0mj4n8wxlsfnmx3r2a0-myserver-0.9.2.463-5352.drv-0/myserver-0.9.2.463-5352/tests'
[q[qmake[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/tmp/nix-build-5yj27xxrk8k8l0mj4n8wxlsfnmx3r2a0-myserver-0.9.2.463-5352.drv-0/myserver-0.9.2.463-5352'
[q[qmake: *** [check] Error 2
[q[q[qbuild time elapsed:  0m0.015s 0m0.014s 2m14.867s 0m43.777s
[pCopying build directory to /nix/store/i9s5ljzviihhbsh7mwla9aw3hkyz1mq7-myserver-0.9.2.463-5352/nix-build-5yj27xxrk8k8l0mj4n8wxlsfnmx3r2a0-myserver-0.9.2.463-5352.drv-0
[qbuild failed with exit code 2 (ignored)


From MAILER-DAEMON Thu Apr 21 09:18:03 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QCtlj-0000xL-Nl
	for mharc-myserver-commit@gnu.org; Thu, 21 Apr 2011 09:18:03 -0400
Received: from eggs.gnu.org ([140.186.70.92]:41032)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QCtlg-0000xF-Py
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 09:18:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QCtlf-0001ZH-JC
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 09:18:00 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:42338)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QCtlf-0001Z7-C6
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 09:17:59 -0400
Received: from lucifer (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.14.4/8.14.4) with SMTP id
	p3LDHv3m005499
	for <myserver-commit@gnu.org>; Thu, 21 Apr 2011 15:17:57 +0200
Message-Id: <201104211317.p3LDHv3m005499@proliant.st.ewi.tudelft.nl>
Received: by lucifer (sSMTP sendmail emulation);
	Thu, 21 Apr 2011 15:17:57 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
X-Hydra-Instance: lucifer
X-Hydra-Project: gnu
X-Hydra-Jobset: myserver-master
X-Hydra-Job: build
Date: Thu, 21 Apr 2011 15:17:57 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 130.161.158.3
Subject: [myserver-commit] Hydra job gnu:myserver-master:build build
	1050842: Failed
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Apr 2011 13:18:01 -0000

Hi,

This is to let you know that Hydra build 1050842 of job gnu:myserver-master:build has changed from 'Failed' to 'Failed'.

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

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:              | 1050842
Nix name:              | myserver-0.9.2.463-5352
Short description:     | Native Nix build on i686-linux
Maintainer(s):         | myserver-commit@gnu.org
System:                | i686-linux
Derivation store path: | /nix/store/axnl62gp0mac9rbvy705lkymz418nsdl-myserver-0.9.2.463-5352.drv
Output store path:     | /nix/store/xm8r5xp4vvmln81gcxmxz2kvpbypd6bv-myserver-0.9.2.463-5352
Time added:            | 2011-04-21 15:17:56
Build started:         | 2011-04-21 15:12:30
Build finished:        | 2011-04-21 15:17:56
Duration:              | 326s

The build inputs were:

Name        | Type   | Value
------------+--------+-------------------------------------------------------------
hydraConfig | svn    | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:26838
nixpkgs     | svn    | https://svn.nixos.org/repos/nix/nixpkgs/trunk:26915
system      | string | i686-linux
tarball     | build  | 1050773

Regards,

The Hydra build daemon.

---
TestConnection::testTries. : OK
TestConnection::testPort. : OK
TestConnection::testLogin. : OK
TestConnection::testPassword. : OK
TestConnection::testForceControl. : OK
TestConnection::testToRemove. : OK
TestConnection::testScheduled. : OK
TestConnection::testPriority. : OK
TestConnectionsScheduler::testAddNewConnection. : OK
TestConnectionsScheduler::testGetNumTotalConnections. : OK
TestConnectionsScheduler::testAddNewReadyConnection. : OK
TestConnectionsScheduler::testGetConnections. : OK
TestConnectionsScheduler::testVisitor. : OK
TestCryptAlgoManager::testRegister. : OK
TestCryptAlgoManager::testCheck. : OK
TestCryptAlgoManager::testNoExists. : OK
TestExceptions::testWrongCwd. : OK
TestExceptions::testErrno. : OK
TestExceptions::testGetBacktrace. : OK
TestFile::testCreateTemporaryFile. : OK
TestFile::testCreateTemporaryDelayedFile. : OK
TestFile::testOnFile. : OK
TestFile::testBinary. : OK
TestFile::testTruncate. : OK
TestFile::testCreationTime. : OK
TestFile::testLastAccessTime. : OK
TestFile::testLastModTime. : OK
TestFile::testSeek. : OK
TestFileStream::testCycleLog. : OK
TestFileStream::testReOpen. : OK
TestFileStreamCreator::testCreation. : OK
TestFilesUtility::testGetPathRecursionLevel. : OK
TestFilesUtility::testSplitPath. : OK
TestFilesUtility::testSplitPathString. : OK
TestFilesUtility::testSplitPathLength. : OK
TestFilesUtility::testGetFileExt. : OK
TestFilterChain::testGzipChain. : OK
TestFilterChain::testIsEmpty. : OK
TestFilterChain::testAcceptDuplicates. : OK
TestFilterChain::testStream. : OK
TestFilterChain::testIsFilterPresent. : OK
TestFilterChain::testRemoveFilter. : OK
TestForkServer::testExecuteProcessmake[2]: *** [check-am] Segmentation fault
make[2]: Leaving directory `/tmp/nix-build-axnl62gp0mac9rbvy705lkymz418nsdl-myserver-0.9.2.463-5352.drv-0/myserver-0.9.2.463-5352/tests'
[q[qmake[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/tmp/nix-build-axnl62gp0mac9rbvy705lkymz418nsdl-myserver-0.9.2.463-5352.drv-0/myserver-0.9.2.463-5352'
[q[qmake: *** [check] Error 2
[q[q[qbuild time elapsed:  0m0.024s 0m0.018s 2m8.527s 0m30.080s
[pCopying build directory to /nix/store/xm8r5xp4vvmln81gcxmxz2kvpbypd6bv-myserver-0.9.2.463-5352/nix-build-axnl62gp0mac9rbvy705lkymz418nsdl-myserver-0.9.2.463-5352.drv-0
[qbuild failed with exit code 2 (ignored)


From MAILER-DAEMON Thu Apr 21 12:45:58 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QCx0w-0001xN-6D
	for mharc-myserver-commit@gnu.org; Thu, 21 Apr 2011 12:45:58 -0400
Received: from eggs.gnu.org ([140.186.70.92]:51449)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCx0t-0001xH-Gf
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 12:45:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCx0s-0004TU-0u
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 12:45:55 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:38233)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCx0r-0004TN-Sf
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 12:45:53 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QCx0r-0007eL-Aq
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 16:45:53 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QCx0q-0007jA-4K
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 16:45:53 +0000
Date: Thu, 21 Apr 2011 16:45:52 +0000
Message-Id: <E1QCx0q-0007jA-4K@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 5352cc50040b0108c1fa8cbe609a1050fbb3741a
X-Git-Newrev: 8dd135c0c0c053733cd70dc04c5db204dc9708ad
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-466-g8dd135c
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Apr 2011 16:45: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  8dd135c0c0c053733cd70dc04c5db204dc9708ad (commit)
       via  e5cd0e11351a8e1cd1cabf6b11e73783bcd383bd (commit)
       via  4ad9c6e0eb2ec22a4d8c23e41878728064d2c7ee (commit)
      from  5352cc50040b0108c1fa8cbe609a1050fbb3741a (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 8dd135c0c0c053733cd70dc04c5db204dc9708ad
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 21 18:45:48 2011 +0200

    Filters: use modifier filters only if they are supported by the client.

diff --git a/myserver/src/filter/filters_factory.cpp b/myserver/src/filter/filters_factory.cpp
index 85fcf9f..999ef45 100644
--- a/myserver/src/filter/filters_factory.cpp
+++ b/myserver/src/filter/filters_factory.cpp
@@ -135,9 +135,6 @@ int FiltersFactory::chain (FiltersChain* c, list<string> &l, Stream* out,
     {
       size_t tmp;
 
-      if (accepted && accepted->find (*i) == string::npos)
-        continue;
-
       Filter *n = getFilter ((*i).c_str ());
       if (!n)
         {
@@ -145,11 +142,17 @@ int FiltersFactory::chain (FiltersChain* c, list<string> &l, Stream* out,
           return 1;
         }
 
-      if (onlyNotModifiers && n->modifyData ())
+      if (n->modifyData ())
         {
-          delete n;
-          c->clearAllFilters ();
-          return 1;
+          if ((! accepted) || accepted->find (*i) == string::npos)
+            continue;
+
+          if (onlyNotModifiers)
+            {
+              delete n;
+              c->clearAllFilters ();
+              return 1;
+            }
         }
 
       c->addFilter (n, &tmp);



commit e5cd0e11351a8e1cd1cabf6b11e73783bcd383bd
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 21 18:38:39 2011 +0200

    Http: fix support for filters.

diff --git a/myserver/include/filter/filters_chain.h b/myserver/include/filter/filters_chain.h
index 588df2a..b3f5e00 100644
--- a/myserver/include/filter/filters_chain.h
+++ b/myserver/include/filter/filters_chain.h
@@ -48,6 +48,7 @@ public:
   virtual int write (const char *buffer, size_t len, size_t *);
   virtual int flush (size_t *);
   FiltersChain ();
+  FiltersChain (Stream *s);
   ~FiltersChain ();
 protected:
   list <Filter*> filters;
diff --git a/myserver/include/protocol/http/http_data_handler.h b/myserver/include/protocol/http/http_data_handler.h
index b0b6e89..cef8c27 100644
--- a/myserver/include/protocol/http/http_data_handler.h
+++ b/myserver/include/protocol/http/http_data_handler.h
@@ -53,7 +53,7 @@ public:
   static void checkDataChunks (HttpThreadContext *, bool *, bool *);
 
   static size_t appendDataToHTTPChannel (HttpThreadContext* td,
-                                         char *buffer,
+                                         const char *buffer,
                                          size_t size,
                                          FiltersChain *chain,
                                          bool useChunks,
@@ -61,7 +61,7 @@ public:
                                          MemoryStream *tmpStream);
 
   static size_t appendDataToHTTPChannel (HttpThreadContext* td,
-                                         char *buffer,
+                                         const char *buffer,
                                          size_t size,
                                          FiltersChain* chain,
                                          bool useChunks);
diff --git a/myserver/src/filter/filters_chain.cpp b/myserver/src/filter/filters_chain.cpp
index 7aeef9b..b9c559e 100644
--- a/myserver/src/filter/filters_chain.cpp
+++ b/myserver/src/filter/filters_chain.cpp
@@ -44,14 +44,13 @@ int FiltersChain::read (char* buffer, size_t len, size_t* nbr)
 */
 void FiltersChain::setStream (Stream* s)
 {
-  list<Filter*>::iterator i=filters.begin ();
+  list<Filter*>::iterator i = filters.begin ();
+
+  for (; i != filters.end (); i++ )
+    if ((*i)->getParent () == stream)
+      (*i)->setParent (s);
 
-  for ( ; i!=filters.end (); i++ )
-    if ((*i)->getParent ()==stream)
-      {
-        (*i)->setParent (s);
-      }
-  stream=s;
+  stream = s;
 }
 
 /*!
@@ -85,6 +84,14 @@ FiltersChain::FiltersChain ()
   firstFilter = NULL;
 }
 
+
+FiltersChain::FiltersChain (Stream *stream)
+{
+  acceptDuplicates = 1;
+  this->stream = stream;
+  firstFilter = NULL;
+}
+
 /*!
   Set if the chain can cointain duplicates of the same filter on different levels.
 */
diff --git a/myserver/src/filter/gzip/gzip.cpp b/myserver/src/filter/gzip/gzip.cpp
index 721c769..8ccacdd 100644
--- a/myserver/src/filter/gzip/gzip.cpp
+++ b/myserver/src/filter/gzip/gzip.cpp
@@ -312,17 +312,17 @@ int Gzip::write (const char* buffer, size_t len, size_t *nbw)
 
   while (len)
     {
-      size_t nbw_parent;
-      size_t  size = std::min (len, (size_t) 512);
+      size_t nbwParent;
+      size_t size = std::min (len, (size_t) 512);
       u_long ret = compress (buffer, size, tmpBuffer, 1024);
 
       if (ret)
-        parent->write (tmpBuffer, ret, &nbw_parent);
+        parent->write (tmpBuffer, ret, &nbwParent);
 
       written += ret;
       buffer += size;
       len -= size;
-      *nbw += nbw_parent;
+      *nbw += nbwParent;
     }
   return 0;
 }
diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 69bd63a..2c390c2 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -213,7 +213,6 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
   size_t nbr;
   time_t lastMT;
   string tmpTime;
-  u_long dataSent = 0;
 
   try
     {
@@ -322,14 +321,13 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
     if (td->mime)
       {
         HttpRequestHeader::Entry* e = td->request.other.get ("accept-encoding");
+        memStream.refresh ();
         if (td->mime)
           Server::getInstance ()->getFiltersFactory ()->chain (&chain,
                                                                td->mime->filters,
                                                                &memStream,
                                                                &nbw, 0,
                                                                e ? &e->value : NULL);
-        memStream.refresh ();
-        dataSent += nbw;
       }
 
     useModifiers = chain.hasModifiersFilters ();
@@ -439,9 +437,12 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
 
         memStream.refresh ();
         if (nbr)
-          dataSent += HttpDataHandler::appendDataToHTTPChannel (td,
+          {
+            FiltersChain directChain (chain.getStream ());
+            td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                                     td->buffer->getBuffer (),
-                                                    nbr, &chain, useChunks);
+                                                    nbr, &directChain, useChunks);
+          }
       } /* memStream.availableToRead ().  */
 
     /* Flush the rest of the file.  */
@@ -468,10 +469,10 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
 
             bytesToSend -= nbr;
 
-            dataSent += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                 nbr, &chain, useChunks,
-                                                 td->buffer->getRealLength (),
-                                                 &memStream);
+            td->sentData += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
+                                                     nbr, &chain, useChunks,
+                                                     td->buffer->getRealLength (),
+                                                     &memStream);
           }
         else /* if (bytesToSend) */
           {
@@ -479,7 +480,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
             if (!useChunks)
               {
                 chain.flush (&nbw);
-                dataSent += nbw;
+                td->sentData += nbw;
                 break;
               }
             else
@@ -491,16 +492,17 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
                   write there the HTTP data chunk.
                 */
                 Stream* tmpStream = chain.getStream ();
-                chain.setStream (&memStream);
+                FiltersChain directChain (tmpStream);
                 memStream.refresh ();
+                chain.setStream (&memStream);
                 chain.flush (&nbw);
-
                 chain.setStream (tmpStream);
                 memStream.read (td->buffer->getBuffer (),
                                 td->buffer->getRealLength (), &nbr);
 
-                dataSent += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                     nbr, &chain, useChunks);
+                td->sentData += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
+                                                         nbr, &directChain, useChunks);
+                chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
                 break;
               }
           }
@@ -512,13 +514,10 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
   }
   catch (exception & e)
     {
-      td->sentData += dataSent;
       chain.clearAllFilters ();
       return HttpDataHandler::RET_FAILURE;
     }
 
-  /* For logging activity.  */
-  td->sentData += dataSent;
   chain.clearAllFilters ();
 
   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 355ee34..2bd5a8f 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -74,17 +74,18 @@ int HttpDataHandler::unLoad ()
   internally by the function.
  */
 size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
-                                                 char *buffer,
+                                                 const char *buffer,
                                                  size_t size,
                                                  FiltersChain *chain,
                                                  bool useChunks,
                                                  size_t realBufferSize,
                                                  MemoryStream *tmpStream)
 {
-  size_t nbr, nbw;
+  char tmpBuf[BUFSIZ];
+  size_t nbr, nbw, written = 0, totalNbw = 0;
   Stream *oldStream = chain->getStream ();
 
-  if (!chain->hasModifiersFilters ())
+  if (! chain->hasModifiersFilters () || size == 0)
     return appendDataToHTTPChannel (td, buffer, size, chain, useChunks);
 
   /*
@@ -94,15 +95,34 @@ size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
     chunk content, finally we read from it and send directly to the
     original stream.
    */
-  chain->setStream (tmpStream);
-
-  chain->write (buffer, size, &nbw);
-
-  tmpStream->read (buffer, realBufferSize, &nbr);
+  try
+    {
+      FiltersChain directStream (oldStream);
+      do
+        {
+          if (size - written)
+            {
+              chain->setStream (tmpStream);
+              chain->write (buffer + written, size - written, &nbw);
+              chain->setStream (oldStream);
+              written += size;
+            }
+
+          tmpStream->read (tmpBuf, BUFSIZ, &nbr);
+          if (nbr)
+            totalNbw += appendDataToHTTPChannel (td, tmpBuf, nbr, &directStream,
+                                                 useChunks);
+        }
+      while (size - written);
 
-  chain->setStream (oldStream);
+    }
+  catch (...)
+    {
+      chain->setStream (oldStream);
+      throw;
+    }
 
-  return appendDataToHTTPChannel (td, buffer, nbr, chain, useChunks);
+  return totalNbw;
 }
 
 /*!
@@ -116,26 +136,17 @@ size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
  */
 size_t
 HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
-                                          char *buffer,
+                                          const char *buffer,
                                           size_t size,
                                           FiltersChain *chain,
                                           bool useChunks)
 {
   size_t tmp, nbw = 0;
-  if (chain->hasModifiersFilters ())
-    {
-      td->connection->host->warningsLogWrite (_("Http: internal error"));
-      return 0;
-    }
 
   if (useChunks)
     {
       ostringstream chunkHeader;
-      size_t flushNbw = 0;
       chunkHeader << hex << size << "\r\n";
-
-      chain->flush (&flushNbw);
-
       chain->getStream ()->write (chunkHeader.str ().c_str (),
                                   chunkHeader.str ().length (), &tmp);
     }



commit 4ad9c6e0eb2ec22a4d8c23e41878728064d2c7ee
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 21 15:36:36 2011 +0200

    configuration: Remove `gzip.threshold'

diff --git a/myserver/binaries/myserver.default.xml b/myserver/binaries/myserver.default.xml
index 2159b06..4c7cc7a 100755
--- a/myserver/binaries/myserver.default.xml
+++ b/myserver/binaries/myserver.default.xml
@@ -66,9 +66,6 @@
   <!--DEFINE THE ADMINISTRATOR E-MAIL.  -->
   <DEFINE name="server.admin" value="root@localhost" />
 
-  <!--DEFINE THE GZIP COMPRESSION THRESHOLD VALUE.  -->
-  <DEFINE name="gzip.threshold" value="1048576" />
-
   <!--DEFINE IF LINKS SHOULD BE FOLLOWED.  -->
   <DEFINE name="symlinks.follow" value="YES" />
 
diff --git a/myserver/src/GUI/MyServer/GUI/GUIConfig.py b/myserver/src/GUI/MyServer/GUI/GUIConfig.py
index 9bac9bf..cfe6fd4 100644
--- a/myserver/src/GUI/MyServer/GUI/GUIConfig.py
+++ b/myserver/src/GUI/MyServer/GUI/GUIConfig.py
@@ -64,7 +64,6 @@ options['log_color.error_bg'] = ('Error log background colour.', 'string', )
 
 # Other
 options['connection.timeout'] = ('Timeout for every client\'s connected to server. If the client doesn\'t request anything for n seconds the connection with the client is closed. Set this to 0 if you don\'t want to use keep-alive-connections', 'integer', )
-options['gzip.threshold'] = ('Define the gzip compression threshold value.', 'integer', )
 options['symlinks.follow'] = ('Define if links should be followed.', 'bool', )
 
 # don't put 'other' or 'unknown' here

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

Summary of changes:
 myserver/binaries/myserver.default.xml             |    3 -
 myserver/include/filter/filters_chain.h            |    1 +
 myserver/include/protocol/http/http_data_handler.h |    4 +-
 myserver/src/GUI/MyServer/GUI/GUIConfig.py         |    1 -
 myserver/src/filter/filters_chain.cpp              |   23 ++++++---
 myserver/src/filter/filters_factory.cpp            |   17 ++++---
 myserver/src/filter/gzip/gzip.cpp                  |    8 ++--
 myserver/src/http_handler/http_file/http_file.cpp  |   33 ++++++-------
 myserver/src/protocol/http/http_data_handler.cpp   |   51 ++++++++++++--------
 9 files changed, 79 insertions(+), 62 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Thu Apr 21 13:18:09 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QCxW5-0007db-7J
	for mharc-myserver-commit@gnu.org; Thu, 21 Apr 2011 13:18:09 -0400
Received: from eggs.gnu.org ([140.186.70.92]:59543)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCxW3-0007dE-5S
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 13:18:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCxW2-0000fb-3E
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 13:18:07 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:47126)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QCxW2-0000fR-1d
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 13:18:06 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QCxW1-0007zn-Kx
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 17:18:05 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QCxW1-0003Hi-Jb
	for myserver-commit@gnu.org; Thu, 21 Apr 2011 17:18:05 +0000
Date: Thu, 21 Apr 2011 17:18:05 +0000
Message-Id: <E1QCxW1-0003Hi-Jb@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 8dd135c0c0c053733cd70dc04c5db204dc9708ad
X-Git-Newrev: 3c79d69d6099d3b03026dd2ca8be30e8c67a24e3
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-467-g3c79d69
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Apr 2011 17:18: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  3c79d69d6099d3b03026dd2ca8be30e8c67a24e3 (commit)
      from  8dd135c0c0c053733cd70dc04c5db204dc9708ad (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 3c79d69d6099d3b03026dd2ca8be30e8c67a24e3
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Thu Apr 21 19:18:04 2011 +0200

    Fix some tests failures.

diff --git a/myserver/include/filter/filters_factory.h b/myserver/include/filter/filters_factory.h
index 6567d54..1878fdd 100644
--- a/myserver/include/filter/filters_factory.h
+++ b/myserver/include/filter/filters_factory.h
@@ -46,10 +46,11 @@ public:
   int insert (const char*, FILTERCREATE ptr);
   int insert (const char*, FiltersSource* ptr);
   Filter *getFilter (const char*);
-  FiltersChain* chain (list<string> &l, Stream* out, size_t *nbw,
-                       int onlyNotModifiers = 0);
+  FiltersChain* makeChain (list<string> &l, Stream* out, size_t *nbw,
+                           int onlyNotModifiers = 0);
   int chain (FiltersChain*, list<string> &l, Stream* out, size_t *nbw,
-             int onlyNotModifiers = 0, string *accepted = NULL);
+             bool onlyNotModifiers = false, bool acceptAll = true,
+             const string &accepted = "");
 
   FiltersFactory ();
   ~FiltersFactory ();
diff --git a/myserver/src/filter/filters_factory.cpp b/myserver/src/filter/filters_factory.cpp
index 999ef45..e3a9112 100644
--- a/myserver/src/filter/filters_factory.cpp
+++ b/myserver/src/filter/filters_factory.cpp
@@ -94,8 +94,8 @@ Filter *FiltersFactory::getFilter (const char* name)
   will not modify the data.
   On errors returns 0.
 */
-FiltersChain* FiltersFactory::chain (list<string> &l, Stream* out, size_t *nbw,
-                                     int onlyNotModifiers)
+FiltersChain* FiltersFactory::makeChain (list<string> &l, Stream* out, size_t *nbw,
+                                         int onlyNotModifiers)
 {
   FiltersChain *ret = new FiltersChain ();
   if (!ret)
@@ -118,11 +118,13 @@ FiltersChain* FiltersFactory::chain (list<string> &l, Stream* out, size_t *nbw,
   \param nbw Number of written bytes, some filters may need to send a header.
   \param onlyNotModifiers if non-zero the method wil check that all the filters
   will not modify the data.
+  \param acceptAll If true, accept only modifier filters specified in `accepted'.
   \param accepted If specified, include only filters present in this string.
   On errors returns nonzero.
 */
 int FiltersFactory::chain (FiltersChain* c, list<string> &l, Stream* out,
-                           size_t *nbw, int onlyNotModifiers, string *accepted)
+                           size_t *nbw, bool onlyNotModifiers, bool acceptAll,
+                           const string &accepted)
 {
 
   list<string>::iterator  i = l.begin ();
@@ -144,7 +146,7 @@ int FiltersFactory::chain (FiltersChain* c, list<string> &l, Stream* out,
 
       if (n->modifyData ())
         {
-          if ((! accepted) || accepted->find (*i) == string::npos)
+          if (!acceptAll && accepted.find (*i) == string::npos)
             continue;
 
           if (onlyNotModifiers)
diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 2c390c2..494d20c 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -326,8 +326,8 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
           Server::getInstance ()->getFiltersFactory ()->chain (&chain,
                                                                td->mime->filters,
                                                                &memStream,
-                                                               &nbw, 0,
-                                                               e ? &e->value : NULL);
+                                                               &nbw, 0, false,
+                                                               e ? e->value : "");
       }
 
     useModifiers = chain.hasModifiersFilters ();
diff --git a/myserver/src/log/stream/console_stream_creator.cpp b/myserver/src/log/stream/console_stream_creator.cpp
index 6d3d484..c99a6b7 100644
--- a/myserver/src/log/stream/console_stream_creator.cpp
+++ b/myserver/src/log/stream/console_stream_creator.cpp
@@ -27,7 +27,7 @@ ConsoleStreamCreator::create (FiltersFactory* ff, string location,
   if (out && !out->openConsole (location))
     {
       size_t nbw;
-      FiltersChain* fc = ff->chain (filters, out, &nbw);
+      FiltersChain* fc = ff->makeChain (filters, out, &nbw);
       if (fc)
         {
           return new ConsoleStream (ff, cycle, out, fc);
diff --git a/myserver/src/log/stream/file_stream_creator.cpp b/myserver/src/log/stream/file_stream_creator.cpp
index 70609cd..6242e09 100644
--- a/myserver/src/log/stream/file_stream_creator.cpp
+++ b/myserver/src/log/stream/file_stream_creator.cpp
@@ -30,7 +30,7 @@ FileStreamCreator::create (FiltersFactory* ff, string location,
       size_t nbw;
       out->openFile (location.c_str (),
                      FileStream::defaultFileMask);
-      fc = ff->chain (filters, out, &nbw);
+      fc = ff->makeChain (filters, out, &nbw);
       if (fc)
         return new FileStream (ff, cycle, out, fc);
     }
diff --git a/myserver/src/log/stream/socket_stream_creator.cpp b/myserver/src/log/stream/socket_stream_creator.cpp
index 573a91a..a29d885 100644
--- a/myserver/src/log/stream/socket_stream_creator.cpp
+++ b/myserver/src/log/stream/socket_stream_creator.cpp
@@ -33,7 +33,7 @@ SocketStreamCreator::create (FiltersFactory* ff, string location,
   if (out && !out->connect (host.c_str (), port))
     {
       size_t nbw;
-      FiltersChain* fc = ff->chain (filters, out, &nbw);
+      FiltersChain* fc = ff->makeChain (filters, out, &nbw);
       if (fc)
         return new SocketStream (ff, cycle, out, fc);
     }

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

Summary of changes:
 myserver/include/filter/filters_factory.h          |    7 ++++---
 myserver/src/filter/filters_factory.cpp            |   10 ++++++----
 myserver/src/http_handler/http_file/http_file.cpp  |    4 ++--
 myserver/src/log/stream/console_stream_creator.cpp |    2 +-
 myserver/src/log/stream/file_stream_creator.cpp    |    2 +-
 myserver/src/log/stream/socket_stream_creator.cpp  |    2 +-
 6 files changed, 15 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Fri Apr 22 07:49:11 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDErH-0006WE-FB
	for mharc-myserver-commit@gnu.org; Fri, 22 Apr 2011 07:49:11 -0400
Received: from eggs.gnu.org ([140.186.70.92]:45436)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDErE-0006Vd-Lu
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 07:49:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDErC-0004bb-HZ
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 07:49:08 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:54156)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDErC-0004bP-F7
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 07:49:06 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QDErC-0003pq-0x
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 11:49:06 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QDEr9-00020c-SA
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 11:49:05 +0000
Date: Fri, 22 Apr 2011 11:49:04 +0000
Message-Id: <E1QDEr9-00020c-SA@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 3c79d69d6099d3b03026dd2ca8be30e8c67a24e3
X-Git-Newrev: ebe8e3b297859c444b3a4d57fe4bfbf5aaaffbbe
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-471-gebe8e3b
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Apr 2011 11:49: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  ebe8e3b297859c444b3a4d57fe4bfbf5aaaffbbe (commit)
       via  5110fad6ca5ec2a6bbaa1aa63df54e348449e055 (commit)
       via  4b94a0f7b4e15c29b867a60cc4787b67f3d7dc17 (commit)
       via  dbee1d8ee189c245a878a4ac7a7e7516372acc89 (commit)
      from  3c79d69d6099d3b03026dd2ca8be30e8c67a24e3 (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 ebe8e3b297859c444b3a4d57fe4bfbf5aaaffbbe
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 22 13:48:43 2011 +0200

    HttpHandler: refactor some code out of HttpFile.

diff --git a/myserver/include/protocol/http/http_data_handler.h b/myserver/include/protocol/http/http_data_handler.h
index cef8c27..c8f863f 100644
--- a/myserver/include/protocol/http/http_data_handler.h
+++ b/myserver/include/protocol/http/http_data_handler.h
@@ -55,17 +55,27 @@ public:
   static size_t appendDataToHTTPChannel (HttpThreadContext* td,
                                          const char *buffer,
                                          size_t size,
-                                         FiltersChain *chain,
+                                         FiltersChain &chain,
                                          bool useChunks,
                                          size_t realBufferSize,
-                                         MemoryStream *tmpStream);
+                                         MemoryStream &tmpStream);
 
   static size_t appendDataToHTTPChannel (HttpThreadContext* td,
                                          const char *buffer,
                                          size_t size,
-                                         FiltersChain* chain,
+                                         FiltersChain &chain,
                                          bool useChunks);
 
+  static size_t beginHTTPResponse (HttpThreadContext *td,
+                                   MemoryStream &memStream,
+                                   FiltersChain &chain,
+                                   bool useChunks);
+
+  static size_t completeHTTPResponse (HttpThreadContext *td,
+                                      MemoryStream &memStream,
+                                      FiltersChain &chain,
+                                      bool useChunks);
+
 };
 
 #endif
diff --git a/myserver/src/http_handler/cgi/cgi.cpp b/myserver/src/http_handler/cgi/cgi.cpp
index d244283..4c820cb 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -346,7 +346,7 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
       td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                                   td->auxiliaryBuffer->getBuffer (),
                                                   nBytesRead,
-                                                  &chain,
+                                                  chain,
                                                   useChunks);
     }
 
@@ -473,7 +473,7 @@ int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile, FiltersChain &chai
       td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                td->auxiliaryBuffer->getBuffer () + headerSize,
                                                     headerOffset - headerSize,
-                                                    &chain,
+                                                    chain,
                                                     useChunks);
     }
 
diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index 196b777..407cf11 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -623,7 +623,7 @@ int FastCgi::sendData (FcgiContext* con, u_long dim, u_long timeout,
   size_t nbw = HttpDataHandler::appendDataToHTTPChannel (con->td,
                                             con->td->buffer->getBuffer (),
                                             con->td->buffer->getLength (),
-                                            chain, con->useChunks);
+                                            *chain, con->useChunks);
 
   con->td->sentData += nbw;
   return 0;
@@ -710,7 +710,7 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain* chain, bool* response
       size_t nbw = HttpDataHandler::appendDataToHTTPChannel (con->td,
                                                 con->td->buffer->getBuffer () + headerSize,
                                                 size - headerSize,
-                                                chain,
+                                                *chain,
                                                 con->useChunks);
       con->td->sentData += nbw;
     }
diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp b/myserver/src/http_handler/http_dir/http_dir.cpp
index fd666d0..9d1e801 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -438,7 +438,7 @@ int HttpDir::send (HttpThreadContext* td,
 
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                            td->auxiliaryBuffer->getLength (),
-                                           &chain, useChunks);
+                                           chain, useChunks);
 
       filename = directory;
       td->auxiliaryBuffer->setLength (0);
@@ -453,7 +453,7 @@ int HttpDir::send (HttpThreadContext* td,
 
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                            td->auxiliaryBuffer->getLength (),
-                                           &chain, useChunks);
+                                           chain, useChunks);
 
       fd.findfirst (filename.c_str ());
 
@@ -468,7 +468,7 @@ int HttpDir::send (HttpThreadContext* td,
 
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                                td->auxiliaryBuffer->getLength (),
-                                               &chain, useChunks);
+                                               chain, useChunks);
       td->auxiliaryBuffer->setLength (0);
 
       if (FilesUtility::getPathRecursionLevel (td->request.uri) >= 1)
@@ -504,7 +504,7 @@ int HttpDir::send (HttpThreadContext* td,
 
           td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                                    td->auxiliaryBuffer->getLength (),
-                                                   &chain, useChunks);
+                                                   chain, useChunks);
         }
 
       /* Put all files in a vector.  */
@@ -565,7 +565,7 @@ int HttpDir::send (HttpThreadContext* td,
           generateElement (*td->auxiliaryBuffer, file, linkPrefix, formatString);
           td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                                    td->auxiliaryBuffer->getLength (),
-                                                   &chain, useChunks);
+                                                   chain, useChunks);
         }
 
       td->auxiliaryBuffer->setLength (0);
@@ -589,7 +589,7 @@ int HttpDir::send (HttpThreadContext* td,
       *td->auxiliaryBuffer << "</address>\r\n</body>\r\n</html>\r\n";
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                                td->auxiliaryBuffer->getLength (),
-                                               &chain, useChunks);
+                                               chain, useChunks);
 
       *td->auxiliaryBuffer << end_str;
       /* Changes the \ character in the / character.  */
diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 72e2e9e..8fd89cd 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -425,25 +425,9 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
 
     chain.setStream (td->connection->socket);
 
-    /*
-      Flush initial data.  This is data that filters could have added
-      and we have to send before the file itself, for example the gzip
-      filter add a header to file.
-    */
-    if (memStream.availableToRead ())
-      {
-        memStream.read (td->buffer->getBuffer (),
-                        td->buffer->getRealLength (), &nbr);
 
-        memStream.refresh ();
-        if (nbr)
-          {
-            FiltersChain directChain (chain.getStream ());
-            td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
-                                                    td->buffer->getBuffer (),
-                                                    nbr, &directChain, useChunks);
-          }
-      } /* memStream.availableToRead ().  */
+    td->sentData += HttpDataHandler::beginHTTPResponse (td, memStream, chain,
+                                                        useChunks);
 
     /* Flush the rest of the file.  */
     for (;;)
@@ -452,7 +436,9 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
         size_t nbw;
 
         /* Check if there are other bytes to send.  */
-        if (bytesToSend)
+        if (! bytesToSend)
+          break;
+        else
           {
             /* Read from the file the bytes to send.  */
             size_t size = std::min (td->buffer->getRealLength (), bytesToSend);
@@ -467,45 +453,14 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
             bytesToSend -= nbr;
 
             td->sentData += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                     nbr, &chain, useChunks,
+                                                     nbr, chain, useChunks,
                                                      td->buffer->getRealLength (),
-                                                     &memStream);
+                                                     memStream);
           }
-        else /* if (bytesToSend) */
-          {
-            /* If we don't use chunks we can flush directly.  */
-            if (!useChunks)
-              {
-                chain.flush (&nbw);
-                td->sentData += nbw;
-                break;
-              }
-            else
-              {
-                /*
-                  Replace the final stream before the flush and write to a
-                  memory buffer, after all the data is flushed from the
-                  chain we can replace the stream with the original one and
-                  write there the HTTP data chunk.
-                */
-                Stream* tmpStream = chain.getStream ();
-                FiltersChain directChain (tmpStream);
-                memStream.refresh ();
-                chain.setStream (&memStream);
-                chain.flush (&nbw);
-                chain.setStream (tmpStream);
-                memStream.read (td->buffer->getBuffer (),
-                                td->buffer->getRealLength (), &nbr);
-
-                td->sentData += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                         nbr, &directChain, useChunks);
-                chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
-                break;
-              }
-          }
-        memStream.refresh ();
       }/* End for loop.  */
 
+    td->sentData += completeHTTPResponse (td, memStream, chain, useChunks);
+
     file->close ();
     delete file;
   }
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp b/myserver/src/http_handler/mscgi/mscgi.cpp
index ee6d22b..9d0f9ff 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -169,8 +169,8 @@ int MsCgi::write (const char* data, size_t len, MsCgiData* mcd)
 
   mcd->td->sentData +=
     HttpDataHandler::appendDataToHTTPChannel (mcd->td,
-                                              (char *) data, len,
-                                              mcd->filtersChain,
+                                              data, len,
+                                              *mcd->filtersChain,
                                               mcd->useChunks);
   return 0;
 }
diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index e9ca531..03e382d 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -310,7 +310,7 @@ int Proxy::readPayLoad (HttpThreadContext* td,
 
               td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                                        td->buffer->getBuffer (),
-                                                       nbr, out, useChunks);
+                                                       nbr, *out, useChunks);
             }
         }
     }
@@ -340,7 +340,7 @@ int Proxy::readPayLoad (HttpThreadContext* td,
             length -= nbr;
 
           td->sentData += HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                    nbr, out, useChunks);
+                                                    nbr, *out, useChunks);
           if (timedOut || contentLength && length == 0)
             break;
         }
diff --git a/myserver/src/http_handler/scgi/scgi.cpp b/myserver/src/http_handler/scgi/scgi.cpp
index 1158582..a7d1e06 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -268,7 +268,7 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
   if (read - headerSize)
     td->sentData +=
       appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer () + headerSize,
-                             read - headerSize, chain, useChunks);
+                             read - headerSize, *chain, useChunks);
 
   if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
     {
@@ -283,7 +283,7 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
 
           td->sentData +=
             appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                     nbr, chain, useChunks);
+                                     nbr, *chain, useChunks);
         }
 
       if (useChunks)
diff --git a/myserver/src/protocol/http/http_data_handler.cpp b/myserver/src/protocol/http/http_data_handler.cpp
index 2bd5a8f..40c9245 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -21,6 +21,7 @@
 #include <include/protocol/http/http_headers.h>
 #include <include/protocol/http/http.h>
 #include <include/protocol/http/http_data_handler.h>
+#include <include/filter/filters_chain.h>
 
 /*!
   Send a file to the client using the HTTP protocol.
@@ -76,16 +77,16 @@ int HttpDataHandler::unLoad ()
 size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
                                                  const char *buffer,
                                                  size_t size,
-                                                 FiltersChain *chain,
+                                                 FiltersChain &chain,
                                                  bool useChunks,
                                                  size_t realBufferSize,
-                                                 MemoryStream *tmpStream)
+                                                 MemoryStream &tmpStream)
 {
   char tmpBuf[BUFSIZ];
   size_t nbr, nbw, written = 0, totalNbw = 0;
-  Stream *oldStream = chain->getStream ();
+  Stream *oldStream = chain.getStream ();
 
-  if (! chain->hasModifiersFilters () || size == 0)
+  if (! chain.hasModifiersFilters () || size == 0)
     return appendDataToHTTPChannel (td, buffer, size, chain, useChunks);
 
   /*
@@ -102,23 +103,23 @@ size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
         {
           if (size - written)
             {
-              chain->setStream (tmpStream);
-              chain->write (buffer + written, size - written, &nbw);
-              chain->setStream (oldStream);
+              chain.setStream (&tmpStream);
+              chain.write (buffer + written, size - written, &nbw);
+              chain.setStream (oldStream);
               written += size;
             }
 
-          tmpStream->read (tmpBuf, BUFSIZ, &nbr);
+          tmpStream.read (tmpBuf, BUFSIZ, &nbr);
           if (nbr)
-            totalNbw += appendDataToHTTPChannel (td, tmpBuf, nbr, &directStream,
+            totalNbw += appendDataToHTTPChannel (td, tmpBuf, nbr, directStream,
                                                  useChunks);
         }
-      while (size - written);
-
+      while (size - written || nbr);
+      tmpStream.refresh ();
     }
   catch (...)
     {
-      chain->setStream (oldStream);
+      chain.setStream (oldStream);
       throw;
     }
 
@@ -138,7 +139,7 @@ size_t
 HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
                                           const char *buffer,
                                           size_t size,
-                                          FiltersChain *chain,
+                                          FiltersChain &chain,
                                           bool useChunks)
 {
   size_t tmp, nbw = 0;
@@ -147,15 +148,15 @@ HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
     {
       ostringstream chunkHeader;
       chunkHeader << hex << size << "\r\n";
-      chain->getStream ()->write (chunkHeader.str ().c_str (),
-                                  chunkHeader.str ().length (), &tmp);
+      chain.getStream ()->write (chunkHeader.str ().c_str (),
+                                 chunkHeader.str ().length (), &tmp);
     }
 
   if (size)
-    chain->write (buffer, size, &nbw);
+    chain.write (buffer, size, &nbw);
 
   if (useChunks)
-    chain->getStream ()->write ("\r\n", 2, &tmp);
+    chain.getStream ()->write ("\r\n", 2, &tmp);
 
   return nbw;
 }
@@ -189,3 +190,75 @@ HttpDataHandler::checkDataChunks (HttpThreadContext* td, bool* keepalive,
       *useChunks = true;
     }
 }
+
+/*!
+  Begin a HTTP response.
+*/
+size_t
+HttpDataHandler::beginHTTPResponse (HttpThreadContext *td,
+                                    MemoryStream &memStream,
+                                    FiltersChain &chain,
+                                    bool useChunks)
+{
+  size_t ret = 0;
+  /*
+    Flush initial data.  This is data that filters could have added
+    and we have to send before the file itself, for example the gzip
+    filter add a header to file.
+  */
+  if (memStream.availableToRead ())
+    {
+      size_t nbr;
+      memStream.read (td->buffer->getBuffer (),
+                      td->buffer->getRealLength (), &nbr);
+
+      memStream.refresh ();
+      if (nbr)
+        {
+          FiltersChain directChain (chain.getStream ());
+          ret += appendDataToHTTPChannel (td, td->buffer->getBuffer (), nbr,
+                                          directChain, useChunks);
+        }
+    }
+
+  return ret;
+}
+
+/*!
+  Complete a HTTP response.
+ */
+size_t
+HttpDataHandler::completeHTTPResponse (HttpThreadContext *td,
+                                       MemoryStream &memStream,
+                                       FiltersChain &chain,
+                                       bool useChunks)
+{
+  size_t ret = 0;
+  /* If we don't use chunks we can flush directly.  */
+  if (! useChunks)
+    chain.flush (&ret);
+  else
+    {
+      /*
+        Replace the final stream before the flush and write to a
+        memory buffer, after all the data is flushed from the
+        chain we can replace the stream with the original one and
+        write there the HTTP data chunk.
+      */
+      size_t nbr, nbw;
+      Stream* tmpStream = chain.getStream ();
+      FiltersChain directChain (tmpStream);
+      memStream.refresh ();
+      chain.setStream (&memStream);
+      chain.flush (&nbw);
+      chain.setStream (tmpStream);
+      memStream.read (td->buffer->getBuffer (),
+                      td->buffer->getRealLength (), &nbr);
+
+      ret += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
+                                      nbr, directChain, useChunks);
+      chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
+    }
+
+  return ret;
+}
diff --git a/myserver/src/protocol/http/webdav/webdav.cpp b/myserver/src/protocol/http/webdav/webdav.cpp
index b15b801..dbacd61 100644
--- a/myserver/src/protocol/http/webdav/webdav.cpp
+++ b/myserver/src/protocol/http/webdav/webdav.cpp
@@ -337,7 +337,7 @@ int WebDAV::propfind (HttpThreadContext* td)
 
           td->sentData +=
             HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                      nbr, &chain, useChunks);
+                                                      nbr, chain, useChunks);
           if (nbr != td->buffer->getRealLength ())
             break;
         }
@@ -654,7 +654,7 @@ int WebDAV::lock (HttpThreadContext* td)
 
           td->sentData +=
             HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                      nbr, &chain, useChunks);
+                                                      nbr, chain, useChunks);
         }
 
       if (useChunks && chain.getStream ()->write ("0\r\n\r\n", 5, &nbw2))



commit 5110fad6ca5ec2a6bbaa1aa63df54e348449e055
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 22 12:25:36 2011 +0200

    ClientsThread: code cleanup

diff --git a/myserver/src/server/clients_thread.cpp b/myserver/src/server/clients_thread.cpp
index 28018bd..073bd90 100644
--- a/myserver/src/server/clients_thread.cpp
+++ b/myserver/src/server/clients_thread.cpp
@@ -261,7 +261,8 @@ int ClientsThread::controlConnections ()
 
   if (! c->isForceControl ())
     {
-      err = c->socket->recv (&((char*)(buffer.getBuffer ()))[dataRead],
+      int available = c->socket->dataAvailable ();
+      err = c->socket->recv (buffer.getBuffer () + dataRead,
                              MYSERVER_KB (8) - dataRead - 1, 0);
 
       if (err <= 0)
@@ -278,7 +279,7 @@ int ClientsThread::controlConnections ()
   nBytesToRead = dataRead + err;
 
   if ((dataRead + err) < MYSERVER_KB (8))
-    ((char*)buffer.getBuffer ())[dataRead + err] = '\0';
+    (buffer.getBuffer ())[dataRead + err] = '\0';
   else
     {
       server->deleteConnection (c);
@@ -289,8 +290,8 @@ int ClientsThread::controlConnections ()
     c->setnTries (0);
 
   if (dataRead)
-    memcpy ((char*) buffer.getBuffer (),
-            c->getConnectionBuffer ()->getBuffer (), dataRead);
+    memcpy (buffer.getBuffer (), c->getConnectionBuffer ()->getBuffer (),
+            dataRead);
 
   c->setActiveThread (this);
   try



commit 4b94a0f7b4e15c29b867a60cc4787b67f3d7dc17
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 22 12:25:26 2011 +0200

    HttpFile: use the whole buffer with modifiers buffer.

diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 494d20c..72e2e9e 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -457,9 +457,6 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
             /* Read from the file the bytes to send.  */
             size_t size = std::min (td->buffer->getRealLength (), bytesToSend);
 
-            if (useModifiers)
-              size = std::min (size, td->auxiliaryBuffer->getRealLength () / 2);
-
             file->read (td->buffer->getBuffer (), size, &nbr);
             if (nbr == 0)
               {



commit dbee1d8ee189c245a878a4ac7a7e7516372acc89
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 22 12:24:42 2011 +0200

    SslSocket: send data ordered correctly

diff --git a/myserver/src/base/socket/ssl_socket.cpp b/myserver/src/base/socket/ssl_socket.cpp
index 69a0082..a232880 100644
--- a/myserver/src/base/socket/ssl_socket.cpp
+++ b/myserver/src/base/socket/ssl_socket.cpp
@@ -122,7 +122,7 @@ int SslSocket::rawSend (const char* buffer, int len, int flags)
   int ret;
   do
     {
-      ret = gnutls_record_send (session, buffer, len);
+      ret = gnutls_record_send (session, buffer + sent, len - sent);
       if (ret > 0)
         sent += ret;
     }
@@ -246,16 +246,11 @@ int SslSocket::recv (char* buffer, int len, int flags)
 {
   int ret = 0;
 
-  for (;;)
+  do
     {
-      do
-        {
-          ret = gnutls_record_recv (session, buffer, len);
-        }
-      while (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN);
-      if (ret > 0)
-        break;
+      ret = gnutls_record_recv (session, buffer, len);
     }
+  while (ret == GNUTLS_E_INTERRUPTED || ret == GNUTLS_E_AGAIN);
 
   if (ret < 0)
     throw SslException (ret);

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

Summary of changes:
 myserver/include/protocol/http/http_data_handler.h |   16 +++-
 myserver/src/base/socket/ssl_socket.cpp            |   13 +--
 myserver/src/http_handler/cgi/cgi.cpp              |    4 +-
 myserver/src/http_handler/fastcgi/fastcgi.cpp      |    4 +-
 myserver/src/http_handler/http_dir/http_dir.cpp    |   12 +-
 myserver/src/http_handler/http_file/http_file.cpp  |   66 ++-----------
 myserver/src/http_handler/mscgi/mscgi.cpp          |    4 +-
 myserver/src/http_handler/proxy/proxy.cpp          |    4 +-
 myserver/src/http_handler/scgi/scgi.cpp            |    4 +-
 myserver/src/protocol/http/http_data_handler.cpp   |  107 ++++++++++++++++---
 myserver/src/protocol/http/webdav/webdav.cpp       |    4 +-
 myserver/src/server/clients_thread.cpp             |    9 +-
 12 files changed, 139 insertions(+), 108 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Fri Apr 22 10:08:37 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDH2D-0005uW-4m
	for mharc-myserver-commit@gnu.org; Fri, 22 Apr 2011 10:08:37 -0400
Received: from eggs.gnu.org ([140.186.70.92]:52258)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDH2B-0005tv-3t
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 10:08:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDH29-0002xQ-TT
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 10:08:35 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:49661)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDH29-0002xM-Rh
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 10:08:33 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QDH29-0005SF-Dq
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 14:08:33 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QDH28-0002Oe-Fj
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 14:08:33 +0000
Date: Fri, 22 Apr 2011 14:08:32 +0000
Message-Id: <E1QDH28-0002Oe-Fj@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: ebe8e3b297859c444b3a4d57fe4bfbf5aaaffbbe
X-Git-Newrev: 1452a920039a2faa8f93796cc417434b96ff4361
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-472-g1452a92
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Apr 2011 14:08:36 -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  1452a920039a2faa8f93796cc417434b96ff4361 (commit)
      from  ebe8e3b297859c444b3a4d57fe4bfbf5aaaffbbe (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 1452a920039a2faa8f93796cc417434b96ff4361
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 22 16:08:29 2011 +0200

    HttpFile: simplify code for `send'.

diff --git a/myserver/include/protocol/http/http_data_handler.h b/myserver/include/protocol/http/http_data_handler.h
index c8f863f..74c694c 100644
--- a/myserver/include/protocol/http/http_data_handler.h
+++ b/myserver/include/protocol/http/http_data_handler.h
@@ -24,7 +24,9 @@
 # include <include/protocol/protocol.h>
 # include "include/protocol/http/http_headers.h"
 # include <include/filter/filters_chain.h>
+#include <include/filter/filters_factory.h>
 # include <include/filter/memory_stream.h>
+# include <include/conf/mime/mime_manager.h>
 
 
 /*!
@@ -50,7 +52,8 @@ public:
   HttpDataHandler ();
   virtual ~HttpDataHandler ();
 
-  static void checkDataChunks (HttpThreadContext *, bool *, bool *);
+  static void checkDataChunks (HttpThreadContext* td, bool* keepalive,
+                               bool* useChunks, bool disableEncoding = false);
 
   static size_t appendDataToHTTPChannel (HttpThreadContext* td,
                                          const char *buffer,
@@ -76,6 +79,11 @@ public:
                                       FiltersChain &chain,
                                       bool useChunks);
 
+  static size_t generateFiltersChain (HttpThreadContext *td,
+                                      FiltersFactory *factory,
+                                      FiltersChain &fc,
+                                      MimeRecord *mime,
+                                      MemoryStream &memStream);
 };
 
 #endif
diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 8fd89cd..42ea59e 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -49,9 +49,6 @@ int HttpFile::putFile (HttpThreadContext* td, string& filename)
 
   try
   {
-    if (td->request.isKeepAlive ())
-      td->response.setValue ("connection", "keep-alive");
-
     if (!(td->permissions & MYSERVER_PERMISSION_WRITE))
       return td->http->sendAuth ();
 
@@ -204,12 +201,11 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
   size_t bytesToSend;
   off_t firstByte = td->request.rangeByteBegin;
   off_t lastByte = td->request.rangeByteEnd;
-  bool keepalive = false;
+  bool fastCopyAllowed;
+  bool keepalive;
   bool useChunks = false;
-  bool useModifiers = false;
   MemoryStream memStream (td->auxiliaryBuffer);
   FiltersChain chain;
-  size_t nbw;
   size_t nbr;
   time_t lastMT;
   string tmpTime;
@@ -293,8 +289,6 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
 
     bytesToSend = lastByte - firstByte;
 
-    keepalive = td->request.isKeepAlive ();
-
     td->buffer->setLength (0);
 
     /* If a Range was requested send 206 and not 200 for success.  */
@@ -317,72 +311,20 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
             td->response.other.put (e->name, e);
           }
       }
-    chain.setStream (&memStream);
-    if (td->mime)
-      {
-        HttpRequestHeader::Entry* e = td->request.other.get ("accept-encoding");
-        memStream.refresh ();
-        if (td->mime)
-          Server::getInstance ()->getFiltersFactory ()->chain (&chain,
-                                                               td->mime->filters,
-                                                               &memStream,
-                                                               &nbw, 0, false,
-                                                               e ? e->value : "");
-      }
 
-    useModifiers = chain.hasModifiersFilters ();
-    if (! useModifiers)
-      {
-        ostringstream buffer;
-        buffer << bytesToSend;
-        td->response.contentLength.assign (buffer.str ());
-      }
+    generateFiltersChain (td, Server::getInstance ()->getFiltersFactory (),
+                          chain, td->mime, memStream);
 
-    if (keepalive)
-      td->response.setValue ("connection", "keep-alive");
-    else
-      td->response.setValue ("connection", "close");
+    fastCopyAllowed = chain.isEmpty ()
+      && !(td->http->getProtocolOptions () & Protocol::SSL);
 
-    if (useModifiers)
-      {
-        string s;
-        HttpResponseHeader::Entry *e;
-        chain.getName (s);
-        e = td->response.other.get ("content-encoding");
+    checkDataChunks (td, &keepalive, &useChunks, fastCopyAllowed);
 
-        if (e)
-          e->value.assign (s);
-        else
-          {
-            e = new HttpResponseHeader::Entry ();
-            e->name.assign ("content-encoding");
-            e->value.assign (s);
-            td->response.other.put (e->name, e);
-          }
-        /* Do not use chunked transfer with old HTTP/1.0 clients.  */
-        if (keepalive)
-          useChunks = true;
-      }
-
-    if (useChunks)
+    if (! chain.hasModifiersFilters ())
       {
-        HttpResponseHeader::Entry *e;
-        e = td->response.other.get ("transfer-encoding");
-        if (e)
-          e->value.assign ("chunked");
-        else
-          {
-            e = new HttpResponseHeader::Entry ();
-            e->name.assign ("transfer-encoding");
-            e->value.assign ("chunked");
-            td->response.other.put (e->name, e);
-          }
-      }
-    else
-      {	HttpResponseHeader::Entry *e;
-        e = td->response.other.remove ("transfer-encoding");
-        if (e)
-          delete e;
+        ostringstream buffer;
+        buffer << bytesToSend;
+        td->response.contentLength.assign (buffer.str ());
       }
 
     HttpHeaders::sendHeader (td->response, *td->connection->socket,
@@ -404,8 +346,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
       Check if there are all the conditions to use a direct copy from the
       file to the socket.
     */
-    if (!useChunks && chain.isEmpty ()
-        && !(td->http->getProtocolOptions () & Protocol::SSL))
+    if (fastCopyAllowed)
       {
         size_t nbw = 0;
         file->fastCopyToSocket (td->connection->socket, firstByte,
@@ -433,7 +374,6 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
     for (;;)
       {
         size_t nbr;
-        size_t nbw;
 
         /* Check if there are other bytes to send.  */
         if (! bytesToSend)
diff --git a/myserver/src/protocol/http/http_data_handler.cpp b/myserver/src/protocol/http/http_data_handler.cpp
index 40c9245..9d2f1aa 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -167,14 +167,14 @@ HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
  */
 void
 HttpDataHandler::checkDataChunks (HttpThreadContext* td, bool* keepalive,
-                                  bool* useChunks)
+                                  bool* useChunks, bool disableEncoding)
 {
   *keepalive = td->request.isKeepAlive ();
   *useChunks = false;
 
   *keepalive &= !td->request.ver.compare ("HTTP/1.1");
 
-  if (*keepalive)
+  if (!disableEncoding && *keepalive)
     {
       HttpResponseHeader::Entry *e;
       e = td->response.other.get ("transfer-encoding");
@@ -262,3 +262,30 @@ HttpDataHandler::completeHTTPResponse (HttpThreadContext *td,
 
   return ret;
 }
+
+/*!
+  Populate a FiltersChain object ensuring desired filters are supported by the
+  client.
+ */
+size_t
+HttpDataHandler::generateFiltersChain (HttpThreadContext *td,
+                                       FiltersFactory *factory,
+                                       FiltersChain &fc,
+                                       MimeRecord *mime,
+                                       MemoryStream &memStream)
+{
+  size_t nbw;
+  HttpRequestHeader::Entry* e = td->request.other.get ("accept-encoding");
+  memStream.refresh ();
+  factory->chain (&fc, mime->filters, &memStream, &nbw, 0, false,
+                  e ? e->value : "");
+
+
+  if (fc.hasModifiersFilters ())
+    {
+      string filters;
+      fc.getName (filters);
+      td->response.setValue ("content-encoding", filters.c_str ());
+    }
+  return nbw;
+}

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

Summary of changes:
 myserver/include/protocol/http/http_data_handler.h |   10 ++-
 myserver/src/http_handler/http_file/http_file.cpp  |   84 +++-----------------
 myserver/src/protocol/http/http_data_handler.cpp   |   31 +++++++-
 3 files changed, 50 insertions(+), 75 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Fri Apr 22 14:12:00 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDKpk-00039b-07
	for mharc-myserver-commit@gnu.org; Fri, 22 Apr 2011 14:12:00 -0400
Received: from eggs.gnu.org ([140.186.70.92]:54889)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDKpf-000392-Sg
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 14:11:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDKpe-0006oY-0s
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 14:11:55 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:52471)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDKpd-0006nV-Rk
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 14:11:53 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QDKpd-0008H3-Cp
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 18:11:53 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QDKpc-0003PP-DI
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 18:11:53 +0000
Date: Fri, 22 Apr 2011 18:11:52 +0000
Message-Id: <E1QDKpc-0003PP-DI@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 1452a920039a2faa8f93796cc417434b96ff4361
X-Git-Newrev: f7999a90b39d964a5e3aa9f70cef8a6bae7ac69a
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-473-gf7999a9
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Apr 2011 18:11: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  f7999a90b39d964a5e3aa9f70cef8a6bae7ac69a (commit)
      from  1452a920039a2faa8f93796cc417434b96ff4361 (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 f7999a90b39d964a5e3aa9f70cef8a6bae7ac69a
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 22 19:35:29 2011 +0200

    Modify handlers to use new HttpHandler class facilities.

diff --git a/myserver/include/http_handler/cgi/cgi.h b/myserver/include/http_handler/cgi/cgi.h
index d357aab..99f920d 100644
--- a/myserver/include/http_handler/cgi/cgi.h
+++ b/myserver/include/http_handler/cgi/cgi.h
@@ -41,6 +41,6 @@ private:
                 Process& cgiProc, bool onlyHeader, bool nph);
   int sendHeader (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
                   Process& cgiProc, bool onlyHeader, bool nph, u_long procStartTime,
-                  bool keepalive, bool useChunks, int *ret);
+                  bool *useChunks, int *ret);
 };
 #endif
diff --git a/myserver/include/http_handler/isapi/isapi.h b/myserver/include/http_handler/isapi/isapi.h
index efd1c48..a8ba3c6 100644
--- a/myserver/include/http_handler/isapi/isapi.h
+++ b/myserver/include/http_handler/isapi/isapi.h
@@ -111,6 +111,8 @@ typedef struct _EXTENSION_CONTROL_BLOCK
 
 struct ConnTableRecord
 {
+  bool keepalive;
+  bool useChunks;
   FiltersChain chain;
   BOOL Allocated;
   bool onlyHeader;
diff --git a/myserver/src/http_handler/cgi/cgi.cpp b/myserver/src/http_handler/cgi/cgi.cpp
index 4c820cb..2f4c7ad 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -290,19 +290,15 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
   size_t nbw = 0;
   size_t nBytesRead = 0;
   u_long procStartTime;
-  bool useChunks = false;
-  bool keepalive = false;
   int ret = 0;
-
+  bool useChunks;
   /* Reset the auxiliaryBuffer length counter. */
   td->auxiliaryBuffer->setLength (0);
 
   procStartTime = getTicks ();
 
-  checkDataChunks (td, &keepalive, &useChunks);
-
   if (sendHeader (td, stdOutFile, chain, cgiProc, onlyHeader, nph,
-                  procStartTime, keepalive, useChunks, &ret))
+                  procStartTime, &useChunks, &ret))
     return ret;
 
   if (!nph && onlyHeader)
@@ -343,16 +339,15 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
         break;
 
       if (nBytesRead)
-      td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
+        td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                                   td->auxiliaryBuffer->getBuffer (),
                                                   nBytesRead,
                                                   chain,
                                                   useChunks);
     }
 
-  /* Send the last null chunk if needed.  */
-  if (useChunks && chain.getStream ()->write ("0\r\n\r\n", 5, &nbw))
-    return HttpDataHandler::RET_FAILURE;
+  MemoryStream memStream (td->auxiliaryBuffer);
+  td->sentData += completeHTTPResponse (td, memStream, chain, useChunks);
 
   return HttpDataHandler::RET_OK;
 }
@@ -361,10 +356,9 @@ 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, bool onlyHeader, bool nph,
-                     u_long procStartTime, bool keepalive, bool useChunks,
-                     int *ret)
+int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile,
+                     FiltersChain &chain, Process &cgiProc, bool onlyHeader,
+                     bool nph, u_long procStartTime, bool *useChunks, int *ret)
 {
   u_long headerSize = 0;
   bool headerCompleted = false;
@@ -443,15 +437,14 @@ int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile, FiltersChain &chai
   /* Send the header.  */
   if (!nph)
     {
-      if (keepalive)
-        td->response.setValue ("Connection", "keep-alive");
-
       /* Send the header.  */
       if (headerSize)
         HttpHeaders::buildHTTPResponseHeaderStruct (td->auxiliaryBuffer->getBuffer (),
                                                     &td->response,
                                                     &(td->nBytesToRead));
         {
+          bool keepalive = false;
+
           string* location = td->response.getValue ("Location", NULL);
 
           /* If it is present "Location: foo" in the header then send a redirect
@@ -462,6 +455,7 @@ int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile, FiltersChain &chai
               return 1;
             }
 
+          checkDataChunks (td, &keepalive, useChunks);
           HttpHeaders::sendHeader (td->response, *chain.getStream (),
                                    *td->buffer, td);
         }
diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index 407cf11..1d3d109 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -77,9 +77,6 @@ int FastCgi::send (HttpThreadContext* td, const char* scriptpath,
   string moreArg;
   bool responseCompleted = false;
 
-  con.useChunks = false;
-  con.keepalive = false;
-
   con.td = td;
   con.headerSent = false;
 
@@ -205,7 +202,6 @@ int FastCgi::send (HttpThreadContext* td, const char* scriptpath,
       initialTicks = getTicks ();
 
       td->buffer->setLength (0);
-      checkDataChunks (td, &con.keepalive, &con.useChunks);
 
       do
         {
@@ -287,9 +283,8 @@ int FastCgi::send (HttpThreadContext* td, const char* scriptpath,
         }
       while (! exit);
 
-      /* Send the last null chunk if needed.  */
-      if (!responseCompleted && con.useChunks && !onlyHeader)
-        chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
+      MemoryStream memStream (td->auxiliaryBuffer);
+      td->sentData += completeHTTPResponse (td, memStream, chain, con.useChunks);
 
       chain.clearAllFilters ();
       con.sock.close ();
@@ -695,6 +690,7 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain* chain, bool* response
         }
     }
 
+  checkDataChunks (con->td, &con->keepalive, &con->useChunks);
   if (HttpHeaders::sendHeader (con->td->response, *con->td->connection->socket,
                                *con->td->auxiliaryBuffer, con->td))
     {
diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp b/myserver/src/http_handler/http_dir/http_dir.cpp
index 9d1e801..8aa34f7 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -325,10 +325,8 @@ int HttpDir::send (HttpThreadContext* td,
   ReadDirectory fd;
   FiltersChain chain;
   int lastSlash = 0;
-  bool useChunks = false;
   char* bufferloop;
   const char* cssFile;
-  bool keepalive = false;
   vector<HttpDir::FileStruct> files;
   size_t sortIndex;
   char sortType = 0;
@@ -362,8 +360,6 @@ int HttpDir::send (HttpThreadContext* td,
 
       lastSlash = td->request.uri.rfind ('/') + 1;
 
-      checkDataChunks (td, &keepalive, &useChunks);
-
       td->response.setValue ("content-type", "text/html");
 
       ignPattern = td->securityToken.getData ("http.dir.ignore",
@@ -384,6 +380,9 @@ int HttpDir::send (HttpThreadContext* td,
             }
         }
 
+      bool keepalive = false;
+      bool useChunks = false;
+      checkDataChunks (td, &keepalive, &useChunks);
       HttpHeaders::sendHeader (td->response, *td->connection->socket,
                                *td->buffer, td);
 
@@ -598,8 +597,8 @@ int HttpDir::send (HttpThreadContext* td,
         if (*bufferloop == '\\')
           *bufferloop = '/';
 
-      if (useChunks)
-        chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
+      MemoryStream memStream (td->auxiliaryBuffer);
+      td->sentData += completeHTTPResponse (td, memStream, chain, useChunks);
     }
   catch (exception & e)
     {
diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 42ea59e..faa3561 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -318,8 +318,6 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
     fastCopyAllowed = chain.isEmpty ()
       && !(td->http->getProtocolOptions () & Protocol::SSL);
 
-    checkDataChunks (td, &keepalive, &useChunks, fastCopyAllowed);
-
     if (! chain.hasModifiersFilters ())
       {
         ostringstream buffer;
@@ -327,6 +325,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
         td->response.contentLength.assign (buffer.str ());
       }
 
+    checkDataChunks (td, &keepalive, &useChunks, fastCopyAllowed);
     HttpHeaders::sendHeader (td->response, *td->connection->socket,
                              *td->buffer, td);
 
diff --git a/myserver/src/http_handler/isapi/isapi.cpp b/myserver/src/http_handler/isapi/isapi.cpp
index d14e5ea..cd0ec98 100644
--- a/myserver/src/http_handler/isapi/isapi.cpp
+++ b/myserver/src/http_handler/isapi/isapi.cpp
@@ -65,20 +65,14 @@ 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->cchMatchingPath=(DWORD)strlen (mapInfo->lpszPath);
+      mapInfo->cchMatchingURL = (DWORD) strlen ((char*) lpvBuffer);
+      mapInfo->cchMatchingPath = (DWORD) strlen (mapInfo->lpszPath);
       delete [] mapInfo->lpszPath;
       mapInfo->lpszPath = new char[tmp.length () + 1];
-      if (mapInfo->lpszPath == 0)
-        if (buffer==0)
-          {
-            SetLastError (ERROR_INSUFFICIENT_BUFFER);
-            return 0;
-          }
       strcpy (mapInfo->lpszPath, tmp.c_str ());
       mapInfo->dwFlags = HSE_URL_FLAGS_WRITE | HSE_URL_FLAGS_SCRIPT
         | HSE_URL_FLAGS_EXECUTE;
@@ -86,7 +80,7 @@ BOOL WINAPI ISAPI_ServerSupportFunctionExport (HCONN hConn, DWORD dwHSERRequest,
 
     case HSE_REQ_MAP_URL_TO_PATH:
       if (((char*) lpvBuffer)[0])
-        strcpy (uri,(char*) lpvBuffer);
+        strcpy (uri, (char*) lpvBuffer);
       else
         lstrcpyn (uri,ConnInfo->td->request.uri.c_str (),
                  (int) ConnInfo->td->request.uri.length ()
@@ -133,15 +127,15 @@ BOOL WINAPI ISAPI_ServerSupportFunctionExport (HCONN hConn, DWORD dwHSERRequest,
       break;
 
     case HSE_REQ_DONE_WITH_SESSION:
-      ConnInfo->td->response.httpStatus=*(DWORD*)lpvBuffer;
+      ConnInfo->td->response.httpStatus = *(DWORD*) lpvBuffer;
       SetEvent (ConnInfo->ISAPIDoneEvent);
       break;
 
     case HSE_REQ_IS_KEEP_CONN:
       if (ConnInfo->td->request.isKeepAlive ())
-        *((BOOL*)lpvBuffer)=1;
+        *((BOOL*)lpvBuffer) = 1;
       else
-        *((BOOL*)lpvBuffer)=0;
+        *((BOOL*)lpvBuffer) = 0;
       break;
 
     default:
@@ -204,11 +198,9 @@ int Isapi::SendHeader (HttpThreadContext* td,ConnectionPtr a,char *data)
 BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwBytes,
                                     DWORD /*!dwReserved*/)
 {
-  int keepalive;
   char* buffer;
   ConnTableRecord *ConnInfo;
-  char chunkSize[15];
-  size_t nbw=0;
+  size_t nbw = 0;
 
   if (*lpdwBytes == 0)
     return HttpDataHandler::RET_FAILURE;
@@ -228,14 +220,13 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
     ((Vhost*)(ConnInfo->td->connection->host))->warningsLogWrite (_("ISAPI: internal error"));
     return HttpDataHandler::RET_FAILURE;
   }
-  keepalive = connection && (!strcasecmp (connection->value.c_str (), "keep-alive")) ;
 
   /*If the HTTP header was sent do not send it again. */
   if (!ConnInfo->headerSent)
     {
       int headerSize = 0;
       u_long size = (u_long) strlen (buffer);
-      strncat (buffer, (char*)Buffer, *lpdwBytes);
+      strncat (buffer, (char *) Buffer, *lpdwBytes);
       ConnInfo->headerSize += *lpdwBytes;
       if (buffer[0] == '\r')
         {
@@ -266,103 +257,61 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
                 }
             }
         }
-      /*!
-       *Handle the HTTP header if exists.
+      /*
+        Handle the HTTP header if exists.
        */
       if (! headerSize)
         nbw = *lpdwBytes;
       else
         {
-          int len = ConnInfo->headerSize-headerSize;
+          int len = ConnInfo->headerSize - headerSize;
 
           HttpHeaders::buildHTTPResponseHeaderStruct
             (ConnInfo->td->buffer->getBuffer (), &ConnInfo->td->response,
              &(ConnInfo->td->nBytesToRead));
 
-          if (keepalive)
-            {
-              HttpResponseHeader::Entry *e;
-              e = ConnInfo->td->response.other.get ("transfer-encoding");
-              if (e)
-                e->value.assign ("chunked");
-              else
-                {
-                  e = new HttpResponseHeader::Entry ();
-                  e->name.assign ("transfer-encoding");
-                  e->value.assign ("chunked");
-                  ConnInfo->td->response.other.put (e->name, e);
-                }
-            }
-          else
-            ConnInfo->td->response.setValue ("connection", "Close");
-
+          HttpDataHandler::checkDataChunks (ConnInfo->td, &ConnInfo->keepalive,
+                                            &ConnInfo->useChunks);
           if (HttpHeaders::sendHeader (ConnInfo->td->response,
                                        *ConnInfo->td->connection->socket,
                                        *ConnInfo->td->auxiliaryBuffer,
                                        ConnInfo->td))
             return HttpDataHandler::RET_FAILURE;
-          /*! Save the headerSent status. */
-          ConnInfo->headerSent=1;
 
-          /*! If only the header was requested return. */
+          /* Save the headerSent status.  */
+          ConnInfo->headerSent = 1;
+
+          /* If only the header was requested return.  */
           if (ConnInfo->headerSent && ConnInfo->onlyHeader
               || ConnInfo->td->response.getStatusType ()
               == HttpResponseHeader::SUCCESSFUL)
             return 0;
 
-          /*!Send the first chunk. */
+          size_t written = 0;
           if (len)
-            {
-              /*! With keep-alive connections use chunks.*/
-              if (keepalive)
-                {
-                  sprintf (chunkSize, "%x\r\n", len);
-                  if (ConnInfo->chain.getStream ()->write (chunkSize,
-                                                           (int) strlen (chunkSize), &nbw))
-                    return HttpDataHandler::RET_FAILURE;
-                }
-
-              if (ConnInfo->chain.write ((char*)(buffer + headerSize),
-                                         len, &nbw))
-                return HttpDataHandler::RET_FAILURE;
-              ConnInfo->dataSent += nbw;
-
-              /*! Send the chunk footer.  */
-              if (keepalive)
-                {
-                  if (ConnInfo->chain.getStream ()->write ("\r\n", 2, &nbw))
-                    return HttpDataHandler::RET_FAILURE;
-                }
-            }
+            written =
+              HttpDataHandler::appendDataToHTTPChannel (ConnInfo->td,
+                                                        buffer + headerSize,
+                                                        len,
+                                                        ConnInfo->chain,
+                                                        ConnInfo->useChunks);
+          ConnInfo->td->sentData += written;
+
+          *lpdwBytes = written;
         }
     }
-  else/*!Continue to send data chunks*/
+  else
     {
-      if (keepalive)
-        {
-          sprintf (chunkSize, "%x\r\n", *lpdwBytes);
-          nbw = ConnInfo->connection->socket->send (chunkSize,
-                                                    (int) strlen (chunkSize), 0);
-          if ((nbw == (size_t) -1) || (! nbw))
-            return HttpDataHandler::RET_FAILURE;
-        }
-
-      if (ConnInfo->chain.write ((char*)Buffer,*lpdwBytes, &nbw))
-        return HttpDataHandler::RET_FAILURE;
-      ConnInfo->dataSent += nbw;
-
-      if (keepalive)
-        {
-          nbw = ConnInfo->connection->socket->send ("\r\n", 2, 0);
-          if ((nbw == (size_t)-1) || (!nbw))
-            return HttpDataHandler::RET_FAILURE;
-        }
+      size_t written =
+        HttpDataHandler::appendDataToHTTPChannel (ConnInfo->td,
+                                                  (const char *) Buffer,
+                                                  *lpdwBytes,
+                                                  ConnInfo->chain,
+                                                  ConnInfo->useChunks);
+      ConnInfo->td->sentData += written;
+      *lpdwBytes = written;
     }
 
-  *lpdwBytes = nbw;
-
-  ConnInfo->td->sentData += ConnInfo->dataSent;
-
   return HttpDataHandler::RET_OK;
 }
 
@@ -389,12 +338,11 @@ BOOL WINAPI ISAPI_ReadClientExport (HCONN hConn, LPVOID lpvBuffer,
 
   if (ConnInfo == NULL)
     {
-      ((Vhost*)(ConnInfo->td->connection->host))->warningsLogWrite
-        (_("ISAPI: internal error"));
+      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 < 0)
     {
@@ -878,8 +826,10 @@ int Isapi::send (HttpThreadContext* td,
       HttpRequestHeader::Entry *connection
         = connTable[connIndex].td->request.other.get ("connection");
 
-      if (connection && !strcasecmp (connection->value.c_str (), "keep-alive"))
-        connTable[connIndex].chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
+      MemoryStream memStream (td->auxiliaryBuffer);
+      td->sentData += completeHTTPResponse (td, memStream,
+                                            connTable[connIndex].chain,
+                                            connTable[connIndex].useChunks);
 
       switch (ret)
         {
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp b/myserver/src/http_handler/mscgi/mscgi.cpp
index 9d0f9ff..7680dc5 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -74,8 +74,6 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
   data.error = false;
   data.filtersChain = &chain;
   data.headerSent = false;
-  data.keepAlive = false;
-  data.useChunks = false;
 
   if (!(td->permissions & MYSERVER_PERMISSION_EXECUTE))
     return td->http->sendAuth ();
@@ -103,7 +101,6 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
                                                              td->connection->socket,
                                                              &nbw, 1);
 
-      checkDataChunks (td, &(data.keepAlive), &(data.useChunks));
       try
         {
           hinstLib.loadLibrary (exec, 0);
@@ -135,8 +132,8 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
           return td->http->raiseHTTPError (data.errorPage);
         }
 
-      if (data.useChunks && !data.error)
-        chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
+      MemoryStream memStream (td->auxiliaryBuffer);
+      td->sentData += completeHTTPResponse (td, memStream, chain, data.useChunks);
 
       if (!data.error)
         return HttpDataHandler::RET_FAILURE;
@@ -161,6 +158,7 @@ int MsCgi::write (const char* data, size_t len, MsCgiData* mcd)
   if (mcd->error)
     return 1;
 
+  checkDataChunks (mcd->td, &mcd->keepAlive, &mcd->useChunks);
   if (!mcd->headerSent && sendHeader (mcd))
     return 1;
 
diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index 03e382d..0c95fb8 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -215,17 +215,8 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
 
   /* At this point we can modify the response struct before send it to the
      client.  */
-  checkDataChunks (td, &keepalive, &useChunks);
-  if (td->response.contentLength.length ())
-    useChunks = false;
-
-  td->response.setValue ("Connection", keepalive ? "keep-alive" : "close");
-
-  if (useChunks)
-    td->response.setValue ("Transfer-encoding", "chunked");
-  else
-    td->response.clearValue ("Transfer-encoding");
 
+  checkDataChunks (td, &keepalive, &useChunks, td->response.contentLength.length ());
   u_long hdrLen = HttpHeaders::buildHTTPResponseHeader (td->buffer->getBuffer (),
                                                         &td->response);
 
@@ -345,8 +336,9 @@ int Proxy::readPayLoad (HttpThreadContext* td,
             break;
         }
     }
-  if (useChunks)
-    out->getStream ()->write ("0\r\n\r\n", 5, &nbw);
+
+  MemoryStream memStream (td->auxiliaryBuffer);
+  td->sentData += completeHTTPResponse (td, memStream, *out, useChunks);
 
   return HttpDataHandler::RET_OK;
 }
diff --git a/myserver/src/http_handler/scgi/scgi.cpp b/myserver/src/http_handler/scgi/scgi.cpp
index a7d1e06..009d006 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -218,8 +218,6 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
   size_t nbw, nbr;
   HttpThreadContext* td = ctx->td;
 
-  checkDataChunks (td, &keepalive, &useChunks);
-
   for (;;)
     {
       while (!ctx->sock.bytesToRead ())
@@ -259,6 +257,7 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
                                                 &td->response,
                                                 &(td->nBytesToRead));
 
+  checkDataChunks (td, &keepalive, &useChunks);
   HttpHeaders::sendHeader (td->response, *td->connection->socket,
                            *td->auxiliaryBuffer, td);
 
@@ -286,8 +285,8 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
                                      nbr, *chain, useChunks);
         }
 
-      if (useChunks)
-        chain->getStream ()->write ("0\r\n\r\n", 5, &nbw);
+      MemoryStream memStream (td->auxiliaryBuffer);
+      td->sentData += completeHTTPResponse (td, memStream, *chain, useChunks);
     }
 
   return HttpDataHandler::RET_OK;
diff --git a/myserver/src/http_handler/wincgi/wincgi.cpp b/myserver/src/http_handler/wincgi/wincgi.cpp
index e96b278..00da485 100644
--- a/myserver/src/http_handler/wincgi/wincgi.cpp
+++ b/myserver/src/http_handler/wincgi/wincgi.cpp
@@ -28,6 +28,7 @@
 #include <include/base/string/stringutils.h>
 #include <include/filter/filters_chain.h>
 #include <include/base/safetime/safetime.h>
+#include <include/filter/filters_chain.h>
 
 #ifdef WIN32
 # include <direct.h>
@@ -64,6 +65,7 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
                   const char *cgipath, bool /*execute*/, bool onlyHeader)
 {
 #ifdef WIN32
+  bool keepalive, useChunks;
   FiltersChain chain;
   Process proc;
   size_t nbr;
@@ -295,11 +297,7 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
 
       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 ());
+      checkDataChunks (td, &keepalive, &useChunks);
       HttpHeaders::sendHeader (td->response, *chain.getStream (),
                                *td->buffer, td);
 
@@ -312,10 +310,11 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
           return HttpDataHandler::RET_OK;
         }
 
-      size_t written;
-      chain.write ((char*)(buffer + headerSize), nBytesRead - headerSize,
-                   &written);
-      td->dataSent += written;
+      td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
+                                                                buffer + headerSize,
+                                                                nBytesRead - headerSize,
+                                                                chain, useChunks);
+
 
       if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
         {
@@ -327,12 +326,19 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
               if (! nBytesRead)
                 break;
 
-              chain.write ((char*) buffer, nBytesRead, &nbw);
+              td->sentData +=
+                HttpDataHandler::appendDataToHTTPChannel (td, buffer,
+                                                          nBytesRead, chain,
+                                                          useChunks);
+
               td->sentData += nbw;
             }
           while (nBytesRead);
         }
 
+      MemoryStream memStream (td->auxiliaryBuffer);
+      td->sentData += completeHTTPResponse (td, memStream, chain, useChunks);
+
       chain.clearAllFilters ();
       OutFileHandle.close ();
       FilesUtility::deleteFile (outFilePath);
diff --git a/myserver/src/protocol/http/webdav/webdav.cpp b/myserver/src/protocol/http/webdav/webdav.cpp
index dbacd61..cd1d422 100644
--- a/myserver/src/protocol/http/webdav/webdav.cpp
+++ b/myserver/src/protocol/http/webdav/webdav.cpp
@@ -302,12 +302,9 @@ int WebDAV::propfind (HttpThreadContext* td)
 
       ff->chain (&chain, filters, td->connection->socket, &nbw, 1);
 
-      HttpDataHandler::checkDataChunks (td, &keepalive, &useChunks);
       td->response.httpStatus = 207;
-      if (keepalive)
-        td->response.setValue ("connection", "keep-alive");
-      else
-        td->response.setValue ("connection", "close");
+
+      HttpDataHandler::checkDataChunks (td, &keepalive, &useChunks);
       HttpHeaders::sendHeader (td->response, *chain.getStream (), *td->buffer, td);
 
       /* Determine the Depth.  */
@@ -342,8 +339,9 @@ int WebDAV::propfind (HttpThreadContext* td)
             break;
         }
 
-      if (useChunks)
-        chain.getStream ()->write ("0\r\n\r\n", 5, &nbw2);
+      MemoryStream memStream (td->auxiliaryBuffer);
+      td->sentData += HttpDataHandler::completeHTTPResponse (td, memStream,
+                                                             chain, useChunks);
 
       return HttpDataHandler::RET_OK;
     }
@@ -619,18 +617,9 @@ int WebDAV::lock (HttpThreadContext* td)
 
       ff->chain (&chain, filters, td->connection->socket, &nbw, 1);
 
-      HttpDataHandler::checkDataChunks (td, &keepalive, &useChunks);
       td->response.httpStatus = 201;
 
-      if (keepalive)
-        td->response.setValue ("connection", "keep-alive");
-      else
-        td->response.setValue ("connection", "close");
-
-        td->response.setValue ("Lock-Token", urn);
-
-        td->response.setValue ("Content-Type", "text/xml");
-
+      HttpDataHandler::checkDataChunks (td, &keepalive, &useChunks);
       HttpHeaders::sendHeader (td->response, *chain.getStream (), *td->buffer, td);
 
       string lc = "http://" + *td->request.getValue ("Host", NULL) + td->request.uri;

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

Summary of changes:
 myserver/include/http_handler/cgi/cgi.h           |    2 +-
 myserver/include/http_handler/isapi/isapi.h       |    2 +
 myserver/src/http_handler/cgi/cgi.cpp             |   28 ++---
 myserver/src/http_handler/fastcgi/fastcgi.cpp     |   10 +-
 myserver/src/http_handler/http_dir/http_dir.cpp   |   11 +-
 myserver/src/http_handler/http_file/http_file.cpp |    3 +-
 myserver/src/http_handler/isapi/isapi.cpp         |  136 +++++++--------------
 myserver/src/http_handler/mscgi/mscgi.cpp         |    8 +-
 myserver/src/http_handler/proxy/proxy.cpp         |   16 +--
 myserver/src/http_handler/scgi/scgi.cpp           |    7 +-
 myserver/src/http_handler/wincgi/wincgi.cpp       |   26 +++--
 myserver/src/protocol/http/webdav/webdav.cpp      |   23 +---
 12 files changed, 98 insertions(+), 174 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Fri Apr 22 14:12:25 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDKq9-0003A1-Cb
	for mharc-myserver-commit@gnu.org; Fri, 22 Apr 2011 14:12:25 -0400
Received: from eggs.gnu.org ([140.186.70.92]:54940)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDKq6-00039v-FV
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 14:12:23 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDKq5-0006qE-Dh
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 14:12:22 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:52472)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDKq5-0006qA-At
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 14:12:21 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QDKq5-0008H6-6l
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 18:12:21 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QDKq4-0003Un-UG
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 18:12:21 +0000
Date: Fri, 22 Apr 2011 18:12:21 +0000
Message-Id: <E1QDKq4-0003Un-UG@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: f7999a90b39d964a5e3aa9f70cef8a6bae7ac69a
X-Git-Newrev: b7b4bdb78b7b6b366b96cfef71c4a5fbc378ef1d
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-474-gb7b4bdb
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Apr 2011 18:12: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  b7b4bdb78b7b6b366b96cfef71c4a5fbc378ef1d (commit)
      from  f7999a90b39d964a5e3aa9f70cef8a6bae7ac69a (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 b7b4bdb78b7b6b366b96cfef71c4a5fbc378ef1d
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 22 20:12:19 2011 +0200

    Fix a segfault when a MIME type is not found.

diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index faa3561..df22552 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -363,9 +363,6 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
 
     file->seek (firstByte);
 
-    chain.setStream (td->connection->socket);
-
-
     td->sentData += HttpDataHandler::beginHTTPResponse (td, memStream, chain,
                                                         useChunks);
 
diff --git a/myserver/src/protocol/http/http_data_handler.cpp b/myserver/src/protocol/http/http_data_handler.cpp
index 9d2f1aa..cd6cb70 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -274,12 +274,13 @@ HttpDataHandler::generateFiltersChain (HttpThreadContext *td,
                                        MimeRecord *mime,
                                        MemoryStream &memStream)
 {
-  size_t nbw;
+  size_t nbw = 0;
   HttpRequestHeader::Entry* e = td->request.other.get ("accept-encoding");
   memStream.refresh ();
-  factory->chain (&fc, mime->filters, &memStream, &nbw, 0, false,
-                  e ? e->value : "");
 
+  if (mime)
+    factory->chain (&fc, mime->filters, &memStream, &nbw, 0, false,
+                    e ? e->value : "");
 
   if (fc.hasModifiersFilters ())
     {
@@ -287,5 +288,7 @@ HttpDataHandler::generateFiltersChain (HttpThreadContext *td,
       fc.getName (filters);
       td->response.setValue ("content-encoding", filters.c_str ());
     }
+
+  fc.setStream (td->connection->socket);
   return nbw;
 }

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

Summary of changes:
 myserver/src/http_handler/http_file/http_file.cpp |    3 ---
 myserver/src/protocol/http/http_data_handler.cpp  |    9 ++++++---
 2 files changed, 6 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Fri Apr 22 15:53:57 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDMQP-0004RV-Az
	for mharc-myserver-commit@gnu.org; Fri, 22 Apr 2011 15:53:57 -0400
Received: from eggs.gnu.org ([140.186.70.92]:42128)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDMQM-0004Pb-SC
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 15:53:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDMQM-0003eK-2F
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 15:53:54 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:43360)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDMQL-0003eF-Vf
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 15:53:54 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QDMQL-0000zc-MC
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 19:53:53 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QDMQL-0007gk-Cg
	for myserver-commit@gnu.org; Fri, 22 Apr 2011 19:53:53 +0000
Date: Fri, 22 Apr 2011 19:53:53 +0000
Message-Id: <E1QDMQL-0007gk-Cg@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: b7b4bdb78b7b6b366b96cfef71c4a5fbc378ef1d
X-Git-Newrev: 93f9942d7e8750eb195d1f2aba9a4a14434de87d
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-475-g93f9942
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Apr 2011 19:53:55 -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  93f9942d7e8750eb195d1f2aba9a4a14434de87d (commit)
      from  b7b4bdb78b7b6b366b96cfef71c4a5fbc378ef1d (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 93f9942d7e8750eb195d1f2aba9a4a14434de87d
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Fri Apr 22 21:53:53 2011 +0200

    Proxy: use HttpHeaders::sendHeader.

diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index 0c95fb8..f32e489 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -216,11 +216,9 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
   /* At this point we can modify the response struct before send it to the
      client.  */
 
-  checkDataChunks (td, &keepalive, &useChunks, td->response.contentLength.length ());
-  u_long hdrLen = HttpHeaders::buildHTTPResponseHeader (td->buffer->getBuffer (),
-                                                        &td->response);
-
-  out.getStream ()->write (td->buffer->getBuffer (), hdrLen, &nbw);
+  checkDataChunks (td, &keepalive, &useChunks,
+                   td->response.contentLength.length ());
+  HttpHeaders::sendHeader (td->response, *out.getStream (), *td->buffer, td);
 
   if (onlyHeader)
     return HttpDataHandler::RET_OK;

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

Summary of changes:
 myserver/src/http_handler/proxy/proxy.cpp |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Sat Apr 23 06:00:56 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDZe4-0006ER-8F
	for mharc-myserver-commit@gnu.org; Sat, 23 Apr 2011 06:00:56 -0400
Received: from eggs.gnu.org ([140.186.70.92]:52846)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDZdz-0006Dq-7z
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 06:00:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDZdw-00066P-EM
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 06:00:51 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:54845)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDZdw-00066L-AA
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 06:00:48 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QDZdv-0002D1-QT
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 10:00:48 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QDZdu-0004wC-D7
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 10:00:47 +0000
Date: Sat, 23 Apr 2011 10:00:46 +0000
Message-Id: <E1QDZdu-0004wC-D7@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 93f9942d7e8750eb195d1f2aba9a4a14434de87d
X-Git-Newrev: 8af71c1b0231109176948f0316c0103304610937
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-478-g8af71c1
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 23 Apr 2011 10:00:54 -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  8af71c1b0231109176948f0316c0103304610937 (commit)
       via  a90a48d661f75a63619d8e64637cc0af3f0dc94e (commit)
       via  8ea8f246c29f869dd7055e1fc854838f73b43fd2 (commit)
      from  93f9942d7e8750eb195d1f2aba9a4a14434de87d (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 8af71c1b0231109176948f0316c0103304610937
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 23 12:00:16 2011 +0200

    Simplify HttpDataHandler::appendDataToHTTPChannel.

diff --git a/myserver/include/protocol/http/http_data_handler.h b/myserver/include/protocol/http/http_data_handler.h
index b91adc9..242d996 100644
--- a/myserver/include/protocol/http/http_data_handler.h
+++ b/myserver/include/protocol/http/http_data_handler.h
@@ -59,15 +59,13 @@ public:
                                          const char *buffer,
                                          size_t size,
                                          FiltersChain &chain,
-                                         bool useChunks,
                                          size_t realBufferSize,
                                          MemoryStream &tmpStream);
 
   static size_t appendDataToHTTPChannel (HttpThreadContext* td,
                                          const char *buffer,
                                          size_t size,
-                                         FiltersChain &chain,
-                                         bool useChunks);
+                                         FiltersChain &chain);
 
   static size_t beginHTTPResponse (HttpThreadContext *td,
                                    MemoryStream &memStream,
diff --git a/myserver/src/http_handler/cgi/cgi.cpp b/myserver/src/http_handler/cgi/cgi.cpp
index a86ca88..6e1c1dd 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -341,8 +341,7 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
         td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                                   td->auxiliaryBuffer->getBuffer (),
                                                   nBytesRead,
-                                                  chain,
-                                                  td->useChunks);
+                                                  chain);
     }
 
   MemoryStream memStream (td->auxiliaryBuffer);
@@ -464,8 +463,7 @@ int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile,
       td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                td->auxiliaryBuffer->getBuffer () + headerSize,
                                                     headerOffset - headerSize,
-                                                    chain,
-                                                    td->useChunks);
+                                                    chain);
     }
 
   return 0;
diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index 9db2c31..2f0c780 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -620,7 +620,7 @@ int FastCgi::sendData (FcgiContext* con, u_long dim, u_long timeout,
     HttpDataHandler::appendDataToHTTPChannel (con->td,
                                               con->td->buffer->getBuffer (),
                                               con->td->buffer->getLength (),
-                                              *chain, con->td->useChunks);
+                                              *chain);
   return 0;
 }
 
@@ -706,8 +706,7 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain* chain, bool* response
       size_t nbw = HttpDataHandler::appendDataToHTTPChannel (con->td,
                                                 con->td->buffer->getBuffer () + headerSize,
                                                 size - headerSize,
-                                                *chain,
-                                                con->td->useChunks);
+                                                *chain);
       con->td->sentData += nbw;
     }
 
diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp b/myserver/src/http_handler/http_dir/http_dir.cpp
index f8eb42e..7b59047 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -435,7 +435,7 @@ int HttpDir::send (HttpThreadContext* td,
 
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                            td->auxiliaryBuffer->getLength (),
-                                           chain, td->useChunks);
+                                           chain);
 
       filename = directory;
       td->auxiliaryBuffer->setLength (0);
@@ -450,7 +450,7 @@ int HttpDir::send (HttpThreadContext* td,
 
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                            td->auxiliaryBuffer->getLength (),
-                                           chain, td->useChunks);
+                                           chain);
 
       fd.findfirst (filename.c_str ());
 
@@ -465,7 +465,7 @@ int HttpDir::send (HttpThreadContext* td,
 
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                                td->auxiliaryBuffer->getLength (),
-                                               chain, td->useChunks);
+                                               chain);
       td->auxiliaryBuffer->setLength (0);
 
       if (FilesUtility::getPathRecursionLevel (td->request.uri) >= 1)
@@ -501,7 +501,7 @@ int HttpDir::send (HttpThreadContext* td,
 
           td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                                    td->auxiliaryBuffer->getLength (),
-                                                   chain, td->useChunks);
+                                                   chain);
         }
 
       /* Put all files in a vector.  */
@@ -562,7 +562,7 @@ int HttpDir::send (HttpThreadContext* td,
           generateElement (*td->auxiliaryBuffer, file, linkPrefix, formatString);
           td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                                    td->auxiliaryBuffer->getLength (),
-                                                   chain, td->useChunks);
+                                                   chain);
         }
 
       td->auxiliaryBuffer->setLength (0);
@@ -586,7 +586,7 @@ int HttpDir::send (HttpThreadContext* td,
       *td->auxiliaryBuffer << "</address>\r\n</body>\r\n</html>\r\n";
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                                td->auxiliaryBuffer->getLength (),
-                                               chain, td->useChunks);
+                                               chain);
 
       *td->auxiliaryBuffer << end_str;
       /* Changes the \ character in the / character.  */
diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 5055e4a..833e9c1 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -387,7 +387,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
             bytesToSend -= nbr;
 
             td->sentData += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                     nbr, chain, td->useChunks,
+                                                     nbr, chain,
                                                      td->buffer->getRealLength (),
                                                      memStream);
           }
diff --git a/myserver/src/http_handler/isapi/isapi.cpp b/myserver/src/http_handler/isapi/isapi.cpp
index c33b8c5..4435b99 100644
--- a/myserver/src/http_handler/isapi/isapi.cpp
+++ b/myserver/src/http_handler/isapi/isapi.cpp
@@ -292,8 +292,7 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
               HttpDataHandler::appendDataToHTTPChannel (ConnInfo->td,
                                                         buffer + headerSize,
                                                         len,
-                                                        ConnInfo->chain,
-                                                        ConnInfo->td->useChunks);
+                                                        ConnInfo->chain);
           ConnInfo->td->sentData += written;
 
           *lpdwBytes = written;
@@ -305,8 +304,7 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
         HttpDataHandler::appendDataToHTTPChannel (ConnInfo->td,
                                                   (const char *) Buffer,
                                                   *lpdwBytes,
-                                                  ConnInfo->chain,
-                                                  ConnInfo->td->useChunks);
+                                                  ConnInfo->chain);
       ConnInfo->td->sentData += written;
       *lpdwBytes = written;
     }
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp b/myserver/src/http_handler/mscgi/mscgi.cpp
index 84e211c..885cbe3 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -167,8 +167,7 @@ int MsCgi::write (const char* data, size_t len, MsCgiData* mcd)
   mcd->td->sentData +=
     HttpDataHandler::appendDataToHTTPChannel (mcd->td,
                                               data, len,
-                                              *mcd->filtersChain,
-                                              mcd->td->useChunks);
+                                              *mcd->filtersChain);
   return 0;
 }
 
diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index 3104283..f305c8f 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -296,7 +296,7 @@ int Proxy::readPayLoad (HttpThreadContext* td,
 
               td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                                        td->buffer->getBuffer (),
-                                                       nbr, *out, useChunks);
+                                                       nbr, *out);
             }
         }
     }
@@ -326,7 +326,7 @@ int Proxy::readPayLoad (HttpThreadContext* td,
             length -= nbr;
 
           td->sentData += HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                    nbr, *out, useChunks);
+                                                    nbr, *out);
           if (timedOut || contentLength && length == 0)
             break;
         }
diff --git a/myserver/src/http_handler/scgi/scgi.cpp b/myserver/src/http_handler/scgi/scgi.cpp
index 5359acd..90569e8 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -265,7 +265,7 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
   if (read - headerSize)
     td->sentData +=
       appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer () + headerSize,
-                             read - headerSize, *chain, td->useChunks);
+                               read - headerSize, *chain);
 
   if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
     {
@@ -280,7 +280,7 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
 
           td->sentData +=
             appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                     nbr, *chain, td->useChunks);
+                                     nbr, *chain);
         }
 
       MemoryStream memStream (td->auxiliaryBuffer);
diff --git a/myserver/src/http_handler/wincgi/wincgi.cpp b/myserver/src/http_handler/wincgi/wincgi.cpp
index e8b977e..dc0eaef 100644
--- a/myserver/src/http_handler/wincgi/wincgi.cpp
+++ b/myserver/src/http_handler/wincgi/wincgi.cpp
@@ -309,7 +309,7 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
       td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                                                 buffer + headerSize,
                                                                 nBytesRead - headerSize,
-                                                                chain, td->useChunks);
+                                                                chain);
 
 
       if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
@@ -324,8 +324,7 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
 
               td->sentData +=
                 HttpDataHandler::appendDataToHTTPChannel (td, buffer,
-                                                          nBytesRead, chain,
-                                                          td->useChunks);
+                                                          nBytesRead, chain);
 
               td->sentData += nbw;
             }
diff --git a/myserver/src/protocol/http/http_data_handler.cpp b/myserver/src/protocol/http/http_data_handler.cpp
index dc2ced9..b0e77d4 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -68,7 +68,6 @@ int HttpDataHandler::unLoad ()
   \param buffer Data to send.
   \param size Size of the buffer.
   \param chain Where send data if not append.
-  \param useChunks Can we use HTTP chunks to send data?
   \param realBufferSize The real dimension of the buffer that can be
   used by this method.
   \param tmpStream A support on memory read/write stream used
@@ -78,7 +77,6 @@ size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
                                                  const char *buffer,
                                                  size_t size,
                                                  FiltersChain &chain,
-                                                 bool useChunks,
                                                  size_t realBufferSize,
                                                  MemoryStream &tmpStream)
 {
@@ -87,7 +85,7 @@ size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
   Stream *oldStream = chain.getStream ();
 
   if (! chain.hasModifiersFilters () || size == 0)
-    return appendDataToHTTPChannel (td, buffer, size, chain, useChunks);
+    return appendDataToHTTPChannel (td, buffer, size, chain);
 
   /*
     This function can't append directly to the chain because we can't
@@ -111,8 +109,7 @@ size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
 
           tmpStream.read (tmpBuf, BUFSIZ, &nbr);
           if (nbr)
-            totalNbw += appendDataToHTTPChannel (td, tmpBuf, nbr, directStream,
-                                                 useChunks);
+            totalNbw += appendDataToHTTPChannel (td, tmpBuf, nbr, directStream);
         }
       while (size - written || nbr);
       tmpStream.refresh ();
@@ -133,18 +130,16 @@ size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
   \param buffer Data to send.
   \param size Size of the buffer.
   \param chain Where send data if not append.
-  \param useChunks Can we use HTTP chunks to send data?
  */
 size_t
 HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
                                           const char *buffer,
                                           size_t size,
-                                          FiltersChain &chain,
-                                          bool useChunks)
+                                          FiltersChain &chain)
 {
   size_t tmp, nbw = 0;
 
-  if (useChunks)
+  if (td->useChunks)
     {
       ostringstream chunkHeader;
       chunkHeader << hex << size << "\r\n";
@@ -155,7 +150,7 @@ HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
   if (size)
     chain.write (buffer, size, &nbw);
 
-  if (useChunks)
+  if (td->useChunks)
     chain.getStream ()->write ("\r\n", 2, &tmp);
 
   return nbw;
@@ -206,7 +201,7 @@ HttpDataHandler::beginHTTPResponse (HttpThreadContext *td,
         {
           FiltersChain directChain (chain.getStream ());
           ret += appendDataToHTTPChannel (td, td->buffer->getBuffer (), nbr,
-                                          directChain, useChunks);
+                                          directChain);
         }
     }
 
@@ -245,7 +240,7 @@ HttpDataHandler::completeHTTPResponse (HttpThreadContext *td,
                       td->buffer->getRealLength (), &nbr);
 
       ret += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                      nbr, directChain, useChunks);
+                                      nbr, directChain);
       chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
     }
 
diff --git a/myserver/src/protocol/http/webdav/webdav.cpp b/myserver/src/protocol/http/webdav/webdav.cpp
index 6dc18dc..b0cbe91 100644
--- a/myserver/src/protocol/http/webdav/webdav.cpp
+++ b/myserver/src/protocol/http/webdav/webdav.cpp
@@ -333,7 +333,7 @@ int WebDAV::propfind (HttpThreadContext* td)
 
           td->sentData +=
             HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                      nbr, chain, td->useChunks);
+                                                      nbr, chain);
           if (nbr != td->buffer->getRealLength ())
             break;
         }
@@ -641,7 +641,7 @@ int WebDAV::lock (HttpThreadContext* td)
 
           td->sentData +=
             HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                      nbr, chain, td->useChunks);
+                                                      nbr, chain);
         }
 
       MemoryStream memStream (td->auxiliaryBuffer);



commit a90a48d661f75a63619d8e64637cc0af3f0dc94e
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 23 11:47:34 2011 +0200

    Http: move useChunks and keepalive to HttpThreadContext

diff --git a/myserver/include/http_handler/fastcgi/fastcgi.h b/myserver/include/http_handler/fastcgi/fastcgi.h
index 882746e..e8801b5 100644
--- a/myserver/include/http_handler/fastcgi/fastcgi.h
+++ b/myserver/include/http_handler/fastcgi/fastcgi.h
@@ -142,12 +142,9 @@ typedef ProcessServerManager::Server FastCgiServer;
 
 struct FcgiContext
 {
-  HttpThreadContext* td;
-  FastCgiServer* server;
+  HttpThreadContext *td;
+  FastCgiServer *server;
   Socket sock;
-
-  bool useChunks;
-  bool keepalive;
   bool headerSent;
 };
 
diff --git a/myserver/include/http_handler/isapi/isapi.h b/myserver/include/http_handler/isapi/isapi.h
index a8ba3c6..efd1c48 100644
--- a/myserver/include/http_handler/isapi/isapi.h
+++ b/myserver/include/http_handler/isapi/isapi.h
@@ -111,8 +111,6 @@ typedef struct _EXTENSION_CONTROL_BLOCK
 
 struct ConnTableRecord
 {
-  bool keepalive;
-  bool useChunks;
   FiltersChain chain;
   BOOL Allocated;
   bool onlyHeader;
diff --git a/myserver/include/http_handler/mscgi/mscgi.h b/myserver/include/http_handler/mscgi/mscgi.h
index 1e9f601..dc14423 100644
--- a/myserver/include/http_handler/mscgi/mscgi.h
+++ b/myserver/include/http_handler/mscgi/mscgi.h
@@ -42,8 +42,6 @@ struct MsCgiData
   Server* server;
   MsCgi* mscgi;
   FiltersChain *filtersChain;
-  bool keepAlive;
-  bool useChunks;
   bool onlyHeader;
   bool error;
 
diff --git a/myserver/include/protocol/http/http_data_handler.h b/myserver/include/protocol/http/http_data_handler.h
index 74c694c..b91adc9 100644
--- a/myserver/include/protocol/http/http_data_handler.h
+++ b/myserver/include/protocol/http/http_data_handler.h
@@ -52,8 +52,8 @@ public:
   HttpDataHandler ();
   virtual ~HttpDataHandler ();
 
-  static void checkDataChunks (HttpThreadContext* td, bool* keepalive,
-                               bool* useChunks, bool disableEncoding = false);
+  static void checkDataChunks (HttpThreadContext* td,
+                               bool disableEncoding = false);
 
   static size_t appendDataToHTTPChannel (HttpThreadContext* td,
                                          const char *buffer,
diff --git a/myserver/include/protocol/http/http_thread_context.h b/myserver/include/protocol/http/http_thread_context.h
index 1a87cf9..51e2cc4 100644
--- a/myserver/include/protocol/http/http_thread_context.h
+++ b/myserver/include/protocol/http/http_thread_context.h
@@ -62,6 +62,10 @@ struct HttpThreadContext
   /*! Size of the request header in `buffer'. */
   size_t headerSize;
 
+  bool useChunks;
+
+  bool keepalive;
+
   ConnectionPtr connection;
   MemBuf *buffer;
   MemBuf *auxiliaryBuffer;
diff --git a/myserver/src/http_handler/cgi/cgi.cpp b/myserver/src/http_handler/cgi/cgi.cpp
index 2f4c7ad..a86ca88 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -291,14 +291,13 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
   size_t nBytesRead = 0;
   u_long procStartTime;
   int ret = 0;
-  bool useChunks;
   /* Reset the auxiliaryBuffer length counter. */
   td->auxiliaryBuffer->setLength (0);
 
   procStartTime = getTicks ();
 
   if (sendHeader (td, stdOutFile, chain, cgiProc, onlyHeader, nph,
-                  procStartTime, &useChunks, &ret))
+                  procStartTime, &td->useChunks, &ret))
     return ret;
 
   if (!nph && onlyHeader)
@@ -343,11 +342,11 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
                                                   td->auxiliaryBuffer->getBuffer (),
                                                   nBytesRead,
                                                   chain,
-                                                  useChunks);
+                                                  td->useChunks);
     }
 
   MemoryStream memStream (td->auxiliaryBuffer);
-  td->sentData += completeHTTPResponse (td, memStream, chain, useChunks);
+  td->sentData += completeHTTPResponse (td, memStream, chain, td->useChunks);
 
   return HttpDataHandler::RET_OK;
 }
@@ -443,8 +442,6 @@ int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile,
                                                     &td->response,
                                                     &(td->nBytesToRead));
         {
-          bool keepalive = false;
-
           string* location = td->response.getValue ("Location", NULL);
 
           /* If it is present "Location: foo" in the header then send a redirect
@@ -455,7 +452,7 @@ int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile,
               return 1;
             }
 
-          checkDataChunks (td, &keepalive, useChunks);
+          checkDataChunks (td);
           HttpHeaders::sendHeader (td->response, *chain.getStream (),
                                    *td->buffer, td);
         }
@@ -468,7 +465,7 @@ int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile,
                                td->auxiliaryBuffer->getBuffer () + headerSize,
                                                     headerOffset - headerSize,
                                                     chain,
-                                                    useChunks);
+                                                    td->useChunks);
     }
 
   return 0;
diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index 1d3d109..9db2c31 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -284,7 +284,8 @@ int FastCgi::send (HttpThreadContext* td, const char* scriptpath,
       while (! exit);
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream, chain, con.useChunks);
+      td->sentData += completeHTTPResponse (td, memStream, chain,
+                                            con.td->useChunks);
 
       chain.clearAllFilters ();
       con.sock.close ();
@@ -615,12 +616,11 @@ int FastCgi::sendData (FcgiContext* con, u_long dim, u_long timeout,
   if (onlyHeader)
     return 1;
 
-  size_t nbw = HttpDataHandler::appendDataToHTTPChannel (con->td,
-                                            con->td->buffer->getBuffer (),
-                                            con->td->buffer->getLength (),
-                                            *chain, con->useChunks);
-
-  con->td->sentData += nbw;
+  con->td->sentData +=
+    HttpDataHandler::appendDataToHTTPChannel (con->td,
+                                              con->td->buffer->getBuffer (),
+                                              con->td->buffer->getLength (),
+                                              *chain, con->td->useChunks);
   return 0;
 }
 
@@ -690,7 +690,7 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain* chain, bool* response
         }
     }
 
-  checkDataChunks (con->td, &con->keepalive, &con->useChunks);
+  checkDataChunks (con->td);
   if (HttpHeaders::sendHeader (con->td->response, *con->td->connection->socket,
                                *con->td->auxiliaryBuffer, con->td))
     {
@@ -707,7 +707,7 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain* chain, bool* response
                                                 con->td->buffer->getBuffer () + headerSize,
                                                 size - headerSize,
                                                 *chain,
-                                                con->useChunks);
+                                                con->td->useChunks);
       con->td->sentData += nbw;
     }
 
diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp b/myserver/src/http_handler/http_dir/http_dir.cpp
index 8aa34f7..f8eb42e 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -380,9 +380,7 @@ int HttpDir::send (HttpThreadContext* td,
             }
         }
 
-      bool keepalive = false;
-      bool useChunks = false;
-      checkDataChunks (td, &keepalive, &useChunks);
+      checkDataChunks (td);
       HttpHeaders::sendHeader (td->response, *td->connection->socket,
                                *td->buffer, td);
 
@@ -437,7 +435,7 @@ int HttpDir::send (HttpThreadContext* td,
 
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                            td->auxiliaryBuffer->getLength (),
-                                           chain, useChunks);
+                                           chain, td->useChunks);
 
       filename = directory;
       td->auxiliaryBuffer->setLength (0);
@@ -452,7 +450,7 @@ int HttpDir::send (HttpThreadContext* td,
 
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                            td->auxiliaryBuffer->getLength (),
-                                           chain, useChunks);
+                                           chain, td->useChunks);
 
       fd.findfirst (filename.c_str ());
 
@@ -467,7 +465,7 @@ int HttpDir::send (HttpThreadContext* td,
 
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                                td->auxiliaryBuffer->getLength (),
-                                               chain, useChunks);
+                                               chain, td->useChunks);
       td->auxiliaryBuffer->setLength (0);
 
       if (FilesUtility::getPathRecursionLevel (td->request.uri) >= 1)
@@ -503,7 +501,7 @@ int HttpDir::send (HttpThreadContext* td,
 
           td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                                    td->auxiliaryBuffer->getLength (),
-                                                   chain, useChunks);
+                                                   chain, td->useChunks);
         }
 
       /* Put all files in a vector.  */
@@ -564,7 +562,7 @@ int HttpDir::send (HttpThreadContext* td,
           generateElement (*td->auxiliaryBuffer, file, linkPrefix, formatString);
           td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                                    td->auxiliaryBuffer->getLength (),
-                                                   chain, useChunks);
+                                                   chain, td->useChunks);
         }
 
       td->auxiliaryBuffer->setLength (0);
@@ -588,7 +586,7 @@ int HttpDir::send (HttpThreadContext* td,
       *td->auxiliaryBuffer << "</address>\r\n</body>\r\n</html>\r\n";
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
                                                td->auxiliaryBuffer->getLength (),
-                                               chain, useChunks);
+                                               chain, td->useChunks);
 
       *td->auxiliaryBuffer << end_str;
       /* Changes the \ character in the / character.  */
@@ -598,7 +596,7 @@ int HttpDir::send (HttpThreadContext* td,
           *bufferloop = '/';
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream, chain, useChunks);
+      td->sentData += completeHTTPResponse (td, memStream, chain, td->useChunks);
     }
   catch (exception & e)
     {
diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index df22552..5055e4a 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -202,8 +202,6 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
   off_t firstByte = td->request.rangeByteBegin;
   off_t lastByte = td->request.rangeByteEnd;
   bool fastCopyAllowed;
-  bool keepalive;
-  bool useChunks = false;
   MemoryStream memStream (td->auxiliaryBuffer);
   FiltersChain chain;
   size_t nbr;
@@ -325,7 +323,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
         td->response.contentLength.assign (buffer.str ());
       }
 
-    checkDataChunks (td, &keepalive, &useChunks, fastCopyAllowed);
+    checkDataChunks (td, fastCopyAllowed);
     HttpHeaders::sendHeader (td->response, *td->connection->socket,
                              *td->buffer, td);
 
@@ -364,7 +362,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
     file->seek (firstByte);
 
     td->sentData += HttpDataHandler::beginHTTPResponse (td, memStream, chain,
-                                                        useChunks);
+                                                        td->useChunks);
 
     /* Flush the rest of the file.  */
     for (;;)
@@ -389,13 +387,13 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
             bytesToSend -= nbr;
 
             td->sentData += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                     nbr, chain, useChunks,
+                                                     nbr, chain, td->useChunks,
                                                      td->buffer->getRealLength (),
                                                      memStream);
           }
       }/* End for loop.  */
 
-    td->sentData += completeHTTPResponse (td, memStream, chain, useChunks);
+    td->sentData += completeHTTPResponse (td, memStream, chain, td->useChunks);
 
     file->close ();
     delete file;
diff --git a/myserver/src/http_handler/isapi/isapi.cpp b/myserver/src/http_handler/isapi/isapi.cpp
index cd0ec98..c33b8c5 100644
--- a/myserver/src/http_handler/isapi/isapi.cpp
+++ b/myserver/src/http_handler/isapi/isapi.cpp
@@ -270,8 +270,7 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
             (ConnInfo->td->buffer->getBuffer (), &ConnInfo->td->response,
              &(ConnInfo->td->nBytesToRead));
 
-          HttpDataHandler::checkDataChunks (ConnInfo->td, &ConnInfo->keepalive,
-                                            &ConnInfo->useChunks);
+          HttpDataHandler::checkDataChunks (ConnInfo->td);
           if (HttpHeaders::sendHeader (ConnInfo->td->response,
                                        *ConnInfo->td->connection->socket,
                                        *ConnInfo->td->auxiliaryBuffer,
@@ -294,7 +293,7 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
                                                         buffer + headerSize,
                                                         len,
                                                         ConnInfo->chain,
-                                                        ConnInfo->useChunks);
+                                                        ConnInfo->td->useChunks);
           ConnInfo->td->sentData += written;
 
           *lpdwBytes = written;
@@ -307,7 +306,7 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
                                                   (const char *) Buffer,
                                                   *lpdwBytes,
                                                   ConnInfo->chain,
-                                                  ConnInfo->useChunks);
+                                                  ConnInfo->td->useChunks);
       ConnInfo->td->sentData += written;
       *lpdwBytes = written;
     }
@@ -829,7 +828,7 @@ int Isapi::send (HttpThreadContext* td,
       MemoryStream memStream (td->auxiliaryBuffer);
       td->sentData += completeHTTPResponse (td, memStream,
                                             connTable[connIndex].chain,
-                                            connTable[connIndex].useChunks);
+                                            connTable[connIndex].td->useChunks);
 
       switch (ret)
         {
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp b/myserver/src/http_handler/mscgi/mscgi.cpp
index 7680dc5..84e211c 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -69,7 +69,6 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
   data.errorPage = 0;
   data.server = Server::getInstance ();
   data.mscgi = this;
-  data.useChunks = false;
   data.onlyHeader = onlyHeader;
   data.error = false;
   data.filtersChain = &chain;
@@ -133,7 +132,7 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
         }
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream, chain, data.useChunks);
+      td->sentData += completeHTTPResponse (td, memStream, chain, td->useChunks);
 
       if (!data.error)
         return HttpDataHandler::RET_FAILURE;
@@ -158,7 +157,7 @@ int MsCgi::write (const char* data, size_t len, MsCgiData* mcd)
   if (mcd->error)
     return 1;
 
-  checkDataChunks (mcd->td, &mcd->keepAlive, &mcd->useChunks);
+  checkDataChunks (mcd->td);
   if (!mcd->headerSent && sendHeader (mcd))
     return 1;
 
@@ -169,7 +168,7 @@ int MsCgi::write (const char* data, size_t len, MsCgiData* mcd)
     HttpDataHandler::appendDataToHTTPChannel (mcd->td,
                                               data, len,
                                               *mcd->filtersChain,
-                                              mcd->useChunks);
+                                              mcd->td->useChunks);
   return 0;
 }
 
diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index f32e489..3104283 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -166,8 +166,6 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
   size_t headerLength;
   int ret;
   size_t nbw;
-  bool useChunks = false;
-  bool keepalive = false;
 
   td->response.free ();
   do
@@ -216,8 +214,7 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
   /* At this point we can modify the response struct before send it to the
      client.  */
 
-  checkDataChunks (td, &keepalive, &useChunks,
-                   td->response.contentLength.length ());
+  checkDataChunks (td, td->response.contentLength.length ());
   HttpHeaders::sendHeader (td->response, *out.getStream (), *td->buffer, td);
 
   if (onlyHeader)
@@ -226,7 +223,7 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
   readPayLoad (td, &td->response, &out, &client,
                td->auxiliaryBuffer->getBuffer () + headerLength,
                read - headerLength, td->http->getTimeout (),
-               useChunks, keepalive,
+               td->useChunks, td->keepalive,
                hasTransferEncoding ? &transferEncoding : NULL);
 
   td->sentData += ret;
diff --git a/myserver/src/http_handler/scgi/scgi.cpp b/myserver/src/http_handler/scgi/scgi.cpp
index 009d006..5359acd 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -210,8 +210,6 @@ int Scgi::send (HttpThreadContext* td, const char* scriptpath,
 int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
 {
   clock_t initialTicks = getTicks ();
-  bool useChunks = false;
-  bool keepalive = false;
   u_long read = 0;
   u_long headerSize = 0;
   u_long tmpHeaderSize = 0;
@@ -257,7 +255,7 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
                                                 &td->response,
                                                 &(td->nBytesToRead));
 
-  checkDataChunks (td, &keepalive, &useChunks);
+  checkDataChunks (td);
   HttpHeaders::sendHeader (td->response, *td->connection->socket,
                            *td->auxiliaryBuffer, td);
 
@@ -267,7 +265,7 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
   if (read - headerSize)
     td->sentData +=
       appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer () + headerSize,
-                             read - headerSize, *chain, useChunks);
+                             read - headerSize, *chain, td->useChunks);
 
   if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
     {
@@ -282,11 +280,12 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
 
           td->sentData +=
             appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                     nbr, *chain, useChunks);
+                                     nbr, *chain, td->useChunks);
         }
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream, *chain, useChunks);
+      td->sentData += completeHTTPResponse (td, memStream, *chain,
+                                            td->useChunks);
     }
 
   return HttpDataHandler::RET_OK;
diff --git a/myserver/src/http_handler/wincgi/wincgi.cpp b/myserver/src/http_handler/wincgi/wincgi.cpp
index 00da485..e8b977e 100644
--- a/myserver/src/http_handler/wincgi/wincgi.cpp
+++ b/myserver/src/http_handler/wincgi/wincgi.cpp
@@ -65,7 +65,6 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
                   const char *cgipath, bool /*execute*/, bool onlyHeader)
 {
 #ifdef WIN32
-  bool keepalive, useChunks;
   FiltersChain chain;
   Process proc;
   size_t nbr;
@@ -292,12 +291,9 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
             }
         }
 
-      if (td->request.isKeepAlive ())
-        td->response.setValue ("connection", "keep-alive");
-
       HttpHeaders::buildHTTPResponseHeaderStruct (buffer, &td->response, &(td->nBytesToRead));
 
-      checkDataChunks (td, &keepalive, &useChunks);
+      checkDataChunks (td);
       HttpHeaders::sendHeader (td->response, *chain.getStream (),
                                *td->buffer, td);
 
@@ -313,7 +309,7 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
       td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                                                 buffer + headerSize,
                                                                 nBytesRead - headerSize,
-                                                                chain, useChunks);
+                                                                chain, td->useChunks);
 
 
       if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
@@ -329,7 +325,7 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
               td->sentData +=
                 HttpDataHandler::appendDataToHTTPChannel (td, buffer,
                                                           nBytesRead, chain,
-                                                          useChunks);
+                                                          td->useChunks);
 
               td->sentData += nbw;
             }
@@ -337,7 +333,7 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
         }
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream, chain, useChunks);
+      td->sentData += completeHTTPResponse (td, memStream, chain, td->useChunks);
 
       chain.clearAllFilters ();
       OutFileHandle.close ();
diff --git a/myserver/src/protocol/http/http_data_handler.cpp b/myserver/src/protocol/http/http_data_handler.cpp
index cd6cb70..dc2ced9 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -166,28 +166,17 @@ HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
   supports keep-alive connections.
  */
 void
-HttpDataHandler::checkDataChunks (HttpThreadContext* td, bool* keepalive,
-                                  bool* useChunks, bool disableEncoding)
+HttpDataHandler::checkDataChunks (HttpThreadContext* td, bool disableEncoding)
 {
-  *keepalive = td->request.isKeepAlive ();
-  *useChunks = false;
+  td->keepalive = td->request.isKeepAlive ();
+  td->useChunks = false;
 
-  *keepalive &= !td->request.ver.compare ("HTTP/1.1");
+  td->keepalive &= !td->request.ver.compare ("HTTP/1.1");
 
-  if (!disableEncoding && *keepalive)
+  if (!disableEncoding && td->keepalive)
     {
-      HttpResponseHeader::Entry *e;
-      e = td->response.other.get ("transfer-encoding");
-      if (e)
-        e->value.assign ("chunked");
-      else
-        {
-          e = new HttpResponseHeader::Entry ();
-          e->name.assign ("transfer-encoding");
-          e->value.assign ("chunked");
-          td->response.other.put (e->name, e);
-        }
-      *useChunks = true;
+      td->response.setValue ("transfer-encoding", "chunked");
+      td->useChunks = true;
     }
 }
 
diff --git a/myserver/src/protocol/http/webdav/webdav.cpp b/myserver/src/protocol/http/webdav/webdav.cpp
index 60a27bc..6dc18dc 100644
--- a/myserver/src/protocol/http/webdav/webdav.cpp
+++ b/myserver/src/protocol/http/webdav/webdav.cpp
@@ -285,7 +285,6 @@ int WebDAV::propfind (HttpThreadContext* td)
 
   try
     {
-      bool keepalive, useChunks;
       size_t nbw, nbw2;
       FiltersChain chain;
       list<string> filters;
@@ -304,7 +303,7 @@ int WebDAV::propfind (HttpThreadContext* td)
 
       td->response.httpStatus = 207;
 
-      HttpDataHandler::checkDataChunks (td, &keepalive, &useChunks);
+      HttpDataHandler::checkDataChunks (td);
       HttpHeaders::sendHeader (td->response, *chain.getStream (), *td->buffer, td);
 
       /* Determine the Depth.  */
@@ -334,14 +333,14 @@ int WebDAV::propfind (HttpThreadContext* td)
 
           td->sentData +=
             HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                      nbr, chain, useChunks);
+                                                      nbr, chain, td->useChunks);
           if (nbr != td->buffer->getRealLength ())
             break;
         }
 
       MemoryStream memStream (td->auxiliaryBuffer);
       td->sentData += HttpDataHandler::completeHTTPResponse (td, memStream,
-                                                             chain, useChunks);
+                                                             chain, td->useChunks);
 
       return HttpDataHandler::RET_OK;
     }
@@ -577,7 +576,6 @@ int WebDAV::lock (HttpThreadContext* td)
     {
       Sha1 sha1;
       vector <const char*> propReq;
-      bool keepalive, useChunks;
       size_t nbw, nbw2;
       FiltersChain chain;
       list<string> filters;
@@ -619,7 +617,7 @@ int WebDAV::lock (HttpThreadContext* td)
 
       td->response.httpStatus = 201;
 
-      HttpDataHandler::checkDataChunks (td, &keepalive, &useChunks);
+      HttpDataHandler::checkDataChunks (td);
       HttpHeaders::sendHeader (td->response, *chain.getStream (), *td->buffer, td);
 
       string lc = "http://" + *td->request.getValue ("Host", NULL) + td->request.uri;
@@ -643,11 +641,12 @@ int WebDAV::lock (HttpThreadContext* td)
 
           td->sentData +=
             HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                      nbr, chain, useChunks);
+                                                      nbr, chain, td->useChunks);
         }
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream, chain, useChunks);
+      td->sentData += HttpDataHandler::completeHTTPResponse (td, memStream, chain,
+                                                             td->useChunks);
 
       return HttpDataHandler::RET_OK;
     }



commit 8ea8f246c29f869dd7055e1fc854838f73b43fd2
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 23 11:13:25 2011 +0200

    WebDav: use completeHTTPResponse.

diff --git a/myserver/src/protocol/http/webdav/webdav.cpp b/myserver/src/protocol/http/webdav/webdav.cpp
index cd1d422..60a27bc 100644
--- a/myserver/src/protocol/http/webdav/webdav.cpp
+++ b/myserver/src/protocol/http/webdav/webdav.cpp
@@ -646,8 +646,8 @@ int WebDAV::lock (HttpThreadContext* td)
                                                       nbr, chain, useChunks);
         }
 
-      if (useChunks && chain.getStream ()->write ("0\r\n\r\n", 5, &nbw2))
-        return HttpDataHandler::RET_FAILURE;
+      MemoryStream memStream (td->auxiliaryBuffer);
+      td->sentData += completeHTTPResponse (td, memStream, chain, useChunks);
 
       return HttpDataHandler::RET_OK;
     }

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

Summary of changes:
 myserver/include/http_handler/fastcgi/fastcgi.h    |    7 +--
 myserver/include/http_handler/isapi/isapi.h        |    2 -
 myserver/include/http_handler/mscgi/mscgi.h        |    2 -
 myserver/include/protocol/http/http_data_handler.h |    8 +--
 .../include/protocol/http/http_thread_context.h    |    4 ++
 myserver/src/http_handler/cgi/cgi.cpp              |   15 ++----
 myserver/src/http_handler/fastcgi/fastcgi.cpp      |   19 ++++----
 myserver/src/http_handler/http_dir/http_dir.cpp    |   18 ++++----
 myserver/src/http_handler/http_file/http_file.cpp  |   10 ++---
 myserver/src/http_handler/isapi/isapi.cpp          |   11 ++---
 myserver/src/http_handler/mscgi/mscgi.cpp          |    8 +--
 myserver/src/http_handler/proxy/proxy.cpp          |   11 ++---
 myserver/src/http_handler/scgi/scgi.cpp            |   11 ++---
 myserver/src/http_handler/wincgi/wincgi.cpp        |   13 ++----
 myserver/src/protocol/http/http_data_handler.cpp   |   44 ++++++-------------
 myserver/src/protocol/http/webdav/webdav.cpp       |   17 ++++----
 16 files changed, 77 insertions(+), 123 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Sat Apr 23 14:00:55 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDh8Z-00037Z-Fy
	for mharc-myserver-commit@gnu.org; Sat, 23 Apr 2011 14:00:55 -0400
Received: from eggs.gnu.org ([140.186.70.92]:51637)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDh8X-00037Q-9I
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 14:00:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDh8V-0001Zl-Qi
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 14:00:53 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:42976)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDh8V-0001Ze-Me
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 14:00:51 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QDh8V-0007gL-9N
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 18:00:51 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QDh8U-000115-HG
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 18:00:51 +0000
Date: Sat, 23 Apr 2011 18:00:50 +0000
Message-Id: <E1QDh8U-000115-HG@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 8af71c1b0231109176948f0316c0103304610937
X-Git-Newrev: 683d2be1d20c202bbcdbe45b77cc37e831638906
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-479-g683d2be
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 23 Apr 2011 18:00:54 -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  683d2be1d20c202bbcdbe45b77cc37e831638906 (commit)
      from  8af71c1b0231109176948f0316c0103304610937 (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 683d2be1d20c202bbcdbe45b77cc37e831638906
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 23 19:56:27 2011 +0200

    HttpDataHandler: Simplify completeHTTPResponse and beginHTTPResponse

diff --git a/myserver/include/protocol/http/http_data_handler.h b/myserver/include/protocol/http/http_data_handler.h
index 242d996..729720e 100644
--- a/myserver/include/protocol/http/http_data_handler.h
+++ b/myserver/include/protocol/http/http_data_handler.h
@@ -69,13 +69,11 @@ public:
 
   static size_t beginHTTPResponse (HttpThreadContext *td,
                                    MemoryStream &memStream,
-                                   FiltersChain &chain,
-                                   bool useChunks);
+                                   FiltersChain &chain);
 
   static size_t completeHTTPResponse (HttpThreadContext *td,
                                       MemoryStream &memStream,
-                                      FiltersChain &chain,
-                                      bool useChunks);
+                                      FiltersChain &chain);
 
   static size_t generateFiltersChain (HttpThreadContext *td,
                                       FiltersFactory *factory,
diff --git a/myserver/src/http_handler/cgi/cgi.cpp b/myserver/src/http_handler/cgi/cgi.cpp
index 6e1c1dd..f171e0f 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -345,7 +345,7 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
     }
 
   MemoryStream memStream (td->auxiliaryBuffer);
-  td->sentData += completeHTTPResponse (td, memStream, chain, td->useChunks);
+  td->sentData += completeHTTPResponse (td, memStream, chain);
 
   return HttpDataHandler::RET_OK;
 }
diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index 2f0c780..ed67a2b 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -284,8 +284,7 @@ int FastCgi::send (HttpThreadContext* td, const char* scriptpath,
       while (! exit);
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream, chain,
-                                            con.td->useChunks);
+      td->sentData += completeHTTPResponse (td, memStream, chain);
 
       chain.clearAllFilters ();
       con.sock.close ();
diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp b/myserver/src/http_handler/http_dir/http_dir.cpp
index 7b59047..eba7db2 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -596,7 +596,7 @@ int HttpDir::send (HttpThreadContext* td,
           *bufferloop = '/';
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream, chain, td->useChunks);
+      td->sentData += completeHTTPResponse (td, memStream, chain);
     }
   catch (exception & e)
     {
diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 833e9c1..a857017 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -361,8 +361,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
 
     file->seek (firstByte);
 
-    td->sentData += HttpDataHandler::beginHTTPResponse (td, memStream, chain,
-                                                        td->useChunks);
+    td->sentData += HttpDataHandler::beginHTTPResponse (td, memStream, chain);
 
     /* Flush the rest of the file.  */
     for (;;)
@@ -393,7 +392,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
           }
       }/* End for loop.  */
 
-    td->sentData += completeHTTPResponse (td, memStream, chain, td->useChunks);
+    td->sentData += completeHTTPResponse (td, memStream, chain);
 
     file->close ();
     delete file;
diff --git a/myserver/src/http_handler/isapi/isapi.cpp b/myserver/src/http_handler/isapi/isapi.cpp
index 4435b99..0f87005 100644
--- a/myserver/src/http_handler/isapi/isapi.cpp
+++ b/myserver/src/http_handler/isapi/isapi.cpp
@@ -825,8 +825,7 @@ int Isapi::send (HttpThreadContext* td,
 
       MemoryStream memStream (td->auxiliaryBuffer);
       td->sentData += completeHTTPResponse (td, memStream,
-                                            connTable[connIndex].chain,
-                                            connTable[connIndex].td->useChunks);
+                                            connTable[connIndex].chain);
 
       switch (ret)
         {
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp b/myserver/src/http_handler/mscgi/mscgi.cpp
index 885cbe3..223a08e 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -132,7 +132,7 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
         }
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream, chain, td->useChunks);
+      td->sentData += completeHTTPResponse (td, memStream, chain);
 
       if (!data.error)
         return HttpDataHandler::RET_FAILURE;
diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index f305c8f..126a19c 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -333,7 +333,7 @@ int Proxy::readPayLoad (HttpThreadContext* td,
     }
 
   MemoryStream memStream (td->auxiliaryBuffer);
-  td->sentData += completeHTTPResponse (td, memStream, *out, useChunks);
+  td->sentData += completeHTTPResponse (td, memStream, *out);
 
   return HttpDataHandler::RET_OK;
 }
diff --git a/myserver/src/http_handler/scgi/scgi.cpp b/myserver/src/http_handler/scgi/scgi.cpp
index 90569e8..2c0c60e 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -284,8 +284,7 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
         }
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream, *chain,
-                                            td->useChunks);
+      td->sentData += completeHTTPResponse (td, memStream, *chain);
     }
 
   return HttpDataHandler::RET_OK;
diff --git a/myserver/src/http_handler/wincgi/wincgi.cpp b/myserver/src/http_handler/wincgi/wincgi.cpp
index dc0eaef..e578f2b 100644
--- a/myserver/src/http_handler/wincgi/wincgi.cpp
+++ b/myserver/src/http_handler/wincgi/wincgi.cpp
@@ -332,7 +332,7 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
         }
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream, chain, td->useChunks);
+      td->sentData += completeHTTPResponse (td, memStream, chain);
 
       chain.clearAllFilters ();
       OutFileHandle.close ();
diff --git a/myserver/src/protocol/http/http_data_handler.cpp b/myserver/src/protocol/http/http_data_handler.cpp
index b0e77d4..37e8dd0 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -181,8 +181,7 @@ HttpDataHandler::checkDataChunks (HttpThreadContext* td, bool disableEncoding)
 size_t
 HttpDataHandler::beginHTTPResponse (HttpThreadContext *td,
                                     MemoryStream &memStream,
-                                    FiltersChain &chain,
-                                    bool useChunks)
+                                    FiltersChain &chain)
 {
   size_t ret = 0;
   /*
@@ -214,12 +213,11 @@ HttpDataHandler::beginHTTPResponse (HttpThreadContext *td,
 size_t
 HttpDataHandler::completeHTTPResponse (HttpThreadContext *td,
                                        MemoryStream &memStream,
-                                       FiltersChain &chain,
-                                       bool useChunks)
+                                       FiltersChain &chain)
 {
   size_t ret = 0;
   /* If we don't use chunks we can flush directly.  */
-  if (! useChunks)
+  if (! td->useChunks)
     chain.flush (&ret);
   else
     {
diff --git a/myserver/src/protocol/http/webdav/webdav.cpp b/myserver/src/protocol/http/webdav/webdav.cpp
index b0cbe91..303a4c0 100644
--- a/myserver/src/protocol/http/webdav/webdav.cpp
+++ b/myserver/src/protocol/http/webdav/webdav.cpp
@@ -340,7 +340,7 @@ int WebDAV::propfind (HttpThreadContext* td)
 
       MemoryStream memStream (td->auxiliaryBuffer);
       td->sentData += HttpDataHandler::completeHTTPResponse (td, memStream,
-                                                             chain, td->useChunks);
+                                                             chain);
 
       return HttpDataHandler::RET_OK;
     }
@@ -645,8 +645,7 @@ int WebDAV::lock (HttpThreadContext* td)
         }
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += HttpDataHandler::completeHTTPResponse (td, memStream, chain,
-                                                             td->useChunks);
+      td->sentData += HttpDataHandler::completeHTTPResponse (td, memStream, chain);
 
       return HttpDataHandler::RET_OK;
     }

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

Summary of changes:
 myserver/include/protocol/http/http_data_handler.h |    6 ++----
 myserver/src/http_handler/cgi/cgi.cpp              |    2 +-
 myserver/src/http_handler/fastcgi/fastcgi.cpp      |    3 +--
 myserver/src/http_handler/http_dir/http_dir.cpp    |    2 +-
 myserver/src/http_handler/http_file/http_file.cpp  |    5 ++---
 myserver/src/http_handler/isapi/isapi.cpp          |    3 +--
 myserver/src/http_handler/mscgi/mscgi.cpp          |    2 +-
 myserver/src/http_handler/proxy/proxy.cpp          |    2 +-
 myserver/src/http_handler/scgi/scgi.cpp            |    3 +--
 myserver/src/http_handler/wincgi/wincgi.cpp        |    2 +-
 myserver/src/protocol/http/http_data_handler.cpp   |    8 +++-----
 myserver/src/protocol/http/webdav/webdav.cpp       |    5 ++---
 12 files changed, 17 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Sat Apr 23 17:42:00 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDkaW-00017a-EI
	for mharc-myserver-commit@gnu.org; Sat, 23 Apr 2011 17:42:00 -0400
Received: from eggs.gnu.org ([140.186.70.92]:40927)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDkaT-00016x-PN
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 17:41:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDkaS-0006rv-Bz
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 17:41:57 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:54618)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QDkaS-0006rr-AJ
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 17:41:56 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QDkaR-0001jb-Tr
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 21:41:55 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QDkaR-0007PD-E8
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 21:41:55 +0000
Date: Sat, 23 Apr 2011 21:41:55 +0000
Message-Id: <E1QDkaR-0007PD-E8@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 683d2be1d20c202bbcdbe45b77cc37e831638906
X-Git-Newrev: 9fc8ba318396e6b884ef68601722c338ff70b52c
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-481-g9fc8ba3
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 23 Apr 2011 21:41: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  9fc8ba318396e6b884ef68601722c338ff70b52c (commit)
       via  6d8d4b834009b8d27b00e679ce7b34492df4b049 (commit)
      from  683d2be1d20c202bbcdbe45b77cc37e831638906 (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 9fc8ba318396e6b884ef68601722c338ff70b52c
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 23 23:39:02 2011 +0200

    HttpHandlers: cleanup

diff --git a/myserver/include/http_handler/cgi/cgi.h b/myserver/include/http_handler/cgi/cgi.h
index 99f920d..8a1f4c5 100644
--- a/myserver/include/http_handler/cgi/cgi.h
+++ b/myserver/include/http_handler/cgi/cgi.h
@@ -41,6 +41,6 @@ private:
                 Process& cgiProc, bool onlyHeader, bool nph);
   int sendHeader (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
                   Process& cgiProc, bool onlyHeader, bool nph, u_long procStartTime,
-                  bool *useChunks, int *ret);
+                  int *ret);
 };
 #endif
diff --git a/myserver/include/http_handler/proxy/proxy.h b/myserver/include/http_handler/proxy/proxy.h
index a92dc08..0ccb3f6 100644
--- a/myserver/include/http_handler/proxy/proxy.h
+++ b/myserver/include/http_handler/proxy/proxy.h
@@ -58,8 +58,6 @@ protected:
                    const char *initBuffer,
                    u_long initBufferSize,
                    int timeout,
-                   bool useChunks = false,
-                   bool keepalive = false,
                    string *serverTransferEncoding = NULL);
 
   static void proxySchedulerHandler (void *p, Connection *c, int event);
diff --git a/myserver/src/http_handler/cgi/cgi.cpp b/myserver/src/http_handler/cgi/cgi.cpp
index 5ddf0a5..7defe45 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -297,7 +297,7 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
   procStartTime = getTicks ();
 
   if (sendHeader (td, stdOutFile, chain, cgiProc, onlyHeader, nph,
-                  procStartTime, &td->useChunks, &ret))
+                  procStartTime, &ret))
     return ret;
 
   if (!nph && onlyHeader)
@@ -356,7 +356,7 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
  */
 int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile,
                      FiltersChain &chain, Process &cgiProc, bool onlyHeader,
-                     bool nph, u_long procStartTime, bool *useChunks, int *ret)
+                     bool nph, u_long procStartTime, int *ret)
 {
   u_long headerSize = 0;
   bool headerCompleted = false;
diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index c1432bb..c2ae6dc 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -223,7 +223,6 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
   readPayLoad (td, &td->response, &out, &client,
                td->auxiliaryBuffer->getBuffer () + headerLength,
                read - headerLength, td->http->getTimeout (),
-               td->useChunks, td->keepalive,
                hasTransferEncoding ? &transferEncoding : NULL);
 
   td->sentData += ret;
@@ -239,9 +238,7 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
   \param initBuffer Initial read data.
   \param initBufferSize Size of initial data.
   \param timeout Connection timeout.
-  \param useChunks Use chunked transfer encoding
   with the client.
-  \param keepalive The connection is keep-alive.
   \param serverTransferEncoding Transfer-encoding
   used by the server.
 
@@ -255,8 +252,6 @@ int Proxy::readPayLoad (HttpThreadContext* td,
                         const char *initBuffer,
                         u_long initBufferSize,
                         int timeout,
-                        bool useChunks,
-                        bool keepalive,
                         string *serverTransferEncoding)
 {
   size_t contentLength = 0;



commit 6d8d4b834009b8d27b00e679ce7b34492df4b049
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sat Apr 23 23:31:56 2011 +0200

    HttpDataHandler: rename `checkDataChunks' to `chooseEncoding'

diff --git a/myserver/include/protocol/http/http_data_handler.h b/myserver/include/protocol/http/http_data_handler.h
index 729720e..cd3d013 100644
--- a/myserver/include/protocol/http/http_data_handler.h
+++ b/myserver/include/protocol/http/http_data_handler.h
@@ -52,7 +52,7 @@ public:
   HttpDataHandler ();
   virtual ~HttpDataHandler ();
 
-  static void checkDataChunks (HttpThreadContext* td,
+  static void chooseEncoding (HttpThreadContext* td,
                                bool disableEncoding = false);
 
   static size_t appendDataToHTTPChannel (HttpThreadContext* td,
diff --git a/myserver/src/http_handler/cgi/cgi.cpp b/myserver/src/http_handler/cgi/cgi.cpp
index f171e0f..5ddf0a5 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -451,7 +451,7 @@ int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile,
               return 1;
             }
 
-          checkDataChunks (td);
+          chooseEncoding (td);
           HttpHeaders::sendHeader (td->response, *chain.getStream (),
                                    *td->buffer, td);
         }
diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index ed67a2b..47f56fc 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -689,7 +689,7 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain* chain, bool* response
         }
     }
 
-  checkDataChunks (con->td);
+  chooseEncoding (con->td);
   if (HttpHeaders::sendHeader (con->td->response, *con->td->connection->socket,
                                *con->td->auxiliaryBuffer, con->td))
     {
diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp b/myserver/src/http_handler/http_dir/http_dir.cpp
index eba7db2..260e94b 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -380,7 +380,7 @@ int HttpDir::send (HttpThreadContext* td,
             }
         }
 
-      checkDataChunks (td);
+      chooseEncoding (td);
       HttpHeaders::sendHeader (td->response, *td->connection->socket,
                                *td->buffer, td);
 
diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index a857017..8f39261 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -323,7 +323,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
         td->response.contentLength.assign (buffer.str ());
       }
 
-    checkDataChunks (td, fastCopyAllowed);
+    chooseEncoding (td, fastCopyAllowed);
     HttpHeaders::sendHeader (td->response, *td->connection->socket,
                              *td->buffer, td);
 
diff --git a/myserver/src/http_handler/isapi/isapi.cpp b/myserver/src/http_handler/isapi/isapi.cpp
index 0f87005..3ae9523 100644
--- a/myserver/src/http_handler/isapi/isapi.cpp
+++ b/myserver/src/http_handler/isapi/isapi.cpp
@@ -270,7 +270,7 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
             (ConnInfo->td->buffer->getBuffer (), &ConnInfo->td->response,
              &(ConnInfo->td->nBytesToRead));
 
-          HttpDataHandler::checkDataChunks (ConnInfo->td);
+          HttpDataHandler::chooseEncoding (ConnInfo->td);
           if (HttpHeaders::sendHeader (ConnInfo->td->response,
                                        *ConnInfo->td->connection->socket,
                                        *ConnInfo->td->auxiliaryBuffer,
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp b/myserver/src/http_handler/mscgi/mscgi.cpp
index 223a08e..0732223 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -157,7 +157,6 @@ int MsCgi::write (const char* data, size_t len, MsCgiData* mcd)
   if (mcd->error)
     return 1;
 
-  checkDataChunks (mcd->td);
   if (!mcd->headerSent && sendHeader (mcd))
     return 1;
 
@@ -184,6 +183,7 @@ int MsCgi::sendHeader (MsCgiData* mcd)
   if (mcd->headerSent)
     return 0;
 
+  chooseEncoding (mcd->td);
   HttpHeaders::sendHeader (td->response, *td->connection->socket,
                            *td->auxiliaryBuffer, td);
 
diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index 126a19c..c1432bb 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -214,7 +214,7 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
   /* At this point we can modify the response struct before send it to the
      client.  */
 
-  checkDataChunks (td, td->response.contentLength.length ());
+  chooseEncoding (td, td->response.contentLength.length ());
   HttpHeaders::sendHeader (td->response, *out.getStream (), *td->buffer, td);
 
   if (onlyHeader)
diff --git a/myserver/src/http_handler/scgi/scgi.cpp b/myserver/src/http_handler/scgi/scgi.cpp
index 2c0c60e..e6583aa 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -255,7 +255,7 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
                                                 &td->response,
                                                 &(td->nBytesToRead));
 
-  checkDataChunks (td);
+  chooseEncoding (td);
   HttpHeaders::sendHeader (td->response, *td->connection->socket,
                            *td->auxiliaryBuffer, td);
 
diff --git a/myserver/src/http_handler/wincgi/wincgi.cpp b/myserver/src/http_handler/wincgi/wincgi.cpp
index e578f2b..c1e7473 100644
--- a/myserver/src/http_handler/wincgi/wincgi.cpp
+++ b/myserver/src/http_handler/wincgi/wincgi.cpp
@@ -293,7 +293,7 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
 
       HttpHeaders::buildHTTPResponseHeaderStruct (buffer, &td->response, &(td->nBytesToRead));
 
-      checkDataChunks (td);
+      chooseEncoding (td);
       HttpHeaders::sendHeader (td->response, *chain.getStream (),
                                *td->buffer, td);
 
diff --git a/myserver/src/protocol/http/http_data_handler.cpp b/myserver/src/protocol/http/http_data_handler.cpp
index 37e8dd0..af656e5 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -157,11 +157,13 @@ HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
 }
 
 /*!
-  Check if the server can use the chunked transfer encoding and if the client
-  supports keep-alive connections.
+  Choose the transfer encoding to use with the client.
+  \param td The HTTP thread context.
+  \param disableEncoding If specified don't use any transfer encoding.
+  If it is specified, then the Content-Length must be specified.
  */
 void
-HttpDataHandler::checkDataChunks (HttpThreadContext* td, bool disableEncoding)
+HttpDataHandler::chooseEncoding (HttpThreadContext* td, bool disableEncoding)
 {
   td->keepalive = td->request.isKeepAlive ();
   td->useChunks = false;
diff --git a/myserver/src/protocol/http/webdav/webdav.cpp b/myserver/src/protocol/http/webdav/webdav.cpp
index 303a4c0..5dbd433 100644
--- a/myserver/src/protocol/http/webdav/webdav.cpp
+++ b/myserver/src/protocol/http/webdav/webdav.cpp
@@ -303,7 +303,7 @@ int WebDAV::propfind (HttpThreadContext* td)
 
       td->response.httpStatus = 207;
 
-      HttpDataHandler::checkDataChunks (td);
+      HttpDataHandler::chooseEncoding (td);
       HttpHeaders::sendHeader (td->response, *chain.getStream (), *td->buffer, td);
 
       /* Determine the Depth.  */
@@ -617,7 +617,7 @@ int WebDAV::lock (HttpThreadContext* td)
 
       td->response.httpStatus = 201;
 
-      HttpDataHandler::checkDataChunks (td);
+      HttpDataHandler::chooseEncoding (td);
       HttpHeaders::sendHeader (td->response, *chain.getStream (), *td->buffer, td);
 
       string lc = "http://" + *td->request.getValue ("Host", NULL) + td->request.uri;

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

Summary of changes:
 myserver/include/http_handler/cgi/cgi.h            |    2 +-
 myserver/include/http_handler/proxy/proxy.h        |    2 --
 myserver/include/protocol/http/http_data_handler.h |    2 +-
 myserver/src/http_handler/cgi/cgi.cpp              |    6 +++---
 myserver/src/http_handler/fastcgi/fastcgi.cpp      |    2 +-
 myserver/src/http_handler/http_dir/http_dir.cpp    |    2 +-
 myserver/src/http_handler/http_file/http_file.cpp  |    2 +-
 myserver/src/http_handler/isapi/isapi.cpp          |    2 +-
 myserver/src/http_handler/mscgi/mscgi.cpp          |    2 +-
 myserver/src/http_handler/proxy/proxy.cpp          |    7 +------
 myserver/src/http_handler/scgi/scgi.cpp            |    2 +-
 myserver/src/http_handler/wincgi/wincgi.cpp        |    2 +-
 myserver/src/protocol/http/http_data_handler.cpp   |    8 +++++---
 myserver/src/protocol/http/webdav/webdav.cpp       |    4 ++--
 14 files changed, 20 insertions(+), 25 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Sat Apr 23 17:57:42 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDkpi-0001tE-Br
	for mharc-myserver-commit@gnu.org; Sat, 23 Apr 2011 17:57:42 -0400
Received: from eggs.gnu.org ([140.186.70.92]:43998)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QDkpg-0001t8-Kr
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 17:57:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QDkpf-0000Jq-Bh
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 17:57:40 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:43767)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QDkpf-0000Jj-3L
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 17:57:39 -0400
Received: from lucifer (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.14.4/8.14.4) with SMTP id
	p3NLvaLw013156
	for <myserver-commit@gnu.org>; Sat, 23 Apr 2011 23:57:36 +0200
Message-Id: <201104232157.p3NLvaLw013156@proliant.st.ewi.tudelft.nl>
Received: by lucifer (sSMTP sendmail emulation);
	Sat, 23 Apr 2011 23:57:36 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
X-Hydra-Instance: lucifer
X-Hydra-Project: gnu
X-Hydra-Jobset: myserver-master
X-Hydra-Job: build
Date: Sat, 23 Apr 2011 23:57:36 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 130.161.158.3
Subject: [myserver-commit] Hydra job gnu:myserver-master:build build
	1052895: Failed
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 23 Apr 2011 21:57:41 -0000

Hi,

This is to let you know that Hydra build 1052895 of job gnu:myserver-master:build has changed from 'Failed' to 'Failed'.

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

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:              | 1052895
Nix name:              | myserver-0.9.2.481-9fc8
Short description:     | Native Nix build on i686-linux
Maintainer(s):         | myserver-commit@gnu.org
System:                | i686-linux
Derivation store path: | /nix/store/j32l1av087v29vfmvd1j6mia2nkylwla-myserver-0.9.2.481-9fc8.drv
Output store path:     | /nix/store/a2r680zjvpvwmkdj4l7s5l6fbpj81r3w-myserver-0.9.2.481-9fc8
Time added:            | 2011-04-23 23:57:36
Build started:         | 2011-04-23 23:53:06
Build finished:        | 2011-04-23 23:57:36
Duration:              | 270s

The build inputs were:

Name        | Type   | Value
------------+--------+-------------------------------------------------------------
hydraConfig | svn    | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:26838
nixpkgs     | svn    | https://svn.nixos.org/repos/nix/nixpkgs/trunk:26942
system      | string | i686-linux
tarball     | build  | 1052890

Regards,

The Hydra build daemon.

---
TestConnection::testTries. : OK
TestConnection::testPort. : OK
TestConnection::testLogin. : OK
TestConnection::testPassword. : OK
TestConnection::testForceControl. : OK
TestConnection::testToRemove. : OK
TestConnection::testScheduled. : OK
TestConnection::testPriority. : OK
TestConnectionsScheduler::testAddNewConnection. : OK
TestConnectionsScheduler::testGetNumTotalConnections. : OK
TestConnectionsScheduler::testAddNewReadyConnection. : OK
TestConnectionsScheduler::testGetConnections. : OK
TestConnectionsScheduler::testVisitor. : OK
TestCryptAlgoManager::testRegister. : OK
TestCryptAlgoManager::testCheck. : OK
TestCryptAlgoManager::testNoExists. : OK
TestExceptions::testWrongCwd. : OK
TestExceptions::testErrno. : OK
TestExceptions::testGetBacktrace. : OK
TestFile::testCreateTemporaryFile. : OK
TestFile::testCreateTemporaryDelayedFile. : OK
TestFile::testOnFile. : OK
TestFile::testBinary. : OK
TestFile::testTruncate. : OK
TestFile::testCreationTime. : OK
TestFile::testLastAccessTime. : OK
TestFile::testLastModTime. : OK
TestFile::testSeek. : OK
TestFileStream::testCycleLog. : OK
TestFileStream::testReOpen. : OK
TestFileStreamCreator::testCreation. : OK
TestFilesUtility::testGetPathRecursionLevel. : OK
TestFilesUtility::testSplitPath. : OK
TestFilesUtility::testSplitPathString. : OK
TestFilesUtility::testSplitPathLength. : OK
TestFilesUtility::testGetFileExt. : OK
TestFilterChain::testGzipChain. : OK
TestFilterChain::testIsEmpty. : OK
TestFilterChain::testAcceptDuplicates. : OK
TestFilterChain::testStream. : OK
TestFilterChain::testIsFilterPresent. : OK
TestFilterChain::testRemoveFilter. : OK
TestForkServer::testExecuteProcessmake[2]: *** [check-am] Segmentation fault
make[2]: Leaving directory `/tmp/nix-build-j32l1av087v29vfmvd1j6mia2nkylwla-myserver-0.9.2.481-9fc8.drv-0/myserver-0.9.2.481-9fc8/tests'
[q[qmake[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/tmp/nix-build-j32l1av087v29vfmvd1j6mia2nkylwla-myserver-0.9.2.481-9fc8.drv-0/myserver-0.9.2.481-9fc8'
[q[qmake: *** [check] Error 2
[q[q[qbuild time elapsed:  0m0.022s 0m0.015s 2m9.313s 0m27.565s
[pCopying build directory to /nix/store/a2r680zjvpvwmkdj4l7s5l6fbpj81r3w-myserver-0.9.2.481-9fc8/nix-build-j32l1av087v29vfmvd1j6mia2nkylwla-myserver-0.9.2.481-9fc8.drv-0
[qbuild failed with exit code 2 (ignored)


From MAILER-DAEMON Sat Apr 23 17:58:23 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDkqN-0001vS-QV
	for mharc-myserver-commit@gnu.org; Sat, 23 Apr 2011 17:58:23 -0400
Received: from eggs.gnu.org ([140.186.70.92]:44064)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QDkqL-0001uy-F2
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 17:58:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QDkqK-0000QI-2z
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 17:58:21 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:43769)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QDkqJ-0000QE-Qj
	for myserver-commit@gnu.org; Sat, 23 Apr 2011 17:58:20 -0400
Received: from lucifer (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.14.4/8.14.4) with SMTP id
	p3NLwI5p013188
	for <myserver-commit@gnu.org>; Sat, 23 Apr 2011 23:58:18 +0200
Message-Id: <201104232158.p3NLwI5p013188@proliant.st.ewi.tudelft.nl>
Received: by lucifer (sSMTP sendmail emulation);
	Sat, 23 Apr 2011 23:58:18 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
X-Hydra-Instance: lucifer
X-Hydra-Project: gnu
X-Hydra-Jobset: myserver-master
X-Hydra-Job: build
Date: Sat, 23 Apr 2011 23:58:18 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 130.161.158.3
Subject: [myserver-commit] Hydra job gnu:myserver-master:build build
	1052892: Failed
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 23 Apr 2011 21:58:22 -0000

Hi,

This is to let you know that Hydra build 1052892 of job gnu:myserver-master:build has changed from 'Failed' to 'Failed'.

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

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:              | 1052892
Nix name:              | myserver-0.9.2.481-9fc8
Short description:     | Native Nix build on x86_64-linux
Maintainer(s):         | myserver-commit@gnu.org
System:                | x86_64-linux
Derivation store path: | /nix/store/vp1mq9kzwzb98hfglmxp4dmdjcq07lb1-myserver-0.9.2.481-9fc8.drv
Output store path:     | /nix/store/an1hkx0ci67amyj3fqah5k8sx5f525v1-myserver-0.9.2.481-9fc8
Time added:            | 2011-04-23 23:58:17
Build started:         | 2011-04-23 23:53:06
Build finished:        | 2011-04-23 23:58:17
Duration:              | 311s

The build inputs were:

Name        | Type   | Value
------------+--------+-------------------------------------------------------------
hydraConfig | svn    | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:26838
nixpkgs     | svn    | https://svn.nixos.org/repos/nix/nixpkgs/trunk:26942
system      | string | x86_64-linux
tarball     | build  | 1052890

Regards,

The Hydra build daemon.

---
7f2b44f71000-7f2b45170000 ---p 00076000 08:02 17614710                   /nix/store/63p55l5dm9wyb6z5x5j953kybhp7ckvm-libgcrypt-1.4.6/lib/libgcrypt.so.11.6.0
7f2b45170000-7f2b45174000 rw-p 00075000 08:02 17614710                   /nix/store/63p55l5dm9wyb6z5x5j953kybhp7ckvm-libgcrypt-1.4.6/lib/libgcrypt.so.11.6.0
7f2b45174000-7f2b4518c000 r-xp 00000000 08:02 36089707                   /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libpthread-2.12.2.so
7f2b4518c000-7f2b4538b000 ---p 00018000 08:02 36089707                   /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libpthread-2.12.2.so
7f2b4538b000-7f2b4538c000 r--p 00017000 08:02 36089707                   /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libpthread-2.12.2.so
7f2b4538c000-7f2b4538d000 rw-p 00018000 08:02 36089707                   /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libpthread-2.12.2.so
7f2b4538d000-7f2b45391000 rw-p 00000000 00:00 0
7f2b45391000-7f2b453a9000 r-xp 00000000 08:02 36184846                   /nix/store/pv49msy9ylg9zhhf35fa9lkssgb8d5qx-zlib-1.2.5/lib/libz.so.1.2.5
7f2b453a9000-7f2b455a8000 ---p 00018000 08:02 36184846                   /nix/store/pv49msy9ylg9zhhf35fa9lkssgb8d5qx-zlib-1.2.5/lib/libz.so.1.2.5
7f2b455a8000-7f2b455a9000 rw-p 00017000 08:02 36184846                   /nix/store/pv49msy9ylg9zhhf35fa9lkssgb8d5qx-zlib-1.2.5/lib/libz.so.1.2.5
7f2b455a9000-7f2b45677000 r-xp 00000000 08:02 23734276                   /nix/store/s76axdlcsw634wi0ykbx32sjvmnadk2s-gnutls-2.12.2/lib/libgnutls.so.26.18.10
7f2b45677000-7f2b45876000 ---p 000ce000 08:02 23734276                   /nix/store/s76axdlcsw634wi0ykbx32sjvmnadk2s-gnutls-2.12.2/lib/libgnutls.so.26.18.10
7f2b45876000-7f2b4587e000 rw-p 000cd000 08:02 23734276                   /nix/store/s76axdlcsw634wi0ykbx32sjvmnadk2s-gnutls-2.12.2/lib/libgnutls.so.26.18.10
7f2b4587e000-7f2b459c6000 r-xp 00000000 08:02 36994142                   /nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/lib/libxml2.so.2.7.7
7f2b459c6000-7f2b45bc5000 ---p 00148000 08:02 36994142                   /nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/lib/libxml2.so.2.7.7
7f2b45bc5000-7f2b45bcf000 rw-p 00147000 08:02 36994142                   /nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/lib/libxml2.so.2.7.7
7f2b45bcf000-7f2b45bd0000 rw-p 00000000 00:00 0
7f2b45bd0000-7f2b45c02000 r-xp 00000000 08:02 23393615                   /nix/store/ihcg4sd4an1snj6ra13v8k6js48vnnxw-libidn-1.20/lib/libidn.so.11.6.3
7f2b45c02000-7f2b45e01000 ---p 00032000 08:02 23393615                   /nix/store/ihcg4sd4an1snj6ra13v8k6js48vnnxw-libidn-1.20/lib/libidn.so.11.6.3
7f2b45e01000-7f2b45e02000 rw-p 00031000 08:02 23393615                   /nix/store/ihcg4sd4an1snj6ra13v8k6js48vnnxw-libidn-1.20/lib/libidn.so.11.6.3
7f2b45e02000-7f2b45e44000 r-xp 00000000 08:02 14964460                   /nix/store/64qvc3kzmpdskx3fn9x09sdshjz0wpvj-cppunit-1.12.0/lib/libcppunit-1.12.so.0.0.0
7f2b45e44000-7f2b46044000 ---p 00042000 08:02 14964460                   /nix/store/64qvc3kzmpdskx3fn9x09sdshjz0wpvj-cppunit-1.12.0/lib/libcppunit-1.12.so.0.0.0
7f2b46044000-7f2b46047000 rw-p 00042000 08:02 14964460                   /nix/store/64qvc3kzmpdskx3fn9x09sdshjz0wpvj-cppunit-1.12.0/lib/libcppunit-1.12.so.0.0.0
7f2b46047000-7f2b4609a000 r-xp 00000000 08:02 33569438                   /nix/store/ji6py9m9w2ray1bmpkmgig9llj1i2ggf-gmp-4.3.2/lib/libgmp.so.3.5.2
7f2b4609a000-7f2b46299000 ---p 00053000 08:02 33569438                   /nix/store/ji6py9m9w2ray1bmpkmgig9llj1i2ggf-gmp-4.3.2/lib/libgmp.so.3.5.2
7f2b46299000-7f2b4629b000 rw-p 00052000 08:02 33569438                   /nix/store/ji6py9m9w2ray1bmpkmgig9llj1i2ggf-gmp-4.3.2/lib/libgmp.so.3.5.2
7f2b4629b000-7f2b462ab000 r-xp 00000000 08:02 20852674                   /nix/store/clk7dqh7lqn6hsamy0r9fzb78h08dj8i-libtasn1-2.9/lib/libtasn1.so.3.1.11
7f2b462ab000-7f2b464aa000 ---p 00010000 08:02 20852674                   /nix/store/clk7dqh7lqn6hsamy0r9fzb78h08dj8i-libtasn1-2.9/lib/libtasn1.so.3.1.11
7f2b464aa000-7f2b464ab000 rw-p 0000f000 08:02 20852674                   /nix/store/clk7dqh7lqn6hsamy0r9fzb78h08dj8i-libtasn1-2.9/lib/libtasn1.so.3.1.11
7f2b464ab000-7f2b4658e000 r-xp 00000000 08:02 36100865                   /nix/store/3r8kfi33y3lbrsvlx8vzwm74h8178y35-gcc-4.5.1/lib64/libstdc++.so.6.0.14
7f2b4658e000-7f2b4678d000 ---p 000e3000 08:02 36100865                   /nix/store/3r8kfi33y3lbrsvlx8vzwm74h8178y35-gcc-4.5.1/lib64/libstdc++.so.6.0.14
7f2b4678d000-7f2b46795000 r--p 000e2000 08:02 36100865                   /nix/store/3r8kfi33y3lbrsvlx8vzwm74h8178y35-gcc-4.5.1/lib64/libstdc++.so.6.0.14
7f2b46795000-7f2b46797000 rw-p 000ea000 08:02 36100865                   /nix/store/3r8kfi33y3lbrsvlx8vzwm74h8178y35-gcc-4.5.1/lib64/libstdc++.so.6.0.14
7f2b46797000-7f2b467ac000 rw-p 00000000 00:00 0
7f2b467ac000-7f2b467ca000 r-xp 00000000 08:02 36089640                   /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/ld-2.12.2.so
7f2b469b9000-7f2b469ca000 rw-p 00000000 00:00 0
7f2b469ca000-7f2b469cb000 r--p 0001e000 08:02 36089640                   /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/ld-2.12.2.so
7f2b469cb000-7f2b469cc000 rw-p 0001f000 08:02 36089640                   /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/ld-2.12.2.so
7f2b469cc000-7f2b469cd000 rw-p 00000000 00:00 0
7fffa3533000-7fffa3549000 rw-p 00000000 00:00 0                          [stack]
7fffa35ff000-7fffa3600000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
.make[2]: *** [check-am] Aborted
make[2]: Leaving directory `/tmp/nix-build-vp1mq9kzwzb98hfglmxp4dmdjcq07lb1-myserver-0.9.2.481-9fc8.drv-0/myserver-0.9.2.481-9fc8/tests'
[q[qmake[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/tmp/nix-build-vp1mq9kzwzb98hfglmxp4dmdjcq07lb1-myserver-0.9.2.481-9fc8.drv-0/myserver-0.9.2.481-9fc8'
[q[qmake: *** [check] Error 2
[q[q[qbuild time elapsed:  0m0.017s 0m0.016s 2m43.527s 0m32.922s
[pCopying build directory to /nix/store/an1hkx0ci67amyj3fqah5k8sx5f525v1-myserver-0.9.2.481-9fc8/nix-build-vp1mq9kzwzb98hfglmxp4dmdjcq07lb1-myserver-0.9.2.481-9fc8.drv-0
[qbuild failed with exit code 2 (ignored)


From MAILER-DAEMON Sun Apr 24 16:44:49 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QE6Aj-0006SK-3J
	for mharc-myserver-commit@gnu.org; Sun, 24 Apr 2011 16:44:49 -0400
Received: from eggs.gnu.org ([140.186.70.92]:46524)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QE6Ae-0006Rj-8D
	for myserver-commit@gnu.org; Sun, 24 Apr 2011 16:44:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QE6Ab-0007fY-DZ
	for myserver-commit@gnu.org; Sun, 24 Apr 2011 16:44:44 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:56970)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QE6Ab-0007fU-Ab
	for myserver-commit@gnu.org; Sun, 24 Apr 2011 16:44:41 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QE6Aa-0000Y6-TN
	for myserver-commit@gnu.org; Sun, 24 Apr 2011 20:44:41 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QE6AZ-00051s-PV
	for myserver-commit@gnu.org; Sun, 24 Apr 2011 20:44:40 +0000
Date: Sun, 24 Apr 2011 20:44:40 +0000
Message-Id: <E1QE6AZ-00051s-PV@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 9fc8ba318396e6b884ef68601722c338ff70b52c
X-Git-Newrev: 473fc006e45e89815967fb0dc073c45f707f6a93
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-483-g473fc00
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Apr 2011 20:44:47 -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  473fc006e45e89815967fb0dc073c45f707f6a93 (commit)
       via  382b5a3c85857290ef497c850a5d6d6ed1128ccc (commit)
      from  9fc8ba318396e6b884ef68601722c338ff70b52c (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 473fc006e45e89815967fb0dc073c45f707f6a93
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sun Apr 24 22:44:58 2011 +0200

    HttpHandlers: simplify appendDataToHTTPChannel.

diff --git a/myserver/include/base/mem_buff/mem_buff.h b/myserver/include/base/mem_buff/mem_buff.h
index d246812..3e504ae 100644
--- a/myserver/include/base/mem_buff/mem_buff.h
+++ b/myserver/include/base/mem_buff/mem_buff.h
@@ -41,7 +41,7 @@ public:
   MemBuf (MemBuf& srcBuf, int bCopy);
   ~MemBuf ();
 
-  void setExternalBuffer (const void* pAdr, size_t size);
+  void setExternalBuffer (void* pAdr, size_t size);
   int setBuffer (const void* pAdr, size_t size);
   void setLength (size_t newSize);
   void setRealLength (size_t newSize);
diff --git a/myserver/include/filter/memory_stream.h b/myserver/include/filter/memory_stream.h
index 65d9d8d..f7514e6 100644
--- a/myserver/include/filter/memory_stream.h
+++ b/myserver/include/filter/memory_stream.h
@@ -42,5 +42,4 @@ private:
   int readSeek;
 };
 
-
 #endif
diff --git a/myserver/include/http_handler/proxy/proxy.h b/myserver/include/http_handler/proxy/proxy.h
index 0ccb3f6..2a02ffc 100644
--- a/myserver/include/http_handler/proxy/proxy.h
+++ b/myserver/include/http_handler/proxy/proxy.h
@@ -53,7 +53,6 @@ protected:
                      FiltersChain &out, bool onlyHeader, bool *kaClient);
   int readPayLoad (HttpThreadContext* td,
                    HttpResponseHeader* res,
-                   FiltersChain *out,
                    Socket *client,
                    const char *initBuffer,
                    u_long initBufferSize,
diff --git a/myserver/include/http_handler/scgi/scgi.h b/myserver/include/http_handler/scgi/scgi.h
index a77a299..76eb81d 100644
--- a/myserver/include/http_handler/scgi/scgi.h
+++ b/myserver/include/http_handler/scgi/scgi.h
@@ -33,7 +33,6 @@
 # include <include/protocol/http/http_data_handler.h>
 # include <include/base/hash_map/hash_map.h>
 # include <include/base/process/process_server_manager.h>
-# include <include/filter/filters_chain.h>
 # include <string>
 
 using namespace std;
@@ -64,7 +63,7 @@ private:
   static int initialized;
   Socket getScgiConnection ();
   int sendPostData (ScgiContext* ctx);
-  int sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain*);
+  int sendResponse (ScgiContext* ctx, bool onlyHeader);
   int buildScgiEnvironmentString (HttpThreadContext*, char*, char*);
   int sendNetString (ScgiContext*, const char*, int);
   ScgiServer* isScgiServerRunning (const char*);
diff --git a/myserver/include/protocol/http/http_data_handler.h b/myserver/include/protocol/http/http_data_handler.h
index cd3d013..eb06572 100644
--- a/myserver/include/protocol/http/http_data_handler.h
+++ b/myserver/include/protocol/http/http_data_handler.h
@@ -22,9 +22,10 @@
 
 # include "myserver.h"
 # include <include/protocol/protocol.h>
-# include "include/protocol/http/http_headers.h"
+# include <include/protocol/http/http_headers.h>
+# include <include/protocol/http/http_thread_context.h>
 # include <include/filter/filters_chain.h>
-#include <include/filter/filters_factory.h>
+# include <include/filter/filters_factory.h>
 # include <include/filter/memory_stream.h>
 # include <include/conf/mime/mime_manager.h>
 
@@ -45,39 +46,34 @@ public:
   virtual int load ();
   virtual int unLoad ();
 
-  virtual int send (HttpThreadContext*, const char* exec,
-                    const char* cmdLine = 0, bool execute = false,
+  virtual int send (HttpThreadContext *, const char *exec,
+                    const char *cmdLine = 0, bool execute = false,
                     bool onlyHeader = false);
 
   HttpDataHandler ();
   virtual ~HttpDataHandler ();
 
-  static void chooseEncoding (HttpThreadContext* td,
+  static void chooseEncoding (HttpThreadContext *td,
                                bool disableEncoding = false);
 
-  static size_t appendDataToHTTPChannel (HttpThreadContext* td,
+  static size_t appendDataToHTTPChannel (HttpThreadContext *td,
                                          const char *buffer,
-                                         size_t size,
-                                         FiltersChain &chain,
-                                         size_t realBufferSize,
-                                         MemoryStream &tmpStream);
+                                         size_t size);
 
   static size_t appendDataToHTTPChannel (HttpThreadContext* td,
                                          const char *buffer,
                                          size_t size,
                                          FiltersChain &chain);
 
+
   static size_t beginHTTPResponse (HttpThreadContext *td,
-                                   MemoryStream &memStream,
-                                   FiltersChain &chain);
+                                   MemoryStream &memStream);
 
   static size_t completeHTTPResponse (HttpThreadContext *td,
-                                      MemoryStream &memStream,
-                                      FiltersChain &chain);
+                                      MemoryStream &memStream);
 
   static size_t generateFiltersChain (HttpThreadContext *td,
                                       FiltersFactory *factory,
-                                      FiltersChain &fc,
                                       MimeRecord *mime,
                                       MemoryStream &memStream);
 };
diff --git a/myserver/include/protocol/http/http_thread_context.h b/myserver/include/protocol/http/http_thread_context.h
index 51e2cc4..7a6800c 100644
--- a/myserver/include/protocol/http/http_thread_context.h
+++ b/myserver/include/protocol/http/http_thread_context.h
@@ -29,6 +29,7 @@
 # include <include/connection/connection.h>
 # include <include/conf/mime/mime_manager.h>
 # include <include/conf/security/security_token.h>
+# include <include/filter/filters_chain.h>
 
 # ifdef WIN32
 #  include <direct.h>
@@ -66,6 +67,8 @@ struct HttpThreadContext
 
   bool keepalive;
 
+  FiltersChain outputChain;
+
   ConnectionPtr connection;
   MemBuf *buffer;
   MemBuf *auxiliaryBuffer;
@@ -93,6 +96,7 @@ struct HttpThreadContext
   SecurityToken securityToken;
   int permissions;
 
+  ~HttpThreadContext ();
   const char* getVhostDir ();
   const char* getVhostSys ();
   const char* getData (const char *name);
diff --git a/myserver/src/base/mem_buff/mem_buff.cpp b/myserver/src/base/mem_buff/mem_buff.cpp
index cbf87cc..81f9751 100644
--- a/myserver/src/base/mem_buff/mem_buff.cpp
+++ b/myserver/src/base/mem_buff/mem_buff.cpp
@@ -266,11 +266,11 @@ int MemBuf::setBuffer (const void* pAdr, size_t size)
   buffer.setExternalBuffer (stackBuffer, 10); // here, you'll use
                                               // the memory from stackBuffer.
  */
-void MemBuf::setExternalBuffer (const void* pAdr, size_t size)
+void MemBuf::setExternalBuffer (void* pAdr, size_t size)
 {
   free ();
   bCanDelete = false;
-  buffer = (char*) pAdr;
+  buffer = (char *) pAdr;
   nRealSize = size;
   nSize = 0;
 }
diff --git a/myserver/src/filter/memory_stream.cpp b/myserver/src/filter/memory_stream.cpp
index f8fc4c1..cdfd797 100644
--- a/myserver/src/filter/memory_stream.cpp
+++ b/myserver/src/filter/memory_stream.cpp
@@ -29,7 +29,7 @@ using namespace std;
 /*!
   Inherited from Stream.
  */
-int MemoryStream::read (char* buffer, size_t len, size_t *nbr)
+int MemoryStream::read (char *buffer, size_t len, size_t *nbr)
 {
   char *b;
   *nbr = std::min (len, static_cast<size_t>(data->getLength () - readSeek));
@@ -45,10 +45,10 @@ int MemoryStream::read (char* buffer, size_t len, size_t *nbr)
 /*!
   Read directly on the stream.
  */
-int MemoryStream::read (Stream* s, size_t len, size_t *nbr)
+int MemoryStream::read (Stream *s, size_t len, size_t *nbr)
 {
   size_t towrite = *nbr = std::min (len, static_cast<size_t>(data->getLength () - readSeek));
-  int ret = s->write (data->getBuffer ()+readSeek, towrite, nbr);
+  int ret = s->write (data->getBuffer () + readSeek, towrite, nbr);
   readSeek += towrite;
   return ret;
 }
@@ -56,7 +56,7 @@ int MemoryStream::read (Stream* s, size_t len, size_t *nbr)
 /*!
   Inherited from Stream.
  */
-int MemoryStream::write (const char* buffer, size_t len, size_t *nbw)
+int MemoryStream::write (const char *buffer, size_t len, size_t *nbw)
 {
   data->addBuffer (buffer, len);
   *nbw = len;
@@ -88,7 +88,7 @@ MemoryStream::MemoryStream (MemBuf* out)
  */
 int MemoryStream::availableToRead ()
 {
-  return data->getLength ()-readSeek;
+  return data->getLength () - readSeek;
 }
 
 /*!
diff --git a/myserver/src/http_handler/cgi/cgi.cpp b/myserver/src/http_handler/cgi/cgi.cpp
index 7defe45..cd7f7f2 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -63,7 +63,7 @@ int Cgi::send (HttpThreadContext* td, const char* scriptpath,
   bool nph = false;
   ostringstream cmdLine;
 
-  FiltersChain chain;
+  FiltersChain &chain = td->outputChain;
   Process cgiProc;
 
   StartProcInfo spi;
@@ -339,13 +339,12 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
 
       if (nBytesRead)
         td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
-                                                  td->auxiliaryBuffer->getBuffer (),
-                                                  nBytesRead,
-                                                  chain);
+                                           td->auxiliaryBuffer->getBuffer (),
+                                                          nBytesRead);
     }
 
   MemoryStream memStream (td->auxiliaryBuffer);
-  td->sentData += completeHTTPResponse (td, memStream, chain);
+  td->sentData += completeHTTPResponse (td, memStream);
 
   return HttpDataHandler::RET_OK;
 }
@@ -462,8 +461,7 @@ int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile,
       /* Flush the buffer.  Data from the header parsing can be present.  */
       td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                td->auxiliaryBuffer->getBuffer () + headerSize,
-                                                    headerOffset - headerSize,
-                                                    chain);
+                                                   headerOffset - headerSize);
     }
 
   return 0;
diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index 47f56fc..3d9ca72 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -63,7 +63,7 @@ int FastCgi::send (HttpThreadContext* td, const char* scriptpath,
   FcgiContext con;
   size_t nbr = 0;
   FcgiHeader header;
-  FiltersChain chain;
+  FiltersChain &chain = td->outputChain;
   size_t nbw;
 
   int exit;
@@ -284,7 +284,7 @@ int FastCgi::send (HttpThreadContext* td, const char* scriptpath,
       while (! exit);
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream, chain);
+      td->sentData += completeHTTPResponse (td, memStream);
 
       chain.clearAllFilters ();
       con.sock.close ();
@@ -618,8 +618,7 @@ int FastCgi::sendData (FcgiContext* con, u_long dim, u_long timeout,
   con->td->sentData +=
     HttpDataHandler::appendDataToHTTPChannel (con->td,
                                               con->td->buffer->getBuffer (),
-                                              con->td->buffer->getLength (),
-                                              *chain);
+                                              con->td->buffer->getLength ());
   return 0;
 }
 
@@ -702,10 +701,10 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain* chain, bool* response
   /* Flush the buffer if remaining data is present.  */
   if (size - headerSize)
     {
-      size_t nbw = HttpDataHandler::appendDataToHTTPChannel (con->td,
-                                                con->td->buffer->getBuffer () + headerSize,
-                                                size - headerSize,
-                                                *chain);
+      size_t nbw =
+        appendDataToHTTPChannel (con->td,
+                                 con->td->buffer->getBuffer () + headerSize,
+                                 size - headerSize);
       con->td->sentData += nbw;
     }
 
diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp b/myserver/src/http_handler/http_dir/http_dir.cpp
index 260e94b..83b7186 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -323,7 +323,7 @@ int HttpDir::send (HttpThreadContext* td,
   string filename;
   int ret;
   ReadDirectory fd;
-  FiltersChain chain;
+  FiltersChain &chain = td->outputChain;
   int lastSlash = 0;
   char* bufferloop;
   const char* cssFile;
@@ -348,15 +348,13 @@ int HttpDir::send (HttpThreadContext* td,
 
 
       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);
+
+      MemoryStream memStream (td->auxiliaryBuffer);
+      generateFiltersChain (td, Server::getInstance ()->getFiltersFactory (),
+                            td->mime, memStream);
 
       lastSlash = td->request.uri.rfind ('/') + 1;
 
@@ -375,7 +373,6 @@ int HttpDir::send (HttpThreadContext* td,
                                                         "is not valid"), ignPattern);
 
               fd.findclose ();
-              chain.clearAllFilters ();
               return td->http->raiseHTTPError (500);
             }
         }
@@ -434,8 +431,7 @@ int HttpDir::send (HttpThreadContext* td,
       *td->auxiliaryBuffer << "</head>\r\n";
 
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                           td->auxiliaryBuffer->getLength (),
-                                           chain);
+                                               td->auxiliaryBuffer->getLength ());
 
       filename = directory;
       td->auxiliaryBuffer->setLength (0);
@@ -449,8 +445,7 @@ int HttpDir::send (HttpThreadContext* td,
       *td->auxiliaryBuffer << "</h1>\r\n<hr />\r\n";
 
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                           td->auxiliaryBuffer->getLength (),
-                                           chain);
+                                           td->auxiliaryBuffer->getLength ());
 
       fd.findfirst (filename.c_str ());
 
@@ -464,8 +459,7 @@ int HttpDir::send (HttpThreadContext* td,
       generateHeader (*td->auxiliaryBuffer, sortType, sortReverse, formatString);
 
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                               td->auxiliaryBuffer->getLength (),
-                                               chain);
+                                               td->auxiliaryBuffer->getLength ());
       td->auxiliaryBuffer->setLength (0);
 
       if (FilesUtility::getPathRecursionLevel (td->request.uri) >= 1)
@@ -500,8 +494,7 @@ int HttpDir::send (HttpThreadContext* td,
           *td->auxiliaryBuffer << "</tr>\r\n";
 
           td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                                   td->auxiliaryBuffer->getLength (),
-                                                   chain);
+                                                   td->auxiliaryBuffer->getLength ());
         }
 
       /* Put all files in a vector.  */
@@ -561,8 +554,7 @@ int HttpDir::send (HttpThreadContext* td,
           td->auxiliaryBuffer->setLength (0);
           generateElement (*td->auxiliaryBuffer, file, linkPrefix, formatString);
           td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                                   td->auxiliaryBuffer->getLength (),
-                                                   chain);
+                                                   td->auxiliaryBuffer->getLength ());
         }
 
       td->auxiliaryBuffer->setLength (0);
@@ -585,8 +577,7 @@ int HttpDir::send (HttpThreadContext* td,
         }
       *td->auxiliaryBuffer << "</address>\r\n</body>\r\n</html>\r\n";
       td->sentData += appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                               td->auxiliaryBuffer->getLength (),
-                                               chain);
+                                               td->auxiliaryBuffer->getLength ());
 
       *td->auxiliaryBuffer << end_str;
       /* Changes the \ character in the / character.  */
@@ -595,16 +586,13 @@ int HttpDir::send (HttpThreadContext* td,
         if (*bufferloop == '\\')
           *bufferloop = '/';
 
-      MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream, chain);
+      td->sentData += completeHTTPResponse (td, memStream);
     }
   catch (exception & e)
     {
-      chain.clearAllFilters ();
       return HttpDataHandler::RET_FAILURE;
     }
 
-  chain.clearAllFilters ();
   return HttpDataHandler::RET_OK;
 }
 
diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 3bc037e..5acdf15 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -203,7 +203,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
   off_t lastByte = td->request.rangeByteEnd;
   bool fastCopyAllowed;
   MemoryStream memStream (td->auxiliaryBuffer);
-  FiltersChain chain;
+  FiltersChain &chain = td->outputChain;
   size_t nbr;
   time_t lastMT;
   string tmpTime;
@@ -300,7 +300,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
       }
 
     generateFiltersChain (td, Server::getInstance ()->getFiltersFactory (),
-                          chain, td->mime, memStream);
+                          td->mime, memStream);
 
     fastCopyAllowed = chain.isEmpty ()
       && !(td->http->getProtocolOptions () & Protocol::SSL);
@@ -350,7 +350,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
 
     file->seek (firstByte);
 
-    td->sentData += HttpDataHandler::beginHTTPResponse (td, memStream, chain);
+    td->sentData += HttpDataHandler::beginHTTPResponse (td, memStream);
 
     /* Flush the rest of the file.  */
     for (;;)
@@ -374,12 +374,10 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
         bytesToSend -= nbr;
 
         td->sentData += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                 nbr, chain,
-                                                 td->buffer->getRealLength (),
-                                                 memStream);
+                                                 nbr);
       }/* End for loop.  */
 
-    td->sentData += completeHTTPResponse (td, memStream, chain);
+    td->sentData += completeHTTPResponse (td, memStream);
 
     file->close ();
     delete file;
diff --git a/myserver/src/http_handler/isapi/isapi.cpp b/myserver/src/http_handler/isapi/isapi.cpp
index 3ae9523..8621bf5 100644
--- a/myserver/src/http_handler/isapi/isapi.cpp
+++ b/myserver/src/http_handler/isapi/isapi.cpp
@@ -291,8 +291,7 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
             written =
               HttpDataHandler::appendDataToHTTPChannel (ConnInfo->td,
                                                         buffer + headerSize,
-                                                        len,
-                                                        ConnInfo->chain);
+                                                        len);
           ConnInfo->td->sentData += written;
 
           *lpdwBytes = written;
@@ -303,8 +302,7 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
       size_t written =
         HttpDataHandler::appendDataToHTTPChannel (ConnInfo->td,
                                                   (const char *) Buffer,
-                                                  *lpdwBytes,
-                                                  ConnInfo->chain);
+                                                  *lpdwBytes);
       ConnInfo->td->sentData += written;
       *lpdwBytes = written;
     }
@@ -824,8 +822,7 @@ int Isapi::send (HttpThreadContext* td,
         = connTable[connIndex].td->request.other.get ("connection");
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream,
-                                            connTable[connIndex].chain);
+      td->sentData += completeHTTPResponse (td, memStream);
 
       switch (ret)
         {
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp b/myserver/src/http_handler/mscgi/mscgi.cpp
index 0732223..cc59ce4 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -53,7 +53,7 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
    */
   ostringstream tmpStream;
   string outDataPath;
-  FiltersChain chain;
+  FiltersChain &chain = td->outputChain;
   size_t nbw;
   DynamicLibrary hinstLib;
   CGIMAIN ProcMain = 0;
@@ -132,7 +132,7 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
         }
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream, chain);
+      td->sentData += completeHTTPResponse (td, memStream);
 
       if (!data.error)
         return HttpDataHandler::RET_FAILURE;
@@ -152,7 +152,7 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
 /*!
   Send a chunk of data to the client.
  */
-int MsCgi::write (const char* data, size_t len, MsCgiData* mcd)
+int MsCgi::write (const char *data, size_t len, MsCgiData *mcd)
 {
   if (mcd->error)
     return 1;
@@ -173,7 +173,7 @@ int MsCgi::write (const char* data, size_t len, MsCgiData* mcd)
 /*!
   Send the HTTP header.
  */
-int MsCgi::sendHeader (MsCgiData* mcd)
+int MsCgi::sendHeader (MsCgiData *mcd)
 {
   HttpThreadContext* td = mcd->td;
 
diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index c2ae6dc..83cb4d5 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -49,7 +49,7 @@ int Proxy::send (HttpThreadContext *td, const char* scriptpath,
   Url destUrl (exec, 80);
   ConnectionPtr con = NULL;
   Socket *sock;
-  FiltersChain chain;
+  FiltersChain &chain = td->outputChain;
   HttpRequestHeader req;
   size_t nbw;
   bool keepalive = false;
@@ -220,7 +220,7 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
   if (onlyHeader)
     return HttpDataHandler::RET_OK;
 
-  readPayLoad (td, &td->response, &out, &client,
+  readPayLoad (td, &td->response, &client,
                td->auxiliaryBuffer->getBuffer () + headerLength,
                read - headerLength, td->http->getTimeout (),
                hasTransferEncoding ? &transferEncoding : NULL);
@@ -234,7 +234,6 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
 
   \param td The current HTTP thread context.
   \param res Response obtained by the server.
-  \param out The client chain.
   \param initBuffer Initial read data.
   \param initBufferSize Size of initial data.
   \param timeout Connection timeout.
@@ -247,7 +246,6 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
  */
 int Proxy::readPayLoad (HttpThreadContext* td,
                         HttpResponseHeader* res,
-                        FiltersChain *out,
                         Socket *client,
                         const char *initBuffer,
                         u_long initBufferSize,
@@ -291,7 +289,7 @@ int Proxy::readPayLoad (HttpThreadContext* td,
 
               td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
                                                        td->buffer->getBuffer (),
-                                                       nbr, *out);
+                                                       nbr);
             }
         }
     }
@@ -320,15 +318,16 @@ int Proxy::readPayLoad (HttpThreadContext* td,
           if (length)
             length -= nbr;
 
-          td->sentData += HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                    nbr, *out);
+          td->sentData +=
+            HttpDataHandler::appendDataToHTTPChannel (td,
+                                             td->buffer->getBuffer (), nbr);
           if (timedOut || contentLength && length == 0)
             break;
         }
     }
 
   MemoryStream memStream (td->auxiliaryBuffer);
-  td->sentData += completeHTTPResponse (td, memStream, *out);
+  td->sentData += completeHTTPResponse (td, memStream);
 
   return HttpDataHandler::RET_OK;
 }
diff --git a/myserver/src/http_handler/scgi/scgi.cpp b/myserver/src/http_handler/scgi/scgi.cpp
index e6583aa..e91be52 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -45,7 +45,7 @@ int Scgi::send (HttpThreadContext* td, const char* scriptpath,
                const char *cgipath, bool execute, bool onlyHeader)
 {
   ScgiContext con;
-  FiltersChain chain;
+  FiltersChain &chain = td->outputChain;
 
   string outDataPath;
 
@@ -166,7 +166,6 @@ int Scgi::send (HttpThreadContext* td, const char* scriptpath,
       if (sizeEnvString == -1)
         {
           td->connection->host->warningsLogWrite (_("SCGI: internal error"));
-          chain.clearAllFilters ();
           return td->http->raiseHTTPError (500);
         }
 
@@ -179,7 +178,6 @@ int Scgi::send (HttpThreadContext* td, const char* scriptpath,
           td->connection->host->warningsLogWrite
             (_E ("SCGI: error connecting to the process %s"),
              cmdLine.str ().c_str (), &e);
-          chain.clearAllFilters ();
           return td->http->raiseHTTPError (500);
         }
 
@@ -188,15 +186,13 @@ int Scgi::send (HttpThreadContext* td, const char* scriptpath,
           && !td->request.contentLength.compare ("0"))
         sendPostData (&con);
 
-      sendResponse (&con, onlyHeader, &chain);
+      sendResponse (&con, onlyHeader);
 
-      chain.clearAllFilters ();
       con.tempOut.close ();
       con.sock.close ();
     }
   catch (exception & e)
     {
-      chain.clearAllFilters ();
       return HttpDataHandler::RET_FAILURE;
     }
 
@@ -207,7 +203,7 @@ int Scgi::send (HttpThreadContext* td, const char* scriptpath,
 /*!
   Send the response to the client.
  */
-int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
+int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader)
 {
   clock_t initialTicks = getTicks ();
   u_long read = 0;
@@ -265,7 +261,7 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
   if (read - headerSize)
     td->sentData +=
       appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer () + headerSize,
-                               read - headerSize, *chain);
+                               read - headerSize);
 
   if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
     {
@@ -280,11 +276,11 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader, FiltersChain* chain)
 
           td->sentData +=
             appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer (),
-                                     nbr, *chain);
+                                     nbr);
         }
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream, *chain);
+      td->sentData += completeHTTPResponse (td, memStream);
     }
 
   return HttpDataHandler::RET_OK;
diff --git a/myserver/src/http_handler/wincgi/wincgi.cpp b/myserver/src/http_handler/wincgi/wincgi.cpp
index c1e7473..51e39c4 100644
--- a/myserver/src/http_handler/wincgi/wincgi.cpp
+++ b/myserver/src/http_handler/wincgi/wincgi.cpp
@@ -65,7 +65,7 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
                   const char *cgipath, bool /*execute*/, bool onlyHeader)
 {
 #ifdef WIN32
-  FiltersChain chain;
+  FiltersChain &chain = td->outputChain;
   Process proc;
   size_t nbr;
   char  dataFilePath[MAX_PATH];
@@ -103,15 +103,10 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
       GetShortPathName (outFilePath, dataFilePath, MAX_PATH);
       sprintf (&outFilePath[strlen (outFilePath)],"/out_%i.ini",td->id);
       td->inputData.seek (0);
-      chain.setStream (td->connection->socket);
-      if (td->mime)
-        {
-          Server::getInstance ()->getFiltersFactory ()->chain (&chain,
-                                                          td->mime->filters,
-                                                        td->connection->socket,
-                                                               &nbw, 1);
-          td->sentData += nbw;
-        }
+
+      MemoryStream memStream (td->auxiliaryBuffer);
+      generateFiltersChain (td, Server::getInstance ()->getFiltersFactory (),
+                            td->mime, memStream);
 
       /* The WinCGI protocol uses a .ini file to send data to the new process.  */
       DataFileHandle.openFile (dataFilePath, File::FILE_OPEN_ALWAYS
@@ -257,7 +252,6 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
         {
           FilesUtility::deleteFile (outFilePath);
           FilesUtility::deleteFile (dataFilePath);
-          chain.clearAllFilters ();
           return HttpDataHandler::RET_FAILURE;
         }
 
@@ -272,7 +266,6 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
           OutFileHandle.close ();
           FilesUtility::deleteFile (outFilePath);
           FilesUtility::deleteFile (dataFilePath);
-          chain.clearAllFilters ();
           return td->http->raiseHTTPError (500);
         }
 
@@ -291,7 +284,8 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
             }
         }
 
-      HttpHeaders::buildHTTPResponseHeaderStruct (buffer, &td->response, &(td->nBytesToRead));
+      HttpHeaders::buildHTTPResponseHeaderStruct (buffer, &td->response,
+                                                  &(td->nBytesToRead));
 
       chooseEncoding (td);
       HttpHeaders::sendHeader (td->response, *chain.getStream (),
@@ -302,14 +296,12 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
           OutFileHandle.close ();
           FilesUtility::deleteFile (outFilePath);
           FilesUtility::deleteFile (dataFilePath);
-          chain.clearAllFilters ();
           return HttpDataHandler::RET_OK;
         }
 
-      td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
-                                                                buffer + headerSize,
-                                                                nBytesRead - headerSize,
-                                                                chain);
+      td->sentData +=
+        HttpDataHandler::appendDataToHTTPChannel (td, buffer + headerSize,
+                                                  nBytesRead - headerSize);
 
 
       if (td->response.getStatusType () == HttpResponseHeader::SUCCESSFUL)
@@ -324,24 +316,21 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
 
               td->sentData +=
                 HttpDataHandler::appendDataToHTTPChannel (td, buffer,
-                                                          nBytesRead, chain);
+                                                          nBytesRead);
 
               td->sentData += nbw;
             }
           while (nBytesRead);
         }
 
-      MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += completeHTTPResponse (td, memStream, chain);
+      td->sentData += completeHTTPResponse (td, memStream);
 
-      chain.clearAllFilters ();
       OutFileHandle.close ();
       FilesUtility::deleteFile (outFilePath);
       FilesUtility::deleteFile (dataFilePath);
     }
   catch (exception & e)
     {
-      chain.clearAllFilters ();
       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 af656e5..74b359e 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -67,25 +67,13 @@ int HttpDataHandler::unLoad ()
   \param td The HTTP thread context.
   \param buffer Data to send.
   \param size Size of the buffer.
-  \param chain Where send data if not append.
-  \param realBufferSize The real dimension of the buffer that can be
-  used by this method.
-  \param tmpStream A support on memory read/write stream used
-  internally by the function.
  */
 size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
                                                  const char *buffer,
-                                                 size_t size,
-                                                 FiltersChain &chain,
-                                                 size_t realBufferSize,
-                                                 MemoryStream &tmpStream)
+                                                 size_t size)
 {
-  char tmpBuf[BUFSIZ];
-  size_t nbr, nbw, written = 0, totalNbw = 0;
-  Stream *oldStream = chain.getStream ();
-
-  if (! chain.hasModifiersFilters () || size == 0)
-    return appendDataToHTTPChannel (td, buffer, size, chain);
+  if (! td->outputChain.hasModifiersFilters () || size == 0)
+    return appendDataToHTTPChannel (td, buffer, size, td->outputChain);
 
   /*
     This function can't append directly to the chain because we can't
@@ -94,29 +82,36 @@ size_t HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
     chunk content, finally we read from it and send directly to the
     original stream.
    */
+  Stream *oldStream = td->outputChain.getStream ();
+  size_t totalNbw = 0;
   try
     {
+      char tmpBuf[BUFSIZ];
+      size_t nbw;
+      MemBuf memBuf;
+      MemoryStream tmpStream (&memBuf);
       FiltersChain directStream (oldStream);
-      do
+      size_t consumed = 0;
+
+      memBuf.setExternalBuffer (tmpBuf, BUFSIZ);
+      while (consumed < size)
         {
-          if (size - written)
-            {
-              chain.setStream (&tmpStream);
-              chain.write (buffer + written, size - written, &nbw);
-              chain.setStream (oldStream);
-              written += size;
-            }
-
-          tmpStream.read (tmpBuf, BUFSIZ, &nbr);
-          if (nbr)
-            totalNbw += appendDataToHTTPChannel (td, tmpBuf, nbr, directStream);
+          size_t available;
+          size_t written = std::min ((size_t) BUFSIZ / 2, size - consumed);
+          td->outputChain.setStream (&tmpStream);
+          td->outputChain.write (buffer + consumed, written, &available);
+          td->outputChain.setStream (oldStream);
+
+          totalNbw += appendDataToHTTPChannel (td, tmpBuf,
+                                               available,
+                                               directStream);
+          tmpStream.refresh ();
+          consumed += written;
         }
-      while (size - written || nbr);
-      tmpStream.refresh ();
     }
   catch (...)
     {
-      chain.setStream (oldStream);
+      td->outputChain.setStream (oldStream);
       throw;
     }
 
@@ -163,7 +158,7 @@ HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
   If it is specified, then the Content-Length must be specified.
  */
 void
-HttpDataHandler::chooseEncoding (HttpThreadContext* td, bool disableEncoding)
+HttpDataHandler::chooseEncoding (HttpThreadContext *td, bool disableEncoding)
 {
   td->keepalive = td->request.isKeepAlive ();
   td->useChunks = false;
@@ -182,8 +177,7 @@ HttpDataHandler::chooseEncoding (HttpThreadContext* td, bool disableEncoding)
 */
 size_t
 HttpDataHandler::beginHTTPResponse (HttpThreadContext *td,
-                                    MemoryStream &memStream,
-                                    FiltersChain &chain)
+                                    MemoryStream &memStream)
 {
   size_t ret = 0;
   /*
@@ -200,7 +194,7 @@ HttpDataHandler::beginHTTPResponse (HttpThreadContext *td,
       memStream.refresh ();
       if (nbr)
         {
-          FiltersChain directChain (chain.getStream ());
+          FiltersChain directChain (td->outputChain.getStream ());
           ret += appendDataToHTTPChannel (td, td->buffer->getBuffer (), nbr,
                                           directChain);
         }
@@ -214,13 +208,12 @@ HttpDataHandler::beginHTTPResponse (HttpThreadContext *td,
  */
 size_t
 HttpDataHandler::completeHTTPResponse (HttpThreadContext *td,
-                                       MemoryStream &memStream,
-                                       FiltersChain &chain)
+                                       MemoryStream &memStream)
 {
   size_t ret = 0;
   /* If we don't use chunks we can flush directly.  */
   if (! td->useChunks)
-    chain.flush (&ret);
+    td->outputChain.flush (&ret);
   else
     {
       /*
@@ -230,18 +223,19 @@ HttpDataHandler::completeHTTPResponse (HttpThreadContext *td,
         write there the HTTP data chunk.
       */
       size_t nbr, nbw;
-      Stream* tmpStream = chain.getStream ();
+      Stream* tmpStream = td->outputChain.getStream ();
       FiltersChain directChain (tmpStream);
       memStream.refresh ();
-      chain.setStream (&memStream);
-      chain.flush (&nbw);
-      chain.setStream (tmpStream);
+      td->outputChain.setStream (&memStream);
+      td->outputChain.flush (&nbw);
+      td->outputChain.setStream (tmpStream);
+
       memStream.read (td->buffer->getBuffer (),
                       td->buffer->getRealLength (), &nbr);
 
       ret += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
                                       nbr, directChain);
-      chain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
+      td->outputChain.getStream ()->write ("0\r\n\r\n", 5, &nbw);
     }
 
   return ret;
@@ -254,7 +248,6 @@ HttpDataHandler::completeHTTPResponse (HttpThreadContext *td,
 size_t
 HttpDataHandler::generateFiltersChain (HttpThreadContext *td,
                                        FiltersFactory *factory,
-                                       FiltersChain &fc,
                                        MimeRecord *mime,
                                        MemoryStream &memStream)
 {
@@ -263,16 +256,16 @@ HttpDataHandler::generateFiltersChain (HttpThreadContext *td,
   memStream.refresh ();
 
   if (mime)
-    factory->chain (&fc, mime->filters, &memStream, &nbw, 0, false,
-                    e ? e->value : "");
+    factory->chain (&td->outputChain, mime->filters, &memStream, &nbw, 0,
+                    false, e ? e->value : "");
 
-  if (fc.hasModifiersFilters ())
+  if (td->outputChain.hasModifiersFilters ())
     {
       string filters;
-      fc.getName (filters);
+      td->outputChain.getName (filters);
       td->response.setValue ("content-encoding", filters.c_str ());
     }
 
-  fc.setStream (td->connection->socket);
+  td->outputChain.setStream (td->connection->socket);
   return nbw;
 }
diff --git a/myserver/src/protocol/http/http_thread_context.cpp b/myserver/src/protocol/http/http_thread_context.cpp
index dd62990..472f3c4 100644
--- a/myserver/src/protocol/http/http_thread_context.cpp
+++ b/myserver/src/protocol/http/http_thread_context.cpp
@@ -66,3 +66,8 @@ const char *HttpThreadContext::getVhostSys ()
 
   return "";
 }
+
+HttpThreadContext::~HttpThreadContext ()
+{
+  outputChain.clearAllFilters ();
+}
diff --git a/myserver/src/protocol/http/webdav/webdav.cpp b/myserver/src/protocol/http/webdav/webdav.cpp
index 5dbd433..f39a1d3 100644
--- a/myserver/src/protocol/http/webdav/webdav.cpp
+++ b/myserver/src/protocol/http/webdav/webdav.cpp
@@ -286,7 +286,7 @@ int WebDAV::propfind (HttpThreadContext* td)
   try
     {
       size_t nbw, nbw2;
-      FiltersChain chain;
+      FiltersChain &chain = td->outputChain;
       list<string> filters;
       FiltersFactory *ff = Server::getInstance ()->getFiltersFactory ();
       vector <const char *> propReq;
@@ -333,14 +333,13 @@ int WebDAV::propfind (HttpThreadContext* td)
 
           td->sentData +=
             HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                      nbr, chain);
+                                                      nbr);
           if (nbr != td->buffer->getRealLength ())
             break;
         }
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += HttpDataHandler::completeHTTPResponse (td, memStream,
-                                                             chain);
+      td->sentData += HttpDataHandler::completeHTTPResponse (td, memStream);
 
       return HttpDataHandler::RET_OK;
     }
@@ -577,7 +576,7 @@ int WebDAV::lock (HttpThreadContext* td)
       Sha1 sha1;
       vector <const char*> propReq;
       size_t nbw, nbw2;
-      FiltersChain chain;
+      FiltersChain &chain = td->outputChain;
       list<string> filters;
       FiltersFactory *ff = Server::getInstance ()->getFiltersFactory ();
 
@@ -641,11 +640,11 @@ int WebDAV::lock (HttpThreadContext* td)
 
           td->sentData +=
             HttpDataHandler::appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                      nbr, chain);
+                                                      nbr);
         }
 
       MemoryStream memStream (td->auxiliaryBuffer);
-      td->sentData += HttpDataHandler::completeHTTPResponse (td, memStream, chain);
+      td->sentData += HttpDataHandler::completeHTTPResponse (td, memStream);
 
       return HttpDataHandler::RET_OK;
     }



commit 382b5a3c85857290ef497c850a5d6d6ed1128ccc
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Sun Apr 24 14:46:28 2011 +0200

    HttpFile: cleanup.

diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 8f39261..3bc037e 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -267,18 +267,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
     if (etagHeader && !etagHeader->value.compare (etag))
       return td->http->sendHTTPNonModified ();
     else
-      {
-        HttpResponseHeader::Entry *e = td->response.other.get ("etag");
-        if (e)
-          e->value.assign (etag);
-        else
-          {
-            e = new HttpResponseHeader::Entry ();
-            e->name.assign ("etag");
-            e->value.assign (etag);
-            td->response.other.put (e->name, e);
-          }
-      }
+      td->response.setValue ("etag", etag.c_str ());
 
     if (lastByte == 0)
       lastByte = filesize;
@@ -371,25 +360,23 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
         /* Check if there are other bytes to send.  */
         if (! bytesToSend)
           break;
-        else
-          {
-            /* Read from the file the bytes to send.  */
-            size_t size = std::min (td->buffer->getRealLength (), bytesToSend);
-
-            file->read (td->buffer->getBuffer (), size, &nbr);
-            if (nbr == 0)
-              {
-                bytesToSend = 0;
-                continue;
-              }
 
-            bytesToSend -= nbr;
+        /* Read from the file the bytes to send.  */
+        size_t size = std::min (td->buffer->getRealLength (), bytesToSend);
 
-            td->sentData += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
-                                                     nbr, chain,
-                                                     td->buffer->getRealLength (),
-                                                     memStream);
+        file->read (td->buffer->getBuffer (), size, &nbr);
+        if (nbr == 0)
+          {
+            bytesToSend = 0;
+            continue;
           }
+
+        bytesToSend -= nbr;
+
+        td->sentData += appendDataToHTTPChannel (td, td->buffer->getBuffer (),
+                                                 nbr, chain,
+                                                 td->buffer->getRealLength (),
+                                                 memStream);
       }/* End for loop.  */
 
     td->sentData += completeHTTPResponse (td, memStream, chain);

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

Summary of changes:
 myserver/include/base/mem_buff/mem_buff.h          |    2 +-
 myserver/include/filter/memory_stream.h            |    1 -
 myserver/include/http_handler/proxy/proxy.h        |    1 -
 myserver/include/http_handler/scgi/scgi.h          |    3 +-
 myserver/include/protocol/http/http_data_handler.h |   26 +++----
 .../include/protocol/http/http_thread_context.h    |    4 +
 myserver/src/base/mem_buff/mem_buff.cpp            |    4 +-
 myserver/src/filter/memory_stream.cpp              |   10 +-
 myserver/src/http_handler/cgi/cgi.cpp              |   12 +--
 myserver/src/http_handler/fastcgi/fastcgi.cpp      |   15 ++--
 myserver/src/http_handler/http_dir/http_dir.cpp    |   36 +++-----
 myserver/src/http_handler/http_file/http_file.cpp  |   49 ++++-------
 myserver/src/http_handler/isapi/isapi.cpp          |    9 +--
 myserver/src/http_handler/mscgi/mscgi.cpp          |    8 +-
 myserver/src/http_handler/proxy/proxy.cpp          |   15 ++--
 myserver/src/http_handler/scgi/scgi.cpp            |   16 ++--
 myserver/src/http_handler/wincgi/wincgi.cpp        |   35 +++-----
 myserver/src/protocol/http/http_data_handler.cpp   |   89 +++++++++-----------
 myserver/src/protocol/http/http_thread_context.cpp |    5 +
 myserver/src/protocol/http/webdav/webdav.cpp       |   13 ++--
 20 files changed, 149 insertions(+), 204 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Sun Apr 24 19:54:30 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QE98I-0003GH-TN
	for mharc-myserver-commit@gnu.org; Sun, 24 Apr 2011 19:54:30 -0400
Received: from eggs.gnu.org ([140.186.70.92]:53299)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QE98G-0003G8-0f
	for myserver-commit@gnu.org; Sun, 24 Apr 2011 19:54:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QE98D-0007Dh-JK
	for myserver-commit@gnu.org; Sun, 24 Apr 2011 19:54:27 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:47177)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QE98D-0007Dd-Gt
	for myserver-commit@gnu.org; Sun, 24 Apr 2011 19:54:25 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QE98D-0002g5-9s
	for myserver-commit@gnu.org; Sun, 24 Apr 2011 23:54:25 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QE98D-0002ST-3T
	for myserver-commit@gnu.org; Sun, 24 Apr 2011 23:54:25 +0000
Date: Sun, 24 Apr 2011 23:54:25 +0000
Message-Id: <E1QE98D-0002ST-3T@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 473fc006e45e89815967fb0dc073c45f707f6a93
X-Git-Newrev: 8539d2f58209a68e932680002527bef816bdb199
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-484-g8539d2f
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Apr 2011 23:54: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  8539d2f58209a68e932680002527bef816bdb199 (commit)
      from  473fc006e45e89815967fb0dc073c45f707f6a93 (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 8539d2f58209a68e932680002527bef816bdb199
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 25 01:20:08 2011 +0200

    HttpHandlers: support filters.

diff --git a/myserver/include/http_handler/cgi/cgi.h b/myserver/include/http_handler/cgi/cgi.h
index 8a1f4c5..bf96a74 100644
--- a/myserver/include/http_handler/cgi/cgi.h
+++ b/myserver/include/http_handler/cgi/cgi.h
@@ -37,10 +37,10 @@ public:
                     const char* exec = 0, bool execute = false,
                     bool onlyHeader = false);
 private:
-  int sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
-                Process& cgiProc, bool onlyHeader, bool nph);
-  int sendHeader (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
-                  Process& cgiProc, bool onlyHeader, bool nph, u_long procStartTime,
+  int sendData (HttpThreadContext* td, Pipe &stdOutFile, Process& cgiProc,
+                bool onlyHeader, bool nph);
+  int sendHeader (HttpThreadContext* td, Pipe &stdOutFile, Process& cgiProc,
+                  bool onlyHeader, bool nph, u_long procStartTime,
                   int *ret);
 };
 #endif
diff --git a/myserver/include/http_handler/mscgi/mscgi.h b/myserver/include/http_handler/mscgi/mscgi.h
index dc14423..b491742 100644
--- a/myserver/include/http_handler/mscgi/mscgi.h
+++ b/myserver/include/http_handler/mscgi/mscgi.h
@@ -59,7 +59,7 @@ public:
                     bool onlyHeader = false);
 
   int write (const char*, size_t, MsCgiData*);
-  int sendHeader (MsCgiData*);
+  int sendHeader (MsCgiData *);
 
 private:
   static DynamicLibrary mscgiModule;
diff --git a/myserver/src/http_handler/cgi/cgi.cpp b/myserver/src/http_handler/cgi/cgi.cpp
index cd7f7f2..0b9d912 100644
--- a/myserver/src/http_handler/cgi/cgi.cpp
+++ b/myserver/src/http_handler/cgi/cgi.cpp
@@ -63,7 +63,6 @@ int Cgi::send (HttpThreadContext* td, const char* scriptpath,
   bool nph = false;
   ostringstream cmdLine;
 
-  FiltersChain &chain = td->outputChain;
   Process cgiProc;
 
   StartProcInfo spi;
@@ -126,8 +125,6 @@ int Cgi::send (HttpThreadContext* td, const char* scriptpath,
       tmpScriptPath.assign (scriptpath);
       FilesUtility::splitPath (tmpScriptPath, td->scriptDir, td->scriptFile);
 
-      chain.setStream (td->connection->socket);
-
       if (execute)
         {
           const char *args = 0;
@@ -183,7 +180,6 @@ int Cgi::send (HttpThreadContext* td, const char* scriptpath,
                   td->scriptPath.assign ("");
                   td->scriptFile.assign ("");
                   td->scriptDir.assign ("");
-                  chain.clearAllFilters ();
                   return td->http->raiseHTTPError (500);
                 }
 
@@ -264,17 +260,15 @@ int Cgi::send (HttpThreadContext* td, const char* scriptpath,
       stdInFile.close ();
       stdOutFile.closeWrite ();
 
-      sendData (td, stdOutFile, chain, cgiProc, onlyHeader, nph);
+      sendData (td, stdOutFile, cgiProc, onlyHeader, nph);
 
       stdOutFile.close ();
       cgiProc.terminateProcess ();
-      chain.clearAllFilters ();
     }
   catch (exception & e)
     {
       stdOutFile.close ();
       stdInFile.close ();
-      chain.clearAllFilters ();
       return HttpDataHandler::RET_FAILURE;
     }
 
@@ -284,8 +278,8 @@ int Cgi::send (HttpThreadContext* td, const char* scriptpath,
 /*
   Read data from the CGI process and send it back to the client.
  */
-int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
-                   Process &cgiProc, bool onlyHeader, bool nph)
+int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, Process &cgiProc,
+                   bool onlyHeader, bool nph)
 {
   size_t nbw = 0;
   size_t nBytesRead = 0;
@@ -296,21 +290,13 @@ int Cgi::sendData (HttpThreadContext* td, Pipe &stdOutFile, FiltersChain& chain,
 
   procStartTime = getTicks ();
 
-  if (sendHeader (td, stdOutFile, chain, cgiProc, onlyHeader, nph,
-                  procStartTime, &ret))
+  if (sendHeader (td, stdOutFile, cgiProc, onlyHeader, nph, procStartTime,
+                  &ret))
     return ret;
 
   if (!nph && onlyHeader)
     return HttpDataHandler::RET_OK;
 
-  /* Create the output filters chain.  */
-  if (td->mime)
-    {
-      FiltersFactory *ff = Server::getInstance ()->getFiltersFactory ();
-      ff->chain (&chain, td->mime->filters, td->connection->socket, &nbw, 1);
-      td->sentData += nbw;
-    }
-
   /* Send the rest of the data until we can read from the pipe.  */
   for (;;)
     {
@@ -353,9 +339,8 @@ 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, bool onlyHeader,
-                     bool nph, u_long procStartTime, int *ret)
+int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile, Process &cgiProc,
+                     bool onlyHeader, bool nph, u_long procStartTime, int *ret)
 {
   u_long headerSize = 0;
   bool headerCompleted = false;
@@ -450,9 +435,18 @@ int Cgi::sendHeader (HttpThreadContext *td, Pipe &stdOutFile,
               return 1;
             }
 
+          MemoryStream memStream (td->auxiliaryBuffer);
+          generateFiltersChain (td, Server::getInstance ()->getFiltersFactory (),
+                                td->mime, memStream);
+
           chooseEncoding (td);
-          HttpHeaders::sendHeader (td->response, *chain.getStream (),
+          HttpHeaders::sendHeader (td->response, *td->outputChain.getStream (),
                                    *td->buffer, td);
+
+          if (onlyHeader)
+            return 0;
+
+          td->sentData += HttpDataHandler::beginHTTPResponse (td, memStream);
         }
     }
 
diff --git a/myserver/src/http_handler/fastcgi/fastcgi.cpp b/myserver/src/http_handler/fastcgi/fastcgi.cpp
index 3d9ca72..969dded 100644
--- a/myserver/src/http_handler/fastcgi/fastcgi.cpp
+++ b/myserver/src/http_handler/fastcgi/fastcgi.cpp
@@ -93,14 +93,6 @@ int FastCgi::send (HttpThreadContext* td, const char* scriptpath,
       FilesUtility::splitPath (tmp, td->cgiRoot, td->cgiFile);
       tmp.assign (scriptpath);
       FilesUtility::splitPath (tmp, td->scriptDir, td->scriptFile);
-      chain.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';
@@ -185,7 +177,6 @@ int FastCgi::send (HttpThreadContext* td, const char* scriptpath,
           td->connection->host->warningsLogWrite
               (_("FastCGI: cannot connect to the %s process"),
                cmdLine.str ().c_str ());
-          chain.clearAllFilters ();
           return td->http->raiseHTTPError (500);
         }
 
@@ -286,12 +277,10 @@ int FastCgi::send (HttpThreadContext* td, const char* scriptpath,
       MemoryStream memStream (td->auxiliaryBuffer);
       td->sentData += completeHTTPResponse (td, memStream);
 
-      chain.clearAllFilters ();
       con.sock.close ();
     }
   catch (exception & e)
     {
-      chain.clearAllFilters ();
       return HttpDataHandler::RET_FAILURE;
     }
 
@@ -631,7 +620,7 @@ int FastCgi::sendData (FcgiContext* con, u_long dim, u_long timeout,
   \return 0 on success.
  */
 int FastCgi::handleHeader (FcgiContext* con, FiltersChain* chain, bool* responseCompleted,
-         bool onlyHeader)
+                           bool onlyHeader)
 {
   char* buffer = con->td->buffer->getBuffer ();
   u_long size = con->td->buffer->getLength ();
@@ -679,14 +668,21 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain* chain, bool* response
         }
     }
 
-    {
-      string *location = con->td->response.getValue ("Location", NULL);
-      if (location)
-        {
-          *responseCompleted = true;
-          return con->td->http->sendHTTPRedirect (location->c_str ());
-        }
-    }
+  {
+    string *location = con->td->response.getValue ("Location", NULL);
+    if (location)
+      {
+        *responseCompleted = true;
+        return con->td->http->sendHTTPRedirect (location->c_str ());
+      }
+  }
+
+  char tmpBuf[1024];
+  MemBuf memBuf;
+  MemoryStream memStream (&memBuf);
+  memBuf.setExternalBuffer (tmpBuf, sizeof (tmpBuf));
+  generateFiltersChain (con->td, Server::getInstance ()->getFiltersFactory (),
+                        con->td->mime, memStream);
 
   chooseEncoding (con->td);
   if (HttpHeaders::sendHeader (con->td->response, *con->td->connection->socket,
@@ -696,8 +692,14 @@ int FastCgi::handleHeader (FcgiContext* con, FiltersChain* chain, bool* response
       return 1;
     }
 
+
   con->headerSent = true;
 
+  if (onlyHeader)
+    return 0;
+
+  con->td->sentData += HttpDataHandler::beginHTTPResponse (con->td, memStream);
+
   /* Flush the buffer if remaining data is present.  */
   if (size - headerSize)
     {
diff --git a/myserver/src/http_handler/http_dir/http_dir.cpp b/myserver/src/http_handler/http_dir/http_dir.cpp
index 83b7186..e155641 100644
--- a/myserver/src/http_handler/http_dir/http_dir.cpp
+++ b/myserver/src/http_handler/http_dir/http_dir.cpp
@@ -384,6 +384,8 @@ int HttpDir::send (HttpThreadContext* td,
       if (onlyHeader)
         return HttpDataHandler::RET_OK;
 
+      td->sentData += HttpDataHandler::beginHTTPResponse (td, memStream);
+
       sortIndex = td->request.uriOpts.find ("sort=");
 
       if (sortIndex != string::npos && sortIndex + 5 < td->request.uriOpts.length ())
diff --git a/myserver/src/http_handler/http_file/http_file.cpp b/myserver/src/http_handler/http_file/http_file.cpp
index 5acdf15..5370841 100644
--- a/myserver/src/http_handler/http_file/http_file.cpp
+++ b/myserver/src/http_handler/http_file/http_file.cpp
@@ -322,9 +322,7 @@ int HttpFile::send (HttpThreadContext* td, const char *filenamePath,
     */
     if (onlyHeader)
       {
-        file->close ();
         delete file;
-        chain.clearAllFilters ();
         return HttpDataHandler::RET_OK;
       }
 
diff --git a/myserver/src/http_handler/isapi/isapi.cpp b/myserver/src/http_handler/isapi/isapi.cpp
index 8621bf5..27be49a 100644
--- a/myserver/src/http_handler/isapi/isapi.cpp
+++ b/myserver/src/http_handler/isapi/isapi.cpp
@@ -212,7 +212,7 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
   if (ConnInfo == NULL)
     return HttpDataHandler::RET_FAILURE;
 
-  buffer= (char*)ConnInfo->td->buffer->getBuffer ();
+  buffer= (char *) ConnInfo->td->buffer->getBuffer ();
   HttpRequestHeader::Entry *connection = ConnInfo->td->request.other.get ("connection");
 
   if (ConnInfo == NULL)
@@ -270,6 +270,14 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
             (ConnInfo->td->buffer->getBuffer (), &ConnInfo->td->response,
              &(ConnInfo->td->nBytesToRead));
 
+          char tmpBuf[1024];
+          MemBuf memBuf;
+          MemoryStream memStream (&memBuf);
+          memBuf.setExternalBuffer (tmpBuf, sizeof (tmpBuf));
+          HttpDataHandler::generateFiltersChain (ConnInfo->td,
+                       Server::getInstance ()->getFiltersFactory (),
+                                ConnInfo->td->mime, memStream);
+
           HttpDataHandler::chooseEncoding (ConnInfo->td);
           if (HttpHeaders::sendHeader (ConnInfo->td->response,
                                        *ConnInfo->td->connection->socket,
@@ -286,6 +294,9 @@ BOOL WINAPI ISAPI_WriteClientExport (HCONN hConn, LPVOID Buffer, LPDWORD lpdwByt
               == HttpResponseHeader::SUCCESSFUL)
             return 0;
 
+          ConnInfo->td->sentData +=
+            HttpDataHandler::beginHTTPResponse (ConnInfo->td, memStream);
+
           size_t written = 0;
           if (len)
             written =
@@ -711,18 +722,6 @@ int Isapi::send (HttpThreadContext* td,
           return td->http->raiseHTTPError (500);
         }
 
-      connTable[connIndex].chain.setStream (td->connection->socket);
-      if (td->mime)
-        {
-          size_t 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;
@@ -739,7 +738,6 @@ int Isapi::send (HttpThreadContext* td,
         {
           td->connection->host->warningsLogWrite (_("ISAPI: internal error"));
           appHnd.close ();
-          connTable[connIndex].chain.clearAllFilters ();
           return td->http->raiseHTTPError (500);
         }
 
@@ -747,7 +745,6 @@ int Isapi::send (HttpThreadContext* td,
         {
           td->connection->host->warningsLogWrite (_("ISAPI: internal error"));
           appHnd.close ();
-          connTable[connIndex].chain.clearAllFilters ();
           return td->http->raiseHTTPError (500);
         }
 
@@ -756,7 +753,6 @@ int Isapi::send (HttpThreadContext* td,
         {
           td->connection->host->warningsLogWrite (_("ISAPI: version not supported"));
           appHnd.close ();
-          connTable[connIndex].chain.clearAllFilters ();
           return td->http->raiseHTTPError (500);
         }
 
@@ -809,7 +805,6 @@ int Isapi::send (HttpThreadContext* td,
         {
           td->connection->host->warningsLogWrite (_("ISAPI: cannot find entry-point"));
           appHnd.close ();
-          connTable[connIndex].chain.clearAllFilters ();
           return td->http->raiseHTTPError (500);
         }
 
@@ -843,13 +838,11 @@ int Isapi::send (HttpThreadContext* td,
       ostringstream tmps;
       tmps << connTable[connIndex].dataSent;
       connTable[connIndex].td->response.contentLength.assign (tmps.str ());
-      connTable[connIndex].chain.clearAllFilters ();
       connTable[connIndex].Allocated = 0;
 
     }
   catch (exception & e)
     {
-      connTable[connIndex].chain.clearAllFilters ();
       return HttpDataHandler::RET_FAILURE;
     }
 
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp b/myserver/src/http_handler/mscgi/mscgi.cpp
index cc59ce4..065d30e 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -73,6 +73,7 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
   data.error = false;
   data.filtersChain = &chain;
   data.headerSent = false;
+  MemoryStream memStream (td->auxiliaryBuffer);
 
   if (!(td->permissions & MYSERVER_PERMISSION_EXECUTE))
     return td->http->sendAuth ();
@@ -94,12 +95,6 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
       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
         {
           hinstLib.loadLibrary (exec, 0);
@@ -131,14 +126,11 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
           return td->http->raiseHTTPError (data.errorPage);
         }
 
-      MemoryStream memStream (td->auxiliaryBuffer);
       td->sentData += completeHTTPResponse (td, memStream);
 
       if (!data.error)
         return HttpDataHandler::RET_FAILURE;
 
-      chain.clearAllFilters ();
-
     }
   catch (exception & e)
     {
@@ -183,11 +175,21 @@ int MsCgi::sendHeader (MsCgiData *mcd)
   if (mcd->headerSent)
     return 0;
 
+  MemoryStream memStream (td->auxiliaryBuffer);
+  generateFiltersChain (td, Server::getInstance ()->getFiltersFactory (),
+                        td->mime, memStream);
+
   chooseEncoding (mcd->td);
   HttpHeaders::sendHeader (td->response, *td->connection->socket,
-                           *td->auxiliaryBuffer, td);
+                           *td->buffer, td);
 
   mcd->headerSent = true;
+
+  if (mcd->onlyHeader)
+    return 0;
+
+  td->sentData += HttpDataHandler::beginHTTPResponse (td, memStream);
+
   return 0;
 }
 
diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index 83cb4d5..ec5c737 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -126,14 +126,6 @@ int Proxy::send (HttpThreadContext *td, const char* scriptpath,
       if (td->request.uriOptsPtr)
         td->inputData.fastCopyToSocket (sock, 0, td->auxiliaryBuffer, &nbw);
 
-      chain.setStream (td->connection->socket);
-      if (td->mime)
-        Server::getInstance ()->getFiltersFactory ()->chain (&chain,
-                                                             td->mime->filters,
-                                                             td->connection->socket,
-                                                             &nbw,
-                                                             1);
-
 
       flushToClient (td, *sock, chain, onlyHeader, &keepalive);
 
@@ -211,6 +203,14 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
       transferEncoding.assign (*tmp);
     }
 
+
+  char tmpBuf[1024];
+  MemBuf memBuf;
+  MemoryStream memStream (&memBuf);
+  memBuf.setExternalBuffer (tmpBuf, sizeof (tmpBuf));
+  generateFiltersChain (td, Server::getInstance ()->getFiltersFactory (),
+                        td->mime, memStream);
+
   /* At this point we can modify the response struct before send it to the
      client.  */
 
@@ -220,6 +220,8 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
   if (onlyHeader)
     return HttpDataHandler::RET_OK;
 
+  td->sentData += HttpDataHandler::beginHTTPResponse (td, memStream);
+
   readPayLoad (td, &td->response, &client,
                td->auxiliaryBuffer->getBuffer () + headerLength,
                read - headerLength, td->http->getTimeout (),
diff --git a/myserver/src/http_handler/scgi/scgi.cpp b/myserver/src/http_handler/scgi/scgi.cpp
index e91be52..54f82d5 100644
--- a/myserver/src/http_handler/scgi/scgi.cpp
+++ b/myserver/src/http_handler/scgi/scgi.cpp
@@ -69,18 +69,6 @@ int Scgi::send (HttpThreadContext* td, const char* scriptpath,
       tmp.assign (scriptpath);
       FilesUtility::splitPath (tmp, td->scriptDir, td->scriptFile);
 
-      chain.setStream (td->connection->socket);
-      if (td->mime)
-        {
-          size_t 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';
 
@@ -205,12 +193,13 @@ int Scgi::send (HttpThreadContext* td, const char* scriptpath,
  */
 int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader)
 {
+  HttpThreadContext* td = ctx->td;
   clock_t initialTicks = getTicks ();
   u_long read = 0;
   u_long headerSize = 0;
   u_long tmpHeaderSize = 0;
   size_t nbw, nbr;
-  HttpThreadContext* td = ctx->td;
+  MemoryStream memStream (td->auxiliaryBuffer);
 
   for (;;)
     {
@@ -251,13 +240,18 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader)
                                                 &td->response,
                                                 &(td->nBytesToRead));
 
+  generateFiltersChain (td, Server::getInstance ()->getFiltersFactory (),
+                        td->mime, memStream);
+
   chooseEncoding (td);
   HttpHeaders::sendHeader (td->response, *td->connection->socket,
-                           *td->auxiliaryBuffer, td);
+                           *td->buffer, td);
 
   if (onlyHeader)
     return HttpDataHandler::RET_OK;
 
+  td->sentData += HttpDataHandler::beginHTTPResponse (td, memStream);
+
   if (read - headerSize)
     td->sentData +=
       appendDataToHTTPChannel (td, td->auxiliaryBuffer->getBuffer () + headerSize,
@@ -279,7 +273,6 @@ int Scgi::sendResponse (ScgiContext* ctx, bool onlyHeader)
                                      nbr);
         }
 
-      MemoryStream memStream (td->auxiliaryBuffer);
       td->sentData += completeHTTPResponse (td, memStream);
     }
 
diff --git a/myserver/src/http_handler/wincgi/wincgi.cpp b/myserver/src/http_handler/wincgi/wincgi.cpp
index 51e39c4..0686be7 100644
--- a/myserver/src/http_handler/wincgi/wincgi.cpp
+++ b/myserver/src/http_handler/wincgi/wincgi.cpp
@@ -104,7 +104,10 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
       sprintf (&outFilePath[strlen (outFilePath)],"/out_%i.ini",td->id);
       td->inputData.seek (0);
 
-      MemoryStream memStream (td->auxiliaryBuffer);
+      char tmpBuf[1024];
+      MemBuf memBuf;
+      MemoryStream memStream (&memBuf);
+      memBuf.setExternalBuffer (tmpBuf, sizeof (tmpBuf));
       generateFiltersChain (td, Server::getInstance ()->getFiltersFactory (),
                             td->mime, memStream);
 
@@ -215,7 +218,7 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
       DataFileHandle.writeToFile (buffer, (size_t) strlen (buffer), &nbr);
 
       /*
-       *Compute the local offset from the GMT time
+        Compute the local offset from the GMT time
        */
       tm tmpTm;
       ltime = 100;
@@ -231,7 +234,7 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
       DataFileHandle.close ();
 
       /*
-       *Create the out file.
+        Create the out file.
        */
       if (! FilesUtility::nodeExists (outFilePath))
         OutFileHandle.openFile (outFilePath, File::FILE_OPEN_ALWAYS
@@ -289,7 +292,7 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
 
       chooseEncoding (td);
       HttpHeaders::sendHeader (td->response, *chain.getStream (),
-                               *td->buffer, td);
+                               *td->auxiliaryBuffer, td);
 
       if (onlyHeader)
         {
@@ -299,6 +302,8 @@ int WinCgi::send (HttpThreadContext* td, const char* scriptpath,
           return HttpDataHandler::RET_OK;
         }
 
+      td->sentData += HttpDataHandler::beginHTTPResponse (td, memStream);
+
       td->sentData +=
         HttpDataHandler::appendDataToHTTPChannel (td, buffer + headerSize,
                                                   nBytesRead - headerSize);
diff --git a/myserver/src/protocol/http/http_data_handler.cpp b/myserver/src/protocol/http/http_data_handler.cpp
index 74b359e..ca9e556 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -179,6 +179,7 @@ size_t
 HttpDataHandler::beginHTTPResponse (HttpThreadContext *td,
                                     MemoryStream &memStream)
 {
+  char tmpBuf[BUFSIZ];
   size_t ret = 0;
   /*
     Flush initial data.  This is data that filters could have added
@@ -187,19 +188,20 @@ HttpDataHandler::beginHTTPResponse (HttpThreadContext *td,
   */
   if (memStream.availableToRead ())
     {
-      size_t nbr;
-      memStream.read (td->buffer->getBuffer (),
-                      td->buffer->getRealLength (), &nbr);
-
-      memStream.refresh ();
-      if (nbr)
+      for (;;)
         {
+          size_t nbr;
+          memStream.read (tmpBuf, BUFSIZ, &nbr);
+          if (nbr == 0)
+            break;
+
           FiltersChain directChain (td->outputChain.getStream ());
-          ret += appendDataToHTTPChannel (td, td->buffer->getBuffer (), nbr,
-                                          directChain);
+          ret += appendDataToHTTPChannel (td, tmpBuf, nbr, directChain);
         }
     }
 
+  memStream.refresh ();
+
   return ret;
 }
 
diff --git a/myserver/src/protocol/http/webdav/webdav.cpp b/myserver/src/protocol/http/webdav/webdav.cpp
index f39a1d3..d61b281 100644
--- a/myserver/src/protocol/http/webdav/webdav.cpp
+++ b/myserver/src/protocol/http/webdav/webdav.cpp
@@ -286,11 +286,8 @@ int WebDAV::propfind (HttpThreadContext* td)
   try
     {
       size_t nbw, nbw2;
-      FiltersChain &chain = td->outputChain;
-      list<string> filters;
-      FiltersFactory *ff = Server::getInstance ()->getFiltersFactory ();
       vector <const char *> propReq;
-
+      FiltersFactory *ff = Server::getInstance ()->getFiltersFactory ();
       /* Obtain the payload.  */
       XmlParser p;
       if (p.open (td->inputData.getFilename (), 0) < 0)
@@ -299,12 +296,19 @@ int WebDAV::propfind (HttpThreadContext* td)
       /* Obtain xml entities in the payload.  */
       getElements (xmlDocGetRootElement (p.getDoc ()), &propReq);
 
-      ff->chain (&chain, filters, td->connection->socket, &nbw, 1);
+      char tmpBuf[1024];
+      MemBuf memBuf;
+      MemoryStream memStream (&memBuf);
+      memBuf.setExternalBuffer (tmpBuf, sizeof (tmpBuf));
+      HttpDataHandler::generateFiltersChain (td, ff, td->mime, memStream);
 
       td->response.httpStatus = 207;
 
       HttpDataHandler::chooseEncoding (td);
-      HttpHeaders::sendHeader (td->response, *chain.getStream (), *td->buffer, td);
+      HttpHeaders::sendHeader (td->response, *td->outputChain.getStream (),
+                               *td->buffer, td);
+
+      td->sentData += HttpDataHandler::beginHTTPResponse (td, memStream);
 
       /* Determine the Depth.  */
       MemBuf tmp;
@@ -338,7 +342,6 @@ int WebDAV::propfind (HttpThreadContext* td)
             break;
         }
 
-      MemoryStream memStream (td->auxiliaryBuffer);
       td->sentData += HttpDataHandler::completeHTTPResponse (td, memStream);
 
       return HttpDataHandler::RET_OK;

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

Summary of changes:
 myserver/include/http_handler/cgi/cgi.h           |    8 ++--
 myserver/include/http_handler/mscgi/mscgi.h       |    2 +-
 myserver/src/http_handler/cgi/cgi.cpp             |   40 ++++++++-----------
 myserver/src/http_handler/fastcgi/fastcgi.cpp     |   42 +++++++++++----------
 myserver/src/http_handler/http_dir/http_dir.cpp   |    2 +
 myserver/src/http_handler/http_file/http_file.cpp |    2 -
 myserver/src/http_handler/isapi/isapi.cpp         |   31 ++++++---------
 myserver/src/http_handler/mscgi/mscgi.cpp         |   22 ++++++-----
 myserver/src/http_handler/proxy/proxy.cpp         |   18 +++++----
 myserver/src/http_handler/scgi/scgi.cpp           |   23 ++++-------
 myserver/src/http_handler/wincgi/wincgi.cpp       |   13 ++++--
 myserver/src/protocol/http/http_data_handler.cpp  |   18 +++++----
 myserver/src/protocol/http/webdav/webdav.cpp      |   17 +++++---
 13 files changed, 117 insertions(+), 121 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Mon Apr 25 04:35:57 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QEHGv-0007WV-9Q
	for mharc-myserver-commit@gnu.org; Mon, 25 Apr 2011 04:35:57 -0400
Received: from eggs.gnu.org ([140.186.70.92]:41382)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QEHGs-0007WA-Rn
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 04:35:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QEHGr-0000iF-5Q
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 04:35:54 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:52953)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QEHGq-0000e7-UF
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 04:35:53 -0400
Received: from lucifer (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.14.4/8.14.4) with SMTP id
	p3P8Zn4a030884
	for <myserver-commit@gnu.org>; Mon, 25 Apr 2011 10:35:49 +0200
Message-Id: <201104250835.p3P8Zn4a030884@proliant.st.ewi.tudelft.nl>
Received: by lucifer (sSMTP sendmail emulation);
	Mon, 25 Apr 2011 10:35:49 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
X-Hydra-Instance: lucifer
X-Hydra-Project: gnu
X-Hydra-Jobset: myserver-master
X-Hydra-Job: tarball
Date: Mon, 25 Apr 2011 10:35:49 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 130.161.158.3
Subject: [myserver-commit] Hydra job gnu:myserver-master:tarball build
	1055154: Failed
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Apr 2011 08:35:56 -0000

Hi,

This is to let you know that Hydra build 1055154 of job gnu:myserver-master:tarball has changed from 'Success' to 'Failed'.

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

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:              | 1055154
Nix name:              | myserver-tarball-0pre8539d2f58209a68e932680002527bef816bdb199
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/z3xxbaw5kj9hv1963pjwg14y0h7i59q8-myserver-tarball-0pre8539d2f58209a68e932680002527bef816bdb199.drv
Output store path:     | /nix/store/6d6dm17yxy003a993v2mmbz7wp36cwac-myserver-tarball-0pre8539d2f58209a68e932680002527bef816bdb199
Time added:            | 2011-04-25 10:35:49
Build started:         | 2011-04-25 10:32:56
Build finished:        | 2011-04-25 10:35:49
Duration:              | 173s

The build inputs were:

Name        | Type | Value
------------+------+---------------------------------------------------------------------------
myserverSrc | git  | git://git.sv.gnu.org/myserver.git:8539d2f58209a68e932680002527bef816bdb199
hydraConfig | svn  | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:26838
gnulibSrc   | git  | git://git.sv.gnu.org/gnulib.git:ea868d4a150963fafb230c888dc093a2e06a3613
nixpkgs     | svn  | https://svn.nixos.org/repos/nix/nixpkgs/trunk:26959

Regards,

The Hydra build daemon.

---
[3s[a/bin/sh ../libtool --silent --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2  -fPIC -DPIC  -c -o creat-safer.lo creat-safer.c[b
[q[pbuilding cycle-check.lo
  CC     cycle-check.lo
[3s[a/bin/sh ../libtool --silent --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2  -fPIC -DPIC  -c -o cycle-check.lo cycle-check.c[b
[q[pbuilding dirname-lgpl.lo
  CC     dirname-lgpl.lo
[3s[a/bin/sh ../libtool --silent --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2  -fPIC -DPIC  -c -o dirname-lgpl.lo dirname-lgpl.c[b
[q[pbuilding dup-safer.lo
  CC     dup-safer.lo
[3s[a/bin/sh ../libtool --silent --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2  -fPIC -DPIC  -c -o dup-safer.lo dup-safer.c[b
[q[pbuilding fcntl.lo
  CC     fcntl.lo
[3s[a/bin/sh ../libtool --silent --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2  -fPIC -DPIC  -c -o fcntl.lo fcntl.c[b
[q[pbuilding fd-safer.lo
  CC     fd-safer.lo
[3s[a/bin/sh ../libtool --silent --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2  -fPIC -DPIC  -c -o fd-safer.lo fd-safer.c[b
[q[pbuilding fts.lo
  CC     fts.lo
[3s[a/bin/sh ../libtool --silent --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2  -fPIC -DPIC  -c -o fts.lo fts.c[b
[q[pbuilding getcwd.lo
  CC     getcwd.lo
[3s[a/bin/sh ../libtool --silent --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2  -fPIC -DPIC  -c -o getcwd.lo getcwd.c[b
[q[pbuilding getopt.lo
  CC     getopt.lo
[3s[a/bin/sh ../libtool --silent --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2  -fPIC -DPIC  -c -o getopt.lo getopt.c[b
[q[pbuilding getopt1.lo
  CC     getopt1.lo
[3s[a/bin/sh ../libtool --silent --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2  -fPIC -DPIC  -c -o getopt1.lo getopt1.c[b
[q[pbuilding hash.lo
  CC     hash.lo
[3s[a/bin/sh ../libtool --silent --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I..   -I/nix/store/wzc3cy1wwwd6d0dgxpa77ijr1yp50s6v-libxml2-2.7.7/include/libxml2  -fPIC -DPIC  -c -o hash.lo hash.c[b
hash.c:158:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'hash_get_n_buckets'
hash.c:166:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'hash_get_n_buckets_used'
hash.c:174:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'hash_get_n_entries'
hash.c:182:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'hash_get_max_bucket_length'
hash.c:209:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'hash_table_ok'
hash.c:296:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'hash_get_first'
hash.c:552:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'compute_bucket_size'
make[4]: *** [hash.lo] Error 1
make[4]: Leaving directory `/tmp/nix-build-z3xxbaw5kj9hv1963pjwg14y0h7i59q8-myserver-tarball-0pre8539d2f58209a68e932680002527bef816bdb199.drv-0/git-export/myserver/lib'
[q[qmake[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/tmp/nix-build-z3xxbaw5kj9hv1963pjwg14y0h7i59q8-myserver-tarball-0pre8539d2f58209a68e932680002527bef816bdb199.drv-0/git-export/myserver/lib'
[q[qmake[2]: *** [all] Error 2
make[2]: Leaving directory `/tmp/nix-build-z3xxbaw5kj9hv1963pjwg14y0h7i59q8-myserver-tarball-0pre8539d2f58209a68e932680002527bef816bdb199.drv-0/git-export/myserver/lib'
[q[qmake[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/nix-build-z3xxbaw5kj9hv1963pjwg14y0h7i59q8-myserver-tarball-0pre8539d2f58209a68e932680002527bef816bdb199.drv-0/git-export/myserver'
[q[qmake: *** [all] Error 2
[q[q[qbuild time elapsed:  0m0.026s 0m0.013s 1m9.446s 0m46.234s
[pCopying build directory to /nix/store/6d6dm17yxy003a993v2mmbz7wp36cwac-myserver-tarball-0pre8539d2f58209a68e932680002527bef816bdb199/nix-build-z3xxbaw5kj9hv1963pjwg14y0h7i59q8-myserver-tarball-0pre8539d2f58209a68e932680002527bef816bdb199.drv-0
[qbuild failed with exit code 2 (ignored)


From MAILER-DAEMON Mon Apr 25 04:48:34 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QEHT8-0000Zn-1g
	for mharc-myserver-commit@gnu.org; Mon, 25 Apr 2011 04:48:34 -0400
Received: from eggs.gnu.org ([140.186.70.92]:37869)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QEHT5-0000Z8-AT
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 04:48:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QEHT4-0005H5-4f
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 04:48:31 -0400
Received: from proliant.st.ewi.tudelft.nl ([130.161.158.3]:52616)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <e.dolstra@tudelft.nl>) id 1QEHT3-0005Gl-OV
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 04:48:29 -0400
Received: from lucifer (buildfarm.st.ewi.tudelft.nl [130.161.158.181])
	by proliant.st.ewi.tudelft.nl (8.14.4/8.14.4) with SMTP id
	p3P8mS5r031570
	for <myserver-commit@gnu.org>; Mon, 25 Apr 2011 10:48:28 +0200
Message-Id: <201104250848.p3P8mS5r031570@proliant.st.ewi.tudelft.nl>
Received: by lucifer (sSMTP sendmail emulation);
	Mon, 25 Apr 2011 10:48:28 +0200
To: myserver-commit@gnu.org
From: Hydra Build Daemon <e.dolstra@tudelft.nl>
X-Hydra-Instance: lucifer
X-Hydra-Project: gnu
X-Hydra-Jobset: myserver-master
X-Hydra-Job: tarball
Date: Mon, 25 Apr 2011 10:48:28 +0200
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 130.161.158.3
Subject: [myserver-commit] Hydra job gnu:myserver-master:tarball build
	1055270: Success
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Apr 2011 08:48:32 -0000

Hi,

This is to let you know that Hydra build 1055270 of job gnu:myserver-master:tarball has changed from 'Failed' to 'Success'.

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

A summary of the build information follows:

Build ID:              | 1055270
Nix name:              | myserver-tarball-0pre8539d2f58209a68e932680002527bef816bdb199
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/iy421fvi5896pz492jg6hpwk99yi7dhs-myserver-tarball-0pre8539d2f58209a68e932680002527bef816bdb199.drv
Output store path:     | /nix/store/vv0agig0557h6prpaj2gz1arl0rxn018-myserver-tarball-0pre8539d2f58209a68e932680002527bef816bdb199
Time added:            | 2011-04-25 10:48:27
Build started:         | 2011-04-25 10:43:26
Build finished:        | 2011-04-25 10:48:27
Duration:              | 301s

The build inputs were:

Name        | Type | Value
------------+------+---------------------------------------------------------------------------
myserverSrc | git  | git://git.sv.gnu.org/myserver.git:8539d2f58209a68e932680002527bef816bdb199
hydraConfig | svn  | https://svn.nixos.org/repos/nix/hydra-config/gnu/trunk:26838
gnulibSrc   | git  | git://git.sv.gnu.org/gnulib.git:6829a6c0c428c91768aa4314752ba92b1340e11b
nixpkgs     | svn  | https://svn.nixos.org/repos/nix/nixpkgs/trunk:26959

Regards,

The Hydra build daemon.


From MAILER-DAEMON Mon Apr 25 09:44:31 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QEM5X-0003Ty-30
	for mharc-myserver-commit@gnu.org; Mon, 25 Apr 2011 09:44:31 -0400
Received: from eggs.gnu.org ([140.186.70.92]:49948)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QEM5U-0003Tj-5N
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 09:44:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QEM5S-0006E7-Af
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 09:44:28 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:42528)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QEM5S-0006Dy-7R
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 09:44:26 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QEM5R-0003oB-Ou
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 13:44:25 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QEM5Q-00047U-Il
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 13:44:25 +0000
Date: Mon, 25 Apr 2011 13:44:25 +0000
Message-Id: <E1QEM5Q-00047U-Il@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 8539d2f58209a68e932680002527bef816bdb199
X-Git-Newrev: 7fc18d70ec79a6d373880e930c1869f676c143ea
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-489-g7fc18d7
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Apr 2011 13:44:29 -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  7fc18d70ec79a6d373880e930c1869f676c143ea (commit)
       via  fcb1ab716e0fe94fff2d659d56e0b52f26e2c6b5 (commit)
       via  b44cfa9bd85d91393720255d19a0100fe68a2453 (commit)
       via  9374898daecdbc59e683ace0102f3de8e4d9fad5 (commit)
       via  277a02215b8befe7479a4fffbd2d0ebf6ae00b84 (commit)
      from  8539d2f58209a68e932680002527bef816bdb199 (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 7fc18d70ec79a6d373880e930c1869f676c143ea
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 25 15:13:50 2011 +0200

    HttpDataHandler: skip chunks with size 0.

diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index 24c89de..fc30836 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -148,29 +148,36 @@ int Proxy::send (HttpThreadContext *td, const char* scriptpath,
 /*!
   Flush the server reply to the client.
  */
-int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
+int Proxy::flushToClient (HttpThreadContext* td, Socket &client,
                           FiltersChain &out, bool onlyHeader, bool *kaClient)
 {
   size_t read = 0;
   size_t headerLength;
   int ret;
   size_t nbw;
-
+  bool validResponse = false;
   td->response.free ();
-  do
+
+  for (;;)
     {
       ret = client.recv (td->auxiliaryBuffer->getBuffer () + read,
-                         td->auxiliaryBuffer->getRealLength () - read,
+                         td->auxiliaryBuffer->getRealLength () - read - 1,
                          0,
                          td->http->getTimeout ());
 
+      if (ret == 0)
+        break;
+
       read += ret;
 
-      if (HttpHeaders::buildHTTPResponseHeaderStruct
-          (td->auxiliaryBuffer->getBuffer (), &td->response, &headerLength))
+      td->auxiliaryBuffer->getBuffer ()[read] = '\0';
+
+      validResponse = HttpHeaders::buildHTTPResponseHeaderStruct
+        (td->auxiliaryBuffer->getBuffer (), &td->response, &headerLength);
+
+      if (validResponse)
         break;
     }
-  while (ret);
 
   if (read == 0)
     return td->http->raiseHTTPError (500);
@@ -200,7 +207,6 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
       transferEncoding.assign (*tmp);
     }
 
-
   char tmpBuf[1024];
   MemBuf memBuf;
   MemoryStream memStream (&memBuf);
@@ -210,7 +216,6 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
 
   /* At this point we can modify the response struct before send it to the
      client.  */
-
   chooseEncoding (td, td->response.contentLength.length ());
   HttpHeaders::sendHeader (td->response, *out.getStream (), *td->buffer, td);
 
@@ -285,9 +290,10 @@ int Proxy::readPayLoad (HttpThreadContext* td,
               if (!nbr)
                 break;
 
-              td->sentData += HttpDataHandler::appendDataToHTTPChannel (td,
-                                                       td->buffer->getBuffer (),
-                                                       nbr);
+              td->sentData +=
+                HttpDataHandler::appendDataToHTTPChannel (td,
+                                                      td->buffer->getBuffer (),
+                                                          nbr);
             }
         }
     }
@@ -306,8 +312,8 @@ int Proxy::readPayLoad (HttpThreadContext* td,
 
           int timedOut =
             HttpDataRead::readContiguousPrimitivePostData (initBuffer, &inPos,
-                                                           initBufferSize, client,
-                                                           td->buffer->getBuffer (),
+                                                       initBufferSize, client,
+                                                     td->buffer->getBuffer (),
                                                            len, &nbr, timeout);
 
           if (contentLength == 0 && nbr == 0)
diff --git a/myserver/src/protocol/http/http.cpp b/myserver/src/protocol/http/http.cpp
index df48dea..74292a1 100644
--- a/myserver/src/protocol/http/http.cpp
+++ b/myserver/src/protocol/http/http.cpp
@@ -744,8 +744,7 @@ Http::sendHTTPResource (string& uri, bool systemrequest, bool onlyHeader,
 int Http::logHTTPaccess ()
 {
   char tmpStrInt[12];
-
-  string time;
+  char time[32];
 
   try
     {
diff --git a/myserver/src/protocol/http/http_data_handler.cpp b/myserver/src/protocol/http/http_data_handler.cpp
index 8a2bada..2409da0 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -134,6 +134,12 @@ HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
 {
   size_t tmp, nbw = 0;
 
+  /* In the chunked transfer encoding, a chunk of size 0 has a special meaning,
+     just skip it.  */
+  if (td->transferEncoding == HttpThreadContext::TRANSFER_ENCODING_CHUNKED
+      && size == 0)
+    return 0;
+
   if (td->transferEncoding == HttpThreadContext::TRANSFER_ENCODING_CHUNKED)
     {
       ostringstream chunkHeader;
diff --git a/myserver/src/protocol/http/http_data_read.cpp b/myserver/src/protocol/http/http_data_read.cpp
index 03b6f89..44d4f97 100644
--- a/myserver/src/protocol/http/http_data_read.cpp
+++ b/myserver/src/protocol/http/http_data_read.cpp
@@ -171,7 +171,7 @@ int HttpDataRead::readChunkedPostData (const char *inBuffer,
 
       while (chunkNbr < dataToRead)
         {
-          u_long rs = min (outBufferSize , dataToRead - chunkNbr);
+          u_long rs = min (outBufferSize, dataToRead - chunkNbr);
 
           int timedOut =
             readContiguousPrimitivePostData (inBuffer, inBufferPos,
diff --git a/myserver/src/protocol/http/http_headers.cpp b/myserver/src/protocol/http/http_headers.cpp
index 4198769..357c11e 100644
--- a/myserver/src/protocol/http/http_headers.cpp
+++ b/myserver/src/protocol/http/http_headers.cpp
@@ -954,7 +954,7 @@ int HttpHeaders::buildHTTPResponseHeaderStruct (const char *input,
   /* Control if the HTTP header is a valid header.  */
   if (input[0] == 0)
     return 0;
-  validResponse = validHTTPResponse (input,&nLines, &maxTotchars);
+  validResponse = validHTTPResponse (input, &nLines, &maxTotchars);
 
   if (validResponse)
   {



commit fcb1ab716e0fe94fff2d659d56e0b52f26e2c6b5
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 25 13:32:07 2011 +0200

    Proxy: report correctly sent data.

diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index de04c5b..24c89de 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -224,7 +224,6 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket& client,
                read - headerLength, td->http->getTimeout (),
                hasTransferEncoding ? &transferEncoding : NULL);
 
-  td->sentData += ret;
   return HttpDataHandler::RET_OK;
 }
 



commit b44cfa9bd85d91393720255d19a0100fe68a2453
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 25 13:29:33 2011 +0200

    Gzip: code cleanup.

diff --git a/myserver/src/filter/gzip/gzip.cpp b/myserver/src/filter/gzip/gzip.cpp
index 8ccacdd..010c354 100644
--- a/myserver/src/filter/gzip/gzip.cpp
+++ b/myserver/src/filter/gzip/gzip.cpp
@@ -88,13 +88,13 @@ u_long Gzip::compress (const char* in, size_t sizeIn,
   u_long old_total_out = data.stream.total_out;
   u_long ret;
 
-  if (compressBound (sizeIn) > (u_long)sizeOut)
+  if (compressBound (sizeIn) > (u_long) sizeOut)
     return 0;
 
   data.stream.data_type = Z_BINARY;
-  data.stream.next_in = (Bytef*) in;
+  data.stream.next_in = (Bytef *) in;
   data.stream.avail_in = sizeIn;
-  data.stream.next_out = (Bytef*) out;
+  data.stream.next_out = (Bytef *) out;
   data.stream.avail_out = sizeOut;
   ret = deflate (&(data.stream), Z_FULL_FLUSH);
 
@@ -266,28 +266,17 @@ u_long Gzip::getHeader (char *buffer, size_t buffersize)
  */
 int Gzip::read (char* buffer, size_t len, size_t *nbr)
 {
-  char *tmp_buff;
-  size_t nbr_parent;
+  char tmpBuf[len / 2];
+  size_t nbrParent;
   if (!parent)
     return -1;
 
   if (!active)
     return parent->read (buffer, len, nbr);
 
-  tmp_buff = new char[len/2];
-
-  try
-    {
-      parent->read (tmp_buff, len/2, &nbr_parent);
-      *nbr = compress (tmp_buff, nbr_parent, buffer, len);
-    }
-  catch (...)
-    {
-      delete [] tmp_buff;
-      throw;
-    }
+  parent->read (tmpBuf, len / 2, &nbrParent);
+  *nbr = compress (tmpBuf, nbrParent, buffer, len);
 
-  delete [] tmp_buff;
   return 0;
 }
 



commit 9374898daecdbc59e683ace0102f3de8e4d9fad5
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 25 13:28:21 2011 +0200

    Proxy: do not clear filters list.

diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp b/myserver/src/http_handler/mscgi/mscgi.cpp
index 299f837..a0e83a1 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -103,7 +103,6 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
         {
           td->connection->host->warningsLogWrite (_E ("MSCGI: cannot load %s"),
                                                   exec, &e);
-          chain.clearAllFilters ();
           /* Internal server error.  */
           return td->http->raiseHTTPError (500);
         }
@@ -122,7 +121,6 @@ int MsCgi::send (HttpThreadContext* td, const char* exec, const char* cmdLine,
 
       if (data.errorPage)
         {
-          chain.clearAllFilters ();
           return td->http->raiseHTTPError (data.errorPage);
         }
 
diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index ec5c737..de04c5b 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -129,8 +129,6 @@ int Proxy::send (HttpThreadContext *td, const char* scriptpath,
 
       flushToClient (td, *sock, chain, onlyHeader, &keepalive);
 
-      chain.clearAllFilters ();
-
       addConnection (con, destUrl.getHost ().c_str (), destUrl.getPort (),
                      keepalive);
 
@@ -141,7 +139,6 @@ int Proxy::send (HttpThreadContext *td, const char* scriptpath,
       if (con)
         addConnection (con, destUrl.getHost ().c_str (), destUrl.getPort (),
                        false);
-      chain.clearAllFilters ();
       return HttpDataHandler::RET_FAILURE;
     }
 



commit 277a02215b8befe7479a4fffbd2d0ebf6ae00b84
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 25 12:38:09 2011 +0200

    HttpThreadContext: enum transfer encodings.

diff --git a/myserver/include/protocol/http/http_data_handler.h b/myserver/include/protocol/http/http_data_handler.h
index eb06572..555c377 100644
--- a/myserver/include/protocol/http/http_data_handler.h
+++ b/myserver/include/protocol/http/http_data_handler.h
@@ -29,7 +29,6 @@
 # include <include/filter/memory_stream.h>
 # include <include/conf/mime/mime_manager.h>
 
-
 /*!
   Base class to handle HTTP data.
  */
@@ -60,12 +59,6 @@ public:
                                          const char *buffer,
                                          size_t size);
 
-  static size_t appendDataToHTTPChannel (HttpThreadContext* td,
-                                         const char *buffer,
-                                         size_t size,
-                                         FiltersChain &chain);
-
-
   static size_t beginHTTPResponse (HttpThreadContext *td,
                                    MemoryStream &memStream);
 
@@ -76,6 +69,12 @@ public:
                                       FiltersFactory *factory,
                                       MimeRecord *mime,
                                       MemoryStream &memStream);
+
+private:
+  static size_t appendDataToHTTPChannel (HttpThreadContext* td,
+                                         const char *buffer,
+                                         size_t size,
+                                         FiltersChain &chain);
 };
 
 #endif
diff --git a/myserver/include/protocol/http/http_thread_context.h b/myserver/include/protocol/http/http_thread_context.h
index 7a6800c..06b848d 100644
--- a/myserver/include/protocol/http/http_thread_context.h
+++ b/myserver/include/protocol/http/http_thread_context.h
@@ -21,6 +21,7 @@
 # define HTTP_THREAD_CONTEXT_H
 
 # include "myserver.h"
+# include <include/protocol/http/http_data_handler.h>
 # include <include/protocol/http/http_request.h>
 # include <include/protocol/http/http_response.h>
 # include <include/base/string/stringutils.h>
@@ -42,12 +43,11 @@
 # include <string>
 using namespace std;
 
-
 class Http;
 class MimeRecord;
 
 /*!
-  Structure used by the HTTP protocol parser to describe a thread.
+  Store thread specific data.
  */
 struct HttpThreadContext
 {
@@ -63,7 +63,12 @@ struct HttpThreadContext
   /*! Size of the request header in `buffer'. */
   size_t headerSize;
 
-  bool useChunks;
+  enum
+    {
+      TRANSFER_ENCODING_NONE = 0,
+      TRANSFER_ENCODING_CHUNKED
+    }
+  transferEncoding;
 
   bool keepalive;
 
diff --git a/myserver/src/http_handler/mscgi/mscgi.cpp b/myserver/src/http_handler/mscgi/mscgi.cpp
index 065d30e..299f837 100644
--- a/myserver/src/http_handler/mscgi/mscgi.cpp
+++ b/myserver/src/http_handler/mscgi/mscgi.cpp
@@ -157,8 +157,7 @@ int MsCgi::write (const char *data, size_t len, MsCgiData *mcd)
 
   mcd->td->sentData +=
     HttpDataHandler::appendDataToHTTPChannel (mcd->td,
-                                              data, len,
-                                              *mcd->filtersChain);
+                                              data, len);
   return 0;
 }
 
diff --git a/myserver/src/protocol/http/http_data_handler.cpp b/myserver/src/protocol/http/http_data_handler.cpp
index ca9e556..8a2bada 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -134,7 +134,7 @@ HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
 {
   size_t tmp, nbw = 0;
 
-  if (td->useChunks)
+  if (td->transferEncoding == HttpThreadContext::TRANSFER_ENCODING_CHUNKED)
     {
       ostringstream chunkHeader;
       chunkHeader << hex << size << "\r\n";
@@ -145,7 +145,7 @@ HttpDataHandler::appendDataToHTTPChannel (HttpThreadContext *td,
   if (size)
     chain.write (buffer, size, &nbw);
 
-  if (td->useChunks)
+  if (td->transferEncoding == HttpThreadContext::TRANSFER_ENCODING_CHUNKED)
     chain.getStream ()->write ("\r\n", 2, &tmp);
 
   return nbw;
@@ -161,14 +161,14 @@ void
 HttpDataHandler::chooseEncoding (HttpThreadContext *td, bool disableEncoding)
 {
   td->keepalive = td->request.isKeepAlive ();
-  td->useChunks = false;
+  td->transferEncoding = HttpThreadContext::TRANSFER_ENCODING_NONE;
 
   td->keepalive &= !td->request.ver.compare ("HTTP/1.1");
 
   if (!disableEncoding && td->keepalive)
     {
       td->response.setValue ("transfer-encoding", "chunked");
-      td->useChunks = true;
+      td->transferEncoding = HttpThreadContext::TRANSFER_ENCODING_CHUNKED;
     }
 }
 
@@ -188,6 +188,7 @@ HttpDataHandler::beginHTTPResponse (HttpThreadContext *td,
   */
   if (memStream.availableToRead ())
     {
+      FiltersChain directChain (td->outputChain.getStream ());
       for (;;)
         {
           size_t nbr;
@@ -195,7 +196,6 @@ HttpDataHandler::beginHTTPResponse (HttpThreadContext *td,
           if (nbr == 0)
             break;
 
-          FiltersChain directChain (td->outputChain.getStream ());
           ret += appendDataToHTTPChannel (td, tmpBuf, nbr, directChain);
         }
     }
@@ -213,10 +213,13 @@ HttpDataHandler::completeHTTPResponse (HttpThreadContext *td,
                                        MemoryStream &memStream)
 {
   size_t ret = 0;
+
   /* If we don't use chunks we can flush directly.  */
-  if (! td->useChunks)
-    td->outputChain.flush (&ret);
-  else
+  if (td->transferEncoding == HttpThreadContext::TRANSFER_ENCODING_NONE)
+    {
+      td->outputChain.flush (&ret);
+    }
+  else if (td->transferEncoding == HttpThreadContext::TRANSFER_ENCODING_CHUNKED)
     {
       /*
         Replace the final stream before the flush and write to a
diff --git a/myserver/src/protocol/http/http_data_read.cpp b/myserver/src/protocol/http/http_data_read.cpp
index 2a7289f..03b6f89 100644
--- a/myserver/src/protocol/http/http_data_read.cpp
+++ b/myserver/src/protocol/http/http_data_read.cpp
@@ -135,9 +135,10 @@ int HttpDataRead::readChunkedPostData (const char *inBuffer,
           buffer[0] = '\0';
           for (;;)
             {
-              int timedOut = readContiguousPrimitivePostData (inBuffer, inBufferPos,
-                                                              inBufferSize, inSocket,
-                                                              &c, 1, &nbr, timeout);
+              int timedOut =
+                readContiguousPrimitivePostData (inBuffer, inBufferPos,
+                                                 inBufferSize, inSocket,
+                                                 &c, 1, &nbr, timeout);
               if (nbr != 1)
                 return -1;
 
@@ -154,8 +155,9 @@ int HttpDataRead::readChunkedPostData (const char *inBuffer,
             }
 
           /* Read the \n character too. */
-          if (readContiguousPrimitivePostData (inBuffer, inBufferPos, inBufferSize,
-                                               inSocket, &c, 1, &nbr, timeout))
+          if (readContiguousPrimitivePostData (inBuffer, inBufferPos,
+                                               inBufferSize, inSocket,
+                                               &c, 1, &nbr, timeout))
             return -1;
 
           dataToRead = (u_long) hexToInt (buffer);
@@ -171,10 +173,11 @@ int HttpDataRead::readChunkedPostData (const char *inBuffer,
         {
           u_long rs = min (outBufferSize , dataToRead - chunkNbr);
 
-          int timedOut = readContiguousPrimitivePostData (inBuffer, inBufferPos,
-                                                          inBufferSize,
-                                                          inSocket, outBuffer,
-                                                          rs, &nbr, timeout);
+          int timedOut =
+            readContiguousPrimitivePostData (inBuffer, inBufferPos,
+                                             inBufferSize,
+                                             inSocket, outBuffer,
+                                             rs, &nbr, timeout);
 
           if (nbr == 0)
             return -1;
@@ -216,7 +219,6 @@ int HttpDataRead::readChunkedPostData (const char *inBuffer,
               return 0;
             }
         }
-
     }
 
   if (remainingChunk)
@@ -321,16 +323,17 @@ int HttpDataRead::readPostData (HttpThreadContext* td, int* httpRetCode)
     {
       if (encoding->value.compare ("chunked") == 0)
         {
-          int ret = readChunkedPostData (td->request.uriOptsPtr,
-                                         &inPos,
-                                         bufferDataSize,
-                                         td->connection->socket,
-                                         td->auxiliaryBuffer->getBuffer (),
-                                         td->auxiliaryBuffer->getRealLength () - 1,
-                                         &nbr,
-                                         timeout,
-                                         &(td->inputData),
-                                         0);
+          int ret =
+            readChunkedPostData (td->request.uriOptsPtr,
+                                 &inPos,
+                                 bufferDataSize,
+                                 td->connection->socket,
+                                 td->auxiliaryBuffer->getBuffer (),
+                                 td->auxiliaryBuffer->getRealLength () - 1,
+                                 &nbr,
+                                 timeout,
+                                 &(td->inputData),
+                                 0);
 
           if (ret < 0)
             {
@@ -382,8 +385,9 @@ int HttpDataRead::readPostData (HttpThreadContext* td, int* httpRetCode)
 
           td->auxiliaryBuffer->getBuffer ()[nbr] = '\0';
 
-          if (nbr && td->inputData.writeToFile (td->auxiliaryBuffer->getBuffer (),
-                                                nbr, &nbw))
+          if (nbr
+              && td->inputData.writeToFile (td->auxiliaryBuffer->getBuffer (),
+                                            nbr, &nbw))
             {
               td->inputData.close ();
               return -1;

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

Summary of changes:
 myserver/include/protocol/http/http_data_handler.h |   13 ++---
 .../include/protocol/http/http_thread_context.h    |   11 +++-
 myserver/src/filter/gzip/gzip.cpp                  |   25 +++-------
 myserver/src/http_handler/mscgi/mscgi.cpp          |    5 +--
 myserver/src/http_handler/proxy/proxy.cpp          |   38 ++++++++-------
 myserver/src/protocol/http/http.cpp                |    3 +-
 myserver/src/protocol/http/http_data_handler.cpp   |   25 +++++++---
 myserver/src/protocol/http/http_data_read.cpp      |   50 +++++++++++---------
 myserver/src/protocol/http/http_headers.cpp        |    2 +-
 9 files changed, 88 insertions(+), 84 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Mon Apr 25 12:24:09 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QEOa1-0006z7-RX
	for mharc-myserver-commit@gnu.org; Mon, 25 Apr 2011 12:24:09 -0400
Received: from eggs.gnu.org ([140.186.70.92]:35156)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QEOZy-0006yV-IM
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 12:24:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QEOZx-00008I-Es
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 12:24:06 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:56736)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QEOZx-000086-Cu
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 12:24:05 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QEOZw-0005fK-KL
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 16:24:04 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QEOZv-00083U-DV
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 16:24:04 +0000
Date: Mon, 25 Apr 2011 16:24:04 +0000
Message-Id: <E1QEOZv-00083U-DV@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: 7fc18d70ec79a6d373880e930c1869f676c143ea
X-Git-Newrev: f0385054dd3832aed991be1f41f47fa0de39920a
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-491-gf038505
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Apr 2011 16:24:07 -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  f0385054dd3832aed991be1f41f47fa0de39920a (commit)
       via  cefd28671e6d17e276e0a18ea39c19d87d5a2059 (commit)
      from  7fc18d70ec79a6d373880e930c1869f676c143ea (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 f0385054dd3832aed991be1f41f47fa0de39920a
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 25 16:43:45 2011 +0200

    ForkServer: kill the server on errors.

diff --git a/myserver/src/base/process/fork_server.cpp b/myserver/src/base/process/fork_server.cpp
index 8c3121b..0e7aaa4 100644
--- a/myserver/src/base/process/fork_server.cpp
+++ b/myserver/src/base/process/fork_server.cpp
@@ -265,7 +265,7 @@ int ForkServer::forkServerLoop (UnixSocket *serverSocket)
         {
           serverSocket->close ();
           socket.close ();
-          perror ("fork server died.");
+          fprintf (stderr, "fork server died.\n");
           exit (1);
         }
     }
diff --git a/myserver/src/myserver.cpp b/myserver/src/myserver.cpp
index ce21472..f784cb4 100644
--- a/myserver/src/myserver.cpp
+++ b/myserver/src/myserver.cpp
@@ -521,6 +521,8 @@ int main (int argn, char **argv)
     }
   catch (...)
     {
+      if (input.useForkServer)
+        Process::getForkServer ()->killServer ();
       return 1;
     };
 



commit cefd28671e6d17e276e0a18ea39c19d87d5a2059
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 25 16:39:59 2011 +0200

    Fix load configuration files from the home directory.

diff --git a/myserver/include/base/home_dir/home_dir.h b/myserver/include/base/home_dir/home_dir.h
index 234489b..0ab67f6 100644
--- a/myserver/include/base/home_dir/home_dir.h
+++ b/myserver/include/base/home_dir/home_dir.h
@@ -42,6 +42,8 @@ public:
 
   int isLoaded (){return loaded;}
 
+  void getLoginName (string &username);
+
 private:
   Mutex loadMutex;
   int loadImpl ();
diff --git a/myserver/src/base/home_dir/home_dir.cpp b/myserver/src/base/home_dir/home_dir.cpp
index e1d3670..97cfad8 100644
--- a/myserver/src/base/home_dir/home_dir.cpp
+++ b/myserver/src/base/home_dir/home_dir.cpp
@@ -123,6 +123,26 @@ int HomeDir::load ()
   return ret;
 }
 
+void HomeDir::getLoginName (string &username)
+{
+  username.assign ("");
+#ifdef WIN32
+  char login[1024];
+  DWORD sz = sizeof (login);
+
+  if (GetUserName (login, &sz))
+    username.assign (login);
+
+  return;
+#else
+  const char *login = getlogin ();
+  if (login)
+    username.assign (login);
+
+  return;
+#endif
+}
+
 /*!
   Load the internal buffer.
  */
diff --git a/myserver/src/myserver.cpp b/myserver/src/myserver.cpp
index cd75834..ce21472 100644
--- a/myserver/src/myserver.cpp
+++ b/myserver/src/myserver.cpp
@@ -24,6 +24,7 @@
 #include <include/conf/main/xml_main_configuration.h>
 
 #include <include/base/exceptions/checked.h>
+#include <include/base/home_dir/home_dir.h>
 
 #ifdef WIN32
 # include <direct.h>
@@ -304,7 +305,13 @@ int loadConfFileLocation (string &outFile, string fileName, const char *dir)
           return 0;
         }
 
-      outFile = "~/.myserver/" + fileName;
+      HomeDir homeDir;
+      string login;
+      homeDir.getLoginName (login);
+      homeDir.getHomeDir (login, outFile);
+
+      outFile.append ("/.myserver/");
+      outFile.append (fileName);
       if (FilesUtility::nodeExists (outFile))
         return 0;
 

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

Summary of changes:
 myserver/include/base/home_dir/home_dir.h |    2 ++
 myserver/src/base/home_dir/home_dir.cpp   |   20 ++++++++++++++++++++
 myserver/src/base/process/fork_server.cpp |    2 +-
 myserver/src/myserver.cpp                 |   11 ++++++++++-
 4 files changed, 33 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Mon Apr 25 17:51:27 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QETgl-0003w8-Bf
	for mharc-myserver-commit@gnu.org; Mon, 25 Apr 2011 17:51:27 -0400
Received: from eggs.gnu.org ([140.186.70.92]:53507)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QETgi-0003w0-E7
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 17:51:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QETgh-0002BX-Gb
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 17:51:24 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:39623)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QETgh-0002BR-EN
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 17:51:23 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QETgg-00014O-Tx
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 21:51:23 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QETgf-0002xD-OL
	for myserver-commit@gnu.org; Mon, 25 Apr 2011 21:51:22 +0000
Date: Mon, 25 Apr 2011 21:51:22 +0000
Message-Id: <E1QETgf-0002xD-OL@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: f0385054dd3832aed991be1f41f47fa0de39920a
X-Git-Newrev: b1508982b8ed2deeb8ae3250ea230e5458925803
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-492-gb150898
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Apr 2011 21:51: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  b1508982b8ed2deeb8ae3250ea230e5458925803 (commit)
      from  f0385054dd3832aed991be1f41f47fa0de39920a (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 b1508982b8ed2deeb8ae3250ea230e5458925803
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Mon Apr 25 23:51:16 2011 +0200

    Proxy: cope correctly when a content-length equals to zero is specified.

diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index fc30836..1bb6a4b 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -19,7 +19,6 @@
 #include <include/http_handler/proxy/proxy.h>
 
 #include <include/base/string/stringutils.h>
-
 #include <include/protocol/http/http_thread_context.h>
 #include <include/protocol/http/http.h>
 #include <include/protocol/url.h>
@@ -255,9 +254,9 @@ int Proxy::readPayLoad (HttpThreadContext* td,
                         int timeout,
                         string *serverTransferEncoding)
 {
-  size_t contentLength = 0;
+  size_t contentLength = ((size_t) -1);
 
-  size_t nbr = 0, nbw = 0, length = 0, inPos = 0;
+  size_t nbr = 0, nbw = 0, inPos = 0;
 
   /* Only the chunked transfer encoding is supported.  */
   if (serverTransferEncoding && serverTransferEncoding->compare ("chunked"))
@@ -270,8 +269,6 @@ int Proxy::readPayLoad (HttpThreadContext* td,
         return HttpDataHandler::RET_FAILURE;
     }
 
-  length = contentLength;
-
   /* If it is specified a transfer encoding read data using it.  */
   if (serverTransferEncoding)
     {
@@ -299,12 +296,14 @@ int Proxy::readPayLoad (HttpThreadContext* td,
     }
   else
     {
+      size_t length = contentLength;
+
       /* If it is not specified an encoding, read the data as it is.  */
       for (;;)
         {
           u_long len = td->buffer->getRealLength () - 1;
 
-          if (contentLength && length < len)
+          if (contentLength != ((size_t) -1) && length < len)
             len = length;
 
           if (len == 0)

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

Summary of changes:
 myserver/src/http_handler/proxy/proxy.cpp |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Tue Apr 26 08:41:08 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QEhZk-0003QJ-Bk
	for mharc-myserver-commit@gnu.org; Tue, 26 Apr 2011 08:41:08 -0400
Received: from eggs.gnu.org ([140.186.70.92]:44193)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QEhZi-0003QC-GT
	for myserver-commit@gnu.org; Tue, 26 Apr 2011 08:41:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QEhZe-0005db-8y
	for myserver-commit@gnu.org; Tue, 26 Apr 2011 08:41:06 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:52397)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QEhZe-0005dV-39
	for myserver-commit@gnu.org; Tue, 26 Apr 2011 08:41:02 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QEhZd-0002q3-Lq
	for myserver-commit@gnu.org; Tue, 26 Apr 2011 12:41:01 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QEhZc-0007oF-2D
	for myserver-commit@gnu.org; Tue, 26 Apr 2011 12:41:01 +0000
Date: Tue, 26 Apr 2011 12:41:01 +0000
Message-Id: <E1QEhZc-0007oF-2D@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: b1508982b8ed2deeb8ae3250ea230e5458925803
X-Git-Newrev: f7801e95bd7809d5dc9f9f7282be8078253e5fbc
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-494-gf7801e9
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Apr 2011 12:41:07 -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  f7801e95bd7809d5dc9f9f7282be8078253e5fbc (commit)
       via  360513f720c194038fa946c2b518e3c693cbbc98 (commit)
      from  b1508982b8ed2deeb8ae3250ea230e5458925803 (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 f7801e95bd7809d5dc9f9f7282be8078253e5fbc
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Tue Apr 26 14:40:51 2011 +0200

    HttpDataHandler: reset the content-length field if a transfer encoding is specified.

diff --git a/myserver/src/conf/vhost/xml_vhost_handler.cpp b/myserver/src/conf/vhost/xml_vhost_handler.cpp
index 3e96b10..ddba181 100644
--- a/myserver/src/conf/vhost/xml_vhost_handler.cpp
+++ b/myserver/src/conf/vhost/xml_vhost_handler.cpp
@@ -272,12 +272,9 @@ XmlVhostHandler::loadXMLlogData (string name, Vhost *vh, xmlNode *lcur)
             }
         }
 
-      int err = 1;
-      string str ("XmlVhostHandler::loadXMLlogData : Unrecognized log type");
-
       if (! name.compare ("ACCESSLOG"))
         {
-          err = vh->openAccessLog (location, filters, cycle);
+          int err = vh->openAccessLog (location, filters, cycle);
           vh->setAccessLogOpt (opt.c_str ());
           if (err)
             Server::getInstance ()->log (MYSERVER_LOG_MSG_ERROR,
@@ -285,7 +282,7 @@ XmlVhostHandler::loadXMLlogData (string name, Vhost *vh, xmlNode *lcur)
         }
       else if (! name.compare ("WARNINGLOG"))
         {
-          err = vh->openWarningLog (location, filters, cycle);
+          int err = vh->openWarningLog (location, filters, cycle);
           vh->setWarningLogOpt (opt.c_str ());
           if (err)
             Server::getInstance ()->log (MYSERVER_LOG_MSG_ERROR,
diff --git a/myserver/src/protocol/http/http_data_handler.cpp b/myserver/src/protocol/http/http_data_handler.cpp
index 2409da0..fdc0875 100644
--- a/myserver/src/protocol/http/http_data_handler.cpp
+++ b/myserver/src/protocol/http/http_data_handler.cpp
@@ -175,6 +175,7 @@ HttpDataHandler::chooseEncoding (HttpThreadContext *td, bool disableEncoding)
     {
       td->response.setValue ("transfer-encoding", "chunked");
       td->transferEncoding = HttpThreadContext::TRANSFER_ENCODING_CHUNKED;
+      td->response.contentLength.assign ("");
     }
 }
 
@@ -275,6 +276,7 @@ HttpDataHandler::generateFiltersChain (HttpThreadContext *td,
       string filters;
       td->outputChain.getName (filters);
       td->response.setValue ("content-encoding", filters.c_str ());
+      td->response.contentLength.assign ("");
     }
 
   td->outputChain.setStream (td->connection->socket);



commit 360513f720c194038fa946c2b518e3c693cbbc98
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Tue Apr 26 14:40:16 2011 +0200

    Proxy: don't assume the content-length remains the same.

diff --git a/myserver/include/http_handler/proxy/proxy.h b/myserver/include/http_handler/proxy/proxy.h
index 2a02ffc..e15d1a3 100644
--- a/myserver/include/http_handler/proxy/proxy.h
+++ b/myserver/include/http_handler/proxy/proxy.h
@@ -57,6 +57,7 @@ protected:
                    const char *initBuffer,
                    u_long initBufferSize,
                    int timeout,
+                   size_t contentLength,
                    string *serverTransferEncoding = NULL);
 
   static void proxySchedulerHandler (void *p, Connection *c, int event);
diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index 1bb6a4b..0852b78 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -155,6 +155,9 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket &client,
   int ret;
   size_t nbw;
   bool validResponse = false;
+  size_t contentLength = (size_t) - 1;
+
+
   td->response.free ();
 
   for (;;)
@@ -181,6 +184,9 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket &client,
   if (read == 0)
     return td->http->raiseHTTPError (500);
 
+  if (td->response.contentLength.length ())
+    contentLength = atoll (td->response.contentLength.c_str ());
+
   string *tmp = td->request.getValue ("Host", NULL);
   const char *via = tmp ? tmp->c_str () : td->connection->getLocalIpAddr ();
 
@@ -225,7 +231,7 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket &client,
 
   readPayLoad (td, &td->response, &client,
                td->auxiliaryBuffer->getBuffer () + headerLength,
-               read - headerLength, td->http->getTimeout (),
+               read - headerLength, td->http->getTimeout (), contentLength,
                hasTransferEncoding ? &transferEncoding : NULL);
 
   return HttpDataHandler::RET_OK;
@@ -240,6 +246,8 @@ int Proxy::flushToClient (HttpThreadContext* td, Socket &client,
   \param initBufferSize Size of initial data.
   \param timeout Connection timeout.
   with the client.
+  \param contentLength The Content-Length specified by
+  the client, if any.
   \param serverTransferEncoding Transfer-encoding
   used by the server.
 
@@ -252,23 +260,15 @@ int Proxy::readPayLoad (HttpThreadContext* td,
                         const char *initBuffer,
                         u_long initBufferSize,
                         int timeout,
+                        size_t contentLength,
                         string *serverTransferEncoding)
 {
-  size_t contentLength = ((size_t) -1);
-
   size_t nbr = 0, nbw = 0, inPos = 0;
 
   /* Only the chunked transfer encoding is supported.  */
   if (serverTransferEncoding && serverTransferEncoding->compare ("chunked"))
     return HttpDataHandler::RET_FAILURE;
 
-  if (res->contentLength.length ())
-    {
-      contentLength = atoll (res->contentLength.c_str ());
-      if (contentLength < 0)
-        return HttpDataHandler::RET_FAILURE;
-    }
-
   /* If it is specified a transfer encoding read data using it.  */
   if (serverTransferEncoding)
     {
@@ -324,7 +324,7 @@ int Proxy::readPayLoad (HttpThreadContext* td,
           td->sentData +=
             HttpDataHandler::appendDataToHTTPChannel (td,
                                              td->buffer->getBuffer (), nbr);
-          if (timedOut || contentLength && length == 0)
+          if (timedOut || contentLength != ((size_t) -1) && length == 0)
             break;
         }
     }

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

Summary of changes:
 myserver/include/http_handler/proxy/proxy.h      |    1 +
 myserver/src/conf/vhost/xml_vhost_handler.cpp    |    7 ++-----
 myserver/src/http_handler/proxy/proxy.cpp        |   22 +++++++++++-----------
 myserver/src/protocol/http/http_data_handler.cpp |    2 ++
 4 files changed, 16 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
GNU MyServer


From MAILER-DAEMON Tue Apr 26 18:11:14 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QEqTS-0001BT-TM
	for mharc-myserver-commit@gnu.org; Tue, 26 Apr 2011 18:11:14 -0400
Received: from eggs.gnu.org ([140.186.70.92]:39971)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QEqTQ-0001Ap-6I
	for myserver-commit@gnu.org; Tue, 26 Apr 2011 18:11:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QEqTP-00036S-CL
	for myserver-commit@gnu.org; Tue, 26 Apr 2011 18:11:12 -0400
Received: from colonialone.fsf.org ([140.186.70.51]:49681)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gscrivano@gnu.org>) id 1QEqTP-00036O-9V
	for myserver-commit@gnu.org; Tue, 26 Apr 2011 18:11:11 -0400
Received: from [10.1.0.108] (helo=vcs-noshell.in.savannah.gnu.org)
	by colonialone.fsf.org with esmtp (Exim 4.69)
	(envelope-from <gscrivano@gnu.org>) id 1QEqTP-0000xE-68
	for myserver-commit@gnu.org; Tue, 26 Apr 2011 22:11:11 +0000
Received: from gscrivano by vcs-noshell.in.savannah.gnu.org with local (Exim
	4.72) (envelope-from <gscrivano@savannah.gnu.org>)
	id 1QEqTN-0004ey-Bn
	for myserver-commit@gnu.org; Tue, 26 Apr 2011 22:11:11 +0000
Date: Tue, 26 Apr 2011 22:11:10 +0000
Message-Id: <E1QEqTN-0004ey-Bn@vcs-noshell.in.savannah.gnu.org>
To: myserver-commit@gnu.org
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: f7801e95bd7809d5dc9f9f7282be8078253e5fbc
X-Git-Newrev: 8b24a0444542acb91ff97b41bd162bea18d29f2a
From: Giuseppe Scrivano <gscrivano@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 140.186.70.51
Subject: [myserver-commit] [SCM] GNU MyServer branch, master,
	updated. v0.9.2-495-g8b24a04
X-BeenThere: myserver-commit@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: <myserver-commit.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/myserver-commit>
List-Post: <mailto:myserver-commit@gnu.org>
List-Help: <mailto:myserver-commit-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/myserver-commit>,
	<mailto:myserver-commit-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Apr 2011 22:11: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  8b24a0444542acb91ff97b41bd162bea18d29f2a (commit)
      from  f7801e95bd7809d5dc9f9f7282be8078253e5fbc (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 8b24a0444542acb91ff97b41bd162bea18d29f2a
Author: Giuseppe Scrivano <gscrivano@gnu.org>
Date:   Wed Apr 27 00:11:02 2011 +0200

    Proxy: clear Accept-Encoding.

diff --git a/myserver/src/http_handler/proxy/proxy.cpp b/myserver/src/http_handler/proxy/proxy.cpp
index 0852b78..dd5e88d 100644
--- a/myserver/src/http_handler/proxy/proxy.cpp
+++ b/myserver/src/http_handler/proxy/proxy.cpp
@@ -115,6 +115,8 @@ int Proxy::send (HttpThreadContext *td, const char* scriptpath,
 
       sock = con->socket;
 
+      req.clearValue ("accept-encoding");
+
       u_long hdrLen =
         HttpHeaders::buildHTTPRequestHeader (td->auxiliaryBuffer->getBuffer (),
                                              &req);

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

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


hooks/post-receive
-- 
GNU MyServer


