aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorDiva Canto2014-12-25 08:01:50 -0800
committerDiva Canto2014-12-25 08:01:50 -0800
commit27c34b69bf5960e02b087f9f298dcbe19f03b142 (patch)
treef299009958858da9db464dcbc84bd03beae0ca15 /OpenSim/Framework
parentRevert "Update libomv to grab latest bug fixes for Collada upload." (diff)
parentIf a moap entry has EnableWhiteList but WhiteList == null, then properly bloc... (diff)
downloadopensim-SC_OLD-27c34b69bf5960e02b087f9f298dcbe19f03b142.zip
opensim-SC_OLD-27c34b69bf5960e02b087f9f298dcbe19f03b142.tar.gz
opensim-SC_OLD-27c34b69bf5960e02b087f9f298dcbe19f03b142.tar.bz2
opensim-SC_OLD-27c34b69bf5960e02b087f9f298dcbe19f03b142.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/Communications/RestClient.cs58
-rw-r--r--OpenSim/Framework/ISceneObject.cs2
2 files changed, 33 insertions, 27 deletions
diff --git a/OpenSim/Framework/Communications/RestClient.cs b/OpenSim/Framework/Communications/RestClient.cs
index 72018e4..6f517b6 100644
--- a/OpenSim/Framework/Communications/RestClient.cs
+++ b/OpenSim/Framework/Communications/RestClient.cs
@@ -90,7 +90,7 @@ namespace OpenSim.Framework.Communications
90 private byte[] _readbuf; 90 private byte[] _readbuf;
91 91
92 /// <summary> 92 /// <summary>
93 /// MemoryStream representing the resultiong resource 93 /// MemoryStream representing the resulting resource
94 /// </summary> 94 /// </summary>
95 private Stream _resource; 95 private Stream _resource;
96 96
@@ -352,42 +352,46 @@ namespace OpenSim.Framework.Communications
352 m_log.DebugFormat("[LOGHTTP]: HTTP OUT {0} REST {1} to {2}", reqnum, _request.Method, _request.RequestUri); 352 m_log.DebugFormat("[LOGHTTP]: HTTP OUT {0} REST {1} to {2}", reqnum, _request.Method, _request.RequestUri);
353 353
354// IAsyncResult responseAsyncResult = _request.BeginGetResponse(new AsyncCallback(ResponseIsReadyDelegate), _request); 354// IAsyncResult responseAsyncResult = _request.BeginGetResponse(new AsyncCallback(ResponseIsReadyDelegate), _request);
355
355 try 356 try
356 { 357 {
357 _response = (HttpWebResponse) _request.GetResponse(); 358 using (_response = (HttpWebResponse) _request.GetResponse())
359 {
360 using (Stream src = _response.GetResponseStream())
361 {
362 int length = src.Read(_readbuf, 0, BufferSize);
363 while (length > 0)
364 {
365 _resource.Write(_readbuf, 0, length);
366 length = src.Read(_readbuf, 0, BufferSize);
367 }
368
369 // TODO! Implement timeout, without killing the server
370 // this line implements the timeout, if there is a timeout, the callback fires and the request becomes aborted
371 //ThreadPool.RegisterWaitForSingleObject(responseAsyncResult.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), _request, DefaultTimeout, true);
372
373 // _allDone.WaitOne();
374 }
375 }
358 } 376 }
359 catch (WebException e) 377 catch (WebException e)
360 { 378 {
361 HttpWebResponse errorResponse = e.Response as HttpWebResponse; 379 using (HttpWebResponse errorResponse = e.Response as HttpWebResponse)
362 if (null != errorResponse && HttpStatusCode.NotFound == errorResponse.StatusCode)
363 {
364 // This is often benign. E.g., requesting a missing asset will return 404.
365 m_log.DebugFormat("[REST CLIENT] Resource not found (404): {0}", _request.Address.ToString());
366 }
367 else
368 { 380 {
369 m_log.Error(string.Format("[REST CLIENT] Error fetching resource from server: {0} ", _request.Address.ToString()), e); 381 if (null != errorResponse && HttpStatusCode.NotFound == errorResponse.StatusCode)
382 {
383 // This is often benign. E.g., requesting a missing asset will return 404.
384 m_log.DebugFormat("[REST CLIENT] Resource not found (404): {0}", _request.Address.ToString());
385 }
386 else
387 {
388 m_log.Error(string.Format("[REST CLIENT] Error fetching resource from server: {0} ", _request.Address.ToString()), e);
389 }
370 } 390 }
371 391
372 return null; 392 return null;
373 } 393 }
374 394
375 Stream src = _response.GetResponseStream();
376 int length = src.Read(_readbuf, 0, BufferSize);
377 while (length > 0)
378 {
379 _resource.Write(_readbuf, 0, length);
380 length = src.Read(_readbuf, 0, BufferSize);
381 }
382
383
384 // TODO! Implement timeout, without killing the server
385 // this line implements the timeout, if there is a timeout, the callback fires and the request becomes aborted
386 //ThreadPool.RegisterWaitForSingleObject(responseAsyncResult.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), _request, DefaultTimeout, true);
387
388// _allDone.WaitOne();
389 if (_response != null)
390 _response.Close();
391 if (_asyncException != null) 395 if (_asyncException != null)
392 throw _asyncException; 396 throw _asyncException;
393 397
@@ -515,4 +519,4 @@ namespace OpenSim.Framework.Communications
515 519
516 #endregion Async Invocation 520 #endregion Async Invocation
517 } 521 }
518} 522} \ No newline at end of file
diff --git a/OpenSim/Framework/ISceneObject.cs b/OpenSim/Framework/ISceneObject.cs
index afac9b8..754b77b 100644
--- a/OpenSim/Framework/ISceneObject.cs
+++ b/OpenSim/Framework/ISceneObject.cs
@@ -32,6 +32,8 @@ namespace OpenSim.Framework
32{ 32{
33 public interface ISceneObject 33 public interface ISceneObject
34 { 34 {
35 string Name { get; }
36
35 UUID UUID { get; } 37 UUID UUID { get; }
36 38
37 /// <summary> 39 /// <summary>