added: support for output compression

git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@511 e52654a7-88a9-db11-a3e9-0013d4bc506e
pull/3/head
Tomasz Sowa 14 years ago
parent 394c7b22a2
commit 9902ce2b78

@ -4,15 +4,17 @@ cat.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
cat.o: ../templates/patterncacher.h ../app/templates.h ../core/thread.h
cat.o: ../core/request.h ../core/requesttypes.h ../core/session.h
cat.o: ../core/done.h ../core/item.h ../core/error.h ../core/log.h
cat.o: ../core/user.h ../core/function.h ../core/thread.h ../core/error.h
cat.o: ../core/user.h ../core/function.h ../core/thread.h ../core/compress.h
cat.o: ../core/error.h
content.o: content.h ../core/item.h ../templates/templates.h
content.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
content.o: ../app/templates.h ../core/thread.h ../core/request.h
content.o: ../core/requesttypes.h ../core/session.h ../core/done.h
content.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
content.o: ../core/function.h ../core/thread.h ../core/error.h ../core/db.h
content.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
content.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
content.o: ../core/function.h ../core/thread.h ../core/compress.h
content.o: ../core/error.h ../core/db.h ../core/group.h
content.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/data.h
content.o: ../core/dirs.h ../core/users.h ../core/groups.h
content.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
content.o: ../core/mount.h ../app/content.h ../core/misc.h
createthread.o: content.h ../core/item.h ../templates/templates.h
@ -20,20 +22,21 @@ createthread.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
createthread.o: ../app/templates.h ../core/thread.h ../core/request.h
createthread.o: ../core/requesttypes.h ../core/session.h ../core/done.h
createthread.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
createthread.o: ../core/function.h ../core/thread.h ../core/error.h
createthread.o: ../core/db.h ../core/group.h ../core/dircontainer.h
createthread.o: ../core/ugcontainer.h ../core/mount.h ../core/data.h
createthread.o: ../core/dirs.h ../core/users.h ../core/groups.h
createthread.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
createthread.o: ../core/mount.h
createthread.o: ../core/function.h ../core/thread.h ../core/compress.h
createthread.o: ../core/error.h ../core/db.h ../core/group.h
createthread.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/mount.h
createthread.o: ../core/data.h ../core/dirs.h ../core/users.h
createthread.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
createthread.o: ../core/mounts.h ../core/mount.h
default.o: content.h ../core/item.h ../templates/templates.h
default.o: ../../ezc/src/ezc.h ../templates/patterncacher.h
default.o: ../app/templates.h ../core/thread.h ../core/request.h
default.o: ../core/requesttypes.h ../core/session.h ../core/done.h
default.o: ../core/item.h ../core/error.h ../core/log.h ../core/user.h
default.o: ../core/function.h ../core/thread.h ../core/error.h ../core/db.h
default.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
default.o: ../core/data.h ../core/dirs.h ../core/users.h ../core/groups.h
default.o: ../core/function.h ../core/thread.h ../core/compress.h
default.o: ../core/error.h ../core/db.h ../core/group.h
default.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/data.h
default.o: ../core/dirs.h ../core/users.h ../core/groups.h
default.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
default.o: ../core/mount.h
emacs.o: content.h ../core/item.h ../templates/templates.h
@ -41,10 +44,10 @@ emacs.o: ../../ezc/src/ezc.h ../templates/patterncacher.h ../app/templates.h
emacs.o: ../core/thread.h ../core/request.h ../core/requesttypes.h
emacs.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
emacs.o: ../core/log.h ../core/user.h ../core/function.h ../core/thread.h
emacs.o: ../core/error.h ../core/db.h ../core/group.h ../core/dircontainer.h
emacs.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
emacs.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
emacs.o: ../core/mounts.h ../core/mount.h
emacs.o: ../core/compress.h ../core/error.h ../core/db.h ../core/group.h
emacs.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/data.h
emacs.o: ../core/dirs.h ../core/users.h ../core/groups.h ../core/functions.h
emacs.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
last.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
last.o: ../templates/patterncacher.h ../app/templates.h ../core/thread.h
login.o: content.h ../core/item.h ../templates/templates.h
@ -52,45 +55,46 @@ login.o: ../../ezc/src/ezc.h ../templates/patterncacher.h ../app/templates.h
login.o: ../core/thread.h ../core/request.h ../core/requesttypes.h
login.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
login.o: ../core/log.h ../core/user.h ../core/function.h ../core/thread.h
login.o: ../core/error.h ../core/db.h ../core/group.h ../core/dircontainer.h
login.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
login.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
login.o: ../core/mounts.h ../core/mount.h
login.o: ../core/compress.h ../core/error.h ../core/db.h ../core/group.h
login.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/data.h
login.o: ../core/dirs.h ../core/users.h ../core/groups.h ../core/functions.h
login.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
logout.o: content.h ../core/item.h ../templates/templates.h
logout.o: ../../ezc/src/ezc.h ../templates/patterncacher.h ../app/templates.h
logout.o: ../core/thread.h ../core/request.h ../core/requesttypes.h
logout.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
logout.o: ../core/log.h ../core/user.h ../core/function.h ../core/thread.h
logout.o: ../core/data.h ../core/dirs.h ../core/dircontainer.h
logout.o: ../core/users.h ../core/ugcontainer.h ../core/groups.h
logout.o: ../core/group.h ../core/functions.h ../core/lastcontainer.h
logout.o: ../core/mounts.h ../core/mount.h
logout.o: ../core/compress.h ../core/data.h ../core/dirs.h
logout.o: ../core/dircontainer.h ../core/users.h ../core/ugcontainer.h
logout.o: ../core/groups.h ../core/group.h ../core/functions.h
logout.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
ls.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
ls.o: ../templates/patterncacher.h ../app/templates.h ../core/thread.h
ls.o: ../core/request.h ../core/requesttypes.h ../core/session.h
ls.o: ../core/done.h ../core/item.h ../core/error.h ../core/log.h
ls.o: ../core/user.h ../core/function.h ../core/thread.h ../core/db.h
ls.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
ls.o: ../core/user.h ../core/function.h ../core/thread.h ../core/compress.h
ls.o: ../core/db.h ../core/group.h ../core/dircontainer.h
ls.o: ../core/ugcontainer.h
mkdir.o: content.h ../core/item.h ../templates/templates.h
mkdir.o: ../../ezc/src/ezc.h ../templates/patterncacher.h ../app/templates.h
mkdir.o: ../core/thread.h ../core/request.h ../core/requesttypes.h
mkdir.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
mkdir.o: ../core/log.h ../core/user.h ../core/function.h ../core/thread.h
mkdir.o: ../core/error.h ../core/db.h ../core/group.h ../core/dircontainer.h
mkdir.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
mkdir.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
mkdir.o: ../core/mounts.h ../core/mount.h
mkdir.o: ../core/compress.h ../core/error.h ../core/db.h ../core/group.h
mkdir.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/data.h
mkdir.o: ../core/dirs.h ../core/users.h ../core/groups.h ../core/functions.h
mkdir.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
node.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
node.o: ../templates/patterncacher.h ../app/templates.h ../core/thread.h
node.o: ../core/request.h ../core/requesttypes.h ../core/session.h
node.o: ../core/done.h ../core/item.h ../core/error.h ../core/log.h
node.o: ../core/user.h ../core/function.h ../core/thread.h
node.o: ../core/user.h ../core/function.h ../core/thread.h ../core/compress.h
priv.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
priv.o: ../templates/patterncacher.h ../app/templates.h ../core/thread.h
priv.o: ../core/request.h ../core/requesttypes.h ../core/session.h
priv.o: ../core/done.h ../core/item.h ../core/error.h ../core/log.h
priv.o: ../core/user.h ../core/function.h ../core/thread.h ../core/error.h
priv.o: ../core/db.h ../core/group.h ../core/dircontainer.h
priv.o: ../core/user.h ../core/function.h ../core/thread.h ../core/compress.h
priv.o: ../core/error.h ../core/db.h ../core/group.h ../core/dircontainer.h
priv.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
priv.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
priv.o: ../core/mounts.h ../core/mount.h
@ -98,8 +102,8 @@ rm.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
rm.o: ../templates/patterncacher.h ../app/templates.h ../core/thread.h
rm.o: ../core/request.h ../core/requesttypes.h ../core/session.h
rm.o: ../core/done.h ../core/item.h ../core/error.h ../core/log.h
rm.o: ../core/user.h ../core/function.h ../core/thread.h ../core/error.h
rm.o: ../core/db.h ../core/group.h ../core/dircontainer.h
rm.o: ../core/user.h ../core/function.h ../core/thread.h ../core/compress.h
rm.o: ../core/error.h ../core/db.h ../core/group.h ../core/dircontainer.h
rm.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
rm.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
rm.o: ../core/mounts.h ../core/mount.h
@ -107,15 +111,17 @@ run.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
run.o: ../templates/patterncacher.h ../app/templates.h ../core/thread.h
run.o: ../core/request.h ../core/requesttypes.h ../core/session.h
run.o: ../core/done.h ../core/item.h ../core/error.h ../core/log.h
run.o: ../core/user.h ../core/function.h ../core/thread.h ../core/error.h
run.o: ../core/user.h ../core/function.h ../core/thread.h ../core/compress.h
run.o: ../core/error.h
thread.o: content.h ../core/item.h ../templates/templates.h
thread.o: ../../ezc/src/ezc.h ../templates/patterncacher.h ../app/templates.h
thread.o: ../core/thread.h ../core/request.h ../core/requesttypes.h
thread.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
thread.o: ../core/log.h ../core/user.h ../core/function.h ../core/thread.h
thread.o: ../core/db.h ../core/group.h ../core/dircontainer.h
thread.o: ../core/ugcontainer.h ../core/data.h ../core/dirs.h ../core/users.h
thread.o: ../core/groups.h ../core/functions.h ../core/lastcontainer.h
thread.o: ../core/mounts.h ../core/mount.h ../core/mount.h
thread.o: ../core/compress.h ../core/db.h ../core/group.h
thread.o: ../core/dircontainer.h ../core/ugcontainer.h ../core/data.h
thread.o: ../core/dirs.h ../core/users.h ../core/groups.h ../core/functions.h
thread.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
thread.o: ../core/mount.h
who.o: content.h ../core/item.h ../templates/templates.h ../../ezc/src/ezc.h
who.o: ../templates/patterncacher.h ../app/templates.h ../core/thread.h

