aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorAdam Frisby2009-05-23 06:14:02 +0000
committerAdam Frisby2009-05-23 06:14:02 +0000
commite9ea9592631beb164bfca0765b14ffbfbbaa4fb7 (patch)
tree0b57b5a5aa8b2793994fc7ebbab71e4f7034e4df
parent* Pipes requestors IP address through all XmlRpcRequest delegates. This is ne... (diff)
downloadopensim-SC-e9ea9592631beb164bfca0765b14ffbfbbaa4fb7.zip
opensim-SC-e9ea9592631beb164bfca0765b14ffbfbbaa4fb7.tar.gz
opensim-SC-e9ea9592631beb164bfca0765b14ffbfbbaa4fb7.tar.bz2
opensim-SC-e9ea9592631beb164bfca0765b14ffbfbbaa4fb7.tar.xz
* Pipes IPEndPoint through all Login methods, including LLSD/OSD login paths.
-rw-r--r--OpenSim/Client/Linden/LLStandaloneLoginService.cs2
-rw-r--r--OpenSim/Framework/Communications/Services/HGLoginAuthService.cs2
-rw-r--r--OpenSim/Framework/Communications/Services/LoginService.cs14
-rw-r--r--OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs2
-rw-r--r--OpenSim/Framework/Servers/HttpServer/LLSDMethod.cs3
-rw-r--r--OpenSim/Grid/UserServer.Modules/UserLoginService.cs6
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
144 /// <param name="user"></param> 144 /// <param name="user"></param>
145 /// <param name="response"></param> 145 /// <param name="response"></param>
146 /// <returns>true if the region was successfully contacted, false otherwise</returns> 146 /// <returns>true if the region was successfully contacted, false otherwise</returns>
147 protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response) 147 protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient)
148 { 148 {
149 IPEndPoint endPoint = regionInfo.ExternalEndPoint; 149 IPEndPoint endPoint = regionInfo.ExternalEndPoint;
150 response.SimAddress = endPoint.Address.ToString(); 150 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
259 /// <param name="user"></param> 259 /// <param name="user"></param>
260 /// <param name="response"></param> 260 /// <param name="response"></param>
261 /// <returns>true if the region was successfully contacted, false otherwise</returns> 261 /// <returns>true if the region was successfully contacted, false otherwise</returns>
262 protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response) 262 protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient)
263 { 263 {
264 IPEndPoint endPoint = regionInfo.ExternalEndPoint; 264 IPEndPoint endPoint = regionInfo.ExternalEndPoint;
265 response.SimAddress = endPoint.Address.ToString(); 265 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
256 logResponse.BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(agentID)); 256 logResponse.BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(agentID));
257 logResponse.StartLocation = startLocationRequest; 257 logResponse.StartLocation = startLocationRequest;
258 258
259 if (CustomiseResponse(logResponse, userProfile, startLocationRequest)) 259 if (CustomiseResponse(logResponse, userProfile, startLocationRequest, remoteClient))
260 { 260 {
261 userProfile.LastLogin = userProfile.CurrentAgent.LoginTime; 261 userProfile.LastLogin = userProfile.CurrentAgent.LoginTime;
262 CommitAgent(ref userProfile); 262 CommitAgent(ref userProfile);
@@ -351,7 +351,7 @@ namespace OpenSim.Framework.Communications.Services
351 /// </summary> 351 /// </summary>
352 /// <param name="request">The LLSD request</param> 352 /// <param name="request">The LLSD request</param>
353 /// <returns>The response to send</returns> 353 /// <returns>The response to send</returns>
354 public OSD LLSDLoginMethod(OSD request) 354 public OSD LLSDLoginMethod(OSD request, IPEndPoint remoteClient)
355 { 355 {
356 // Temporary fix 356 // Temporary fix
357 m_loginMutex.WaitOne(); 357 m_loginMutex.WaitOne();
@@ -486,7 +486,7 @@ namespace OpenSim.Framework.Communications.Services
486 486
487 try 487 try
488 { 488 {
489 CustomiseResponse(logResponse, userProfile, startLocationRequest); 489 CustomiseResponse(logResponse, userProfile, startLocationRequest, remoteClient);
490 } 490 }
491 catch (Exception ex) 491 catch (Exception ex)
492 { 492 {
@@ -891,7 +891,7 @@ namespace OpenSim.Framework.Communications.Services
891 /// <param name="theUser">The user profile</param> 891 /// <param name="theUser">The user profile</param>
892 /// <param name="startLocationRequest">The requested start location</param> 892 /// <param name="startLocationRequest">The requested start location</param>
893 /// <returns>true on success, false if the region was not successfully told to expect a user connection</returns> 893 /// <returns>true on success, false if the region was not successfully told to expect a user connection</returns>
894 public bool CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest) 894 public bool CustomiseResponse(LoginResponse response, UserProfileData theUser, string startLocationRequest, IPEndPoint client)
895 { 895 {
896 // add active gestures to login-response 896 // add active gestures to login-response
897 AddActiveGestures(response, theUser); 897 AddActiveGestures(response, theUser);
@@ -984,7 +984,7 @@ namespace OpenSim.Framework.Communications.Services
984 response.StartLocation = "url"; 984 response.StartLocation = "url";
985 } 985 }
986 986
987 if ((regionInfo != null) && (PrepareLoginToRegion(regionInfo, theUser, response))) 987 if ((regionInfo != null) && (PrepareLoginToRegion(regionInfo, theUser, response, client)))
988 { 988 {
989 return true; 989 return true;
990 } 990 }
@@ -1015,13 +1015,13 @@ namespace OpenSim.Framework.Communications.Services
1015 theUser.CurrentAgent.Position = new Vector3(128, 128, 0); 1015 theUser.CurrentAgent.Position = new Vector3(128, 128, 0);
1016 response.StartLocation = "safe"; 1016 response.StartLocation = "safe";
1017 1017
1018 return PrepareLoginToRegion(regionInfo, theUser, response); 1018 return PrepareLoginToRegion(regionInfo, theUser, response, client);
1019 } 1019 }
1020 1020
1021 protected abstract RegionInfo RequestClosestRegion(string region); 1021 protected abstract RegionInfo RequestClosestRegion(string region);
1022 protected abstract RegionInfo GetRegionInfo(ulong homeRegionHandle); 1022 protected abstract RegionInfo GetRegionInfo(ulong homeRegionHandle);
1023 protected abstract RegionInfo GetRegionInfo(UUID homeRegionId); 1023 protected abstract RegionInfo GetRegionInfo(UUID homeRegionId);
1024 protected abstract bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response); 1024 protected abstract bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint client);
1025 1025
1026 /// <summary> 1026 /// <summary>
1027 /// Add active gestures of the user to the login response. 1027 /// 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
755 if (m_defaultLlsdHandler != null) 755 if (m_defaultLlsdHandler != null)
756 { 756 {
757 // LibOMV path 757 // LibOMV path
758 llsdResponse = m_defaultLlsdHandler(llsdRequest); 758 llsdResponse = m_defaultLlsdHandler(llsdRequest, request.RemoteIPEndPoint);
759 } 759 }
760 else 760 else
761 { 761 {
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 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System.Net;
28using OpenMetaverse.StructuredData; 29using OpenMetaverse.StructuredData;
29 30
30namespace OpenSim.Framework.Servers.HttpServer 31namespace OpenSim.Framework.Servers.HttpServer
31{ 32{
32 public delegate OSD LLSDMethod( string path, OSD request, string endpoint ); 33 public delegate OSD LLSDMethod( string path, OSD request, string endpoint );
33 public delegate OSD DefaultLLSDMethod(OSD request); 34 public delegate OSD DefaultLLSDMethod(OSD request, IPEndPoint client);
34} 35}
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
246 } 246 }
247 } 247 }
248 248
249 protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response) 249 protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient)
250 { 250 {
251 return PrepareLoginToRegion(RegionProfileData.FromRegionInfo(regionInfo), user, response); 251 return PrepareLoginToRegion(RegionProfileData.FromRegionInfo(regionInfo), user, response, remoteClient);
252 } 252 }
253 253
254 /// <summary> 254 /// <summary>
@@ -259,7 +259,7 @@ namespace OpenSim.Grid.UserServer.Modules
259 /// <param name="user"></param> 259 /// <param name="user"></param>
260 /// <param name="response"></param> 260 /// <param name="response"></param>
261 /// <returns>true if the region was successfully contacted, false otherwise</returns> 261 /// <returns>true if the region was successfully contacted, false otherwise</returns>
262 private bool PrepareLoginToRegion(RegionProfileData regionInfo, UserProfileData user, LoginResponse response) 262 private bool PrepareLoginToRegion(RegionProfileData regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient)
263 { 263 {
264 try 264 try
265 { 265 {