diff options
author | UbitUmarov | 2018-01-24 10:02:18 +0000 |
---|---|---|
committer | UbitUmarov | 2018-01-24 10:02:18 +0000 |
commit | fc224b444a8339aae2802fb919c34cfd994595f1 (patch) | |
tree | c3dd0211a1e350ec325885fbb7ce3eb648d0cdd8 | |
parent | let MinHeap self trim on empty; cleanup (diff) | |
download | opensim-SC-fc224b444a8339aae2802fb919c34cfd994595f1.zip opensim-SC-fc224b444a8339aae2802fb919c34cfd994595f1.tar.gz opensim-SC-fc224b444a8339aae2802fb919c34cfd994595f1.tar.bz2 opensim-SC-fc224b444a8339aae2802fb919c34cfd994595f1.tar.xz |
avoid some large unnecessary strings
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs | 55 | ||||
-rw-r--r-- | OpenSim/Capabilities/LLSDHelpers.cs | 13 | ||||
-rw-r--r-- | OpenSim/Framework/Monitoring/JobEngine.cs | 2 | ||||
-rw-r--r-- | bin/OpenSim32.exe.config | 1 | ||||
-rw-r--r-- | bin/Robust32.exe.config | 3 | ||||
-rw-r--r-- | bin/Robust32.vshost.exe.config | 3 |
6 files changed, 40 insertions, 37 deletions
diff --git a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs index 73f2770..89d9e80 100644 --- a/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs +++ b/OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs | |||
@@ -77,10 +77,7 @@ namespace OpenSim.Capabilities.Handlers | |||
77 | } | 77 | } |
78 | 78 | ||
79 | ArrayList foldersrequested = (ArrayList)hash["folders"]; | 79 | ArrayList foldersrequested = (ArrayList)hash["folders"]; |
80 | 80 | ||
81 | StringBuilder tmpresponse = new StringBuilder(1024); | ||
82 | StringBuilder tmpbadfolders = new StringBuilder(1024); | ||
83 | |||
84 | List<LLSDFetchInventoryDescendents> folders = new List<LLSDFetchInventoryDescendents>(); | 81 | List<LLSDFetchInventoryDescendents> folders = new List<LLSDFetchInventoryDescendents>(); |
85 | for (int i = 0; i < foldersrequested.Count; i++) | 82 | for (int i = 0; i < foldersrequested.Count; i++) |
86 | { | 83 | { |
@@ -101,6 +98,8 @@ namespace OpenSim.Capabilities.Handlers | |||
101 | folders.Add(llsdRequest); | 98 | folders.Add(llsdRequest); |
102 | } | 99 | } |
103 | 100 | ||
101 | StringBuilder lastresponse = new StringBuilder(1024); | ||
102 | lastresponse.Append("<llsd>"); | ||
104 | if (folders.Count > 0) | 103 | if (folders.Count > 0) |
105 | { | 104 | { |
106 | List<UUID> bad_folders = new List<UUID>(); | 105 | List<UUID> bad_folders = new List<UUID>(); |
@@ -115,43 +114,39 @@ namespace OpenSim.Capabilities.Handlers | |||
115 | #pragma warning restore 0612 | 114 | #pragma warning restore 0612 |
116 | } | 115 | } |
117 | 116 | ||
118 | string inventoryitemstr = string.Empty; | 117 | if(invcollSet.Count > 0) |
119 | foreach (InventoryCollectionWithDescendents icoll in invcollSet) | ||
120 | { | 118 | { |
121 | LLSDInventoryFolderContents thiscontents = contentsToLLSD(icoll.Collection, icoll.Descendents); | 119 | lastresponse.Append("<map><key>folders</key><array>"); |
122 | inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(thiscontents); | 120 | foreach (InventoryCollectionWithDescendents icoll in invcollSet) |
123 | tmpresponse.Append(inventoryitemstr.Substring(6,inventoryitemstr.Length - 13)); | 121 | { |
122 | LLSDInventoryFolderContents thiscontents = contentsToLLSD(icoll.Collection, icoll.Descendents); | ||
123 | lastresponse.Append(LLSDHelpers.SerialiseLLSDReplyNoHeader(thiscontents)); | ||
124 | } | ||
125 | lastresponse.Append("</array></map>"); | ||
124 | } | 126 | } |
127 | else | ||
128 | lastresponse.Append("<map><key>folders</key><array /></map>"); | ||
125 | 129 | ||
126 | //m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Bad folders {0}", string.Join(", ", bad_folders)); | 130 | //m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Bad folders {0}", string.Join(", ", bad_folders)); |
127 | foreach (UUID bad in bad_folders) | 131 | if(bad_folders.Count > 0) |
128 | { | 132 | { |
129 | tmpbadfolders.Append("<map><key>folder_id</key><uuid>"); | 133 | lastresponse.Append("<map><key>bad_folders</key><array>"); |
130 | tmpbadfolders.Append(bad.ToString()); | 134 | foreach (UUID bad in bad_folders) |
131 | tmpbadfolders.Append("</uuid><key>error</key><string>Unknown</string></map>"); | 135 | { |
136 | lastresponse.Append("<map><key>folder_id</key><uuid>"); | ||
137 | lastresponse.Append(bad.ToString()); | ||
138 | lastresponse.Append("</uuid><key>error</key><string>Unknown</string></map>"); | ||
139 | } | ||
140 | lastresponse.Append("</array></map>"); | ||
132 | } | 141 | } |
133 | } | 142 | lastresponse.Append("</llsd>"); |
134 | |||
135 | StringBuilder lastresponse = new StringBuilder(1024); | ||
136 | lastresponse.Append("<llsd>"); | ||
137 | if(tmpresponse.Length > 0) | ||
138 | { | ||
139 | lastresponse.Append("<map><key>folders</key><array>"); | ||
140 | lastresponse.Append(tmpresponse.ToString()); | ||
141 | lastresponse.Append("</array></map>"); | ||
142 | } | 143 | } |
143 | else | 144 | else |
144 | lastresponse.Append("<map><key>folders</key><array /></map>"); | ||
145 | |||
146 | if(tmpbadfolders.Length > 0) | ||
147 | { | 145 | { |
148 | lastresponse.Append("<map><key>bad_folders</key><array>"); | 146 | lastresponse.Append("<map><key>folders</key><array /></map></llsd>"); |
149 | lastresponse.Append(tmpbadfolders.ToString()); | ||
150 | lastresponse.Append("</array></map>"); | ||
151 | } | 147 | } |
152 | lastresponse.Append("</llsd>"); | ||
153 | 148 | ||
154 | return lastresponse.ToString(); | 149 | return lastresponse.ToString();; |
155 | } | 150 | } |
156 | 151 | ||
157 | /// <summary> | 152 | /// <summary> |
diff --git a/OpenSim/Capabilities/LLSDHelpers.cs b/OpenSim/Capabilities/LLSDHelpers.cs index e331cfb..4a7c6a5 100644 --- a/OpenSim/Capabilities/LLSDHelpers.cs +++ b/OpenSim/Capabilities/LLSDHelpers.cs | |||
@@ -54,6 +54,19 @@ namespace OpenSim.Framework.Capabilities | |||
54 | return sw.ToString(); | 54 | return sw.ToString(); |
55 | } | 55 | } |
56 | 56 | ||
57 | public static string SerialiseLLSDReplyNoHeader(object obj) | ||
58 | { | ||
59 | StringWriter sw = new StringWriter(); | ||
60 | XmlTextWriter writer = new XmlTextWriter(sw); | ||
61 | writer.Formatting = Formatting.None; | ||
62 | SerializeOSDType(writer, obj); | ||
63 | writer.Close(); | ||
64 | |||
65 | //m_log.DebugFormat("[LLSD Helpers]: Generated serialized LLSD reply {0}", sw.ToString()); | ||
66 | |||
67 | return sw.ToString(); | ||
68 | } | ||
69 | |||
57 | private static void SerializeOSDType(XmlTextWriter writer, object obj) | 70 | private static void SerializeOSDType(XmlTextWriter writer, object obj) |
58 | { | 71 | { |
59 | Type myType = obj.GetType(); | 72 | Type myType = obj.GetType(); |
diff --git a/OpenSim/Framework/Monitoring/JobEngine.cs b/OpenSim/Framework/Monitoring/JobEngine.cs index 4a831e8..6c388b3 100644 --- a/OpenSim/Framework/Monitoring/JobEngine.cs +++ b/OpenSim/Framework/Monitoring/JobEngine.cs | |||
@@ -79,7 +79,7 @@ namespace OpenSim.Framework.Monitoring | |||
79 | /// </remarks> | 79 | /// </remarks> |
80 | private bool m_warnOverMaxQueue = true; | 80 | private bool m_warnOverMaxQueue = true; |
81 | 81 | ||
82 | private BlockingCollection<Job> m_jobQueue = new BlockingCollection<Job>(new ConcurrentQueue<Job>(), 5000); | 82 | private BlockingCollection<Job> m_jobQueue = new BlockingCollection<Job>(5000); |
83 | 83 | ||
84 | private CancellationTokenSource m_cancelSource; | 84 | private CancellationTokenSource m_cancelSource; |
85 | 85 | ||
diff --git a/bin/OpenSim32.exe.config b/bin/OpenSim32.exe.config index 9224240..a3b2026 100644 --- a/bin/OpenSim32.exe.config +++ b/bin/OpenSim32.exe.config | |||
@@ -1,3 +1,4 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" ?> | ||
1 | <configuration> | 2 | <configuration> |
2 | <configSections> | 3 | <configSections> |
3 | <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> | 4 | <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> |
diff --git a/bin/Robust32.exe.config b/bin/Robust32.exe.config index ca3ee0e..a27f22a 100644 --- a/bin/Robust32.exe.config +++ b/bin/Robust32.exe.config | |||
@@ -3,9 +3,6 @@ | |||
3 | <configSections> | 3 | <configSections> |
4 | <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> | 4 | <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> |
5 | </configSections> | 5 | </configSections> |
6 | <startup> | ||
7 | <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /> | ||
8 | </startup> | ||
9 | <runtime> | 6 | <runtime> |
10 | <loadFromRemoteSources enabled="true" /> | 7 | <loadFromRemoteSources enabled="true" /> |
11 | </runtime> | 8 | </runtime> |
diff --git a/bin/Robust32.vshost.exe.config b/bin/Robust32.vshost.exe.config index ca3ee0e..a27f22a 100644 --- a/bin/Robust32.vshost.exe.config +++ b/bin/Robust32.vshost.exe.config | |||
@@ -3,9 +3,6 @@ | |||
3 | <configSections> | 3 | <configSections> |
4 | <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> | 4 | <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" /> |
5 | </configSections> | 5 | </configSections> |
6 | <startup> | ||
7 | <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" /> | ||
8 | </startup> | ||
9 | <runtime> | 6 | <runtime> |
10 | <loadFromRemoteSources enabled="true" /> | 7 | <loadFromRemoteSources enabled="true" /> |
11 | </runtime> | 8 | </runtime> |