[mapguide-commits] r1149 - in trunk/MgDev/Common: Foundation/System MapGuideCommon/Services

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Fri Mar 2 16:54:12 EST 2007


Author: brucedechant
Date: 2007-03-02 16:54:12 -0500 (Fri, 02 Mar 2007)
New Revision: 1149

Modified:
   trunk/MgDev/Common/Foundation/System/StreamParser.cpp
   trunk/MgDev/Common/MapGuideCommon/Services/Command.cpp
Log:
Fix the server/web tier from throwing the TCP/IP protocol mismatch exception when it shouldn't be.

Modified: trunk/MgDev/Common/Foundation/System/StreamParser.cpp
===================================================================
--- trunk/MgDev/Common/Foundation/System/StreamParser.cpp	2007-03-02 19:52:32 UTC (rev 1148)
+++ trunk/MgDev/Common/Foundation/System/StreamParser.cpp	2007-03-02 21:54:12 UTC (rev 1149)
@@ -78,8 +78,12 @@
             }
         }
 
-        if (ret == false || MgStreamParser::StreamVersion != pStreamData->GetVersion())
+        if (ret == false)
         {
+            throw new MgInvalidStreamHeaderException(L"MgStreamParser.ParseStreamHeader", __LINE__, __WFILE__, NULL, L"", NULL);
+        }
+        else if (MgStreamParser::StreamVersion != pStreamData->GetVersion())
+        {
             throw new MgStreamIoException(L"MgStreamParser.ParseStreamHeader", __LINE__, __WFILE__, NULL, L"MgInvalidTCPProtocol", NULL);
         }
 

Modified: trunk/MgDev/Common/MapGuideCommon/Services/Command.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/Services/Command.cpp	2007-03-02 19:52:32 UTC (rev 1148)
+++ trunk/MgDev/Common/MapGuideCommon/Services/Command.cpp	2007-03-02 21:54:12 UTC (rev 1149)
@@ -142,8 +142,12 @@
     // Get the stream header i.e. stream_start, stream_data etc.
     ptrStream->GetStreamHeader(msh);
 
-    if (MgStreamParser::mshStreamStart != msh.m_streamStart || MgStreamParser::StreamVersion != msh.m_streamVersion)
+    if (MgStreamParser::mshStreamStart != msh.m_streamStart)
     {
+        throw new MgInvalidStreamHeaderException(L"MgCommand.GetResponse", __LINE__, __WFILE__, NULL, L"", NULL);
+    }
+    else if (MgStreamParser::StreamVersion != msh.m_streamVersion)
+    {
         throw new MgStreamIoException(L"MgCommand.GetResponse", __LINE__, __WFILE__, NULL, L"MgInvalidTCPProtocol", NULL);
     }
 



More information about the mapguide-commits mailing list