aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorCharles Krinke2008-06-05 20:18:15 +0000
committerCharles Krinke2008-06-05 20:18:15 +0000
commitf9a67ab5f0aefe9033593babb790d6c1c74628ec (patch)
tree445af6afd4b8a6c65fe953279c65d3fb7b0c523e /OpenSim/Region/Environment
parentMantis#1459. Thank you kindly, CMickeyb for a patch that: (diff)
downloadopensim-SC-f9a67ab5f0aefe9033593babb790d6c1c74628ec.zip
opensim-SC-f9a67ab5f0aefe9033593babb790d6c1c74628ec.tar.gz
opensim-SC-f9a67ab5f0aefe9033593babb790d6c1c74628ec.tar.bz2
opensim-SC-f9a67ab5f0aefe9033593babb790d6c1c74628ec.tar.xz
Mantis#1460. Thank you, CMickeyb for a patch that addresses:
I'm getting an unhandled exception in openxmlrpcchannel during simulator initialization. I have two objects in different regions that open remote data channels in the state_entry event. It appears that the state_entry call is executing before the postinitialize method is called in xmlrpcmodule (the exception occurs because m_openChannels is not initialized).
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs33
1 files changed, 23 insertions, 10 deletions
diff --git a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs
index 79cd151..bde90bc 100644
--- a/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs
+++ b/OpenSim/Region/Environment/Modules/Scripting/XMLRPC/XMLRPCModule.cs
@@ -97,12 +97,23 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC
97 97
98 public void Initialise(Scene scene, IConfigSource config) 98 public void Initialise(Scene scene, IConfigSource config)
99 { 99 {
100 try 100 // We need to create these early because the scripts might be calling
101 { 101 // But since this gets called for every region, we need to make sure they
102 m_remoteDataPort = config.Configs["Network"].GetInt("remoteDataPort", m_remoteDataPort); 102 // get called only one time (or we lose any open channels)
103 } 103 if (null == m_openChannels)
104 catch (Exception)
105 { 104 {
105 m_openChannels = new Dictionary<LLUUID, RPCChannelInfo>();
106 m_rpcPending = new Dictionary<LLUUID, RPCRequestInfo>();
107 m_rpcPendingResponses = new Dictionary<LLUUID, RPCRequestInfo>();
108 m_pendingSRDResponses = new Dictionary<LLUUID, SendRemoteDataRequest>();
109
110 try
111 {
112 m_remoteDataPort = config.Configs["Network"].GetInt("remoteDataPort", m_remoteDataPort);
113 }
114 catch (Exception)
115 {
116 }
106 } 117 }
107 118
108 if (!m_scenes.Contains(scene)) 119 if (!m_scenes.Contains(scene))
@@ -117,11 +128,6 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC
117 { 128 {
118 if (IsEnabled()) 129 if (IsEnabled())
119 { 130 {
120 m_openChannels = new Dictionary<LLUUID, RPCChannelInfo>();
121 m_rpcPending = new Dictionary<LLUUID, RPCRequestInfo>();
122 m_rpcPendingResponses = new Dictionary<LLUUID, RPCRequestInfo>();
123 m_pendingSRDResponses = new Dictionary<LLUUID, SendRemoteDataRequest>();
124
125 // Start http server 131 // Start http server
126 // Attach xmlrpc handlers 132 // Attach xmlrpc handlers
127 m_log.Info("[REMOTE_DATA]: " + 133 m_log.Info("[REMOTE_DATA]: " +
@@ -177,6 +183,13 @@ namespace OpenSim.Region.Environment.Modules.Scripting.XMLRPC
177 { 183 {
178 LLUUID newChannel = LLUUID.Zero; 184 LLUUID newChannel = LLUUID.Zero;
179 185
186 // This should no longer happen, but the check is reasonable anyway
187 if (null == m_openChannels)
188 {
189 m_log.Warn("[RemoteDataReply] Attempt to open channel before initialization is complete");
190 return newChannel;
191 }
192
180 //Is a dupe? 193 //Is a dupe?
181 foreach (RPCChannelInfo ci in m_openChannels.Values) 194 foreach (RPCChannelInfo ci in m_openChannels.Values)
182 { 195 {