diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-09-26 23:58:59 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-09-26 23:58:59 +0900 |
| commit | 8f2030da0983188147f321da697c331964dc1431 (patch) | |
| tree | d19158dc8e56846130141894248a5b841eb87739 /src/HttpServer.cc | |
| parent | b9f972665b9a0ec348167d42a9acd5002b35ac3c (diff) | |
Removed HttpHeader::findAs{LL}Int and unused HttpResponse::{has,get}RetryAfter
Diffstat (limited to 'src/HttpServer.cc')
| -rw-r--r-- | src/HttpServer.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/HttpServer.cc b/src/HttpServer.cc index b7f467b1..afb1ab45 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -148,10 +148,13 @@ SharedHandle<HttpHeader> HttpServer::receiveRequest() if(setupResponseRecv() < 0) { A2_LOG_INFO("Request path is invaild. Ignore the request body."); } - lastContentLength_ = - lastRequestHeader_->findAsLLInt(HttpHeader::CONTENT_LENGTH); - if(lastContentLength_ < 0) { - throw DL_ABORT_EX("Content-Length must be positive."); + if(!util::parseLLIntNoThrow(lastContentLength_, + lastRequestHeader_-> + find(HttpHeader::CONTENT_LENGTH)) || + lastContentLength_ < 0) { + throw DL_ABORT_EX(fmt("Invalid Content-Length=%s", + lastRequestHeader_-> + find(HttpHeader::CONTENT_LENGTH).c_str())); } headerProcessor_->clear(); |
