summaryrefslogtreecommitdiff
path: root/src/HttpHeader.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-09-23 21:46:01 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2012-09-23 21:46:01 +0900
commit54665ff4093f4517104fe36c1b58f9a339710adf (patch)
treec946194194f84032d0ace485d113828404364820 /src/HttpHeader.cc
parentdd7014a6121c0985e94451e2492a112402501335 (diff)
Removed static std::string constant in HttpHeader
This change also removes inspection of Proxy-Connection header field when checking whether the remote endpoint keeps connection open.
Diffstat (limited to 'src/HttpHeader.cc')
-rw-r--r--src/HttpHeader.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc
index 165ce546..b934f1bd 100644
--- a/src/HttpHeader.cc
+++ b/src/HttpHeader.cc
@@ -41,13 +41,6 @@
namespace aria2 {
-const std::string HttpHeader::HTTP_1_1 = "HTTP/1.1";
-const std::string HttpHeader::CLOSE = "close";
-const std::string HttpHeader::KEEP_ALIVE = "keep-alive";
-const std::string HttpHeader::CHUNKED = "chunked";
-const std::string HttpHeader::GZIP = "gzip";
-const std::string HttpHeader::DEFLATE = "deflate";
-
HttpHeader::HttpHeader() {}
HttpHeader::~HttpHeader() {}
@@ -259,6 +252,13 @@ bool HttpHeader::fieldContains(int hdKey, const char* value)
return false;
}
+bool HttpHeader::isKeepAlive() const
+{
+ const std::string& connection = find(CONNECTION);
+ return !util::strieq(connection, "close") &&
+ (version_ == "HTTP/1.1" || util::strieq(connection, "keep-alive"));
+}
+
namespace {
const char* INTERESTING_HEADER_NAMES[] = {
"accept-encoding",