aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Capabilities/Handlers/FetchInventory/FetchInvDescHandler.cs55
-rw-r--r--OpenSim/Capabilities/LLSDHelpers.cs13
-rw-r--r--OpenSim/Framework/Monitoring/JobEngine.cs2
3 files changed, 39 insertions, 31 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