added: a new way: HEX format to saving/reading from PostgreSQL bytea columns

added: to Request:
       // binary page
       BinaryPage binary_page;

       // a compressed page ready to send to the client
       BinaryPage compressed_page;

       // if true then either page or ajaxpage will be sent to the client
       // if false then binary_page is sent
       // default: true
       bool use_text_page;

       BinaryPage is defined as (in requesttypes.h):
       typedef PT::TextStreamBase<char, 1, 4096> BinaryPage;

added: to Compress: now it can gets BinaryPage as arguments (input, output)
changed: winix version to: 0.5.0
added: in templates: TexTextStream class
       for taking input to the TeX typesetting system





git-svn-id: svn://ttmath.org/publicrep/winix/trunk@884 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2012-09-11 05:19:45 +00:00
parent 9174555ff8
commit d8260d8383
23 changed files with 1051 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-2011, Tomasz Sowa
* Copyright (c) 2008-2012, Tomasz Sowa
* All rights reserved.
*
*/
@@ -13,6 +13,8 @@
#include <cstring>
#include <fcgiapp.h>
#include <zlib.h>
#include "requesttypes.h"
class Compress
@@ -33,7 +35,8 @@ public:
2 - gzip
*/
int CompressAndPut(const char * source, size_t source_len, FCGX_Stream * out_stream, int encoding = 2);
size_t last_out_size;
int Compressing(const BinaryPage & in, BinaryPage & out, int encoding = 2);
private:
@@ -43,13 +46,20 @@ private:
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 BinaryPage & page, BinaryPage & out, int encoding);
z_stream * SelectStream(int encoding);
void ResetStream(z_stream * pstrm, int encoding);
void PutLog(size_t source_len, int encoding);
void CopyToInputBuffer(BinaryPage::const_iterator & i, size_t len);
int compress_level;
size_t buffer_max_len;
char * buffer;
// size of the last compressed page
size_t last_out_size;
char * buffer_in;
char * buffer_out;
z_stream strm_raw_deflate, strm_deflate, strm_gzip;
bool raw_deflate_inited, deflate_inited, gzip_inited;
bool ready_for_compress;