From e9ea9592631beb164bfca0765b14ffbfbbaa4fb7 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Sat, 23 May 2009 06:14:02 +0000 Subject: * Pipes IPEndPoint through all Login methods, including LLSD/OSD login paths. --- OpenSim/Client/Linden/LLStandaloneLoginService.cs | 2 +- .../Communications/Services/HGLoginAuthService.cs | 2 +- OpenSim/Framework/Communications/Services/LoginService.cs | 14 +++++++------- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 2 +- OpenSim/Framework/Servers/HttpServer/LLSDMethod.cs | 3 ++- OpenSim/Grid/UserServer.Modules/UserLoginService.cs | 6 +++--- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/OpenSim/Client/Linden/LLStandaloneLoginService.cs b/OpenSim/Client/Linden/LLStandaloneLoginService.cs index 58b004a..73cc7a3 100644 --- a/OpenSim/Client/Linden/LLStandaloneLoginService.cs +++ b/OpenSim/Client/Linden/LLStandaloneLoginService.cs @@ -144,7 +144,7 @@ namespace OpenSim.Client.Linden /// /// /// true if the region was successfully contacted, false otherwise - protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response) + protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient) { IPEndPoint endPoint = regionInfo.ExternalEndPoint; response.SimAddress = endPoint.Address.ToString(); diff --git a/OpenSim/Framework/Communications/Services/HGLoginAuthService.cs b/OpenSim/Framework/Communications/Services/HGLoginAuthService.cs index 3756cf5..1de0d4d 100644 --- a/OpenSim/Framework/Communications/Services/HGLoginAuthService.cs +++ b/OpenSim/Framework/Communications/Services/HGLoginAuthService.cs @@ -259,7 +259,7 @@ namespace OpenSim.Framework.Communications.Services /// /// /// true if the region was successfully contacted, false otherwise - protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response) + protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient) { IPEndPoint endPoint = regionInfo.ExternalEndPoint; response.SimAddress = endPoint.Address.ToString(); diff --git a/OpenSim/Framework/Communications/Services/LoginService.cs b/OpenSim/Framework/Communications/Services/LoginService.cs index 6859827..68a1819 100644 --- a/OpenSim/Framework/Communications/Services/LoginService.cs +++ b/OpenSim/Framework/Communications/Services/LoginService.cs @@ -256,7 +256,7 @@ namespace OpenSim.Framework.Communications.Services logResponse.BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(agentID)); logResponse.StartLocation = startLocationRequest; - if (CustomiseResponse(logResponse, userProfile, startLocationRequest)) + if (CustomiseResponse(logResponse, userProfile, startLocationRequest, remoteClient)) { userProfile.LastLogin = userProfile.CurrentAgent.LoginTime; CommitAgent(ref userProfile); @@ -351,7 +351,7 @@ namespace OpenSim.Framework.Communications.Services /// /// The LLSD request /// The response to send - public OSD LLSDLoginMethod(OSD request) + public OSD LLSDLoginMethod(OSD request, IPEndPoint remoteClient) { // Temporary fix m_loginMutex.WaitOne(); @@ -486,7 +486,7 @@ namespace OpenSim.Framework.Communications.Services try { - CustomiseResponse(logResponse, userProfile, startLocationRequest); + CustomiseResponse(logResponse, userProfile, startLocationRequest, remoteClient); } catch (Exception ex) { @@ -891,7 +891,7 @@ namespace OpenSim.Framework.Communications.Services /// The user profile /// The requested start location /// true on success, false if the region was not successfully told to expect a user connection - public bool CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest) + public bool CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest, IPEndPoint client) { // add active gestures to login-response AddActiveGestures(response, theUser); @@ -984,7 +984,7 @@ namespace OpenSim.Framework.Communications.Services response.StartLocation = "url"; } - if ((regionInfo != null) && (PrepareLoginToRegion(regionInfo, theUser, response))) + if ((regionInfo != null) && (PrepareLoginToRegion(regionInfo, theUser, response, client))) { return true; } @@ -1015,13 +1015,13 @@ namespace OpenSim.Framework.Communications.Services theUser.CurrentAgent.Position = new Vector3(128, 128, 0); response.StartLocation = "safe"; - return PrepareLoginToRegion(regionInfo, theUser, response); + return PrepareLoginToRegion(regionInfo, theUser, response, client); } protected abstract RegionInfo RequestClosestRegion(string region); protected abstract RegionInfo GetRegionInfo(ulong homeRegionHandle); protected abstract RegionInfo GetRegionInfo(UUID homeRegionId); - protected abstract bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response); + protected abstract bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint client); /// /// Add active gestures of the user to the login response. diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 8fb2082..e18fd55 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -755,7 +755,7 @@ namespace OpenSim.Framework.Servers.HttpServer if (m_defaultLlsdHandler != null) { // LibOMV path - llsdResponse = m_defaultLlsdHandler(llsdRequest); + llsdResponse = m_defaultLlsdHandler(llsdRequest, request.RemoteIPEndPoint); } else { diff --git a/OpenSim/Framework/Servers/HttpServer/LLSDMethod.cs b/OpenSim/Framework/Servers/HttpServer/LLSDMethod.cs index d669182..aa03414 100644 --- a/OpenSim/Framework/Servers/HttpServer/LLSDMethod.cs +++ b/OpenSim/Framework/Servers/HttpServer/LLSDMethod.cs @@ -25,10 +25,11 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System.Net; using OpenMetaverse.StructuredData; namespace OpenSim.Framework.Servers.HttpServer { public delegate OSD LLSDMethod( string path, OSD request, string endpoint ); - public delegate OSD DefaultLLSDMethod(OSD request); + public delegate OSD DefaultLLSDMethod(OSD request, IPEndPoint client); } diff --git a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs index 8fd9c6d..323dc48 100644 --- a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs +++ b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs @@ -246,9 +246,9 @@ namespace OpenSim.Grid.UserServer.Modules } } - protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response) + protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient) { - return PrepareLoginToRegion(RegionProfileData.FromRegionInfo(regionInfo), user, response); + return PrepareLoginToRegion(RegionProfileData.FromRegionInfo(regionInfo), user, response, remoteClient); } /// @@ -259,7 +259,7 @@ namespace OpenSim.Grid.UserServer.Modules /// /// /// true if the region was successfully contacted, false otherwise - private bool PrepareLoginToRegion(RegionProfileData regionInfo, UserProfileData user, LoginResponse response) + private bool PrepareLoginToRegion(RegionProfileData regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient) { try { -- cgit v1.1