diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2006-02-22 16:01:54 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2006-02-22 16:01:54 +0000 |
| commit | 44beebd257b0fb265bea5387850b9beb33c0adc2 (patch) | |
| tree | 0ec08e4aad18ccff2d578aca1c0b3799d2716c6c /src/Request.cc | |
| parent | d027ca8e7c383e9755d6fb997e8a880df99e88b9 (diff) | |
| parent | 87a229cab18679042beb06076e5dec1dcfadaeae (diff) | |
Tagging release 0.2.0 of aria2release-0.2.0
Diffstat (limited to 'src/Request.cc')
| -rw-r--r-- | src/Request.cc | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/Request.cc b/src/Request.cc index b87cab1d..9d183cd4 100644 --- a/src/Request.cc +++ b/src/Request.cc @@ -22,14 +22,13 @@ #include "Request.h" #include "Util.h" -#define MAX_RETRY_COUNT 5 - -Request::Request():port(0), retryCount(0) { +Request::Request():port(0), tryCount(0) { defaultPorts["http"] = 80; #ifdef HAVE_LIBSSL // for SSL defaultPorts["https"] = 443; #endif // HAVE_LIBSSL + defaultPorts["ftp"] = 21; seg.sp = 0; seg.ep = 0; seg.ds = 0; @@ -80,14 +79,12 @@ bool Request::parseUrl(string url) { Util::split(hostAndPort, url.substr(hp, hep-hp), ':'); host = hostAndPort.first; if(hostAndPort.second != "") { - // TODO rewrite this using strtoul function. If strtoul fails, - // return false. port = (int)strtol(hostAndPort.second.c_str(), NULL, 10); if(!(0 < port && port <= 65535)) { return false; } } else { - // If port is not specified, then we leave it 0. + // If port is not specified, then we set it to default port of its protocol.. port = defPort; } string::size_type direp = url.find_last_of("/"); @@ -102,15 +99,3 @@ bool Request::parseUrl(string url) { } return true; } - -void Request::resetRetryCount() { - this->retryCount = 0; -} - -void Request::addRetryCount() { - retryCount++; -} - -bool Request::noMoreRetry() { - return retryCount >= MAX_RETRY_COUNT; -} |
