[prev in list] [next in list] [prev in thread] [next in thread]
List: mapguide-commits
Subject: [mapguide-commits] r3282 - in branches/2.0.x/MgDev:
From: svn_mapguide () osgeo ! org
Date: 2008-08-20 23:11:09
Message-ID: 20080820231109.46E82E01A0D () lists ! osgeo ! org
[Download RAW message or body]
Author: trevorwekel
Date: 2008-08-20 19:11:09 -0400 (Wed, 20 Aug 2008)
New Revision: 3282
Modified:
branches/2.0.x/MgDev/Common/MapGuideCommon/Services/SiteConnection.cpp
branches/2.0.x/MgDev/Web/src/HttpHandler/HttpCreateSession.cpp
branches/2.0.x/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.cpp
branches/2.0.x/MgDev/Web/src/mapviewerjava/mainframe.jsp
branches/2.0.x/MgDev/Web/src/mapviewernet/mainframe.aspx
branches/2.0.x/MgDev/Web/src/mapviewerphp/mainframe.php
Log:
Fix #669 WebLayout Load Balancing Fails because of API call sequence
Submission for 2.0.x stream
Modified: branches/2.0.x/MgDev/Common/MapGuideCommon/Services/SiteConnection.cpp
===================================================================
--- branches/2.0.x/MgDev/Common/MapGuideCommon/Services/SiteConnection.cpp 2008-08-20 \
20:42:26 UTC (rev 3281)
+++ branches/2.0.x/MgDev/Common/MapGuideCommon/Services/SiteConnection.cpp 2008-08-20 \
23:11:09 UTC (rev 3282) @@ -491,19 +491,16 @@
}
else
{
- // TODO: The following overhead could be eliminated if additional load
- // balancing is implemented on the Web Tier. Also, the
- // RequestServer API could be optimized to allow the Web Tier to
- // notify the site server when a support server is down.
- Ptr<MgUserInformation> userInformation = m_connProp->GetUserInfo();
- assert(NULL != userInformation.p);
- Ptr<MgSite> site = new MgSite();
+ // We have deprecated support servers. All load balanced servers
+ // should support all services. With this change, we do not need to
+ // contact the site server to determine where to vector service requests.
+ //
+ // A site connection has already been established if we are looking for \
services. + // Just use the target and port from the existing connection. \
This will + // bind all service requests to the machine initially connected to \
in + // the MgSiteConnection.Open call.
- site->Open(userInformation, true);
-
- STRING target = site->RequestServer(serviceType);
-
- connProp = new MgConnectionProperties(userInformation.p, target, \
m_connProp->GetPort()); + connProp = m_connProp;
}
return connProp.Detach();
@@ -549,15 +546,23 @@
/// </summary>
MgSite* MgSiteConnection::GetSite()
{
- // Get user information
+ Ptr<MgSite> site;
+
+ MgSiteManager* siteManager = MgSiteManager::GetInstance();
+ Ptr<MgSiteInfo> siteInfo = siteManager->GetSiteInfo(m_connProp->GetTarget(), \
m_connProp->GetPort()); Ptr<MgUserInformation> userInfo = m_connProp->GetUserInfo();
- Ptr<MgSite> site;
-
if (NULL != userInfo.p)
{
site = new MgSite();
- site->Open(userInfo);
+ if (NULL != siteInfo.p)
+ {
+ site->Open(userInfo, siteInfo);
+ }
+ else
+ {
+ site->Open(userInfo);
+ }
}
else
{
Modified: branches/2.0.x/MgDev/Web/src/HttpHandler/HttpCreateSession.cpp
===================================================================
--- branches/2.0.x/MgDev/Web/src/HttpHandler/HttpCreateSession.cpp 2008-08-20 \
20:42:26 UTC (rev 3281)
+++ branches/2.0.x/MgDev/Web/src/HttpHandler/HttpCreateSession.cpp 2008-08-20 \
23:11:09 UTC (rev 3282) @@ -53,10 +53,8 @@
// Check common parameters
ValidateCommonParameters();
- // Open connection to Mg server
- Ptr<MgSite> mgSite;
- mgSite = new MgSite();
- mgSite->Open(m_userInfo);
+ // Get the site
+ Ptr<MgSite> mgSite = m_siteConn->GetSite();
// Run API command
STRING ret = mgSite->CreateSession();
Modified: branches/2.0.x/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.cpp
===================================================================
--- branches/2.0.x/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.cpp 2008-08-20 \
20:42:26 UTC (rev 3281)
+++ branches/2.0.x/MgDev/Web/src/HttpHandler/HttpRequestResponseHandler.cpp 2008-08-20 \
23:11:09 UTC (rev 3282) @@ -177,6 +177,17 @@
m_userInfo->SetClientIp(clientIp);
}
+ // Short circuit the authentication check if no username or session is supplied.
+ // This will ensure that load balancing works correctly if browsers send an
+ // unauthenticated then an authenticated request.
+ //
+ // The check increments the load balanced servers so the unauthenticated HTTP \
request + // will eat up one of the servers and give uneven load balancing.
+ if (m_userInfo->GetUserName().empty() && m_userInfo->GetMgSessionId().empty())
+ {
+ throw new MgAuthenticationFailedException(L"MgHttpRequestResponseHandler.InitializeCommonParameters", \
__LINE__, __WFILE__, NULL, L"", NULL); + }
+
// And create the site connection
m_siteConn = new MgSiteConnection();
m_siteConn->Open(m_userInfo);
Modified: branches/2.0.x/MgDev/Web/src/mapviewerjava/mainframe.jsp
===================================================================
--- branches/2.0.x/MgDev/Web/src/mapviewerjava/mainframe.jsp 2008-08-20 20:42:26 UTC \
(rev 3281)
+++ branches/2.0.x/MgDev/Web/src/mapviewerjava/mainframe.jsp 2008-08-20 23:11:09 UTC \
(rev 3282) @@ -77,8 +77,7 @@
if(createSession)
{
- MgSite site1 = new MgSite();
- site1.Open(cred);
+ MgSite site1 = site.GetSite();
sessionId = site1.CreateSession();
if(forDwf == 0)
{
Modified: branches/2.0.x/MgDev/Web/src/mapviewernet/mainframe.aspx
===================================================================
--- branches/2.0.x/MgDev/Web/src/mapviewernet/mainframe.aspx 2008-08-20 20:42:26 UTC \
(rev 3281)
+++ branches/2.0.x/MgDev/Web/src/mapviewernet/mainframe.aspx 2008-08-20 23:11:09 UTC \
(rev 3282) @@ -78,8 +78,7 @@
if (createSession)
{
- MgSite site1 = new MgSite();
- site1.Open(cred);
+ MgSite site1 = site.GetSite();
sessionId = site1.CreateSession();
if (forDwf == 0)
{
Modified: branches/2.0.x/MgDev/Web/src/mapviewerphp/mainframe.php
===================================================================
--- branches/2.0.x/MgDev/Web/src/mapviewerphp/mainframe.php 2008-08-20 20:42:26 UTC \
(rev 3281)
+++ branches/2.0.x/MgDev/Web/src/mapviewerphp/mainframe.php 2008-08-20 23:11:09 UTC \
(rev 3282) @@ -77,8 +77,7 @@
if($createSession)
{
- $site1 = new MgSite();
- $site1->Open($cred);
+ $site1 = $site->GetSite();
$sessionId = $site1->CreateSession();
if($forDwf == false)
$orgSessionId = $sessionId;
_______________________________________________
mapguide-commits mailing list
mapguide-commits@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-commits
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic