mirror of https://github.com/aria2/aria2
2010-01-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Fixed compile error on Mac OS X. * src/CookieStorage.hpull/1/head
parent
149530de4e
commit
c0f642df52
|
@ -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>
|
2010-01-31 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Removed cookietest.txt from Makefile.am
|
Removed cookietest.txt from Makefile.am
|
||||||
|
|
|
@ -54,32 +54,6 @@ public:
|
||||||
|
|
||||||
static const size_t MAX_COOKIE_PER_DOMAIN = 50;
|
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 {
|
class DomainEntry {
|
||||||
private:
|
private:
|
||||||
std::string _key;
|
std::string _key;
|
||||||
|
@ -102,11 +76,14 @@ public:
|
||||||
const std::string& requestPath,
|
const std::string& requestPath,
|
||||||
time_t date, bool secure)
|
time_t date, bool secure)
|
||||||
{
|
{
|
||||||
OutputIterator last =
|
for(std::deque<Cookie>::iterator i = _cookies.begin();
|
||||||
std::remove_copy_if
|
i != _cookies.end(); ++i) {
|
||||||
(_cookies.begin(), _cookies.end(), out,
|
if((*i).match(requestHost, requestPath, date, secure)) {
|
||||||
std::not1(FindCookie(requestHost, requestPath, date, secure)));
|
(*i).updateLastAccess();
|
||||||
return last;
|
out++ = *i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t countCookie() const
|
size_t countCookie() const
|
||||||
|
|
Loading…
Reference in New Issue