part II of rewriting
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@635 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -21,7 +21,7 @@ class CookieParser : public HttpSimpleParser
|
||||
{
|
||||
|
||||
const char * cookie_string;
|
||||
CookieTab & cookie_tab;
|
||||
CookieTab * cookie_tab;
|
||||
|
||||
|
||||
protected:
|
||||
@@ -41,7 +41,7 @@ protected:
|
||||
// Cookie names are case insensitive according to section 3.1 of RFC 2965
|
||||
ToLower(name);
|
||||
|
||||
std::pair<CookieTab::iterator, bool> res = cookie_tab.insert( std::make_pair(name, value) );
|
||||
std::pair<CookieTab::iterator, bool> res = cookie_tab->insert( std::make_pair(name, value) );
|
||||
|
||||
log << log2 << "Cookie, name: \"" << name << "\", value: \"" << value << "\"";
|
||||
|
||||
@@ -58,7 +58,7 @@ protected:
|
||||
public:
|
||||
|
||||
|
||||
CookieParser(const char * cookie_string_, CookieTab & cookie_tab_) : cookie_string(cookie_string_), cookie_tab(cookie_tab_)
|
||||
CookieParser()
|
||||
{
|
||||
HttpSimpleParser::separator = ';';
|
||||
HttpSimpleParser::value_can_be_quoted = true;
|
||||
@@ -66,6 +66,16 @@ public:
|
||||
HttpSimpleParser::recognize_special_chars = false;
|
||||
}
|
||||
|
||||
|
||||
// cookie_string can be null
|
||||
void Parse(const char * cookie_string_, CookieTab & cookie_tab_)
|
||||
{
|
||||
cookie_string = cookie_string_;
|
||||
cookie_tab = &cookie_tab_;
|
||||
|
||||
HttpSimpleParser::Parse();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user