From 387e9f7a7faeb412054383080afc3507a1522746 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Fri, 2 Oct 2009 18:31:08 -0700 Subject: * Creates Util.UTF8 and switches some references of Encoding.UTF8 to Util.UTF8 (not all references were switched since not all OpenSim libraries reference OpenSim.Framework) * Shrinks the largest in-memory object, the LLRAW.HeightmapLookupValue struct (only used for exporting to LLRAW terrain files), to the minimum possible size. This seems to have the odd side effect of cutting the size of the two double[256,256] terrain objects in half. Possibly an alignment optimization? --- OpenSim/Framework/Communications/XMPP/XmppWriter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Framework/Communications') diff --git a/OpenSim/Framework/Communications/XMPP/XmppWriter.cs b/OpenSim/Framework/Communications/XMPP/XmppWriter.cs index b52eda7..415d808 100644 --- a/OpenSim/Framework/Communications/XMPP/XmppWriter.cs +++ b/OpenSim/Framework/Communications/XMPP/XmppWriter.cs @@ -38,7 +38,7 @@ namespace OpenSim.Framework.Communications.XMPP { } - public XMPPWriter(IOStream stream) : this(stream, Encoding.UTF8) + public XMPPWriter(IOStream stream) : this(stream, Util.UTF8) { } -- cgit v1.1 From 30aac00f6bb24e0aed2e8a49907e0c4c573febfd Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 4 Oct 2009 10:12:19 -0700 Subject: Closing more streams even if things fail. --- .../Communications/Clients/RegionClient.cs | 31 +++++++++++++++++----- 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'OpenSim/Framework/Communications') diff --git a/OpenSim/Framework/Communications/Clients/RegionClient.cs b/OpenSim/Framework/Communications/Clients/RegionClient.cs index 3419ce2..10be069 100644 --- a/OpenSim/Framework/Communications/Clients/RegionClient.cs +++ b/OpenSim/Framework/Communications/Clients/RegionClient.cs @@ -106,7 +106,6 @@ namespace OpenSim.Framework.Communications.Clients AgentCreateRequest.ContentLength = buffer.Length; //Count bytes to send os = AgentCreateRequest.GetRequestStream(); os.Write(buffer, 0, strBuffer.Length); //Send it - os.Close(); //m_log.InfoFormat("[REST COMMS]: Posted CreateChildAgent request to remote sim {0}", uri); } //catch (WebException ex) @@ -116,6 +115,11 @@ namespace OpenSim.Framework.Communications.Clients reason = "cannot contact remote region"; return false; } + finally + { + if (os != null) + os.Close(); + } // Let's wait for the response //m_log.Info("[REST COMMS]: Waiting for a reply after DoCreateChildAgentCall"); @@ -224,7 +228,6 @@ namespace OpenSim.Framework.Communications.Clients ChildUpdateRequest.ContentLength = buffer.Length; //Count bytes to send os = ChildUpdateRequest.GetRequestStream(); os.Write(buffer, 0, strBuffer.Length); //Send it - os.Close(); //m_log.InfoFormat("[REST COMMS]: Posted ChildAgentUpdate request to remote sim {0}", uri); } //catch (WebException ex) @@ -234,6 +237,11 @@ namespace OpenSim.Framework.Communications.Clients return false; } + finally + { + if (os != null) + os.Close(); + } // Let's wait for the response //m_log.Info("[REST COMMS]: Waiting for a reply after ChildAgentUpdate"); @@ -437,7 +445,6 @@ namespace OpenSim.Framework.Communications.Clients ObjectCreateRequest.ContentLength = buffer.Length; //Count bytes to send os = ObjectCreateRequest.GetRequestStream(); os.Write(buffer, 0, strBuffer.Length); //Send it - os.Close(); m_log.InfoFormat("[REST COMMS]: Posted ChildAgentUpdate request to remote sim {0}", uri); } //catch (WebException ex) @@ -447,6 +454,11 @@ namespace OpenSim.Framework.Communications.Clients return false; } + finally + { + if (os != null) + os.Close(); + } // Let's wait for the response //m_log.Info("[REST COMMS]: Waiting for a reply after DoCreateChildAgentCall"); @@ -512,7 +524,6 @@ namespace OpenSim.Framework.Communications.Clients ObjectCreateRequest.ContentLength = buffer.Length; //Count bytes to send os = ObjectCreateRequest.GetRequestStream(); os.Write(buffer, 0, strBuffer.Length); //Send it - os.Close(); //m_log.InfoFormat("[REST COMMS]: Posted CreateObject request to remote sim {0}", uri); } //catch (WebException ex) @@ -522,6 +533,11 @@ namespace OpenSim.Framework.Communications.Clients return false; } + finally + { + if (os != null) + os.Close(); + } // Let's wait for the response //m_log.Info("[REST COMMS]: Waiting for a reply after DoCreateChildAgentCall"); @@ -597,7 +613,6 @@ namespace OpenSim.Framework.Communications.Clients HelloNeighbourRequest.ContentLength = buffer.Length; //Count bytes to send os = HelloNeighbourRequest.GetRequestStream(); os.Write(buffer, 0, strBuffer.Length); //Send it - os.Close(); //m_log.InfoFormat("[REST COMMS]: Posted HelloNeighbour request to remote sim {0}", uri); } //catch (WebException ex) @@ -607,7 +622,11 @@ namespace OpenSim.Framework.Communications.Clients return false; } - + finally + { + if (os != null) + os.Close(); + } // Let's wait for the response //m_log.Info("[REST COMMS]: Waiting for a reply after DoHelloNeighbourCall"); -- cgit v1.1