[mapguide-commits] r6057 - in trunk/MgDev/Common/MapGuideCommon: Services Util

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Aug 10 21:38:40 EDT 2011


Author: liuar
Date: 2011-08-10 18:38:40 -0700 (Wed, 10 Aug 2011)
New Revision: 6057

Modified:
   trunk/MgDev/Common/MapGuideCommon/Services/ServerInformation.cpp
   trunk/MgDev/Common/MapGuideCommon/Util/IpUtil.cpp
Log:
Submit on behalf of Mars Wu
Implements RFC 118 - IPv6 Support
Ticket: http://trac.osgeo.org/mapguide/ticket/1767

1. ServerInformation::CheckAddress will treat : as an invalid charactor for an IP address. After IPv6 is implemented, it's not true. So remove the : from the invalid characters list
2. Clean up: 
bool isv6Address = address.find(L":") != -1
changed -1 to wstring::npos

Modified: trunk/MgDev/Common/MapGuideCommon/Services/ServerInformation.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/ServerInformation.cpp	2011-08-10 15:23:09 UTC (rev 6056)
+++ trunk/MgDev/Common/MapGuideCommon/Services/ServerInformation.cpp	2011-08-11 01:38:40 UTC (rev 6057)
@@ -270,7 +270,7 @@
             __LINE__, __WFILE__, NULL, L"", NULL);
     }
 
-    if (wstring::npos != address.find_first_of(L"[]=:"))
+    if (wstring::npos != address.find_first_of(L"[]="))
     {
         MgStringCollection arguments;
         arguments.Add(address);

Modified: trunk/MgDev/Common/MapGuideCommon/Util/IpUtil.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Util/IpUtil.cpp	2011-08-10 15:23:09 UTC (rev 6056)
+++ trunk/MgDev/Common/MapGuideCommon/Util/IpUtil.cpp	2011-08-11 01:38:40 UTC (rev 6057)
@@ -139,7 +139,7 @@
     }
 
     // An valid IPv6 address must have ":"
-    bool isv6Address = address.find(L":") != -1;
+    bool isv6Address = wstring::npos != address.find(L":");
 
     if (isv6Address)
     {



More information about the mapguide-commits mailing list