aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-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 {