@ -1,5 +1,6 @@
# DO NOT DELETE
compress.o: compress.h log.h
config.o: config.h ../confparser/confparser.h log.h data.h dirs.h item.h
config.o: dircontainer.h users.h user.h ugcontainer.h groups.h group.h
config.o: functions.h function.h lastcontainer.h mounts.h mount.h
@ -22,7 +23,7 @@ functionparser.o: functionparser.h requesttypes.h ../app/content.h log.h
functionparser.o: item.h error.h data.h dirs.h dircontainer.h users.h user.h
functionparser.o: ugcontainer.h groups.h group.h functions.h function.h
functionparser.o: lastcontainer.h mounts.h mount.h db.h thread.h request.h
functionparser.o: session.h done.h
functionparser.o: session.h done.h compress.h
functions.o: functions.h function.h item.h
groups.o: groups.h group.h ugcontainer.h log.h db.h item.h user.h thread.h
groups.o: error.h dircontainer.h
@ -36,7 +37,7 @@ main.o: sessionmanager.h sessioncontainer.h session.h done.h item.h error.h
main.o: log.h user.h functionparser.h requesttypes.h ../app/content.h data.h
main.o: dirs.h dircontainer.h users.h ugcontainer.h groups.h group.h
main.o: functions.h function.h lastcontainer.h mounts.h mount.h request.h
main.o: thread.h db.h config.h ../confparser/confparser.h
main.o: thread.h compress.h db.h config.h ../confparser/confparser.h
misc.o: misc.h item.h log.h
mount.o: mount.h
mountparser.o: mountparser.h mount.h item.h error.h log.h data.h dirs.h
@ -45,12 +46,12 @@ mountparser.o: functions.h function.h lastcontainer.h mounts.h
mounts.o: mounts.h mount.h data.h dirs.h item.h dircontainer.h users.h user.h
mounts.o: ugcontainer.h log.h groups.h group.h functions.h function.h
mounts.o: lastcontainer.h request.h requesttypes.h session.h done.h error.h
mounts.o: thread.h mountparser.h
mounts.o: thread.h compress.h mountparser.h
request.o: request.h requesttypes.h session.h done.h item.h error.h log.h
request.o: user.h function.h thread.h getparser.h httpsimpleparser.h
request.o: postparser.h cookieparser.h data.h dirs.h dircontainer.h users.h
request.o: ugcontainer.h groups.h group.h functions.h lastcontainer.h
request.o: mounts.h mount.h
request.o: user.h function.h thread.h compress.h getparser.h
request.o: httpsimpleparser.h postparser.h cookieparser.h data.h dirs.h
request.o: dircontainer.h users.h ugcontainer.h groups.h group.h functions.h
request.o: lastcontainer.h mounts.h mount.h
requestcontroller.o: requestcontroller.h ../content/content.h ../core/item.h
requestcontroller.o: ../templates/templates.h ../../ezc/src/ezc.h
requestcontroller.o: ../templates/patterncacher.h ../app/templates.h
@ -59,7 +60,7 @@ requestcontroller.o: session.h done.h item.h error.h log.h user.h
requestcontroller.o: functionparser.h requesttypes.h ../app/content.h data.h
requestcontroller.o: dirs.h dircontainer.h users.h ugcontainer.h groups.h
requestcontroller.o: group.h functions.h function.h lastcontainer.h mounts.h
requestcontroller.o: mount.h request.h thread.h postparser.h
requestcontroller.o: mount.h request.h thread.h compress.h postparser.h
requestcontroller.o: httpsimpleparser.h cookieparser.h
session.o: session.h done.h item.h error.h log.h user.h
sessioncontainer.o: sessioncontainer.h session.h done.h item.h error.h log.h
@ -68,8 +69,8 @@ sessioncontainer.o: groups.h group.h functions.h function.h lastcontainer.h
sessioncontainer.o: mounts.h mount.h
sessionmanager.o: sessionmanager.h sessioncontainer.h session.h done.h item.h
sessionmanager.o: error.h log.h user.h request.h requesttypes.h function.h
sessionmanager.o: thread.h data.h dirs.h dircontainer.h users.h ugcontainer.h
sessionmanager.o: groups.h group.h functions.h lastcontainer.h mounts.h
sessionmanager.o: mount.h
sessionmanager.o: thread.h compress.h data.h dirs.h dircontainer.h users.h
sessionmanager.o: ugcontainer.h groups.h group.h functions.h lastcontainer.h
sessionmanager.o: mounts.h mount.h
users.o: users.h user.h ugcontainer.h log.h db.h item.h group.h thread.h
users.o: error.h dircontainer.h

