added: generating Content-Length header when text answer is sent to the client

added:   now we are able to use the html filter for the whole out_streams (when ajax is used the output is filtered too)
         splitted FilterCompressSend() function -- first we are making the filtering
         (after filtering we know the size of the content to send)
added:   to Compress:
         Compressing(const char * source, size_t source_len, BinaryPage & out_stream, int encoding);
changed: some refactoring in App




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@942 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2013-12-04 01:21:57 +00:00
parent c04874397b
commit ee9c68b04e
12 changed files with 213 additions and 129 deletions

View File

@@ -2,7 +2,7 @@
* This file is a part of Winix
* and is not publicly distributed
*
* Copyright (c) 2008-2012, Tomasz Sowa
* Copyright (c) 2008-2013, Tomasz Sowa
* All rights reserved.
*
*/
@@ -11,7 +11,6 @@
#define headerfile_winix_core_compress
#include <cstring>
#include <fcgiapp.h>
#include <zlib.h>
#include "requesttypes.h"
@@ -34,7 +33,7 @@ public:
1 - deflate
2 - gzip
*/
int CompressAndPut(const char * source, size_t source_len, FCGX_Stream * out_stream, int encoding = 2);
int Compressing(const char * source, size_t source_len, BinaryPage & out_stream, int encoding = 2);
int Compressing(const BinaryPage & in, BinaryPage & out, int encoding = 2);
@@ -45,7 +44,7 @@ private:
bool InitDeflate();
bool InitGzip();
int MakeCompress(z_stream & strm, const char * source, size_t source_len, FCGX_Stream * out_stream, int encoding);
int MakeCompress(z_stream & strm, const char * source, size_t source_len, BinaryPage & out_stream, int encoding);
int MakeCompress(z_stream & strm, const BinaryPage & page, BinaryPage & out, int encoding);
z_stream * SelectStream(int encoding);
void ResetStream(z_stream * pstrm, int encoding);