summaryrefslogtreecommitdiff
path: root/src/HttpServer.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-12-07 22:57:34 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-12-09 21:39:43 +0900
commit12988e5282ef52a2806cbaca9f4074698f35e399 (patch)
tree7a8d5a65a8e8478ba5855e84a1077baee1a2028d /src/HttpServer.cc
parentf25e67b0178511b26d55642f215a095321a169a8 (diff)
Replaced uint64_t with off_t or int64_t.
Since off_t is int64_t with LFS, we cannot take advantage of extra capacity of uint64_t.
Diffstat (limited to 'src/HttpServer.cc')
-rw-r--r--src/HttpServer.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/HttpServer.cc b/src/HttpServer.cc
index a30cc9ae..58add493 100644
--- a/src/HttpServer.cc
+++ b/src/HttpServer.cc
@@ -90,7 +90,10 @@ SharedHandle<HttpHeader> HttpServer::receiveRequest()
lastBody_.clear();
lastBody_.str("");
lastContentLength_ =
- lastRequestHeader_->findAsUInt(HttpHeader::CONTENT_LENGTH);
+ lastRequestHeader_->findAsLLInt(HttpHeader::CONTENT_LENGTH);
+ if(lastContentLength_ < 0) {
+ throw DL_ABORT_EX("Content-Length must be positive.");
+ }
headerProcessor_->clear();
const std::string& connection =
@@ -144,7 +147,7 @@ bool HttpServer::receiveBody()
lastBody_.write(reinterpret_cast<const char*>(socketRecvBuffer_->getBuffer()),
length);
socketRecvBuffer_->shiftBuffer(length);
- return lastContentLength_ == static_cast<uint64_t>(lastBody_.tellp());
+ return lastContentLength_ == lastBody_.tellp();
}
std::string HttpServer::getBody() const