summaryrefslogtreecommitdiff
path: root/src/HttpServerCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-06-21 13:51:56 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2010-06-21 13:51:56 +0000
commitca4940622c05e50a50f77c621ade914029663446 (patch)
tree2715d87c6b4faa669ae317f6f95d9694630cd4a0 /src/HttpServerCommand.cc
parentae957baa98d4f97ea2437596db5073f9c33d22ae (diff)
2010-06-21 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Changed naming standards for class member variable: now it looks like var_ instead of _var.
Diffstat (limited to 'src/HttpServerCommand.cc')
-rw-r--r--src/HttpServerCommand.cc66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/HttpServerCommand.cc b/src/HttpServerCommand.cc
index 06521cbb..bbce79df 100644
--- a/src/HttpServerCommand.cc
+++ b/src/HttpServerCommand.cc
@@ -57,18 +57,18 @@ namespace aria2 {
HttpServerCommand::HttpServerCommand(cuid_t cuid, DownloadEngine* e,
const SharedHandle<SocketCore>& socket):
Command(cuid),
- _e(e),
- _socket(socket),
- _httpServer(new HttpServer(socket, e))
+ e_(e),
+ socket_(socket),
+ httpServer_(new HttpServer(socket, e))
{
setStatus(Command::STATUS_ONESHOT_REALTIME);
- _e->addSocketForReadCheck(_socket, this);
- _httpServer->setUsernamePassword(_e->getOption()->get(PREF_XML_RPC_USER),
- _e->getOption()->get(PREF_XML_RPC_PASSWD));
+ e_->addSocketForReadCheck(socket_, this);
+ httpServer_->setUsernamePassword(e_->getOption()->get(PREF_XML_RPC_USER),
+ e_->getOption()->get(PREF_XML_RPC_PASSWD));
#ifdef HAVE_LIBZ
- _httpServer->enableGZip();
+ httpServer_->enableGZip();
#else // !HAVE_LIBZ
- _httpServer->disableGZip();
+ httpServer_->disableGZip();
#endif // !HAVE_LIBZ
}
@@ -77,65 +77,65 @@ HttpServerCommand::HttpServerCommand(cuid_t cuid,
DownloadEngine* e,
const SharedHandle<SocketCore>& socket):
Command(cuid),
- _e(e),
- _socket(socket),
- _httpServer(httpServer)
+ e_(e),
+ socket_(socket),
+ httpServer_(httpServer)
{
- _e->addSocketForReadCheck(_socket, this);
+ e_->addSocketForReadCheck(socket_, this);
}
HttpServerCommand::~HttpServerCommand()
{
- _e->deleteSocketForReadCheck(_socket, this);
+ e_->deleteSocketForReadCheck(socket_, this);
}
bool HttpServerCommand::execute()
{
- if(_e->getRequestGroupMan()->downloadFinished() || _e->isHaltRequested()) {
+ if(e_->getRequestGroupMan()->downloadFinished() || e_->isHaltRequested()) {
return true;
}
try {
- if(_socket->isReadable(0)) {
- _timeoutTimer = global::wallclock;
+ if(socket_->isReadable(0)) {
+ timeoutTimer_ = global::wallclock;
SharedHandle<HttpHeader> header;
- header = _httpServer->receiveRequest();
+ header = httpServer_->receiveRequest();
if(header.isNull()) {
- _e->addCommand(this);
+ e_->addCommand(this);
return false;
}
- if(!_httpServer->authenticate()) {
- _httpServer->disableKeepAlive();
- _httpServer->feedResponse("401 Unauthorized",
+ if(!httpServer_->authenticate()) {
+ httpServer_->disableKeepAlive();
+ httpServer_->feedResponse("401 Unauthorized",
"WWW-Authenticate: Basic realm=\"aria2\"",
"","text/html");
Command* command =
- new HttpServerResponseCommand(getCuid(), _httpServer, _e, _socket);
- _e->addCommand(command);
- _e->setNoWait(true);
+ new HttpServerResponseCommand(getCuid(), httpServer_, e_, socket_);
+ e_->addCommand(command);
+ e_->setNoWait(true);
return true;
}
if(static_cast<uint64_t>
- (_e->getOption()->getAsInt(PREF_XML_RPC_MAX_REQUEST_SIZE)) <
- _httpServer->getContentLength()) {
+ (e_->getOption()->getAsInt(PREF_XML_RPC_MAX_REQUEST_SIZE)) <
+ httpServer_->getContentLength()) {
getLogger()->info("Request too long. ContentLength=%s."
" See --xml-rpc-max-request-size option to loose"
" this limitation.",
- util::uitos(_httpServer->getContentLength()).c_str());
+ util::uitos(httpServer_->getContentLength()).c_str());
return true;
}
- Command* command = new HttpServerBodyCommand(getCuid(), _httpServer, _e,
- _socket);
- _e->addCommand(command);
- _e->setNoWait(true);
+ Command* command = new HttpServerBodyCommand(getCuid(), httpServer_, e_,
+ socket_);
+ e_->addCommand(command);
+ e_->setNoWait(true);
return true;
} else {
- if(_timeoutTimer.difference(global::wallclock) >= 30) {
+ if(timeoutTimer_.difference(global::wallclock) >= 30) {
getLogger()->info("HTTP request timeout.");
return true;
} else {
- _e->addCommand(this);
+ e_->addCommand(this);
return false;
}
}