diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-11-15 12:52:03 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-11-15 12:52:03 +0000 |
| commit | d8d159ccd86183649771b5b20ef154504540b1ab (patch) | |
| tree | c32e4a8b838fced1337b406a81d56cd1f80d3712 /src/HttpHeaderProcessor.cc | |
| parent | 6a1fe669751801b55affa0aeaff4646ac2ac6a00 (diff) | |
2010-11-15 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Replaced HttpHeader::responseStatus_ with HttpHeader::statusCode_.
statusCode_ is of type int.
* src/AbstractProxyResponseCommand.cc
* src/FtpNegotiationCommand.cc
* src/HttpHeader.cc
* src/HttpHeader.h
* src/HttpHeaderProcessor.cc
* src/HttpResponse.cc
* src/HttpResponse.h
* src/HttpResponseCommand.cc
* src/HttpSkipResponseCommand.cc
* src/util.cc
* src/util.h
* test/HttpHeaderProcessorTest.cc
* test/HttpHeaderTest.cc
* test/HttpResponseTest.cc
* test/UtilTest.cc
Diffstat (limited to 'src/HttpHeaderProcessor.cc')
| -rw-r--r-- | src/HttpHeaderProcessor.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/HttpHeaderProcessor.cc b/src/HttpHeaderProcessor.cc index 47beae09..86ba19a0 100644 --- a/src/HttpHeaderProcessor.cc +++ b/src/HttpHeaderProcessor.cc @@ -110,9 +110,13 @@ SharedHandle<HttpHeader> HttpHeaderProcessor::getHttpResponseHeader() delimpos < 12) { throw DL_RETRY_EX(EX_NO_STATUS_HEADER); } + int32_t statusCode; + if(!util::parseIntNoThrow(statusCode, buf_.substr(9, 3))) { + throw DL_RETRY_EX("Status code could not be parsed as integer."); + } HttpHeaderHandle httpHeader(new HttpHeader()); httpHeader->setVersion(buf_.substr(0, 8)); - httpHeader->setResponseStatus(buf_.substr(9, 3)); + httpHeader->setStatusCode(statusCode); std::istringstream strm(buf_); // TODO 1st line(HTTP/1.1 200...) is also send to HttpHeader, but it should // not. |
