diff options
Diffstat (limited to 'OpenSim')
7 files changed, 79 insertions, 35 deletions
diff --git a/OpenSim/Framework/Communications/RestClient.cs b/OpenSim/Framework/Communications/RestClient.cs index 42c0b18..ce36fbf 100644 --- a/OpenSim/Framework/Communications/RestClient.cs +++ b/OpenSim/Framework/Communications/RestClient.cs | |||
@@ -326,18 +326,22 @@ namespace OpenSim.Framework.Communications | |||
326 | m_log.Debug(e.ToString()); | 326 | m_log.Debug(e.ToString()); |
327 | } | 327 | } |
328 | 328 | ||
329 | if (_response != null) | ||
330 | _response.Close(); | ||
331 | |||
329 | return null; | 332 | return null; |
330 | } | 333 | } |
331 | 334 | ||
332 | Stream src = _response.GetResponseStream(); | 335 | using (Stream src = _response.GetResponseStream()) |
333 | int length = src.Read(_readbuf, 0, BufferSize); | ||
334 | while (length > 0) | ||
335 | { | 336 | { |
336 | _resource.Write(_readbuf, 0, length); | 337 | int length = src.Read(_readbuf, 0, BufferSize); |
337 | length = src.Read(_readbuf, 0, BufferSize); | 338 | while (length > 0) |
339 | { | ||
340 | _resource.Write(_readbuf, 0, length); | ||
341 | length = src.Read(_readbuf, 0, BufferSize); | ||
342 | } | ||
338 | } | 343 | } |
339 | 344 | ||
340 | |||
341 | // TODO! Implement timeout, without killing the server | 345 | // TODO! Implement timeout, without killing the server |
342 | // this line implements the timeout, if there is a timeout, the callback fires and the request becomes aborted | 346 | // this line implements the timeout, if there is a timeout, the callback fires and the request becomes aborted |
343 | //ThreadPool.RegisterWaitForSingleObject(responseAsyncResult.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), _request, DefaultTimeout, true); | 347 | //ThreadPool.RegisterWaitForSingleObject(responseAsyncResult.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), _request, DefaultTimeout, true); |
@@ -372,20 +376,26 @@ namespace OpenSim.Framework.Communications | |||
372 | m_log.InfoFormat("[REST]: Sending Web Request {0}", buildUri()); | 376 | m_log.InfoFormat("[REST]: Sending Web Request {0}", buildUri()); |
373 | src.Seek(0, SeekOrigin.Begin); | 377 | src.Seek(0, SeekOrigin.Begin); |
374 | m_log.Info("[REST]: Seek is ok"); | 378 | m_log.Info("[REST]: Seek is ok"); |
375 | Stream dst = _request.GetRequestStream(); | ||
376 | m_log.Info("[REST]: GetRequestStream is ok"); | ||
377 | 379 | ||
378 | byte[] buf = new byte[1024]; | 380 | using (Stream dst = _request.GetRequestStream()) |
379 | int length = src.Read(buf, 0, 1024); | ||
380 | m_log.Info("[REST]: First Read is ok"); | ||
381 | while (length > 0) | ||
382 | { | 381 | { |
383 | dst.Write(buf, 0, length); | 382 | m_log.Info("[REST]: GetRequestStream is ok"); |
384 | length = src.Read(buf, 0, 1024); | 383 | |
384 | byte[] buf = new byte[1024]; | ||
385 | int length = src.Read(buf, 0, 1024); | ||
386 | m_log.Info("[REST]: First Read is ok"); | ||
387 | while (length > 0) | ||
388 | { | ||
389 | dst.Write(buf, 0, length); | ||
390 | length = src.Read(buf, 0, 1024); | ||
391 | } | ||
385 | } | 392 | } |
386 | 393 | ||
387 | _response = (HttpWebResponse) _request.GetResponse(); | 394 | _response = (HttpWebResponse) _request.GetResponse(); |
388 | 395 | ||
396 | if (_response != null) | ||
397 | _response.Close(); | ||
398 | |||
389 | // IAsyncResult responseAsyncResult = _request.BeginGetResponse(new AsyncCallback(ResponseIsReadyDelegate), _request); | 399 | // IAsyncResult responseAsyncResult = _request.BeginGetResponse(new AsyncCallback(ResponseIsReadyDelegate), _request); |
390 | 400 | ||
391 | // TODO! Implement timeout, without killing the server | 401 | // TODO! Implement timeout, without killing the server |
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 3a4e5df..6215055 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs | |||
@@ -75,6 +75,7 @@ namespace OpenSim | |||
75 | new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); | 75 | new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); |
76 | 76 | ||
77 | ServicePointManager.DefaultConnectionLimit = 12; | 77 | ServicePointManager.DefaultConnectionLimit = 12; |
78 | ServicePointManager.UseNagleAlgorithm = false; | ||
78 | 79 | ||
79 | // Add the arguments supplied when running the application to the configuration | 80 | // Add the arguments supplied when running the application to the configuration |
80 | ArgvConfigSource configSource = new ArgvConfigSource(args); | 81 | ArgvConfigSource configSource = new ArgvConfigSource(args); |
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs index d359ebc..db8405b 100644 --- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs | |||
@@ -1239,19 +1239,25 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
1239 | return false; | 1239 | return false; |
1240 | } | 1240 | } |
1241 | 1241 | ||
1242 | Stream rstream = webResponse.GetResponseStream(); | ||
1243 | |||
1244 | OSDMap mret = new OSDMap(); | 1242 | OSDMap mret = new OSDMap(); |
1245 | try | 1243 | |
1246 | { | 1244 | using (Stream rstream = webResponse.GetResponseStream()) |
1247 | mret = (OSDMap)OSDParser.DeserializeJson(rstream); | ||
1248 | } | ||
1249 | catch (Exception e) | ||
1250 | { | 1245 | { |
1251 | m_log.DebugFormat("[PROFILES]: JsonRpcRequest Error {0} - remote user with legacy profiles?", e.Message); | 1246 | try |
1252 | return false; | 1247 | { |
1248 | mret = (OSDMap)OSDParser.DeserializeJson(rstream); | ||
1249 | } | ||
1250 | catch (Exception e) | ||
1251 | { | ||
1252 | m_log.DebugFormat("[PROFILES]: JsonRpcRequest Error {0} - remote user with legacy profiles?", e.Message); | ||
1253 | if (webResponse != null) | ||
1254 | webResponse.Close(); | ||
1255 | return false; | ||
1256 | } | ||
1253 | } | 1257 | } |
1254 | 1258 | ||
1259 | if (webResponse != null) | ||
1260 | webResponse.Close(); | ||
1255 | 1261 | ||
1256 | if (mret.ContainsKey("error")) | 1262 | if (mret.ContainsKey("error")) |
1257 | return false; | 1263 | return false; |
@@ -1315,19 +1321,26 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles | |||
1315 | return false; | 1321 | return false; |
1316 | } | 1322 | } |
1317 | 1323 | ||
1318 | Stream rstream = webResponse.GetResponseStream(); | ||
1319 | |||
1320 | OSDMap response = new OSDMap(); | 1324 | OSDMap response = new OSDMap(); |
1321 | try | 1325 | |
1322 | { | 1326 | using (Stream rstream = webResponse.GetResponseStream()) |
1323 | response = (OSDMap)OSDParser.DeserializeJson(rstream); | ||
1324 | } | ||
1325 | catch (Exception e) | ||
1326 | { | 1327 | { |
1327 | m_log.DebugFormat("[PROFILES]: JsonRpcRequest Error {0} - remote user with legacy profiles?", e.Message); | 1328 | try |
1328 | return false; | 1329 | { |
1330 | response = (OSDMap)OSDParser.DeserializeJson(rstream); | ||
1331 | } | ||
1332 | catch (Exception e) | ||
1333 | { | ||
1334 | m_log.DebugFormat("[PROFILES]: JsonRpcRequest Error {0} - remote user with legacy profiles?", e.Message); | ||
1335 | if (webResponse != null) | ||
1336 | webResponse.Close(); | ||
1337 | return false; | ||
1338 | } | ||
1329 | } | 1339 | } |
1330 | 1340 | ||
1341 | if (webResponse != null) | ||
1342 | webResponse.Close(); | ||
1343 | |||
1331 | if(response.ContainsKey("error")) | 1344 | if(response.ContainsKey("error")) |
1332 | { | 1345 | { |
1333 | data = response["error"]; | 1346 | data = response["error"]; |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 19c068a..b735f36 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -868,6 +868,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
868 | // Let's send a full update of the agent. This is a synchronous call. | 868 | // Let's send a full update of the agent. This is a synchronous call. |
869 | AgentData agent = new AgentData(); | 869 | AgentData agent = new AgentData(); |
870 | sp.CopyTo(agent); | 870 | sp.CopyTo(agent); |
871 | |||
872 | if ((teleportFlags & (uint)TeleportFlags.IsFlying) != 0) | ||
873 | agent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | ||
874 | |||
871 | agent.Position = agentCircuit.startpos; | 875 | agent.Position = agentCircuit.startpos; |
872 | SetCallbackURL(agent, sp.Scene.RegionInfo); | 876 | SetCallbackURL(agent, sp.Scene.RegionInfo); |
873 | 877 | ||
@@ -1109,6 +1113,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1109 | AgentData agent = new AgentData(); | 1113 | AgentData agent = new AgentData(); |
1110 | sp.CopyTo(agent); | 1114 | sp.CopyTo(agent); |
1111 | agent.Position = agentCircuit.startpos; | 1115 | agent.Position = agentCircuit.startpos; |
1116 | |||
1117 | if ((teleportFlags & (uint)TeleportFlags.IsFlying) != 0) | ||
1118 | agent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | ||
1119 | |||
1112 | agent.SenderWantsToWaitForRoot = true; | 1120 | agent.SenderWantsToWaitForRoot = true; |
1113 | //SetCallbackURL(agent, sp.Scene.RegionInfo); | 1121 | //SetCallbackURL(agent, sp.Scene.RegionInfo); |
1114 | 1122 | ||
diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs index 0c0a7aa..78c050a 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | |||
@@ -391,6 +391,7 @@ namespace OpenSim.Region.DataSnapshot | |||
391 | { | 391 | { |
392 | m_log.Warn("[DATASNAPSHOT]: Ignoring unknown exception " + e.ToString()); | 392 | m_log.Warn("[DATASNAPSHOT]: Ignoring unknown exception " + e.ToString()); |
393 | } | 393 | } |
394 | |||
394 | byte[] response = new byte[1024]; | 395 | byte[] response = new byte[1024]; |
395 | // int n = 0; | 396 | // int n = 0; |
396 | try | 397 | try |
@@ -405,6 +406,9 @@ namespace OpenSim.Region.DataSnapshot | |||
405 | // This is not quite working, so... | 406 | // This is not quite working, so... |
406 | // string responseStr = Util.UTF8.GetString(response); | 407 | // string responseStr = Util.UTF8.GetString(response); |
407 | m_log.Info("[DATASNAPSHOT]: data service " + url + " notified. Secret: " + m_Secret); | 408 | m_log.Info("[DATASNAPSHOT]: data service " + url + " notified. Secret: " + m_Secret); |
409 | |||
410 | if(reply != null) | ||
411 | reply.Close(); | ||
408 | } | 412 | } |
409 | 413 | ||
410 | } | 414 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index fd1bab6..9d06c26 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -4268,14 +4268,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
4268 | GodLevel = cAgent.GodLevel; | 4268 | GodLevel = cAgent.GodLevel; |
4269 | SetAlwaysRun = cAgent.AlwaysRun; | 4269 | SetAlwaysRun = cAgent.AlwaysRun; |
4270 | 4270 | ||
4271 | |||
4271 | Appearance = new AvatarAppearance(cAgent.Appearance); | 4272 | Appearance = new AvatarAppearance(cAgent.Appearance); |
4273 | /* | ||
4274 | bool isFlying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); | ||
4275 | |||
4272 | if (PhysicsActor != null) | 4276 | if (PhysicsActor != null) |
4273 | { | 4277 | { |
4274 | bool isFlying = Flying; | ||
4275 | RemoveFromPhysicalScene(); | 4278 | RemoveFromPhysicalScene(); |
4276 | AddToPhysicalScene(isFlying); | 4279 | AddToPhysicalScene(isFlying); |
4277 | } | 4280 | } |
4278 | 4281 | */ | |
4279 | try | 4282 | try |
4280 | { | 4283 | { |
4281 | lock (scriptedcontrols) | 4284 | lock (scriptedcontrols) |
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs index bf0cc35..9b0ebcf 100644 --- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs +++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs | |||
@@ -284,9 +284,11 @@ namespace OpenSim.Services.Connectors | |||
284 | byte[] ret = new byte[s.Length]; | 284 | byte[] ret = new byte[s.Length]; |
285 | s.Read(ret, 0, (int)s.Length); | 285 | s.Read(ret, 0, (int)s.Length); |
286 | 286 | ||
287 | s.Close(); | ||
287 | return ret; | 288 | return ret; |
288 | } | 289 | } |
289 | 290 | ||
291 | s.Close(); | ||
290 | return null; | 292 | return null; |
291 | } | 293 | } |
292 | 294 | ||
@@ -325,13 +327,16 @@ namespace OpenSim.Services.Connectors | |||
325 | handlers = m_AssetHandlers[id]; | 327 | handlers = m_AssetHandlers[id]; |
326 | m_AssetHandlers.Remove(id); | 328 | m_AssetHandlers.Remove(id); |
327 | } | 329 | } |
330 | |||
328 | foreach (AssetRetrievedEx h in handlers) | 331 | foreach (AssetRetrievedEx h in handlers) |
329 | { | 332 | { |
330 | Util.FireAndForget(x => | 333 | Util.FireAndForget(x => |
331 | { | 334 | { |
332 | h.Invoke(a); | 335 | try { h.Invoke(a); } |
336 | catch { } | ||
333 | }); | 337 | }); |
334 | } | 338 | } |
339 | |||
335 | if (handlers != null) | 340 | if (handlers != null) |
336 | handlers.Clear(); | 341 | handlers.Clear(); |
337 | 342 | ||