diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-11-12 15:34:55 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2009-11-12 15:34:55 +0000 |
| commit | 9cdf102850169caf8059c19042dd2dc679038b95 (patch) | |
| tree | 0081ab583bd6a52e8b3afaef1e9ec77c1ba06710 /src/Request.cc | |
| parent | 8865b9e8e667880420aea3ebaac32bbb0c93d81d (diff) | |
2009-11-13 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added util::parseUIntNoThrow(). Use it in Request::parseUrl().
* src/Request.cc
* src/util.cc
* src/util.h
* test/RequestTest.cc
Diffstat (limited to 'src/Request.cc')
| -rw-r--r-- | src/Request.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Request.cc b/src/Request.cc index 2fbeea2e..8dd4dc14 100644 --- a/src/Request.cc +++ b/src/Request.cc @@ -38,7 +38,6 @@ #include "util.h" #include "FeatureConfig.h" -#include "RecoverableException.h" #include "StringFormat.h" #include "A2STR.h" #include "a2functional.h" @@ -252,14 +251,13 @@ bool Request::parseUrl(const std::string& url) { // its protocol.. _port = defPort; } else { - try { - unsigned int tempPort = - util::parseUInt(std::string(portFirst, authorityLast)); + uint32_t tempPort; + if(util::parseUIntNoThrow(tempPort, std::string(portFirst, authorityLast))){ if(65535 < tempPort) { return false; } - _port = tempPort; - } catch(RecoverableException& e) { + _port = tempPort; + } else { return false; } } |
