avoid some large unnecessary strings
parent
5a246026a0
commit
fc224b444a
|
@ -78,9 +78,6 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
|
|
||||||
ArrayList foldersrequested = (ArrayList)hash["folders"];
|
ArrayList foldersrequested = (ArrayList)hash["folders"];
|
||||||
|
|
||||||
StringBuilder tmpresponse = new StringBuilder(1024);
|
|
||||||
StringBuilder tmpbadfolders = new StringBuilder(1024);
|
|
||||||
|
|
||||||
List<LLSDFetchInventoryDescendents> folders = new List<LLSDFetchInventoryDescendents>();
|
List<LLSDFetchInventoryDescendents> folders = new List<LLSDFetchInventoryDescendents>();
|
||||||
for (int i = 0; i < foldersrequested.Count; i++)
|
for (int i = 0; i < foldersrequested.Count; i++)
|
||||||
{
|
{
|
||||||
|
@ -101,6 +98,8 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
folders.Add(llsdRequest);
|
folders.Add(llsdRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
StringBuilder lastresponse = new StringBuilder(1024);
|
||||||
|
lastresponse.Append("<llsd>");
|
||||||
if (folders.Count > 0)
|
if (folders.Count > 0)
|
||||||
{
|
{
|
||||||
List<UUID> bad_folders = new List<UUID>();
|
List<UUID> bad_folders = new List<UUID>();
|
||||||
|
@ -115,43 +114,39 @@ namespace OpenSim.Capabilities.Handlers
|
||||||
#pragma warning restore 0612
|
#pragma warning restore 0612
|
||||||
}
|
}
|
||||||
|
|
||||||
string inventoryitemstr = string.Empty;
|
if(invcollSet.Count > 0)
|
||||||
|
{
|
||||||
|
lastresponse.Append("<map><key>folders</key><array>");
|
||||||
foreach (InventoryCollectionWithDescendents icoll in invcollSet)
|
foreach (InventoryCollectionWithDescendents icoll in invcollSet)
|
||||||
{
|
{
|
||||||
LLSDInventoryFolderContents thiscontents = contentsToLLSD(icoll.Collection, icoll.Descendents);
|
LLSDInventoryFolderContents thiscontents = contentsToLLSD(icoll.Collection, icoll.Descendents);
|
||||||
inventoryitemstr = LLSDHelpers.SerialiseLLSDReply(thiscontents);
|
lastresponse.Append(LLSDHelpers.SerialiseLLSDReplyNoHeader(thiscontents));
|
||||||
tmpresponse.Append(inventoryitemstr.Substring(6,inventoryitemstr.Length - 13));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Bad folders {0}", string.Join(", ", bad_folders));
|
|
||||||
foreach (UUID bad in bad_folders)
|
|
||||||
{
|
|
||||||
tmpbadfolders.Append("<map><key>folder_id</key><uuid>");
|
|
||||||
tmpbadfolders.Append(bad.ToString());
|
|
||||||
tmpbadfolders.Append("</uuid><key>error</key><string>Unknown</string></map>");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StringBuilder lastresponse = new StringBuilder(1024);
|
|
||||||
lastresponse.Append("<llsd>");
|
|
||||||
if(tmpresponse.Length > 0)
|
|
||||||
{
|
|
||||||
lastresponse.Append("<map><key>folders</key><array>");
|
|
||||||
lastresponse.Append(tmpresponse.ToString());
|
|
||||||
lastresponse.Append("</array></map>");
|
lastresponse.Append("</array></map>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
lastresponse.Append("<map><key>folders</key><array /></map>");
|
lastresponse.Append("<map><key>folders</key><array /></map>");
|
||||||
|
|
||||||
if(tmpbadfolders.Length > 0)
|
//m_log.DebugFormat("[WEB FETCH INV DESC HANDLER]: Bad folders {0}", string.Join(", ", bad_folders));
|
||||||
|
if(bad_folders.Count > 0)
|
||||||
{
|
{
|
||||||
lastresponse.Append("<map><key>bad_folders</key><array>");
|
lastresponse.Append("<map><key>bad_folders</key><array>");
|
||||||
lastresponse.Append(tmpbadfolders.ToString());
|
foreach (UUID bad in bad_folders)
|
||||||
|
{
|
||||||
|
lastresponse.Append("<map><key>folder_id</key><uuid>");
|
||||||
|
lastresponse.Append(bad.ToString());
|
||||||
|
lastresponse.Append("</uuid><key>error</key><string>Unknown</string></map>");
|
||||||
|
}
|
||||||
lastresponse.Append("</array></map>");
|
lastresponse.Append("</array></map>");
|
||||||
}
|
}
|
||||||
lastresponse.Append("</llsd>");
|
lastresponse.Append("</llsd>");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
lastresponse.Append("<map><key>folders</key><array /></map></llsd>");
|
||||||
|
}
|
||||||
|
|
||||||
return lastresponse.ToString();
|
return lastresponse.ToString();;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -54,6 +54,19 @@ namespace OpenSim.Framework.Capabilities
|
||||||
return sw.ToString();
|
return sw.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string SerialiseLLSDReplyNoHeader(object obj)
|
||||||
|
{
|
||||||
|
StringWriter sw = new StringWriter();
|
||||||
|
XmlTextWriter writer = new XmlTextWriter(sw);
|
||||||
|
writer.Formatting = Formatting.None;
|
||||||
|
SerializeOSDType(writer, obj);
|
||||||
|
writer.Close();
|
||||||
|
|
||||||
|
//m_log.DebugFormat("[LLSD Helpers]: Generated serialized LLSD reply {0}", sw.ToString());
|
||||||
|
|
||||||
|
return sw.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
private static void SerializeOSDType(XmlTextWriter writer, object obj)
|
private static void SerializeOSDType(XmlTextWriter writer, object obj)
|
||||||
{
|
{
|
||||||
Type myType = obj.GetType();
|
Type myType = obj.GetType();
|
||||||
|
|
|
@ -79,7 +79,7 @@ namespace OpenSim.Framework.Monitoring
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
private bool m_warnOverMaxQueue = true;
|
private bool m_warnOverMaxQueue = true;
|
||||||
|
|
||||||
private BlockingCollection<Job> m_jobQueue = new BlockingCollection<Job>(new ConcurrentQueue<Job>(), 5000);
|
private BlockingCollection<Job> m_jobQueue = new BlockingCollection<Job>(5000);
|
||||||
|
|
||||||
private CancellationTokenSource m_cancelSource;
|
private CancellationTokenSource m_cancelSource;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
|
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
<configSections>
|
<configSections>
|
||||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
|
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
|
||||||
</configSections>
|
</configSections>
|
||||||
<startup>
|
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
|
|
||||||
</startup>
|
|
||||||
<runtime>
|
<runtime>
|
||||||
<loadFromRemoteSources enabled="true" />
|
<loadFromRemoteSources enabled="true" />
|
||||||
</runtime>
|
</runtime>
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
<configSections>
|
<configSections>
|
||||||
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
|
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
|
||||||
</configSections>
|
</configSections>
|
||||||
<startup>
|
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
|
|
||||||
</startup>
|
|
||||||
<runtime>
|
<runtime>
|
||||||
<loadFromRemoteSources enabled="true" />
|
<loadFromRemoteSources enabled="true" />
|
||||||
</runtime>
|
</runtime>
|
||||||
|
|
Loading…
Reference in New Issue