@ -1 +1 @@
o = config.o data.o db.o db_itemcolumns.o dircontainer.o dirs.o done.o error.o function.o functioncodeparser.o functionparser.o functions.o groups.o httpsimpleparser.o lastcontainer.o log.o main.o misc.o mount.o mountparser.o mounts.o request.o requestcontroller.o session.o sessioncontainer.o sessionmanager.o users.o
o = compress.o config.o data.o db.o db_itemcolumns.o dircontainer.o dirs.o done.o error.o function.o functioncodeparser.o functionparser.o functions.o groups.o httpsimpleparser.o lastcontainer.o log.o main.o misc.o mount.o mountparser.o mounts.o request.o requestcontroller.o session.o sessioncontainer.o sessionmanager.o users.o

@ -0,0 +1,172 @@
/*
* This file is a part of CMSLU -- Content Management System like Unix
* and is not publicly distributed
*
* Copyright (c) 2008-2009, Tomasz Sowa
* All rights reserved.
*
*/
#include "compress.h"
#include "log.h"
Compress::Compress()
{
buffer = 0;
buffer_max_len = 65536; // 64KB
ready_for_compress = false;
}
Compress::~Compress()
{
if( buffer )
delete [] buffer;
}
bool Compress::AllocateMemory()
{
if( buffer )
delete [] buffer;
try
{
buffer = new char[buffer_max_len];
}
catch(const std::bad_alloc &)
{
log << log1 << "Compress: can't allocate memory" << logend;
buffer = 0;
return false;
}
return true;
}
/*
return:
0 - ok;
1 - can't allocate memory
100 - unknown
*/
int Compress::Init(int compress_level)
{
if( buffer == 0 )
if( !AllocateMemory() )
return 1;
strm.zalloc = Z_NULL;
strm.zfree = Z_NULL;
strm.opaque = Z_NULL;
int ret = deflateInit(&strm, compress_level);
if( ret != Z_OK )
log << log1 << "Compress: problem with deflateInit()" << logend;
if( ret == Z_MEM_ERROR )
return 1;
if( ret != Z_OK )
return 100;
ready_for_compress = true;
return 0;
}
int Compress::MakeCompress(const char * source, size_t source_len, FCGX_Stream * out_stream)
{
int ret, flush;
size_t have;
do
{
strm.avail_in = (source_len > buffer_max_len) ? buffer_max_len : source_len;
source_len -= strm.avail_in;
flush = (source_len == 0) ? Z_FINISH : Z_NO_FLUSH;
strm.next_in = (Bytef*)source;
source += strm.avail_in;
do
{
strm.avail_out = buffer_max_len;
strm.next_out = (Bytef*)buffer;
ret = deflate(&strm, flush);
if( ret == Z_STREAM_ERROR || ret == Z_BUF_ERROR )
{
log << log1 << "Compress: problem with deflate()" << logend;
return 2;
}
have = buffer_max_len - strm.avail_out;
last_out_size += have;
FCGX_PutStr(buffer, have, out_stream);
}
while( strm.avail_out == 0 );
if( strm.avail_in != 0 )
{
log << log1 << "Compress: problem with deflate() - not all input is used" << logend;
return 2;
}
}
while( flush != Z_FINISH );
if( ret != Z_STREAM_END )
{
log << log1 << "Compress: problem with deflate() - stream not complete" << logend;
return 2;
}
return 0;
}
/*
return:
0 - ok;
1 - can't allocate memory
2 - error during compressing
3 - not inited (use Init() first)
100 - unknown
*/
int Compress::CompressAndPut(const char * source, size_t source_len, FCGX_Stream * out_stream, int level)
{
int ret;
last_out_size = 0;
if( !ready_for_compress )
{
log << log1 << "Compress: not ready yet" << logend;
return 3;
}
if( source_len == 0 )
return 0;
ret = MakeCompress(source, source_len, out_stream);
if( deflateReset(&strm) != Z_OK )
log << log1 << "Compress: problem with deflateReset()" << logend;
double ratio = (double(last_out_size) / double(source_len) * 100.0);
log << log2 << "Compress: original size: " << source_len << ", compress size: " << (int)last_out_size << ", ratio: " << ratio << "%" << logend;
return ret;
}

