added: acceptbaseparser.h acceptbaseparser.cpp

class AcceptBaseParser for parsing http accept* headers
added: acceptencodingparser.h
       class AcceptEncodingParser for parsing HTTP_ACCEPT_ENCODING header
added: compresion only when HTTP_ACCEPT_ENCODING has 'deflate'
       and the browser is not the Internet Explorer


git-svn-id: svn://ttmath.org/publicrep/cmslu/trunk@515 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2009-10-08 17:59:10 +00:00
parent 85b678a8fb
commit 7db71d43e0
11 changed files with 527 additions and 249 deletions

View File

@@ -22,7 +22,7 @@
#include "function.h"
#include "thread.h"
#include "compress.h"
#include "acceptencodingparser.h"
struct Request
@@ -58,7 +58,12 @@ struct Request
const char * env_remote_addr;
const char * env_http_host;
const char * env_http_user_agent;
const char * env_http_accept_encoding;
// true if the browser is Microsoft Internet Explorer
bool browser_msie;
// current session
// is set after calling session_manager.SetSession()
Session * session;
@@ -175,6 +180,9 @@ struct Request
bool CanUseBBCode(long user_id);
private:
void CheckIE();
// used to set some env_* variables into it, when the server didn't set that variable
// it contains '\0'
const char char_empty;
@@ -184,7 +192,8 @@ private:
void StandardLog();
Compress compress;
AcceptEncodingParser accept_encoding_parser;
};