aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
diff options
context:
space:
mode:
authorUbitUmarov2015-09-02 19:54:53 +0100
committerUbitUmarov2015-09-02 19:54:53 +0100
commita11edceb00b5b86f825bd957bdac9edb91f893dd (patch)
treec192eae26f3aadf365a66f32fc6d9ade2f0a0c61 /OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
parentbad merge? (diff)
downloadopensim-SC_OLD-a11edceb00b5b86f825bd957bdac9edb91f893dd.zip
opensim-SC_OLD-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.gz
opensim-SC_OLD-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.bz2
opensim-SC_OLD-a11edceb00b5b86f825bd957bdac9edb91f893dd.tar.xz
seems to compile ( tests comented out)
Diffstat (limited to 'OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs')
-rw-r--r--OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs60
1 files changed, 2 insertions, 58 deletions
diff --git a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
index 795ca2e..24f802e 100644
--- a/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Asset/AssetServicesConnector.cs
@@ -275,18 +275,11 @@ namespace OpenSim.Services.Connectors
275 return fullAsset.Data; 275 return fullAsset.Data;
276 } 276 }
277 277
278<<<<<<< HEAD 278 using (RestClient rc = new RestClient(MapServer(id)))
279 using (RestClient rc = new RestClient(m_ServerURI))
280 { 279 {
281 rc.AddResourcePath("assets"); 280 rc.AddResourcePath("assets");
282 rc.AddResourcePath(id); 281 rc.AddResourcePath(id);
283 rc.AddResourcePath("data"); 282 rc.AddResourcePath("data");
284=======
285 RestClient rc = new RestClient(MapServer(id));
286 rc.AddResourcePath("assets");
287 rc.AddResourcePath(id);
288 rc.AddResourcePath("data");
289>>>>>>> avn/ubitvar
290 283
291 rc.RequestMethod = "GET"; 284 rc.RequestMethod = "GET";
292 285
@@ -300,20 +293,11 @@ namespace OpenSim.Services.Connectors
300 byte[] ret = new byte[s.Length]; 293 byte[] ret = new byte[s.Length];
301 s.Read(ret, 0, (int)s.Length); 294 s.Read(ret, 0, (int)s.Length);
302 295
303<<<<<<< HEAD
304 return ret; 296 return ret;
305 } 297 }
306 298
307 return null; 299 return null;
308 } 300 }
309=======
310 s.Close();
311 return ret;
312 }
313
314 s.Close();
315 return null;
316>>>>>>> avn/ubitvar
317 } 301 }
318 302
319 private class QueuedAssetRequest 303 private class QueuedAssetRequest
@@ -348,24 +332,13 @@ namespace OpenSim.Services.Connectors
348 List<AssetRetrievedEx> handlers; 332 List<AssetRetrievedEx> handlers;
349 lock (m_AssetHandlers) 333 lock (m_AssetHandlers)
350 { 334 {
351<<<<<<< HEAD
352 if (a != null && m_Cache != null)
353 m_Cache.Cache(a);
354=======
355 handlers = m_AssetHandlers[id]; 335 handlers = m_AssetHandlers[id];
356 m_AssetHandlers.Remove(id); 336 m_AssetHandlers.Remove(id);
357 } 337 }
358>>>>>>> avn/ubitvar
359 338
360 Util.FireAndForget(x => 339 Util.FireAndForget(x =>
361 { 340 {
362<<<<<<< HEAD 341
363 handlers = m_AssetHandlers[id];
364 m_AssetHandlers.Remove(id);
365 }
366 handlers.Invoke(a);
367 }, m_maxAssetRequestConcurrency, m_Auth);
368=======
369 foreach (AssetRetrievedEx h in handlers) 342 foreach (AssetRetrievedEx h in handlers)
370 { 343 {
371 // Util.FireAndForget(x => 344 // Util.FireAndForget(x =>
@@ -382,8 +355,6 @@ namespace OpenSim.Services.Connectors
382 355
383// if (handlers != null) 356// if (handlers != null)
384// handlers.Clear(); 357// handlers.Clear();
385>>>>>>> avn/ubitvar
386
387 success = true; 358 success = true;
388 } 359 }
389 } 360 }
@@ -510,32 +481,6 @@ namespace OpenSim.Services.Connectors
510 string newID; 481 string newID;
511 try 482 try
512 { 483 {
513<<<<<<< HEAD
514 newID = SynchronousRestObjectRequester.MakeRequest<AssetBase, string>("POST", uri, asset, m_Auth);
515 }
516 catch (Exception e)
517 {
518 m_log.Warn(string.Format("[ASSET CONNECTOR]: Unable to send asset {0} to asset server. Reason: {1} ", asset.ID, e.Message), e);
519 return string.Empty;
520 }
521
522 // TEMPORARY: SRAS returns 'null' when it's asked to store existing assets
523 if (newID == null)
524 {
525 m_log.DebugFormat("[ASSET CONNECTOR]: Storing of asset {0} returned null; assuming the asset already exists", asset.ID);
526 return asset.ID;
527 }
528
529 if (string.IsNullOrEmpty(newID))
530 return string.Empty;
531
532 asset.ID = newID;
533
534 if (m_Cache != null)
535 m_Cache.Cache(asset);
536
537 return newID;
538=======
539 newID = SynchronousRestObjectRequester. 484 newID = SynchronousRestObjectRequester.
540 MakeRequest<AssetBase, string>("POST", uri, asset, 25); 485 MakeRequest<AssetBase, string>("POST", uri, asset, 25);
541 if (newID == null || newID == "") 486 if (newID == null || newID == "")
@@ -588,7 +533,6 @@ namespace OpenSim.Services.Connectors
588 } 533 }
589 } 534 }
590 return asset.ID; 535 return asset.ID;
591>>>>>>> avn/ubitvar
592 } 536 }
593 537
594 public bool UpdateContent(string id, byte[] data) 538 public bool UpdateContent(string id, byte[] data)