diff options
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; -} |
