From d0099cf4ef119fd52f46cc0f2bf6e7cc9fd3e1b4 Mon Sep 17 00:00:00 2001 From: Maxim Mamontov Date: Fri, 26 Nov 2010 17:02:27 +0200 Subject: [PATCH] =?utf8?q?=D0=9F=D1=80=D0=B8=20=D0=BF=D1=80=D0=B5=D0=BE?= =?utf8?q?=D0=B1=D1=80=D0=B0=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B8=20?= =?utf8?q?=D1=81=D0=BF=D0=B8=D1=81=D0=BA=D0=B0=20IP-=D0=B0=D0=B4=D1=80?= =?utf8?q?=D0=B5=D1=81=D0=BE=D0=B2=20=D0=B8=D0=B7=20=D1=81=D1=82=D1=80?= =?utf8?q?=D0=BE=D0=BA=D0=B8=20=D1=83=D0=B1=D1=80=D0=B0=D0=BD=D0=B0=20?= =?utf8?q?=D0=B3=D0=B5=D0=BD=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D1=8F=20=D0=B8?= =?utf8?q?=D1=81=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D0=B9=20(=D0=B2?= =?utf8?q?=20Stragazer'=D0=B5=20=D1=81=D0=B5=D0=B9=D1=87=D0=B0=D1=81=20?= =?utf8?q?=D0=BF=D0=B5=D1=80=D0=B5=D1=85=D0=B2=D0=B0=D1=82=20=D0=B8=D1=81?= =?utf8?q?=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=B4=D0=B5-?= =?utf8?q?=D1=84=D0=B0=D0=BA=D1=82=D0=BE=20=D0=BD=D0=B5=20=20=20=20=20=20?= =?utf8?q?=20=20=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D1=83=D0=B5?= =?utf8?q?=D1=82=D1=81=D1=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- include/user_ips.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/include/user_ips.h b/include/user_ips.h index d3e640c1..f160a31a 100644 --- a/include/user_ips.h +++ b/include/user_ips.h @@ -202,8 +202,7 @@ std::vector ipMask; std::string err; if (ipsStr.empty()) { - err = "Incorrect IP address."; - throw(err); + return ips; } if (ipsStr[0] == '*' && ipsStr.size() == 1) @@ -235,7 +234,7 @@ for (unsigned int i = 0; i < ipMask.size(); i++) if (strIp == NULL) { err = "Incorrect IP address " + ipsStr; - throw(err); + return ips; } strMask = strtok(NULL, "/"); @@ -243,7 +242,7 @@ for (unsigned int i = 0; i < ipMask.size(); i++) if (im.ip == INADDR_NONE) { err = "Incorrect IP address: " + std::string(strIp); - throw(err); + return ips; } im.mask = 32; @@ -253,20 +252,20 @@ for (unsigned int i = 0; i < ipMask.size(); i++) if (str2x(strMask, m) != 0) { err = "Incorrect mask: " + std::string(strMask); - throw(err); + return ips; } im.mask = m; if (im.mask > 32) { err = "Incorrect mask: " + std::string(strMask); - throw(err); + return ips; } if ((im.ip & ips.CalcMask(im.mask)) != im.ip) { err = "Address does'n match mask: " + std::string(strIp) + "/" + std::string(strMask); - throw(err); + return ips; } } ips.ips.push_back(im); @@ -276,5 +275,3 @@ return ips; } //------------------------------------------------------------------------- #endif //USER_IPS_H - - -- 2.44.2