2010-01-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Fixed compile error on Mac OS X.
	* src/CookieStorage.h
pull/1/head
Tatsuhiro Tsujikawa 2010-01-31 12:36:18 +00:00
parent 149530de4e
commit c0f642df52
2 changed files with 13 additions and 31 deletions

View File

@ -1,3 +1,8 @@
2010-01-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error on Mac OS X.
* src/CookieStorage.h
2010-01-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Removed cookietest.txt from Makefile.am

View File

@ -54,32 +54,6 @@ public:
static const size_t MAX_COOKIE_PER_DOMAIN = 50;
class FindCookie:public std::unary_function<Cookie&, bool> {
private:
std::string _requestHost;
std::string _requestPath;
time_t _date;
bool _secure;
public:
FindCookie(const std::string& requestHost,
const std::string& requestPath,
time_t date, bool secure):
_requestHost(requestHost),
_requestPath(requestPath),
_date(date),
_secure(secure) {}
bool operator()(Cookie& cookie) const
{
if(cookie.match(_requestHost, _requestPath, _date, _secure)) {
cookie.updateLastAccess();
return true;
} else {
return false;
}
}
};
class DomainEntry {
private:
std::string _key;
@ -102,11 +76,14 @@ public:
const std::string& requestPath,
time_t date, bool secure)
{
OutputIterator last =
std::remove_copy_if
(_cookies.begin(), _cookies.end(), out,
std::not1(FindCookie(requestHost, requestPath, date, secure)));
return last;
for(std::deque<Cookie>::iterator i = _cookies.begin();
i != _cookies.end(); ++i) {
if((*i).match(requestHost, requestPath, date, secure)) {
(*i).updateLastAccess();
out++ = *i;
}
}
return out;
}
size_t countCookie() const