2008-05-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>

Made USER_AGENT const. Made "/" static const std::string.
	* src/A2STR.cc
	* src/A2STR.h
	* src/HttpRequest.cc
	* src/HttpRequest.h
pull/1/head
Tatsuhiro Tsujikawa 2008-05-13 16:58:40 +00:00
parent 0c821d0ad7
commit 29d5651cd5
5 changed files with 15 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2008-05-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made USER_AGENT const. Made "/" static const std::string.
* src/A2STR.cc
* src/A2STR.h
* src/HttpRequest.cc
* src/HttpRequest.h
2008-05-14 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Made string listeral to static const std::string:

View File

@ -44,4 +44,6 @@ const std::string A2STR::CR_C("\r");
const std::string A2STR::LF_C("\n");
const std::string A2STR::SLASH_C("/");
} // namespace aria2

View File

@ -51,6 +51,7 @@ public:
static const std::string LF_C;
static const std::string SLASH_C;
};
} // namespace aria2

View File

@ -49,7 +49,7 @@
namespace aria2 {
std::string HttpRequest::USER_AGENT = "aria2";
const std::string HttpRequest::USER_AGENT("aria2");
HttpRequest::HttpRequest():entityLength(0),
authEnabled(false),
@ -137,10 +137,10 @@ std::string HttpRequest::createRequest() const
if(getProtocol() == Request::PROTO_FTP || proxyEnabled) {
requestLine += getCurrentURI();
} else {
if(getDir() == "/") {
if(getDir() == A2STR::SLASH_C) {
requestLine += getDir();
} else {
requestLine += getDir()+"/";
requestLine += getDir()+A2STR::SLASH_C;
}
requestLine += getFile()+getQuery();
}

View File

@ -50,7 +50,7 @@ class Option;
class HttpRequest {
private:
static std::string USER_AGENT;
static const std::string USER_AGENT;
SharedHandle<Request> request;