[mapguide-commits] r4971 - trunk/MgDev/Web/src/HttpHandler

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Jun 22 21:52:13 EDT 2010


Author: liuar
Date: 2010-06-23 01:52:13 +0000 (Wed, 23 Jun 2010)
New Revision: 4971

Modified:
   trunk/MgDev/Web/src/HttpHandler/OgcServer.cpp
Log:
This is the section about versions negotiation in WMS specification

1. If a version unknown to the server and higher than the lowest supported version is requested, the server should send the highest version it supports that is less than the requested version. 

2. If a version lower than any of those known to the server is requested, then the server shall send the lowest version it supports. 

So, for the current implementation of OgcServer in webTier, there's a potential issue for an unknown version which is just greater than the lowest supported version and less than any other supported versions. 

For example, MapGuide support 1.0.0 and 1.1.0. if there's a 1.0.5 request, MapGuide should reply a 1.0.0. However, the response is the highest version in the current implementation. 

MapGuide already supports all the possible versions of WMS, nevertheless it's still a potential issue. 

Modified: trunk/MgDev/Web/src/HttpHandler/OgcServer.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/OgcServer.cpp	2010-06-22 17:26:52 UTC (rev 4970)
+++ trunk/MgDev/Web/src/HttpHandler/OgcServer.cpp	2010-06-23 01:52:13 UTC (rev 4971)
@@ -1661,10 +1661,15 @@
                     if(bLowest) {
                         // OGC spec: "If a version lower than any of those known to the server
                         // then the server shall send the lowest version it supports."
-                        if(pszRequested <= sVersion) {
-                            m_sNegotiatedVersion = sVersion;
+                        
+                        // This fixed a potential issue for an unknown request version which just 
+                        // greater than the lowest version and lower than any other supported 
+                        // versions, then we should return the loweset version.
+                        m_sNegotiatedVersion = sVersion;
+
+                        if(pszRequested <= sVersion)
                             break;
-                        }
+
                         bLowest = false;
                     }
                     else {
@@ -1685,11 +1690,6 @@
                 }
             }
         }
-
-        // Still not found?  requested version is too new for us.
-        // Tell them about the latest we've got.
-        if(m_sNegotiatedVersion.length() == 0)
-            m_sNegotiatedVersion = sVersion; // the last version we found.
     }
 
     AddDefinition(kpszDictionaryTemplateVersion,m_sNegotiatedVersion.c_str());



More information about the mapguide-commits mailing list