summaryrefslogtreecommitdiff
path: root/src/Request.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-11-22 11:17:35 +0000
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2007-11-22 11:17:35 +0000
commit7436490f75e4e7941ec5e70316c3e5c9e91405cf (patch)
treec8c8ce53ee2c24a410e3efa6b4ab73c6d444e157 /src/Request.cc
parent1fed0c0cb09aa70da2b02dea9742ff8dd59636be (diff)
2007-11-22 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Replaced strtol with Util::parseInt * src/ChunkedEncoding.cc * src/HttpConnection.cc * src/CookieBoxFactory.cc * src/ParameterizedStringParser.cc * src/Util.cc * test/UtilTest.cc * test/OptionHandlerTest.cc * src/Request.cc Throw exception when empty string is given. The message for exception changed. * src/Util.cc (parseInt)(parseLLInt) * src/message.h
Diffstat (limited to 'src/Request.cc')
-rw-r--r--src/Request.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Request.cc b/src/Request.cc
index 69cf025e..c913ea90 100644
--- a/src/Request.cc
+++ b/src/Request.cc
@@ -36,6 +36,7 @@
#include "Util.h"
#include "FeatureConfig.h"
#include "CookieBoxFactory.h"
+#include "RecoverableException.h"
const string Request::METHOD_GET = "get";
@@ -113,8 +114,13 @@ bool Request::parseUrl(const string& url) {
Util::split(hostAndPort, hostPart, ':');
host = hostAndPort.first;
if(hostAndPort.second != "") {
- port = strtol(hostAndPort.second.c_str(), NULL, 10);
- if(!(0 < port && port <= 65535)) {
+ try {
+ port = Util::parseInt(hostAndPort.second);
+ if(!(0 < port && port <= 65535)) {
+ return false;
+ }
+ } catch(RecoverableException* e) {
+ delete e;
return false;
}
} else {