mirror of https://github.com/aria2/aria2
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.hpull/1/head
parent
0c821d0ad7
commit
29d5651cd5
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -51,6 +51,7 @@ public:
|
|||
|
||||
static const std::string LF_C;
|
||||
|
||||
static const std::string SLASH_C;
|
||||
};
|
||||
} // namespace aria2
|
||||
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ class Option;
|
|||
class HttpRequest {
|
||||
private:
|
||||
|
||||
static std::string USER_AGENT;
|
||||
static const std::string USER_AGENT;
|
||||
|
||||
SharedHandle<Request> request;
|
||||
|
||||
|
|
Loading…
Reference in New Issue