aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2011-05-02 09:04:34 -0700
committerDiva Canto2011-05-02 09:47:51 -0700
commit729c42f5fac40a2979865e04dce421229de600ef (patch)
treeaac9565d0114b4ad13e2ff8136b93bd7fbf89464
parentMerge branch '0.7.1-dev' of ssh://opensimulator.org/var/git/opensim into 0.7.... (diff)
downloadopensim-SC_OLD-729c42f5fac40a2979865e04dce421229de600ef.zip
opensim-SC_OLD-729c42f5fac40a2979865e04dce421229de600ef.tar.gz
opensim-SC_OLD-729c42f5fac40a2979865e04dce421229de600ef.tar.bz2
opensim-SC_OLD-729c42f5fac40a2979865e04dce421229de600ef.tar.xz
Turns out that it's a bad idea to let Agent position updates linger for a long time on certain versions of mono. It's better to abort them if they take too long. So timeout is now an argument. Currently: 20secs for CreateAgent, 100secs for UpdateAgent (fat), 10 secs for UpdateAgent (Position); all of these divided by 4, for ReadWrite, as Mic had before.
-rw-r--r--OpenSim/Framework/WebUtil.cs18
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs14
2 files changed, 16 insertions, 16 deletions
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index a866e4c..698ae94 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -140,19 +140,19 @@ namespace OpenSim.Framework
140 /// PUT JSON-encoded data to a web service that returns LLSD or 140 /// PUT JSON-encoded data to a web service that returns LLSD or
141 /// JSON data 141 /// JSON data
142 /// </summary> 142 /// </summary>
143 public static OSDMap PutToService(string url, OSDMap data) 143 public static OSDMap PutToService(string url, OSDMap data, int timeout)
144 { 144 {
145 return ServiceOSDRequest(url,data,"PUT",30000); 145 return ServiceOSDRequest(url,data, "PUT", timeout);
146 } 146 }
147 147
148 public static OSDMap PostToService(string url, OSDMap data) 148 public static OSDMap PostToService(string url, OSDMap data, int timeout)
149 { 149 {
150 return ServiceOSDRequest(url,data,"POST",30000); 150 return ServiceOSDRequest(url, data, "POST", timeout);
151 } 151 }
152 152
153 public static OSDMap GetFromService(string url) 153 public static OSDMap GetFromService(string url, int timeout)
154 { 154 {
155 return ServiceOSDRequest(url,null,"GET",30000); 155 return ServiceOSDRequest(url, null, "GET", timeout);
156 } 156 }
157 157
158 public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout) 158 public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout)
@@ -171,7 +171,7 @@ namespace OpenSim.Framework
171 request.Timeout = timeout; 171 request.Timeout = timeout;
172 request.KeepAlive = false; 172 request.KeepAlive = false;
173 request.MaximumAutomaticRedirections = 10; 173 request.MaximumAutomaticRedirections = 10;
174 request.ReadWriteTimeout = timeout * 4; 174 request.ReadWriteTimeout = timeout / 4;
175 request.Headers[OSHeaderRequestID] = reqnum.ToString(); 175 request.Headers[OSHeaderRequestID] = reqnum.ToString();
176 176
177 // If there is some input, write it into the request 177 // If there is some input, write it into the request
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index 93b3ae6..ff06fca 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -102,7 +102,7 @@ namespace OpenSim.Services.Connectors.Simulation
102 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); 102 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
103 args["teleport_flags"] = OSD.FromString(flags.ToString()); 103 args["teleport_flags"] = OSD.FromString(flags.ToString());
104 104
105 OSDMap result = WebUtil.PostToService(uri,args); 105 OSDMap result = WebUtil.PostToService(uri, args, 20000);
106 if (result["Success"].AsBoolean()) 106 if (result["Success"].AsBoolean())
107 return true; 107 return true;
108 108
@@ -126,7 +126,7 @@ namespace OpenSim.Services.Connectors.Simulation
126 /// </summary> 126 /// </summary>
127 public bool UpdateAgent(GridRegion destination, AgentData data) 127 public bool UpdateAgent(GridRegion destination, AgentData data)
128 { 128 {
129 return UpdateAgent(destination, (IAgentData)data); 129 return UpdateAgent(destination, (IAgentData)data, 100000); // yes, 100 seconds
130 } 130 }
131 131
132 /// <summary> 132 /// <summary>
@@ -181,7 +181,7 @@ namespace OpenSim.Services.Connectors.Simulation
181 } 181 }
182 } 182 }
183 183
184 UpdateAgent(destination,(IAgentData)pos); 184 UpdateAgent(destination, (IAgentData)pos, 10000);
185 } 185 }
186 186
187 // unreachable 187 // unreachable
@@ -191,7 +191,7 @@ namespace OpenSim.Services.Connectors.Simulation
191 /// <summary> 191 /// <summary>
192 /// This is the worker function to send AgentData to a neighbor region 192 /// This is the worker function to send AgentData to a neighbor region
193 /// </summary> 193 /// </summary>
194 private bool UpdateAgent(GridRegion destination, IAgentData cAgentData) 194 private bool UpdateAgent(GridRegion destination, IAgentData cAgentData, int timeout)
195 { 195 {
196 // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: UpdateAgent start"); 196 // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: UpdateAgent start");
197 197
@@ -207,7 +207,7 @@ namespace OpenSim.Services.Connectors.Simulation
207 args["destination_name"] = OSD.FromString(destination.RegionName); 207 args["destination_name"] = OSD.FromString(destination.RegionName);
208 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); 208 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
209 209
210 OSDMap result = WebUtil.PutToService(uri,args); 210 OSDMap result = WebUtil.PutToService(uri, args, timeout);
211 return result["Success"].AsBoolean(); 211 return result["Success"].AsBoolean();
212 } 212 }
213 catch (Exception e) 213 catch (Exception e)
@@ -233,7 +233,7 @@ namespace OpenSim.Services.Connectors.Simulation
233 233
234 try 234 try
235 { 235 {
236 OSDMap result = WebUtil.GetFromService(uri); 236 OSDMap result = WebUtil.GetFromService(uri, 10000);
237 if (result["Success"].AsBoolean()) 237 if (result["Success"].AsBoolean())
238 { 238 {
239 // OSDMap args = Util.GetOSDMap(result["_RawResult"].AsString()); 239 // OSDMap args = Util.GetOSDMap(result["_RawResult"].AsString());
@@ -384,7 +384,7 @@ namespace OpenSim.Services.Connectors.Simulation
384 args["destination_name"] = OSD.FromString(destination.RegionName); 384 args["destination_name"] = OSD.FromString(destination.RegionName);
385 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); 385 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
386 386
387 WebUtil.PostToService(uri, args); 387 WebUtil.PostToService(uri, args, 40000);
388 } 388 }
389 catch (Exception e) 389 catch (Exception e)
390 { 390 {