mirror of https://github.com/aria2/aria2
2008-09-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Use CookieStorage class instead of CookieBox class. Now CookieStorage accepts cookies from numeric host such as 192.168.1.1. * src/AbstractProxyRequestCommand.cc * src/CookieStorage.cc * src/DownloadEngine.cc * src/DownloadEngine.h * src/HttpConnection.cc * src/HttpConnection.h * src/HttpRequest.cc * src/HttpRequest.h * src/HttpRequestCommand.cc * src/HttpResponse.cc * src/HttpResponseCommand.cc * src/HttpSkipResponseCommand.cc * src/Makefile.am * src/MultiUrlRequestInfo.cc * src/Request.cc * src/Request.h * src/main.cc * test/AllTest.cc * test/CookieStorageTest.cc * test/CookieTest.cc * test/HttpRequestTest.cc * test/HttpResponseTest.cc * test/Makefile.am * test/NsCookieParserTest.cc * test/Sqlite3MozCookieParserTest.cc * test/nscookietest.txtpull/1/head
parent
f670cdbba9
commit
398d53f5f5
30
ChangeLog
30
ChangeLog
|
@ -1,3 +1,33 @@
|
||||||
|
2008-09-01 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
|
Use CookieStorage class instead of CookieBox class.
|
||||||
|
* src/AbstractProxyRequestCommand.cc
|
||||||
|
* src/CookieStorage.cc
|
||||||
|
* src/DownloadEngine.cc
|
||||||
|
* src/DownloadEngine.h
|
||||||
|
* src/HttpConnection.cc
|
||||||
|
* src/HttpConnection.h
|
||||||
|
* src/HttpRequest.cc
|
||||||
|
* src/HttpRequest.h
|
||||||
|
* src/HttpRequestCommand.cc
|
||||||
|
* src/HttpResponse.cc
|
||||||
|
* src/HttpResponseCommand.cc
|
||||||
|
* src/HttpSkipResponseCommand.cc
|
||||||
|
* src/Makefile.am
|
||||||
|
* src/MultiUrlRequestInfo.cc
|
||||||
|
* src/Request.cc
|
||||||
|
* src/Request.h
|
||||||
|
* src/main.cc
|
||||||
|
* test/AllTest.cc
|
||||||
|
* test/CookieStorageTest.cc
|
||||||
|
* test/CookieTest.cc
|
||||||
|
* test/HttpRequestTest.cc
|
||||||
|
* test/HttpResponseTest.cc
|
||||||
|
* test/Makefile.am
|
||||||
|
* test/NsCookieParserTest.cc
|
||||||
|
* test/Sqlite3MozCookieParserTest.cc
|
||||||
|
* test/nscookietest.txt
|
||||||
|
|
||||||
2008-08-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
2008-08-28 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
|
||||||
|
|
||||||
Updated
|
Updated
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
#include "Option.h"
|
#include "Option.h"
|
||||||
#include "prefs.h"
|
#include "prefs.h"
|
||||||
#include "Socket.h"
|
#include "Socket.h"
|
||||||
|
#include "CookieStorage.h"
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
|
|
|
@ -86,9 +86,6 @@ bool CookieStorage::parseAndStore(const std::string& setCookieString,
|
||||||
const std::string& requestHost,
|
const std::string& requestHost,
|
||||||
const std::string& requestPath)
|
const std::string& requestPath)
|
||||||
{
|
{
|
||||||
if(Util::isNumbersAndDotsNotation(requestHost)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
Cookie cookie = _parser.parse(setCookieString, requestHost, requestPath);
|
Cookie cookie = _parser.parse(setCookieString, requestHost, requestPath);
|
||||||
if(cookie.validate(requestHost, requestPath)) {
|
if(cookie.validate(requestHost, requestPath)) {
|
||||||
return store(cookie);
|
return store(cookie);
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
#include "a2functional.h"
|
#include "a2functional.h"
|
||||||
#include "DlAbortEx.h"
|
#include "DlAbortEx.h"
|
||||||
#include "ServerStatMan.h"
|
#include "ServerStatMan.h"
|
||||||
|
#include "CookieStorage.h"
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -393,7 +394,8 @@ void AsyncNameResolverEntry::process(fd_set* rfdsPtr, fd_set* wfdsPtr)
|
||||||
|
|
||||||
DownloadEngine::DownloadEngine():logger(LogFactory::getInstance()),
|
DownloadEngine::DownloadEngine():logger(LogFactory::getInstance()),
|
||||||
_haltRequested(false),
|
_haltRequested(false),
|
||||||
_noWait(false)
|
_noWait(false),
|
||||||
|
_cookieStorage(new CookieStorage())
|
||||||
{
|
{
|
||||||
#ifdef HAVE_EPOLL
|
#ifdef HAVE_EPOLL
|
||||||
|
|
||||||
|
@ -881,6 +883,11 @@ void DownloadEngine::addRoutineCommand(Command* command)
|
||||||
_routineCommands.push_back(command);
|
_routineCommands.push_back(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SharedHandle<CookieStorage> DownloadEngine::getCookieStorage() const
|
||||||
|
{
|
||||||
|
return _cookieStorage;
|
||||||
|
}
|
||||||
|
|
||||||
void DownloadEngine::poolSocket(const std::string& ipaddr, uint16_t port,
|
void DownloadEngine::poolSocket(const std::string& ipaddr, uint16_t port,
|
||||||
const SharedHandle<SocketCore>& sock,
|
const SharedHandle<SocketCore>& sock,
|
||||||
time_t timeout)
|
time_t timeout)
|
||||||
|
|
|
@ -59,6 +59,7 @@ class FileAllocationMan;
|
||||||
class StatCalc;
|
class StatCalc;
|
||||||
class CheckIntegrityMan;
|
class CheckIntegrityMan;
|
||||||
class SocketCore;
|
class SocketCore;
|
||||||
|
class CookieStorage;
|
||||||
|
|
||||||
class CommandEvent
|
class CommandEvent
|
||||||
{
|
{
|
||||||
|
@ -277,6 +278,12 @@ private:
|
||||||
// key = IP address:port, value = SocketPoolEntry
|
// key = IP address:port, value = SocketPoolEntry
|
||||||
std::multimap<std::string, SocketPoolEntry> _socketPool;
|
std::multimap<std::string, SocketPoolEntry> _socketPool;
|
||||||
|
|
||||||
|
bool _noWait;
|
||||||
|
|
||||||
|
std::deque<Command*> _routineCommands;
|
||||||
|
|
||||||
|
SharedHandle<CookieStorage> _cookieStorage;
|
||||||
|
|
||||||
void shortSleep() const;
|
void shortSleep() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -287,12 +294,6 @@ private:
|
||||||
void onEndOfRun();
|
void onEndOfRun();
|
||||||
|
|
||||||
void afterEachIteration();
|
void afterEachIteration();
|
||||||
|
|
||||||
private:
|
|
||||||
bool _noWait;
|
|
||||||
|
|
||||||
std::deque<Command*> _routineCommands;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
std::deque<Command*> commands;
|
std::deque<Command*> commands;
|
||||||
SharedHandle<RequestGroupMan> _requestGroupMan;
|
SharedHandle<RequestGroupMan> _requestGroupMan;
|
||||||
|
@ -371,6 +372,8 @@ public:
|
||||||
|
|
||||||
SharedHandle<SocketCore>
|
SharedHandle<SocketCore>
|
||||||
popPooledSocket(const std::deque<std::string>& ipaddrs, uint16_t port);
|
popPooledSocket(const std::deque<std::string>& ipaddrs, uint16_t port);
|
||||||
|
|
||||||
|
SharedHandle<CookieStorage> getCookieStorage() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef SharedHandle<DownloadEngine> DownloadEngineHandle;
|
typedef SharedHandle<DownloadEngine> DownloadEngineHandle;
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
#include "Socket.h"
|
#include "Socket.h"
|
||||||
#include "Option.h"
|
#include "Option.h"
|
||||||
|
#include "CookieStorage.h"
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
@ -169,4 +170,13 @@ bool HttpConnection::isIssued(const SegmentHandle& segment) const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SharedHandle<HttpRequest> HttpConnection::getFirstHttpRequest() const
|
||||||
|
{
|
||||||
|
if(outstandingHttpRequests.empty()) {
|
||||||
|
return SharedHandle<HttpRequest>();
|
||||||
|
} else {
|
||||||
|
return outstandingHttpRequests.front()->getHttpRequest();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace aria2
|
} // namespace aria2
|
||||||
|
|
|
@ -109,14 +109,7 @@ public:
|
||||||
*/
|
*/
|
||||||
SharedHandle<HttpResponse> receiveResponse();
|
SharedHandle<HttpResponse> receiveResponse();
|
||||||
|
|
||||||
SharedHandle<HttpRequest> getFirstHttpRequest() const
|
SharedHandle<HttpRequest> getFirstHttpRequest() const;
|
||||||
{
|
|
||||||
if(outstandingHttpRequests.size() > 0) {
|
|
||||||
return outstandingHttpRequests.front()->getHttpRequest();
|
|
||||||
} else {
|
|
||||||
return SharedHandle<HttpRequest>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isIssued(const SharedHandle<Segment>& segment) const;
|
bool isIssued(const SharedHandle<Segment>& segment) const;
|
||||||
};
|
};
|
||||||
|
|
|
@ -36,8 +36,7 @@
|
||||||
#include "Request.h"
|
#include "Request.h"
|
||||||
#include "Segment.h"
|
#include "Segment.h"
|
||||||
#include "Range.h"
|
#include "Range.h"
|
||||||
#include "Cookie.h"
|
#include "CookieStorage.h"
|
||||||
#include "CookieBox.h"
|
|
||||||
#include "Option.h"
|
#include "Option.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "Base64.h"
|
#include "Base64.h"
|
||||||
|
@ -45,6 +44,7 @@
|
||||||
#include "AuthConfigFactory.h"
|
#include "AuthConfigFactory.h"
|
||||||
#include "AuthConfig.h"
|
#include "AuthConfig.h"
|
||||||
#include "a2functional.h"
|
#include "a2functional.h"
|
||||||
|
#include "TimeA2.h"
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
@ -200,17 +200,21 @@ std::string HttpRequest::createRequest() const
|
||||||
if(getPreviousURI().size()) {
|
if(getPreviousURI().size()) {
|
||||||
requestLine += "Referer: "+getPreviousURI()+"\r\n";
|
requestLine += "Referer: "+getPreviousURI()+"\r\n";
|
||||||
}
|
}
|
||||||
std::string cookiesValue;
|
if(!_cookieStorage.isNull()) {
|
||||||
Cookies cookies = request->cookieBox->criteriaFind(getHost(),
|
std::string cookiesValue;
|
||||||
getDir(),
|
std::deque<Cookie> cookies =
|
||||||
time(0),
|
_cookieStorage->criteriaFind(getHost(),
|
||||||
getProtocol() == Request::PROTO_HTTPS ?
|
getDir(),
|
||||||
true : false);
|
Time().getTime(),
|
||||||
for(Cookies::const_iterator itr = cookies.begin(); itr != cookies.end(); itr++) {
|
getProtocol() == Request::PROTO_HTTPS ?
|
||||||
cookiesValue += (*itr).toString()+";";
|
true : false);
|
||||||
}
|
for(std::deque<Cookie>::const_iterator itr = cookies.begin();
|
||||||
if(cookiesValue.size()) {
|
itr != cookies.end(); ++itr) {
|
||||||
requestLine += std::string("Cookie: ")+cookiesValue+"\r\n";
|
cookiesValue += (*itr).toString()+";";
|
||||||
|
}
|
||||||
|
if(!cookiesValue.empty()) {
|
||||||
|
requestLine += std::string("Cookie: ")+cookiesValue+"\r\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// append additional headers given by user.
|
// append additional headers given by user.
|
||||||
for(std::deque<std::string>::const_iterator i = _headers.begin();
|
for(std::deque<std::string>::const_iterator i = _headers.begin();
|
||||||
|
@ -322,4 +326,15 @@ const std::string& HttpRequest::getQuery() const
|
||||||
return request->getQuery();
|
return request->getQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HttpRequest::setCookieStorage
|
||||||
|
(const SharedHandle<CookieStorage>& cookieStorage)
|
||||||
|
{
|
||||||
|
_cookieStorage = cookieStorage;
|
||||||
|
}
|
||||||
|
|
||||||
|
SharedHandle<CookieStorage> HttpRequest::getCookieStorage() const
|
||||||
|
{
|
||||||
|
return _cookieStorage;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace aria2
|
} // namespace aria2
|
||||||
|
|
|
@ -46,6 +46,7 @@ class Request;
|
||||||
class Segment;
|
class Segment;
|
||||||
class Range;
|
class Range;
|
||||||
class Option;
|
class Option;
|
||||||
|
class CookieStorage;
|
||||||
|
|
||||||
class HttpRequest {
|
class HttpRequest {
|
||||||
private:
|
private:
|
||||||
|
@ -72,10 +73,11 @@ private:
|
||||||
|
|
||||||
std::deque<std::string> _acceptTypes;
|
std::deque<std::string> _acceptTypes;
|
||||||
|
|
||||||
|
SharedHandle<CookieStorage> _cookieStorage;
|
||||||
|
|
||||||
std::string getHostText(const std::string& host, uint16_t port) const;
|
std::string getHostText(const std::string& host, uint16_t port) const;
|
||||||
|
|
||||||
std::string getProxyAuthString() const;
|
std::string getProxyAuthString() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
HttpRequest();
|
HttpRequest();
|
||||||
|
|
||||||
|
@ -187,6 +189,10 @@ public:
|
||||||
{
|
{
|
||||||
_acceptTypes.insert(_acceptTypes.end(), first, last);
|
_acceptTypes.insert(_acceptTypes.end(), first, last);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setCookieStorage(const SharedHandle<CookieStorage>& cookieStorage);
|
||||||
|
|
||||||
|
SharedHandle<CookieStorage> getCookieStorage() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef SharedHandle<HttpRequest> HttpRequestHandle;
|
typedef SharedHandle<HttpRequest> HttpRequestHandle;
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
#include "prefs.h"
|
#include "prefs.h"
|
||||||
#include "a2functional.h"
|
#include "a2functional.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
|
#include "CookieStorage.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
@ -71,7 +72,8 @@ createHttpRequest(const SharedHandle<Request>& req,
|
||||||
const SharedHandle<Segment>& segment,
|
const SharedHandle<Segment>& segment,
|
||||||
uint64_t totalLength,
|
uint64_t totalLength,
|
||||||
const Option* option,
|
const Option* option,
|
||||||
const RequestGroup* rg)
|
const RequestGroup* rg,
|
||||||
|
const SharedHandle<CookieStorage>& cookieStorage)
|
||||||
{
|
{
|
||||||
HttpRequestHandle httpRequest(new HttpRequest());
|
HttpRequestHandle httpRequest(new HttpRequest());
|
||||||
httpRequest->setUserAgent(option->get(PREF_USER_AGENT));
|
httpRequest->setUserAgent(option->get(PREF_USER_AGENT));
|
||||||
|
@ -79,6 +81,7 @@ createHttpRequest(const SharedHandle<Request>& req,
|
||||||
httpRequest->setSegment(segment);
|
httpRequest->setSegment(segment);
|
||||||
httpRequest->setEntityLength(totalLength);
|
httpRequest->setEntityLength(totalLength);
|
||||||
httpRequest->addHeader(option->get(PREF_HEADER));
|
httpRequest->addHeader(option->get(PREF_HEADER));
|
||||||
|
httpRequest->setCookieStorage(cookieStorage);
|
||||||
if(!rg->getAcceptFeatures().empty()) {
|
if(!rg->getAcceptFeatures().empty()) {
|
||||||
const std::deque<std::string>& acceptFeatures = rg->getAcceptFeatures();
|
const std::deque<std::string>& acceptFeatures = rg->getAcceptFeatures();
|
||||||
std::string acceptFeaturesHeader = "Accept-Features: ";
|
std::string acceptFeaturesHeader = "Accept-Features: ";
|
||||||
|
@ -103,7 +106,8 @@ bool HttpRequestCommand::executeInternal() {
|
||||||
HttpRequestHandle httpRequest
|
HttpRequestHandle httpRequest
|
||||||
(createHttpRequest(req, SharedHandle<Segment>(),
|
(createHttpRequest(req, SharedHandle<Segment>(),
|
||||||
_requestGroup->getTotalLength(), e->option,
|
_requestGroup->getTotalLength(), e->option,
|
||||||
_requestGroup));
|
_requestGroup,
|
||||||
|
e->getCookieStorage()));
|
||||||
_httpConnection->sendRequest(httpRequest);
|
_httpConnection->sendRequest(httpRequest);
|
||||||
} else {
|
} else {
|
||||||
for(Segments::iterator itr = _segments.begin(); itr != _segments.end(); ++itr) {
|
for(Segments::iterator itr = _segments.begin(); itr != _segments.end(); ++itr) {
|
||||||
|
@ -112,7 +116,8 @@ bool HttpRequestCommand::executeInternal() {
|
||||||
HttpRequestHandle httpRequest
|
HttpRequestHandle httpRequest
|
||||||
(createHttpRequest(req, segment,
|
(createHttpRequest(req, segment,
|
||||||
_requestGroup->getTotalLength(), e->option,
|
_requestGroup->getTotalLength(), e->option,
|
||||||
_requestGroup));
|
_requestGroup,
|
||||||
|
e->getCookieStorage()));
|
||||||
_httpConnection->sendRequest(httpRequest);
|
_httpConnection->sendRequest(httpRequest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
#include "HttpResponse.h"
|
#include "HttpResponse.h"
|
||||||
#include "Request.h"
|
#include "Request.h"
|
||||||
#include "Segment.h"
|
#include "Segment.h"
|
||||||
#include "CookieBox.h"
|
|
||||||
#include "HttpRequest.h"
|
#include "HttpRequest.h"
|
||||||
#include "HttpHeader.h"
|
#include "HttpHeader.h"
|
||||||
#include "Range.h"
|
#include "Range.h"
|
||||||
|
@ -52,6 +51,7 @@
|
||||||
#ifdef HAVE_LIBZ
|
#ifdef HAVE_LIBZ
|
||||||
# include "GZipDecoder.h"
|
# include "GZipDecoder.h"
|
||||||
#endif // HAVE_LIBZ
|
#endif // HAVE_LIBZ
|
||||||
|
#include "CookieStorage.h"
|
||||||
#include <deque>
|
#include <deque>
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
@ -109,9 +109,10 @@ void HttpResponse::retrieveCookie()
|
||||||
{
|
{
|
||||||
std::deque<std::string> v = httpHeader->get(HttpHeader::SET_COOKIE);
|
std::deque<std::string> v = httpHeader->get(HttpHeader::SET_COOKIE);
|
||||||
for(std::deque<std::string>::const_iterator itr = v.begin(); itr != v.end();
|
for(std::deque<std::string>::const_iterator itr = v.begin(); itr != v.end();
|
||||||
itr++) {
|
++itr) {
|
||||||
httpRequest->getRequest()->cookieBox->add(*itr, httpRequest->getHost(),
|
httpRequest->getCookieStorage()->parseAndStore(*itr,
|
||||||
httpRequest->getDir());
|
httpRequest->getHost(),
|
||||||
|
httpRequest->getDir());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,7 @@
|
||||||
#include "HttpHeader.h"
|
#include "HttpHeader.h"
|
||||||
#include "Decoder.h"
|
#include "Decoder.h"
|
||||||
#include "LogFactory.h"
|
#include "LogFactory.h"
|
||||||
|
#include "CookieStorage.h"
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
#include "HttpHeader.h"
|
#include "HttpHeader.h"
|
||||||
#include "prefs.h"
|
#include "prefs.h"
|
||||||
#include "Option.h"
|
#include "Option.h"
|
||||||
|
#include "CookieStorage.h"
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,8 @@ SRCS = Socket.h\
|
||||||
URISelector.h\
|
URISelector.h\
|
||||||
InOrderURISelector.cc InOrderURISelector.h\
|
InOrderURISelector.cc InOrderURISelector.h\
|
||||||
ServerStatURISelector.cc ServerStatURISelector.h\
|
ServerStatURISelector.cc ServerStatURISelector.h\
|
||||||
NsCookieParser.cc NsCookieParser.h
|
NsCookieParser.cc NsCookieParser.h\
|
||||||
|
CookieStorage.cc CookieStorage.h
|
||||||
|
|
||||||
if HAVE_LIBZ
|
if HAVE_LIBZ
|
||||||
SRCS += GZipDecoder.cc GZipDecoder.h
|
SRCS += GZipDecoder.cc GZipDecoder.h
|
||||||
|
|
|
@ -415,9 +415,10 @@ am__libaria2c_a_SOURCES_DIST = Socket.h SocketCore.cc SocketCore.h \
|
||||||
ServerStatMan.h URISelector.h InOrderURISelector.cc \
|
ServerStatMan.h URISelector.h InOrderURISelector.cc \
|
||||||
InOrderURISelector.h ServerStatURISelector.cc \
|
InOrderURISelector.h ServerStatURISelector.cc \
|
||||||
ServerStatURISelector.h NsCookieParser.cc NsCookieParser.h \
|
ServerStatURISelector.h NsCookieParser.cc NsCookieParser.h \
|
||||||
GZipDecoder.cc GZipDecoder.h Sqlite3MozCookieParser.cc \
|
CookieStorage.cc CookieStorage.h GZipDecoder.cc GZipDecoder.h \
|
||||||
Sqlite3MozCookieParser.h AsyncNameResolver.cc \
|
Sqlite3MozCookieParser.cc Sqlite3MozCookieParser.h \
|
||||||
AsyncNameResolver.h IteratableChunkChecksumValidator.cc \
|
AsyncNameResolver.cc AsyncNameResolver.h \
|
||||||
|
IteratableChunkChecksumValidator.cc \
|
||||||
IteratableChunkChecksumValidator.h \
|
IteratableChunkChecksumValidator.h \
|
||||||
IteratableChecksumValidator.cc IteratableChecksumValidator.h \
|
IteratableChecksumValidator.cc IteratableChecksumValidator.h \
|
||||||
CheckIntegrityCommand.cc CheckIntegrityCommand.h \
|
CheckIntegrityCommand.cc CheckIntegrityCommand.h \
|
||||||
|
@ -809,12 +810,12 @@ am__objects_18 = SocketCore.$(OBJEXT) Command.$(OBJEXT) \
|
||||||
Signature.$(OBJEXT) ServerStat.$(OBJEXT) \
|
Signature.$(OBJEXT) ServerStat.$(OBJEXT) \
|
||||||
ServerStatMan.$(OBJEXT) InOrderURISelector.$(OBJEXT) \
|
ServerStatMan.$(OBJEXT) InOrderURISelector.$(OBJEXT) \
|
||||||
ServerStatURISelector.$(OBJEXT) NsCookieParser.$(OBJEXT) \
|
ServerStatURISelector.$(OBJEXT) NsCookieParser.$(OBJEXT) \
|
||||||
$(am__objects_1) $(am__objects_2) $(am__objects_3) \
|
CookieStorage.$(OBJEXT) $(am__objects_1) $(am__objects_2) \
|
||||||
$(am__objects_4) $(am__objects_5) $(am__objects_6) \
|
$(am__objects_3) $(am__objects_4) $(am__objects_5) \
|
||||||
$(am__objects_7) $(am__objects_8) $(am__objects_9) \
|
$(am__objects_6) $(am__objects_7) $(am__objects_8) \
|
||||||
$(am__objects_10) $(am__objects_11) $(am__objects_12) \
|
$(am__objects_9) $(am__objects_10) $(am__objects_11) \
|
||||||
$(am__objects_13) $(am__objects_14) $(am__objects_15) \
|
$(am__objects_12) $(am__objects_13) $(am__objects_14) \
|
||||||
$(am__objects_16) $(am__objects_17)
|
$(am__objects_15) $(am__objects_16) $(am__objects_17)
|
||||||
am_libaria2c_a_OBJECTS = $(am__objects_18)
|
am_libaria2c_a_OBJECTS = $(am__objects_18)
|
||||||
libaria2c_a_OBJECTS = $(am_libaria2c_a_OBJECTS)
|
libaria2c_a_OBJECTS = $(am_libaria2c_a_OBJECTS)
|
||||||
am__installdirs = "$(DESTDIR)$(bindir)"
|
am__installdirs = "$(DESTDIR)$(bindir)"
|
||||||
|
@ -1139,12 +1140,13 @@ SRCS = Socket.h SocketCore.cc SocketCore.h BinaryStream.h Command.cc \
|
||||||
ServerStatMan.h URISelector.h InOrderURISelector.cc \
|
ServerStatMan.h URISelector.h InOrderURISelector.cc \
|
||||||
InOrderURISelector.h ServerStatURISelector.cc \
|
InOrderURISelector.h ServerStatURISelector.cc \
|
||||||
ServerStatURISelector.h NsCookieParser.cc NsCookieParser.h \
|
ServerStatURISelector.h NsCookieParser.cc NsCookieParser.h \
|
||||||
$(am__append_1) $(am__append_2) $(am__append_3) \
|
CookieStorage.cc CookieStorage.h $(am__append_1) \
|
||||||
$(am__append_4) $(am__append_5) $(am__append_6) \
|
$(am__append_2) $(am__append_3) $(am__append_4) \
|
||||||
$(am__append_7) $(am__append_8) $(am__append_9) \
|
$(am__append_5) $(am__append_6) $(am__append_7) \
|
||||||
$(am__append_10) $(am__append_11) $(am__append_12) \
|
$(am__append_8) $(am__append_9) $(am__append_10) \
|
||||||
$(am__append_13) $(am__append_14) $(am__append_15) \
|
$(am__append_11) $(am__append_12) $(am__append_13) \
|
||||||
$(am__append_16) $(am__append_17)
|
$(am__append_14) $(am__append_15) $(am__append_16) \
|
||||||
|
$(am__append_17)
|
||||||
noinst_LIBRARIES = libaria2c.a
|
noinst_LIBRARIES = libaria2c.a
|
||||||
libaria2c_a_SOURCES = $(SRCS)
|
libaria2c_a_SOURCES = $(SRCS)
|
||||||
aria2c_LDADD = libaria2c.a @LIBINTL@ @ALLOCA@ @LIBGNUTLS_LIBS@\
|
aria2c_LDADD = libaria2c.a @LIBINTL@ @ALLOCA@ @LIBGNUTLS_LIBS@\
|
||||||
|
@ -1297,6 +1299,7 @@ distclean-compile:
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieBox.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieBox.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieBoxFactory.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieBoxFactory.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieParser.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieParser.Po@am__quote@
|
||||||
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieStorage.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CopyDiskAdaptor.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CopyDiskAdaptor.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DHTAbstractMessage.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DHTAbstractMessage.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DHTAbstractNodeLookupTask.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DHTAbstractNodeLookupTask.Po@am__quote@
|
||||||
|
|
|
@ -46,6 +46,8 @@
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "Option.h"
|
#include "Option.h"
|
||||||
#include "StatCalc.h"
|
#include "StatCalc.h"
|
||||||
|
#include "CookieStorage.h"
|
||||||
|
#include "File.h"
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
||||||
|
@ -100,6 +102,20 @@ int MultiUrlRequestInfo::execute()
|
||||||
DownloadEngineHandle e =
|
DownloadEngineHandle e =
|
||||||
DownloadEngineFactory().newDownloadEngine(_option, _requestGroups);
|
DownloadEngineFactory().newDownloadEngine(_option, _requestGroups);
|
||||||
|
|
||||||
|
try {
|
||||||
|
if(_option->defined(PREF_LOAD_COOKIES)) {
|
||||||
|
File cookieFile(_option->get(PREF_LOAD_COOKIES));
|
||||||
|
if(cookieFile.isFile()) {
|
||||||
|
e->getCookieStorage()->load(_option->get(PREF_LOAD_COOKIES));
|
||||||
|
} else {
|
||||||
|
_logger->error(MSG_LOADING_COOKIE_FAILED,
|
||||||
|
_option->get(PREF_LOAD_COOKIES).c_str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch(RecoverableException& e) {
|
||||||
|
_logger->error(EX_EXCEPTION_CAUGHT, e);
|
||||||
|
}
|
||||||
|
|
||||||
std::string serverStatIf = _option->get(PREF_SERVER_STAT_IF);
|
std::string serverStatIf = _option->get(PREF_SERVER_STAT_IF);
|
||||||
if(!serverStatIf.empty()) {
|
if(!serverStatIf.empty()) {
|
||||||
e->_requestGroupMan->loadServerStat(serverStatIf);
|
e->_requestGroupMan->loadServerStat(serverStatIf);
|
||||||
|
|
|
@ -35,8 +35,6 @@
|
||||||
#include "Request.h"
|
#include "Request.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "FeatureConfig.h"
|
#include "FeatureConfig.h"
|
||||||
#include "CookieBoxFactory.h"
|
|
||||||
#include "CookieBox.h"
|
|
||||||
#include "RecoverableException.h"
|
#include "RecoverableException.h"
|
||||||
#include "StringFormat.h"
|
#include "StringFormat.h"
|
||||||
#include "A2STR.h"
|
#include "A2STR.h"
|
||||||
|
@ -60,8 +58,7 @@ Request::Request():
|
||||||
_supportsPersistentConnection(true),
|
_supportsPersistentConnection(true),
|
||||||
_keepAliveHint(false),
|
_keepAliveHint(false),
|
||||||
_pipeliningHint(false),
|
_pipeliningHint(false),
|
||||||
method(METHOD_GET),
|
method(METHOD_GET)
|
||||||
cookieBox(CookieBoxFactorySingletonHolder::instance()->createNewInstance())
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
Request::~Request() {}
|
Request::~Request() {}
|
||||||
|
|
|
@ -50,8 +50,6 @@
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
|
||||||
class CookieBox;
|
|
||||||
|
|
||||||
class Request {
|
class Request {
|
||||||
private:
|
private:
|
||||||
std::string url;
|
std::string url;
|
||||||
|
@ -93,9 +91,6 @@ private:
|
||||||
bool isHexNumber(const char c) const;
|
bool isHexNumber(const char c) const;
|
||||||
|
|
||||||
void urlencode(std::string& result, const std::string& src) const;
|
void urlencode(std::string& result, const std::string& src) const;
|
||||||
|
|
||||||
public:
|
|
||||||
SharedHandle<CookieBox> cookieBox;
|
|
||||||
public:
|
public:
|
||||||
Request();
|
Request();
|
||||||
virtual ~Request();
|
virtual ~Request();
|
||||||
|
|
15
src/main.cc
15
src/main.cc
|
@ -39,7 +39,6 @@
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "BitfieldManFactory.h"
|
#include "BitfieldManFactory.h"
|
||||||
#include "AuthConfigFactory.h"
|
#include "AuthConfigFactory.h"
|
||||||
#include "CookieBoxFactory.h"
|
|
||||||
#include "FeatureConfig.h"
|
#include "FeatureConfig.h"
|
||||||
#include "MultiUrlRequestInfo.h"
|
#include "MultiUrlRequestInfo.h"
|
||||||
#include "SimpleRandomizer.h"
|
#include "SimpleRandomizer.h"
|
||||||
|
@ -380,20 +379,6 @@ int main(int argc, char* argv[])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CookieBoxFactoryHandle cookieBoxFactory(new CookieBoxFactory());
|
|
||||||
CookieBoxFactorySingletonHolder::instance(cookieBoxFactory);
|
|
||||||
if(op->defined(PREF_LOAD_COOKIES)) {
|
|
||||||
File cookieFile(op->get(PREF_LOAD_COOKIES));
|
|
||||||
if(cookieFile.isFile()) {
|
|
||||||
CookieBoxFactorySingletonHolder::instance()->loadDefaultCookie
|
|
||||||
(op->get(PREF_LOAD_COOKIES));
|
|
||||||
} else {
|
|
||||||
logger->error(MSG_LOADING_COOKIE_FAILED,
|
|
||||||
op->get(PREF_LOAD_COOKIES).c_str());
|
|
||||||
exit(EXIT_FAILURE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AuthConfigFactorySingleton::instance(authConfigFactory);
|
AuthConfigFactorySingleton::instance(authConfigFactory);
|
||||||
CUIDCounterHandle cuidCounter(new CUIDCounter());
|
CUIDCounterHandle cuidCounter(new CUIDCounter());
|
||||||
CUIDCounterSingletonHolder::instance(cuidCounter);
|
CUIDCounterSingletonHolder::instance(cuidCounter);
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
#include "CookieBoxFactory.h"
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cppunit/CompilerOutputter.h>
|
#include <cppunit/CompilerOutputter.h>
|
||||||
#include <cppunit/extensions/TestFactoryRegistry.h>
|
#include <cppunit/extensions/TestFactoryRegistry.h>
|
||||||
#include <cppunit/ui/text/TestRunner.h>
|
#include <cppunit/ui/text/TestRunner.h>
|
||||||
|
|
||||||
using aria2::SharedHandle;
|
|
||||||
using aria2::SingletonHolder;
|
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
aria2::Platform platform;
|
aria2::Platform platform;
|
||||||
|
|
||||||
|
@ -23,12 +19,6 @@ int main(int argc, char* argv[]) {
|
||||||
|
|
||||||
runner.setOutputter(new CppUnit::CompilerOutputter(&runner.result(), std::cerr));
|
runner.setOutputter(new CppUnit::CompilerOutputter(&runner.result(), std::cerr));
|
||||||
|
|
||||||
// setup
|
|
||||||
|
|
||||||
SharedHandle<aria2::CookieBoxFactory> cookieBoxFactory
|
|
||||||
(new aria2::CookieBoxFactory());
|
|
||||||
SingletonHolder<SharedHandle<aria2::CookieBoxFactory> >::instance(cookieBoxFactory);
|
|
||||||
|
|
||||||
// Run the tests.
|
// Run the tests.
|
||||||
bool successfull = runner.run();
|
bool successfull = runner.run();
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,11 @@ void CookieStorageTest::testStore()
|
||||||
CPPUNIT_ASSERT(!st.store(badCookie));
|
CPPUNIT_ASSERT(!st.store(badCookie));
|
||||||
CPPUNIT_ASSERT_EQUAL((size_t)1, st.size());
|
CPPUNIT_ASSERT_EQUAL((size_t)1, st.size());
|
||||||
CPPUNIT_ASSERT(std::find(st.begin(), st.end(), anotherCookie) != st.end());
|
CPPUNIT_ASSERT(std::find(st.begin(), st.end(), anotherCookie) != st.end());
|
||||||
|
|
||||||
|
Cookie fromNumericHost("k", "v", "/", "192.168.1.1", false);
|
||||||
|
CPPUNIT_ASSERT(st.store(fromNumericHost));
|
||||||
|
CPPUNIT_ASSERT_EQUAL((size_t)2, st.size());
|
||||||
|
CPPUNIT_ASSERT(std::find(st.begin(), st.end(), fromNumericHost) != st.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CookieStorageTest::testParseAndStore()
|
void CookieStorageTest::testParseAndStore()
|
||||||
|
@ -81,6 +86,11 @@ void CookieStorageTest::testParseAndStore()
|
||||||
|
|
||||||
CPPUNIT_ASSERT(!st.parseAndStore(localhostCookieStr,
|
CPPUNIT_ASSERT(!st.parseAndStore(localhostCookieStr,
|
||||||
"127.0.0.1", "/downloads"));
|
"127.0.0.1", "/downloads"));
|
||||||
|
|
||||||
|
std::string numericHostCookieStr = "k=v;"
|
||||||
|
" expires=Fri, 2038-01-01 00:00:00 GMT; path=/; domain=192.168.1.1;";
|
||||||
|
CPPUNIT_ASSERT(st.parseAndStore(numericHostCookieStr, "192.168.1.1", "/"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CookieStorageTest::testCriteriaFind()
|
void CookieStorageTest::testCriteriaFind()
|
||||||
|
@ -94,12 +104,15 @@ void CookieStorageTest::testCriteriaFind()
|
||||||
Cookie delta("delta", "DELTA", "/foo/bar", ".aria2.org", false);
|
Cookie delta("delta", "DELTA", "/foo/bar", ".aria2.org", false);
|
||||||
Cookie echo("echo", "ECHO", "/", "www.aria2.org", false);
|
Cookie echo("echo", "ECHO", "/", "www.aria2.org", false);
|
||||||
Cookie foxtrot("foxtrot", "FOXTROT", "/", ".sf.net", false);
|
Cookie foxtrot("foxtrot", "FOXTROT", "/", ".sf.net", false);
|
||||||
|
Cookie golf("golf", "GOLF", "/", "192.168.1.1", false);
|
||||||
|
|
||||||
CPPUNIT_ASSERT(st.store(alpha));
|
CPPUNIT_ASSERT(st.store(alpha));
|
||||||
CPPUNIT_ASSERT(st.store(bravo));
|
CPPUNIT_ASSERT(st.store(bravo));
|
||||||
CPPUNIT_ASSERT(st.store(charlie));
|
CPPUNIT_ASSERT(st.store(charlie));
|
||||||
CPPUNIT_ASSERT(st.store(delta));
|
CPPUNIT_ASSERT(st.store(delta));
|
||||||
CPPUNIT_ASSERT(st.store(echo));
|
CPPUNIT_ASSERT(st.store(echo));
|
||||||
CPPUNIT_ASSERT(st.store(foxtrot));
|
CPPUNIT_ASSERT(st.store(foxtrot));
|
||||||
|
CPPUNIT_ASSERT(st.store(golf));
|
||||||
|
|
||||||
std::deque<Cookie> aria2Slash = st.criteriaFind("www.aria2.org", "/",
|
std::deque<Cookie> aria2Slash = st.criteriaFind("www.aria2.org", "/",
|
||||||
0, false);
|
0, false);
|
||||||
|
@ -130,6 +143,11 @@ void CookieStorageTest::testCriteriaFind()
|
||||||
std::deque<Cookie> dlAria2 = st.criteriaFind("dl.aria2.org", "/", 0, false);
|
std::deque<Cookie> dlAria2 = st.criteriaFind("dl.aria2.org", "/", 0, false);
|
||||||
CPPUNIT_ASSERT_EQUAL((size_t)1, dlAria2.size());
|
CPPUNIT_ASSERT_EQUAL((size_t)1, dlAria2.size());
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("alpha"), dlAria2[0].name);
|
CPPUNIT_ASSERT_EQUAL(std::string("alpha"), dlAria2[0].name);
|
||||||
|
|
||||||
|
std::deque<Cookie> numericHostCookies = st.criteriaFind("192.168.1.1", "/", 0,
|
||||||
|
false);
|
||||||
|
CPPUNIT_ASSERT_EQUAL((size_t)1, numericHostCookies.size());
|
||||||
|
CPPUNIT_ASSERT_EQUAL(std::string("golf"), numericHostCookies[0].name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CookieStorageTest::testLoad()
|
void CookieStorageTest::testLoad()
|
||||||
|
|
|
@ -85,6 +85,11 @@ void CookieTest::testValidate()
|
||||||
Cookie nameEmpty("", "v", "/", "localhost", false);
|
Cookie nameEmpty("", "v", "/", "localhost", false);
|
||||||
CPPUNIT_ASSERT(!nameEmpty.validate("localhost", "/"));
|
CPPUNIT_ASSERT(!nameEmpty.validate("localhost", "/"));
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
Cookie fromNumericHost("k", "v", "/", "192.168.1.1", false);
|
||||||
|
CPPUNIT_ASSERT(fromNumericHost.validate("192.168.1.1", "/"));
|
||||||
|
CPPUNIT_ASSERT(!fromNumericHost.validate("www.aria2.org", "/"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CookieTest::testOperatorEqual()
|
void CookieTest::testOperatorEqual()
|
||||||
|
@ -127,6 +132,10 @@ void CookieTest::testMatch()
|
||||||
CPPUNIT_ASSERT(expireTest.match("www.aria2.org", "/", 999, false));
|
CPPUNIT_ASSERT(expireTest.match("www.aria2.org", "/", 999, false));
|
||||||
CPPUNIT_ASSERT(!expireTest.match("www.aria2.org", "/", 1000, false));
|
CPPUNIT_ASSERT(!expireTest.match("www.aria2.org", "/", 1000, false));
|
||||||
CPPUNIT_ASSERT(!expireTest.match("www.aria2.org", "/", 1001, false));
|
CPPUNIT_ASSERT(!expireTest.match("www.aria2.org", "/", 1001, false));
|
||||||
|
|
||||||
|
Cookie fromNumericHost("k", "v", "/", "192.168.1.1", false);
|
||||||
|
CPPUNIT_ASSERT(fromNumericHost.match("192.168.1.1", "/", 0, false));
|
||||||
|
CPPUNIT_ASSERT(!fromNumericHost.match("www.aria2.org", "/", 0, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
void CookieTest::testIsExpired()
|
void CookieTest::testIsExpired()
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
#include "Piece.h"
|
#include "Piece.h"
|
||||||
#include "Range.h"
|
#include "Range.h"
|
||||||
#include "Request.h"
|
#include "Request.h"
|
||||||
#include "CookieBox.h"
|
|
||||||
#include "Option.h"
|
#include "Option.h"
|
||||||
#include "array_fun.h"
|
#include "array_fun.h"
|
||||||
|
#include "CookieStorage.h"
|
||||||
#include <cppunit/extensions/HelperMacros.h>
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
|
|
||||||
namespace aria2 {
|
namespace aria2 {
|
||||||
|
@ -396,19 +396,21 @@ void HttpRequestTest::testCreateRequest_with_cookie()
|
||||||
|
|
||||||
Cookie cookie1("name1", "value1", "/archives", "localhost", false);
|
Cookie cookie1("name1", "value1", "/archives", "localhost", false);
|
||||||
Cookie cookie2("name2", "value2", "/archives/download", "localhost", false);
|
Cookie cookie2("name2", "value2", "/archives/download", "localhost", false);
|
||||||
Cookie cookie3("name3", "value3", "/archives/download", "tt.localhost", false);
|
Cookie cookie3("name3", "value3", "/archives/download", ".aria2.org", false);
|
||||||
Cookie cookie4("name4", "value4", "/archives/download", "tt.localhost", true);
|
Cookie cookie4("name4", "value4", "/archives/", ".aria2.org", true);
|
||||||
|
|
||||||
request->cookieBox->add(cookie1);
|
SharedHandle<CookieStorage> st(new CookieStorage());
|
||||||
request->cookieBox->add(cookie2);
|
CPPUNIT_ASSERT(st->store(cookie1));
|
||||||
request->cookieBox->add(cookie3);
|
CPPUNIT_ASSERT(st->store(cookie2));
|
||||||
request->cookieBox->add(cookie4);
|
CPPUNIT_ASSERT(st->store(cookie3));
|
||||||
|
CPPUNIT_ASSERT(st->store(cookie4));
|
||||||
|
|
||||||
HttpRequest httpRequest;
|
HttpRequest httpRequest;
|
||||||
|
|
||||||
httpRequest.disableContentEncoding();
|
httpRequest.disableContentEncoding();
|
||||||
httpRequest.setRequest(request);
|
httpRequest.setRequest(request);
|
||||||
httpRequest.setSegment(segment);
|
httpRequest.setSegment(segment);
|
||||||
|
httpRequest.setCookieStorage(st);
|
||||||
|
|
||||||
std::string expectedText = "GET /archives/aria2-1.0.0.tar.bz2 HTTP/1.1\r\n"
|
std::string expectedText = "GET /archives/aria2-1.0.0.tar.bz2 HTTP/1.1\r\n"
|
||||||
"User-Agent: aria2\r\n"
|
"User-Agent: aria2\r\n"
|
||||||
|
@ -431,35 +433,36 @@ void HttpRequestTest::testCreateRequest_with_cookie()
|
||||||
"Pragma: no-cache\r\n"
|
"Pragma: no-cache\r\n"
|
||||||
"Cache-Control: no-cache\r\n"
|
"Cache-Control: no-cache\r\n"
|
||||||
"Connection: close\r\n"
|
"Connection: close\r\n"
|
||||||
"Cookie: name1=value1;name2=value2;\r\n"
|
"Cookie: name2=value2;name1=value1;\r\n"
|
||||||
"\r\n";
|
"\r\n";
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(expectedText, httpRequest.createRequest());
|
CPPUNIT_ASSERT_EQUAL(expectedText, httpRequest.createRequest());
|
||||||
|
|
||||||
request->setUrl("http://tt.localhost/archives/download/aria2-1.0.0.tar.bz2");
|
request->setUrl("http://www.aria2.org/archives/download/aria2-1.0.0.tar.bz2");
|
||||||
|
|
||||||
expectedText = "GET /archives/download/aria2-1.0.0.tar.bz2 HTTP/1.1\r\n"
|
expectedText = "GET /archives/download/aria2-1.0.0.tar.bz2 HTTP/1.1\r\n"
|
||||||
"User-Agent: aria2\r\n"
|
"User-Agent: aria2\r\n"
|
||||||
"Accept: */*\r\n"
|
"Accept: */*\r\n"
|
||||||
"Host: tt.localhost\r\n"
|
"Host: www.aria2.org\r\n"
|
||||||
"Pragma: no-cache\r\n"
|
"Pragma: no-cache\r\n"
|
||||||
"Cache-Control: no-cache\r\n"
|
"Cache-Control: no-cache\r\n"
|
||||||
"Connection: close\r\n"
|
"Connection: close\r\n"
|
||||||
"Cookie: name1=value1;name2=value2;name3=value3;\r\n"
|
"Cookie: name3=value3;\r\n"
|
||||||
"\r\n";
|
"\r\n";
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(expectedText, httpRequest.createRequest());
|
CPPUNIT_ASSERT_EQUAL(expectedText, httpRequest.createRequest());
|
||||||
|
|
||||||
request->setUrl("https://tt.localhost/archives/download/aria2-1.0.0.tar.bz2");
|
request->setUrl("https://www.aria2.org/archives/download/"
|
||||||
|
"aria2-1.0.0.tar.bz2");
|
||||||
|
|
||||||
expectedText = "GET /archives/download/aria2-1.0.0.tar.bz2 HTTP/1.1\r\n"
|
expectedText = "GET /archives/download/aria2-1.0.0.tar.bz2 HTTP/1.1\r\n"
|
||||||
"User-Agent: aria2\r\n"
|
"User-Agent: aria2\r\n"
|
||||||
"Accept: */*\r\n"
|
"Accept: */*\r\n"
|
||||||
"Host: tt.localhost\r\n"
|
"Host: www.aria2.org\r\n"
|
||||||
"Pragma: no-cache\r\n"
|
"Pragma: no-cache\r\n"
|
||||||
"Cache-Control: no-cache\r\n"
|
"Cache-Control: no-cache\r\n"
|
||||||
"Connection: close\r\n"
|
"Connection: close\r\n"
|
||||||
"Cookie: name1=value1;name2=value2;name3=value3;name4=value4;\r\n"
|
"Cookie: name3=value3;name4=value4;\r\n"
|
||||||
"\r\n";
|
"\r\n";
|
||||||
|
|
||||||
CPPUNIT_ASSERT_EQUAL(expectedText, httpRequest.createRequest());
|
CPPUNIT_ASSERT_EQUAL(expectedText, httpRequest.createRequest());
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "A2STR.h"
|
#include "A2STR.h"
|
||||||
#include "Decoder.h"
|
#include "Decoder.h"
|
||||||
#include "DlRetryEx.h"
|
#include "DlRetryEx.h"
|
||||||
|
#include "CookieStorage.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <cppunit/extensions/HelperMacros.h>
|
#include <cppunit/extensions/HelperMacros.h>
|
||||||
|
|
||||||
|
@ -40,6 +41,7 @@ class HttpResponseTest : public CppUnit::TestFixture {
|
||||||
CPPUNIT_TEST(testValidateResponse_chunked);
|
CPPUNIT_TEST(testValidateResponse_chunked);
|
||||||
CPPUNIT_TEST(testHasRetryAfter);
|
CPPUNIT_TEST(testHasRetryAfter);
|
||||||
CPPUNIT_TEST(testProcessRedirect);
|
CPPUNIT_TEST(testProcessRedirect);
|
||||||
|
CPPUNIT_TEST(testRetrieveCookie);
|
||||||
CPPUNIT_TEST_SUITE_END();
|
CPPUNIT_TEST_SUITE_END();
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -69,6 +71,7 @@ public:
|
||||||
void testValidateResponse_chunked();
|
void testValidateResponse_chunked();
|
||||||
void testHasRetryAfter();
|
void testHasRetryAfter();
|
||||||
void testProcessRedirect();
|
void testProcessRedirect();
|
||||||
|
void testRetrieveCookie();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -454,4 +457,33 @@ void HttpResponseTest::testProcessRedirect()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HttpResponseTest::testRetrieveCookie()
|
||||||
|
{
|
||||||
|
HttpResponse httpResponse;
|
||||||
|
SharedHandle<HttpHeader> httpHeader(new HttpHeader());
|
||||||
|
httpResponse.setHttpHeader(httpHeader);
|
||||||
|
|
||||||
|
SharedHandle<HttpRequest> httpRequest(new HttpRequest());
|
||||||
|
SharedHandle<Request> request(new Request());
|
||||||
|
request->setUrl("http://www.aria2.org/archives/aria2-1.0.0.tar.bz2");
|
||||||
|
httpRequest->setRequest(request);
|
||||||
|
SharedHandle<CookieStorage> st(new CookieStorage());
|
||||||
|
httpRequest->setCookieStorage(st);
|
||||||
|
httpResponse.setHttpRequest(httpRequest);
|
||||||
|
|
||||||
|
httpHeader->put("Set-Cookie", "k1=v1; expires=Sun, 2007-06-10 11:00:00 GMT;"
|
||||||
|
"path=/; domain=.aria2.org;");
|
||||||
|
httpHeader->put("Set-Cookie", "k2=v2; expires=Sun, 2038-01-01 00:00:00 GMT;"
|
||||||
|
"path=/; domain=.aria2.org;");
|
||||||
|
httpHeader->put("Set-Cookie", "k3=v3;");
|
||||||
|
|
||||||
|
httpResponse.retrieveCookie();
|
||||||
|
|
||||||
|
CPPUNIT_ASSERT_EQUAL((size_t)2, st->size());
|
||||||
|
|
||||||
|
std::deque<Cookie>::const_iterator citer = st->begin();
|
||||||
|
CPPUNIT_ASSERT_EQUAL(std::string("k2=v2"), (*(st->begin())).toString());
|
||||||
|
CPPUNIT_ASSERT_EQUAL(std::string("k3=v3"), (*(st->begin()+1)).toString());
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace aria2
|
} // namespace aria2
|
||||||
|
|
|
@ -24,11 +24,9 @@ aria2c_SOURCES = AllTest.cc\
|
||||||
AlphaNumberDecoratorTest.cc\
|
AlphaNumberDecoratorTest.cc\
|
||||||
UriListParserTest.cc\
|
UriListParserTest.cc\
|
||||||
HttpHeaderProcessorTest.cc\
|
HttpHeaderProcessorTest.cc\
|
||||||
CookieBoxTest.cc\
|
|
||||||
RequestTest.cc\
|
RequestTest.cc\
|
||||||
CookieParserTest.cc\
|
CookieParserTest.cc\
|
||||||
HttpRequestTest.cc\
|
HttpRequestTest.cc\
|
||||||
CookieBoxFactoryTest.cc\
|
|
||||||
RequestGroupManTest.cc\
|
RequestGroupManTest.cc\
|
||||||
AuthConfigFactoryTest.cc\
|
AuthConfigFactoryTest.cc\
|
||||||
NetrcAuthResolverTest.cc\
|
NetrcAuthResolverTest.cc\
|
||||||
|
|
|
@ -178,17 +178,17 @@ am__aria2c_SOURCES_DIST = AllTest.cc TestUtil.cc TestUtil.h \
|
||||||
SingleFileDownloadContextTest.cc RequestGroupTest.cc \
|
SingleFileDownloadContextTest.cc RequestGroupTest.cc \
|
||||||
PStringBuildVisitorTest.cc ParameterizedStringParserTest.cc \
|
PStringBuildVisitorTest.cc ParameterizedStringParserTest.cc \
|
||||||
UtilTest.cc AlphaNumberDecoratorTest.cc UriListParserTest.cc \
|
UtilTest.cc AlphaNumberDecoratorTest.cc UriListParserTest.cc \
|
||||||
HttpHeaderProcessorTest.cc CookieBoxTest.cc RequestTest.cc \
|
HttpHeaderProcessorTest.cc RequestTest.cc CookieParserTest.cc \
|
||||||
CookieParserTest.cc HttpRequestTest.cc CookieBoxFactoryTest.cc \
|
HttpRequestTest.cc RequestGroupManTest.cc \
|
||||||
RequestGroupManTest.cc AuthConfigFactoryTest.cc \
|
AuthConfigFactoryTest.cc NetrcAuthResolverTest.cc \
|
||||||
NetrcAuthResolverTest.cc DefaultAuthResolverTest.cc \
|
DefaultAuthResolverTest.cc OptionHandlerTest.cc \
|
||||||
OptionHandlerTest.cc SegmentManTest.cc BitfieldManTest.cc \
|
SegmentManTest.cc BitfieldManTest.cc NetrcTest.cc \
|
||||||
NetrcTest.cc SingletonHolderTest.cc HttpHeaderTest.cc \
|
SingletonHolderTest.cc HttpHeaderTest.cc HttpResponseTest.cc \
|
||||||
HttpResponseTest.cc SharedHandleTest.cc FileTest.cc \
|
SharedHandleTest.cc FileTest.cc OptionTest.cc \
|
||||||
OptionTest.cc DefaultDiskWriterTest.cc FeatureConfigTest.cc \
|
DefaultDiskWriterTest.cc FeatureConfigTest.cc SpeedCalcTest.cc \
|
||||||
SpeedCalcTest.cc MultiDiskAdaptorTest.cc \
|
MultiDiskAdaptorTest.cc MultiFileAllocationIteratorTest.cc \
|
||||||
MultiFileAllocationIteratorTest.cc FixedNumberRandomizer.h \
|
FixedNumberRandomizer.h ProtocolDetectorTest.cc \
|
||||||
ProtocolDetectorTest.cc StringFormatTest.cc ExceptionTest.cc \
|
StringFormatTest.cc ExceptionTest.cc \
|
||||||
DownloadHandlerFactoryTest.cc ChunkedDecoderTest.cc \
|
DownloadHandlerFactoryTest.cc ChunkedDecoderTest.cc \
|
||||||
SignatureTest.cc ServerStatManTest.cc \
|
SignatureTest.cc ServerStatManTest.cc \
|
||||||
ServerStatURISelectorTest.cc InOrderURISelectorTest.cc \
|
ServerStatURISelectorTest.cc InOrderURISelectorTest.cc \
|
||||||
|
@ -345,9 +345,8 @@ am_aria2c_OBJECTS = AllTest.$(OBJEXT) TestUtil.$(OBJEXT) \
|
||||||
RequestGroupTest.$(OBJEXT) PStringBuildVisitorTest.$(OBJEXT) \
|
RequestGroupTest.$(OBJEXT) PStringBuildVisitorTest.$(OBJEXT) \
|
||||||
ParameterizedStringParserTest.$(OBJEXT) UtilTest.$(OBJEXT) \
|
ParameterizedStringParserTest.$(OBJEXT) UtilTest.$(OBJEXT) \
|
||||||
AlphaNumberDecoratorTest.$(OBJEXT) UriListParserTest.$(OBJEXT) \
|
AlphaNumberDecoratorTest.$(OBJEXT) UriListParserTest.$(OBJEXT) \
|
||||||
HttpHeaderProcessorTest.$(OBJEXT) CookieBoxTest.$(OBJEXT) \
|
HttpHeaderProcessorTest.$(OBJEXT) RequestTest.$(OBJEXT) \
|
||||||
RequestTest.$(OBJEXT) CookieParserTest.$(OBJEXT) \
|
CookieParserTest.$(OBJEXT) HttpRequestTest.$(OBJEXT) \
|
||||||
HttpRequestTest.$(OBJEXT) CookieBoxFactoryTest.$(OBJEXT) \
|
|
||||||
RequestGroupManTest.$(OBJEXT) AuthConfigFactoryTest.$(OBJEXT) \
|
RequestGroupManTest.$(OBJEXT) AuthConfigFactoryTest.$(OBJEXT) \
|
||||||
NetrcAuthResolverTest.$(OBJEXT) \
|
NetrcAuthResolverTest.$(OBJEXT) \
|
||||||
DefaultAuthResolverTest.$(OBJEXT) OptionHandlerTest.$(OBJEXT) \
|
DefaultAuthResolverTest.$(OBJEXT) OptionHandlerTest.$(OBJEXT) \
|
||||||
|
@ -574,17 +573,17 @@ aria2c_SOURCES = AllTest.cc TestUtil.cc TestUtil.h SocketCoreTest.cc \
|
||||||
SingleFileDownloadContextTest.cc RequestGroupTest.cc \
|
SingleFileDownloadContextTest.cc RequestGroupTest.cc \
|
||||||
PStringBuildVisitorTest.cc ParameterizedStringParserTest.cc \
|
PStringBuildVisitorTest.cc ParameterizedStringParserTest.cc \
|
||||||
UtilTest.cc AlphaNumberDecoratorTest.cc UriListParserTest.cc \
|
UtilTest.cc AlphaNumberDecoratorTest.cc UriListParserTest.cc \
|
||||||
HttpHeaderProcessorTest.cc CookieBoxTest.cc RequestTest.cc \
|
HttpHeaderProcessorTest.cc RequestTest.cc CookieParserTest.cc \
|
||||||
CookieParserTest.cc HttpRequestTest.cc CookieBoxFactoryTest.cc \
|
HttpRequestTest.cc RequestGroupManTest.cc \
|
||||||
RequestGroupManTest.cc AuthConfigFactoryTest.cc \
|
AuthConfigFactoryTest.cc NetrcAuthResolverTest.cc \
|
||||||
NetrcAuthResolverTest.cc DefaultAuthResolverTest.cc \
|
DefaultAuthResolverTest.cc OptionHandlerTest.cc \
|
||||||
OptionHandlerTest.cc SegmentManTest.cc BitfieldManTest.cc \
|
SegmentManTest.cc BitfieldManTest.cc NetrcTest.cc \
|
||||||
NetrcTest.cc SingletonHolderTest.cc HttpHeaderTest.cc \
|
SingletonHolderTest.cc HttpHeaderTest.cc HttpResponseTest.cc \
|
||||||
HttpResponseTest.cc SharedHandleTest.cc FileTest.cc \
|
SharedHandleTest.cc FileTest.cc OptionTest.cc \
|
||||||
OptionTest.cc DefaultDiskWriterTest.cc FeatureConfigTest.cc \
|
DefaultDiskWriterTest.cc FeatureConfigTest.cc SpeedCalcTest.cc \
|
||||||
SpeedCalcTest.cc MultiDiskAdaptorTest.cc \
|
MultiDiskAdaptorTest.cc MultiFileAllocationIteratorTest.cc \
|
||||||
MultiFileAllocationIteratorTest.cc FixedNumberRandomizer.h \
|
FixedNumberRandomizer.h ProtocolDetectorTest.cc \
|
||||||
ProtocolDetectorTest.cc StringFormatTest.cc ExceptionTest.cc \
|
StringFormatTest.cc ExceptionTest.cc \
|
||||||
DownloadHandlerFactoryTest.cc ChunkedDecoderTest.cc \
|
DownloadHandlerFactoryTest.cc ChunkedDecoderTest.cc \
|
||||||
SignatureTest.cc ServerStatManTest.cc \
|
SignatureTest.cc ServerStatManTest.cc \
|
||||||
ServerStatURISelectorTest.cc InOrderURISelectorTest.cc \
|
ServerStatURISelectorTest.cc InOrderURISelectorTest.cc \
|
||||||
|
@ -710,8 +709,6 @@ distclean-compile:
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BtUnchokeMessageTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BtUnchokeMessageTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ByteArrayDiskWriterTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ByteArrayDiskWriterTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ChunkedDecoderTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ChunkedDecoderTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieBoxFactoryTest.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieBoxTest.Po@am__quote@
|
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieParserTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieParserTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieStorageTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieStorageTest.Po@am__quote@
|
||||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieTest.Po@am__quote@
|
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CookieTest.Po@am__quote@
|
||||||
|
|
|
@ -28,12 +28,12 @@ void NsCookieParserTest::testParse()
|
||||||
{
|
{
|
||||||
NsCookieParser parser;
|
NsCookieParser parser;
|
||||||
std::deque<Cookie> cookies = parser.parse("nscookietest.txt");
|
std::deque<Cookie> cookies = parser.parse("nscookietest.txt");
|
||||||
CPPUNIT_ASSERT_EQUAL((size_t)4, cookies.size());
|
CPPUNIT_ASSERT_EQUAL((size_t)5, cookies.size());
|
||||||
|
|
||||||
Cookie c = cookies[0];
|
Cookie c = cookies[0];
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("JSESSIONID"), c.name);
|
CPPUNIT_ASSERT_EQUAL(std::string("JSESSIONID"), c.name);
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("123456789"), c.value);
|
CPPUNIT_ASSERT_EQUAL(std::string("123456789"), c.value);
|
||||||
CPPUNIT_ASSERT_EQUAL((time_t)1181473200, c.expires);
|
CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.expires);
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("/"), c.path);
|
CPPUNIT_ASSERT_EQUAL(std::string("/"), c.path);
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("localhost"), c.domain);
|
CPPUNIT_ASSERT_EQUAL(std::string("localhost"), c.domain);
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ void NsCookieParserTest::testParse()
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("me"), c.value);
|
CPPUNIT_ASSERT_EQUAL(std::string("me"), c.value);
|
||||||
CPPUNIT_ASSERT_EQUAL((time_t)1181473200, c.expires);
|
CPPUNIT_ASSERT_EQUAL((time_t)1181473200, c.expires);
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("/"), c.path);
|
CPPUNIT_ASSERT_EQUAL(std::string("/"), c.path);
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("localhost"), c.domain);
|
CPPUNIT_ASSERT_EQUAL(std::string("expired"), c.domain);
|
||||||
|
|
||||||
c = cookies[2];
|
c = cookies[2];
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("passwd"), c.name);
|
CPPUNIT_ASSERT_EQUAL(std::string("passwd"), c.name);
|
||||||
|
@ -52,6 +52,13 @@ void NsCookieParserTest::testParse()
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("localhost"), c.domain);
|
CPPUNIT_ASSERT_EQUAL(std::string("localhost"), c.domain);
|
||||||
|
|
||||||
c = cookies[3];
|
c = cookies[3];
|
||||||
|
CPPUNIT_ASSERT_EQUAL(std::string("TAX"), c.name);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(std::string("1000"), c.value);
|
||||||
|
CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.expires);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(std::string("/"), c.path);
|
||||||
|
CPPUNIT_ASSERT_EQUAL(std::string("overflow"), c.domain);
|
||||||
|
|
||||||
|
c = cookies[4];
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("novalue"), c.name);
|
CPPUNIT_ASSERT_EQUAL(std::string("novalue"), c.name);
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string(""), c.value);
|
CPPUNIT_ASSERT_EQUAL(std::string(""), c.value);
|
||||||
CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.expires);
|
CPPUNIT_ASSERT_EQUAL((time_t)2147483647, c.expires);
|
||||||
|
|
|
@ -37,7 +37,7 @@ void Sqlite3MozCookieParserTest::testParse()
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("/"), localhost.path);
|
CPPUNIT_ASSERT_EQUAL(std::string("/"), localhost.path);
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("JSESSIONID"), localhost.name);
|
CPPUNIT_ASSERT_EQUAL(std::string("JSESSIONID"), localhost.name);
|
||||||
CPPUNIT_ASSERT_EQUAL(std::string("123456789"), localhost.value);
|
CPPUNIT_ASSERT_EQUAL(std::string("123456789"), localhost.value);
|
||||||
CPPUNIT_ASSERT_EQUAL((time_t)1200000000, localhost.expires);
|
CPPUNIT_ASSERT_EQUAL((time_t)INT32_MAX, localhost.expires);
|
||||||
CPPUNIT_ASSERT_EQUAL(true, localhost.secure);
|
CPPUNIT_ASSERT_EQUAL(true, localhost.secure);
|
||||||
|
|
||||||
const Cookie& nullValue = cookies[1];
|
const Cookie& nullValue = cookies[1];
|
||||||
|
|
|
@ -4,5 +4,6 @@ localhost FALSE / TRUE 2147483647 JSESSIONID 123456789
|
||||||
expired FALSE / FALSE 1181473200 user me
|
expired FALSE / FALSE 1181473200 user me
|
||||||
|
|
||||||
localhost FALSE /cgi-bin FALSE 2147483647 passwd secret
|
localhost FALSE /cgi-bin FALSE 2147483647 passwd secret
|
||||||
|
badformat
|
||||||
overflow FALSE / FALSE 9223372036854775807 TAX 1000
|
overflow FALSE / FALSE 9223372036854775807 TAX 1000
|
||||||
localhost FALSE / FALSE 2147483648 novalue
|
localhost FALSE / FALSE 2147483648 novalue
|
||||||
|
|
Loading…
Reference in New Issue