summaryrefslogtreecommitdiff
path: root/src/HttpServerCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-05-26 14:38:11 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2009-05-26 14:38:11 +0000
commit544732b124335cac5a390634da04d2ef63becd88 (patch)
tree2950afb092332b76e1d01c14c4b6f6a2fd5011c7 /src/HttpServerCommand.cc
parent4c1ed46094b17aa06bf3c5bcdf15d4469391d37a (diff)
2009-05-26 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added --xml-rpc-max-request-size option to limit the size of XML-RPC request.
Diffstat (limited to 'src/HttpServerCommand.cc')
-rw-r--r--src/HttpServerCommand.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/HttpServerCommand.cc b/src/HttpServerCommand.cc
index 78077add..90691d2a 100644
--- a/src/HttpServerCommand.cc
+++ b/src/HttpServerCommand.cc
@@ -45,6 +45,7 @@
#include "RecoverableException.h"
#include "prefs.h"
#include "Option.h"
+#include "Util.h"
namespace aria2 {
@@ -103,6 +104,14 @@ bool HttpServerCommand::execute()
if(header.isNull()) {
_e->commands.push_back(this);
return false;
+ } else if(static_cast<uint64_t>
+ (_e->option->getAsInt(PREF_XML_RPC_MAX_REQUEST_SIZE)) <
+ _httpServer->getContentLength()) {
+ logger->info("Request too long. ContentLength=%s."
+ " See --xml-rpc-max-request-size option to loose"
+ " this limitation.",
+ Util::uitos(_httpServer->getContentLength()).c_str());
+ return true;
} else {
Command* command = new HttpServerBodyCommand(cuid, _httpServer, _e,
_socket);