@ -0,0 +1,43 @@
/*
* This file is a part of CMSLU -- Content Management System like Unix
* and is not publicly distributed
*
* Copyright (c) 2008-2009, Tomasz Sowa
* All rights reserved.
*
*/
#ifndef headerfilecmslucorecompress
#define headerfilecmslucorecompress
#include <cstring>
#include <fcgiapp.h>
#include <zlib.h>
class Compress
{
public:
Compress();
~Compress();
int Init(int compress_level = 6);
int CompressAndPut(const char * source, size_t source_len, FCGX_Stream * out_stream, int level = 6);
size_t last_out_size;
private:
bool AllocateMemory();
int MakeCompress(const char * source, size_t source_len, FCGX_Stream * out_stream);
size_t buffer_max_len;
char * buffer;
z_stream strm;
bool ready_for_compress;
};
#endif

@ -117,6 +117,7 @@ void Config::AssignValues()
data.priv_no_group = Text("priv_no_group");
data.session_max_iddle = Int("session_max_iddle");
data.compression = Bool("compression");
}

@ -85,6 +85,8 @@ public:
// time in second when the user will be automatically logged out (iddle time)
int session_max_iddle;
bool compression;
// end config members
// -----------------------------------------------------------------

@ -82,6 +82,13 @@ Log & Log::operator<<(size_t s)
}
Log & Log::operator<<(double s)
{
buffer << s;
return *this;
}
Log & Log::operator<<(Manipulators m)
{
switch(m)

@ -42,6 +42,7 @@ public:
Log & operator<<(long s);
Log & operator<<(char s);
Log & operator<<(size_t s);
Log & operator<<(double s);
Log & operator<<(Manipulators m);
void SaveLog();

@ -97,7 +97,8 @@ int main(int argv, char ** argc)
{
log.Init(data.log_level, data.log_file, data.log_stdout);
db.Init(data.db_database, data.db_user, data.db_pass);
request.Init();
if( !req_controller.Init() )
return 1;

@ -14,13 +14,18 @@
#include "log.h"
#include "data.h"
Request::Request() : char_empty(0)
{
id = 0;
Clear();
}
void Request::Init()
{
compress.Init();
}
void Request::Clear()
{
@ -319,6 +324,9 @@ void Request::SendAll()
FCGX_PutS("Status: 200 OK\r\n", out);
FCGX_PutS("Content-Type: Text/Html\r\n", out);
}
if( data.compression )
FCGX_PutS("Content-Encoding: deflate\r\n", out);
FCGX_PutS(headers.str().c_str(), out);
FCGX_PutS("\r\n", out);
@ -327,9 +335,16 @@ void Request::SendAll()
if( result == redirect )
// if there is a redirect we do not send a content
return;
//
FCGX_PutS(page.str().c_str(), out);
const std::string & source = page.str();
if( !data.compression || compress.CompressAndPut(source.c_str(), source.length(), out) != 0 )
{
// there were problems during compressing, or we don't use compression at all
FCGX_PutS(source.c_str(), out);
}
const std::string & d = debug.str();
if( !d.empty() )

@ -22,6 +22,7 @@
#include "error.h"
#include "function.h"
#include "thread.h"
#include "compress.h"
@ -128,6 +129,7 @@ struct Request
Request();
void Clear();
void Init();
bool IsParam(const char * s);
@ -177,7 +179,7 @@ private:
void StandardLog();
Compress compress;
};

@ -108,6 +108,8 @@ bool RequestController::Init()
data.mounts.ReadMounts();
//
if( !content.Init() )
return false;

@ -4,10 +4,11 @@ dir.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
dir.o: ../app/templates.h ../core/request.h ../core/requesttypes.h
dir.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
dir.o: ../core/log.h ../core/user.h ../core/function.h ../core/thread.h
dir.o: ../core/data.h ../core/dirs.h ../core/dircontainer.h ../core/users.h
dir.o: ../core/ugcontainer.h ../core/groups.h ../core/group.h
dir.o: ../core/functions.h ../core/lastcontainer.h ../core/mounts.h
dir.o: ../core/mount.h ../core/db.h ../core/log.h ../core/misc.h
dir.o: ../core/compress.h ../core/data.h ../core/dirs.h
dir.o: ../core/dircontainer.h ../core/users.h ../core/ugcontainer.h
dir.o: ../core/groups.h ../core/group.h ../core/functions.h
dir.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h ../core/db.h
dir.o: ../core/log.h ../core/misc.h
doc.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
doc.o: ../app/templates.h ../core/data.h ../core/dirs.h ../core/item.h
doc.o: ../core/dircontainer.h ../core/users.h ../core/user.h
@ -15,12 +16,12 @@ doc.o: ../core/ugcontainer.h ../core/log.h ../core/groups.h ../core/group.h
doc.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h
doc.o: ../core/mounts.h ../core/mount.h ../core/request.h
doc.o: ../core/requesttypes.h ../core/session.h ../core/done.h
doc.o: ../core/error.h ../core/thread.h ../core/misc.h
doc.o: ../core/error.h ../core/thread.h ../core/compress.h ../core/misc.h
done.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
done.o: ../app/templates.h ../core/request.h ../core/requesttypes.h
done.o: ../core/session.h ../core/done.h ../core/item.h ../core/error.h
done.o: ../core/log.h ../core/user.h ../core/function.h ../core/thread.h
done.o: ../core/misc.h
done.o: ../core/compress.h ../core/misc.h
item.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
item.o: ../app/templates.h ../core/data.h ../core/dirs.h ../core/item.h
item.o: ../core/dircontainer.h ../core/users.h ../core/user.h
@ -28,7 +29,7 @@ item.o: ../core/ugcontainer.h ../core/log.h ../core/groups.h ../core/group.h
item.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h
item.o: ../core/mounts.h ../core/mount.h ../core/request.h
item.o: ../core/requesttypes.h ../core/session.h ../core/done.h
item.o: ../core/error.h ../core/thread.h ../core/misc.h
item.o: ../core/error.h ../core/thread.h ../core/compress.h ../core/misc.h
last.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
last.o: ../app/templates.h ../core/lastcontainer.h ../core/data.h
last.o: ../core/dirs.h ../core/item.h ../core/dircontainer.h ../core/users.h
@ -36,7 +37,8 @@ last.o: ../core/user.h ../core/ugcontainer.h ../core/log.h ../core/groups.h
last.o: ../core/group.h ../core/functions.h ../core/function.h
last.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
last.o: ../core/request.h ../core/requesttypes.h ../core/session.h
last.o: ../core/done.h ../core/error.h ../core/thread.h ../core/misc.h
last.o: ../core/done.h ../core/error.h ../core/thread.h ../core/compress.h
last.o: ../core/misc.h
mount.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
mount.o: ../app/templates.h ../core/data.h ../core/dirs.h ../core/item.h
mount.o: ../core/dircontainer.h ../core/users.h ../core/user.h
@ -57,7 +59,7 @@ priv.o: ../core/ugcontainer.h ../core/log.h ../core/groups.h ../core/group.h
priv.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h
priv.o: ../core/mounts.h ../core/mount.h ../core/request.h
priv.o: ../core/requesttypes.h ../core/session.h ../core/done.h
priv.o: ../core/error.h ../core/thread.h ../core/misc.h
priv.o: ../core/error.h ../core/thread.h ../core/compress.h ../core/misc.h
sys.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
sys.o: ../app/templates.h ../core/data.h ../core/dirs.h ../core/item.h
sys.o: ../core/dircontainer.h ../core/users.h ../core/user.h
@ -65,7 +67,7 @@ sys.o: ../core/ugcontainer.h ../core/log.h ../core/groups.h ../core/group.h
sys.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h
sys.o: ../core/mounts.h ../core/mount.h ../core/request.h
sys.o: ../core/requesttypes.h ../core/session.h ../core/done.h
sys.o: ../core/error.h ../core/thread.h ../core/misc.h
sys.o: ../core/error.h ../core/thread.h ../core/compress.h ../core/misc.h
templates.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
templates.o: ../app/templates.h ../core/data.h ../core/dirs.h ../core/item.h
templates.o: ../core/dircontainer.h ../core/users.h ../core/user.h
@ -73,7 +75,8 @@ templates.o: ../core/ugcontainer.h ../core/log.h ../core/groups.h
templates.o: ../core/group.h ../core/functions.h ../core/function.h
templates.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
templates.o: ../core/request.h ../core/requesttypes.h ../core/session.h
templates.o: ../core/done.h ../core/error.h ../core/thread.h ../core/misc.h
templates.o: ../core/done.h ../core/error.h ../core/thread.h
templates.o: ../core/compress.h ../core/misc.h
thread.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
thread.o: ../app/templates.h ../core/data.h ../core/dirs.h ../core/item.h
thread.o: ../core/dircontainer.h ../core/users.h ../core/user.h
@ -81,7 +84,8 @@ thread.o: ../core/ugcontainer.h ../core/log.h ../core/groups.h
thread.o: ../core/group.h ../core/functions.h ../core/function.h
thread.o: ../core/lastcontainer.h ../core/mounts.h ../core/mount.h
thread.o: ../core/request.h ../core/requesttypes.h ../core/session.h
thread.o: ../core/done.h ../core/error.h ../core/thread.h ../core/misc.h
thread.o: ../core/done.h ../core/error.h ../core/thread.h ../core/compress.h
thread.o: ../core/misc.h
user.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
user.o: ../app/templates.h ../core/data.h ../core/dirs.h ../core/item.h
user.o: ../core/dircontainer.h ../core/users.h ../core/user.h
@ -89,7 +93,7 @@ user.o: ../core/ugcontainer.h ../core/log.h ../core/groups.h ../core/group.h
user.o: ../core/functions.h ../core/function.h ../core/lastcontainer.h
user.o: ../core/mounts.h ../core/mount.h ../core/request.h
user.o: ../core/requesttypes.h ../core/session.h ../core/done.h
user.o: ../core/error.h ../core/thread.h ../core/misc.h
user.o: ../core/error.h ../core/thread.h ../core/compress.h ../core/misc.h
who.o: templates.h ../../ezc/src/ezc.h patterncacher.h ../core/item.h
who.o: ../app/templates.h ../core/sessioncontainer.h ../core/session.h
who.o: ../core/done.h ../core/item.h ../core/error.h ../core/log.h
@ -100,4 +104,5 @@ who.o: ../core/requesttypes.h ../app/content.h ../core/data.h ../core/dirs.h
who.o: ../core/dircontainer.h ../core/users.h ../core/ugcontainer.h
who.o: ../core/groups.h ../core/group.h ../core/functions.h
who.o: ../core/function.h ../core/lastcontainer.h ../core/mounts.h
who.o: ../core/mount.h ../core/request.h ../core/thread.h ../core/misc.h
who.o: ../core/mount.h ../core/request.h ../core/thread.h ../core/compress.h
who.o: ../core/misc.h

Loading…
Cancel
Save