diff options
author | Melanie | 2009-10-08 10:32:15 +0100 |
---|---|---|
committer | Melanie | 2009-10-08 10:32:15 +0100 |
commit | f6b8bac0fab3dfc3d25775e51bb89ee10feebb53 (patch) | |
tree | de16f4c7c14fce6851a4cd9c80117d1cbdd4b38e /OpenSim/Framework/Communications | |
parent | Correct a build break caused by an optimization in trunk (diff) | |
parent | Remove ThreadTrackerTest. It's no longer relevant because the thread (diff) | |
download | opensim-SC-f6b8bac0fab3dfc3d25775e51bb89ee10feebb53.zip opensim-SC-f6b8bac0fab3dfc3d25775e51bb89ee10feebb53.tar.gz opensim-SC-f6b8bac0fab3dfc3d25775e51bb89ee10feebb53.tar.bz2 opensim-SC-f6b8bac0fab3dfc3d25775e51bb89ee10feebb53.tar.xz |
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Framework/Communications')
-rw-r--r-- | OpenSim/Framework/Communications/Clients/RegionClient.cs | 79 |
1 files changed, 62 insertions, 17 deletions
diff --git a/OpenSim/Framework/Communications/Clients/RegionClient.cs b/OpenSim/Framework/Communications/Clients/RegionClient.cs index 10be069..220a9b6 100644 --- a/OpenSim/Framework/Communications/Clients/RegionClient.cs +++ b/OpenSim/Framework/Communications/Clients/RegionClient.cs | |||
@@ -124,9 +124,11 @@ namespace OpenSim.Framework.Communications.Clients | |||
124 | // Let's wait for the response | 124 | // Let's wait for the response |
125 | //m_log.Info("[REST COMMS]: Waiting for a reply after DoCreateChildAgentCall"); | 125 | //m_log.Info("[REST COMMS]: Waiting for a reply after DoCreateChildAgentCall"); |
126 | 126 | ||
127 | WebResponse webResponse = null; | ||
128 | StreamReader sr = null; | ||
127 | try | 129 | try |
128 | { | 130 | { |
129 | WebResponse webResponse = AgentCreateRequest.GetResponse(); | 131 | webResponse = AgentCreateRequest.GetResponse(); |
130 | if (webResponse == null) | 132 | if (webResponse == null) |
131 | { | 133 | { |
132 | m_log.Info("[REST COMMS]: Null reply on DoCreateChildAgentCall post"); | 134 | m_log.Info("[REST COMMS]: Null reply on DoCreateChildAgentCall post"); |
@@ -134,11 +136,10 @@ namespace OpenSim.Framework.Communications.Clients | |||
134 | else | 136 | else |
135 | { | 137 | { |
136 | 138 | ||
137 | StreamReader sr = new StreamReader(webResponse.GetResponseStream()); | 139 | sr = new StreamReader(webResponse.GetResponseStream()); |
138 | string response = sr.ReadToEnd().Trim(); | 140 | string response = sr.ReadToEnd().Trim(); |
139 | sr.Close(); | ||
140 | m_log.InfoFormat("[REST COMMS]: DoCreateChildAgentCall reply was {0} ", response); | 141 | m_log.InfoFormat("[REST COMMS]: DoCreateChildAgentCall reply was {0} ", response); |
141 | 142 | ||
142 | if (!String.IsNullOrEmpty(response)) | 143 | if (!String.IsNullOrEmpty(response)) |
143 | { | 144 | { |
144 | try | 145 | try |
@@ -167,6 +168,11 @@ namespace OpenSim.Framework.Communications.Clients | |||
167 | m_log.InfoFormat("[REST COMMS]: exception on reply of DoCreateChildAgentCall {0}", ex.Message); | 168 | m_log.InfoFormat("[REST COMMS]: exception on reply of DoCreateChildAgentCall {0}", ex.Message); |
168 | // ignore, really | 169 | // ignore, really |
169 | } | 170 | } |
171 | finally | ||
172 | { | ||
173 | if (sr != null) | ||
174 | sr.Close(); | ||
175 | } | ||
170 | 176 | ||
171 | return true; | 177 | return true; |
172 | 178 | ||
@@ -246,15 +252,17 @@ namespace OpenSim.Framework.Communications.Clients | |||
246 | // Let's wait for the response | 252 | // Let's wait for the response |
247 | //m_log.Info("[REST COMMS]: Waiting for a reply after ChildAgentUpdate"); | 253 | //m_log.Info("[REST COMMS]: Waiting for a reply after ChildAgentUpdate"); |
248 | 254 | ||
255 | WebResponse webResponse = null; | ||
256 | StreamReader sr = null; | ||
249 | try | 257 | try |
250 | { | 258 | { |
251 | WebResponse webResponse = ChildUpdateRequest.GetResponse(); | 259 | webResponse = ChildUpdateRequest.GetResponse(); |
252 | if (webResponse == null) | 260 | if (webResponse == null) |
253 | { | 261 | { |
254 | m_log.Info("[REST COMMS]: Null reply on ChilAgentUpdate post"); | 262 | m_log.Info("[REST COMMS]: Null reply on ChilAgentUpdate post"); |
255 | } | 263 | } |
256 | 264 | ||
257 | StreamReader sr = new StreamReader(webResponse.GetResponseStream()); | 265 | sr = new StreamReader(webResponse.GetResponseStream()); |
258 | //reply = sr.ReadToEnd().Trim(); | 266 | //reply = sr.ReadToEnd().Trim(); |
259 | sr.ReadToEnd().Trim(); | 267 | sr.ReadToEnd().Trim(); |
260 | sr.Close(); | 268 | sr.Close(); |
@@ -266,6 +274,11 @@ namespace OpenSim.Framework.Communications.Clients | |||
266 | m_log.InfoFormat("[REST COMMS]: exception on reply of ChilAgentUpdate {0}", ex.Message); | 274 | m_log.InfoFormat("[REST COMMS]: exception on reply of ChilAgentUpdate {0}", ex.Message); |
267 | // ignore, really | 275 | // ignore, really |
268 | } | 276 | } |
277 | finally | ||
278 | { | ||
279 | if (sr != null) | ||
280 | sr.Close(); | ||
281 | } | ||
269 | 282 | ||
270 | return true; | 283 | return true; |
271 | } | 284 | } |
@@ -284,6 +297,7 @@ namespace OpenSim.Framework.Communications.Clients | |||
284 | 297 | ||
285 | HttpWebResponse webResponse = null; | 298 | HttpWebResponse webResponse = null; |
286 | string reply = string.Empty; | 299 | string reply = string.Empty; |
300 | StreamReader sr = null; | ||
287 | try | 301 | try |
288 | { | 302 | { |
289 | webResponse = (HttpWebResponse)request.GetResponse(); | 303 | webResponse = (HttpWebResponse)request.GetResponse(); |
@@ -292,9 +306,8 @@ namespace OpenSim.Framework.Communications.Clients | |||
292 | m_log.Info("[REST COMMS]: Null reply on agent get "); | 306 | m_log.Info("[REST COMMS]: Null reply on agent get "); |
293 | } | 307 | } |
294 | 308 | ||
295 | StreamReader sr = new StreamReader(webResponse.GetResponseStream()); | 309 | sr = new StreamReader(webResponse.GetResponseStream()); |
296 | reply = sr.ReadToEnd().Trim(); | 310 | reply = sr.ReadToEnd().Trim(); |
297 | sr.Close(); | ||
298 | 311 | ||
299 | //Console.WriteLine("[REST COMMS]: ChilAgentUpdate reply was " + reply); | 312 | //Console.WriteLine("[REST COMMS]: ChilAgentUpdate reply was " + reply); |
300 | 313 | ||
@@ -305,6 +318,11 @@ namespace OpenSim.Framework.Communications.Clients | |||
305 | // ignore, really | 318 | // ignore, really |
306 | return false; | 319 | return false; |
307 | } | 320 | } |
321 | finally | ||
322 | { | ||
323 | if (sr != null) | ||
324 | sr.Close(); | ||
325 | } | ||
308 | 326 | ||
309 | if (webResponse.StatusCode == HttpStatusCode.OK) | 327 | if (webResponse.StatusCode == HttpStatusCode.OK) |
310 | { | 328 | { |
@@ -333,6 +351,7 @@ namespace OpenSim.Framework.Communications.Clients | |||
333 | request.Method = "DELETE"; | 351 | request.Method = "DELETE"; |
334 | request.Timeout = 10000; | 352 | request.Timeout = 10000; |
335 | 353 | ||
354 | StreamReader sr = null; | ||
336 | try | 355 | try |
337 | { | 356 | { |
338 | WebResponse webResponse = request.GetResponse(); | 357 | WebResponse webResponse = request.GetResponse(); |
@@ -341,7 +360,7 @@ namespace OpenSim.Framework.Communications.Clients | |||
341 | m_log.Info("[REST COMMS]: Null reply on agent delete "); | 360 | m_log.Info("[REST COMMS]: Null reply on agent delete "); |
342 | } | 361 | } |
343 | 362 | ||
344 | StreamReader sr = new StreamReader(webResponse.GetResponseStream()); | 363 | sr = new StreamReader(webResponse.GetResponseStream()); |
345 | //reply = sr.ReadToEnd().Trim(); | 364 | //reply = sr.ReadToEnd().Trim(); |
346 | sr.ReadToEnd().Trim(); | 365 | sr.ReadToEnd().Trim(); |
347 | sr.Close(); | 366 | sr.Close(); |
@@ -353,6 +372,11 @@ namespace OpenSim.Framework.Communications.Clients | |||
353 | m_log.InfoFormat("[REST COMMS]: exception on reply of agent delete {0}", ex.Message); | 372 | m_log.InfoFormat("[REST COMMS]: exception on reply of agent delete {0}", ex.Message); |
354 | // ignore, really | 373 | // ignore, really |
355 | } | 374 | } |
375 | finally | ||
376 | { | ||
377 | if (sr != null) | ||
378 | sr.Close(); | ||
379 | } | ||
356 | 380 | ||
357 | return true; | 381 | return true; |
358 | } | 382 | } |
@@ -377,6 +401,7 @@ namespace OpenSim.Framework.Communications.Clients | |||
377 | request.Method = "DELETE"; | 401 | request.Method = "DELETE"; |
378 | request.Timeout = 10000; | 402 | request.Timeout = 10000; |
379 | 403 | ||
404 | StreamReader sr = null; | ||
380 | try | 405 | try |
381 | { | 406 | { |
382 | WebResponse webResponse = request.GetResponse(); | 407 | WebResponse webResponse = request.GetResponse(); |
@@ -385,7 +410,7 @@ namespace OpenSim.Framework.Communications.Clients | |||
385 | m_log.Info("[REST COMMS]: Null reply on agent delete "); | 410 | m_log.Info("[REST COMMS]: Null reply on agent delete "); |
386 | } | 411 | } |
387 | 412 | ||
388 | StreamReader sr = new StreamReader(webResponse.GetResponseStream()); | 413 | sr = new StreamReader(webResponse.GetResponseStream()); |
389 | //reply = sr.ReadToEnd().Trim(); | 414 | //reply = sr.ReadToEnd().Trim(); |
390 | sr.ReadToEnd().Trim(); | 415 | sr.ReadToEnd().Trim(); |
391 | sr.Close(); | 416 | sr.Close(); |
@@ -397,6 +422,11 @@ namespace OpenSim.Framework.Communications.Clients | |||
397 | m_log.InfoFormat("[REST COMMS]: exception on reply of agent delete {0}", ex.Message); | 422 | m_log.InfoFormat("[REST COMMS]: exception on reply of agent delete {0}", ex.Message); |
398 | // ignore, really | 423 | // ignore, really |
399 | } | 424 | } |
425 | finally | ||
426 | { | ||
427 | if (sr != null) | ||
428 | sr.Close(); | ||
429 | } | ||
400 | 430 | ||
401 | return true; | 431 | return true; |
402 | } | 432 | } |
@@ -463,6 +493,7 @@ namespace OpenSim.Framework.Communications.Clients | |||
463 | // Let's wait for the response | 493 | // Let's wait for the response |
464 | //m_log.Info("[REST COMMS]: Waiting for a reply after DoCreateChildAgentCall"); | 494 | //m_log.Info("[REST COMMS]: Waiting for a reply after DoCreateChildAgentCall"); |
465 | 495 | ||
496 | StreamReader sr = null; | ||
466 | try | 497 | try |
467 | { | 498 | { |
468 | WebResponse webResponse = ObjectCreateRequest.GetResponse(); | 499 | WebResponse webResponse = ObjectCreateRequest.GetResponse(); |
@@ -471,10 +502,9 @@ namespace OpenSim.Framework.Communications.Clients | |||
471 | m_log.Info("[REST COMMS]: Null reply on DoCreateObjectCall post"); | 502 | m_log.Info("[REST COMMS]: Null reply on DoCreateObjectCall post"); |
472 | } | 503 | } |
473 | 504 | ||
474 | StreamReader sr = new StreamReader(webResponse.GetResponseStream()); | 505 | sr = new StreamReader(webResponse.GetResponseStream()); |
475 | //reply = sr.ReadToEnd().Trim(); | 506 | //reply = sr.ReadToEnd().Trim(); |
476 | sr.ReadToEnd().Trim(); | 507 | sr.ReadToEnd().Trim(); |
477 | sr.Close(); | ||
478 | //m_log.InfoFormat("[REST COMMS]: DoCreateChildAgentCall reply was {0} ", reply); | 508 | //m_log.InfoFormat("[REST COMMS]: DoCreateChildAgentCall reply was {0} ", reply); |
479 | 509 | ||
480 | } | 510 | } |
@@ -483,6 +513,11 @@ namespace OpenSim.Framework.Communications.Clients | |||
483 | m_log.InfoFormat("[REST COMMS]: exception on reply of DoCreateObjectCall {0}", ex.Message); | 513 | m_log.InfoFormat("[REST COMMS]: exception on reply of DoCreateObjectCall {0}", ex.Message); |
484 | // ignore, really | 514 | // ignore, really |
485 | } | 515 | } |
516 | finally | ||
517 | { | ||
518 | if (sr != null) | ||
519 | sr.Close(); | ||
520 | } | ||
486 | 521 | ||
487 | return true; | 522 | return true; |
488 | 523 | ||
@@ -542,6 +577,7 @@ namespace OpenSim.Framework.Communications.Clients | |||
542 | // Let's wait for the response | 577 | // Let's wait for the response |
543 | //m_log.Info("[REST COMMS]: Waiting for a reply after DoCreateChildAgentCall"); | 578 | //m_log.Info("[REST COMMS]: Waiting for a reply after DoCreateChildAgentCall"); |
544 | 579 | ||
580 | StreamReader sr = null; | ||
545 | try | 581 | try |
546 | { | 582 | { |
547 | WebResponse webResponse = ObjectCreateRequest.GetResponse(); | 583 | WebResponse webResponse = ObjectCreateRequest.GetResponse(); |
@@ -550,11 +586,10 @@ namespace OpenSim.Framework.Communications.Clients | |||
550 | m_log.Info("[REST COMMS]: Null reply on DoCreateObjectCall post"); | 586 | m_log.Info("[REST COMMS]: Null reply on DoCreateObjectCall post"); |
551 | } | 587 | } |
552 | 588 | ||
553 | StreamReader sr = new StreamReader(webResponse.GetResponseStream()); | 589 | sr = new StreamReader(webResponse.GetResponseStream()); |
554 | sr.ReadToEnd().Trim(); | 590 | sr.ReadToEnd().Trim(); |
555 | sr.ReadToEnd().Trim(); | 591 | sr.ReadToEnd().Trim(); |
556 | sr.Close(); | 592 | |
557 | |||
558 | //m_log.InfoFormat("[REST COMMS]: DoCreateChildAgentCall reply was {0} ", reply); | 593 | //m_log.InfoFormat("[REST COMMS]: DoCreateChildAgentCall reply was {0} ", reply); |
559 | 594 | ||
560 | } | 595 | } |
@@ -563,6 +598,11 @@ namespace OpenSim.Framework.Communications.Clients | |||
563 | m_log.InfoFormat("[REST COMMS]: exception on reply of DoCreateObjectCall {0}", ex.Message); | 598 | m_log.InfoFormat("[REST COMMS]: exception on reply of DoCreateObjectCall {0}", ex.Message); |
564 | // ignore, really | 599 | // ignore, really |
565 | } | 600 | } |
601 | finally | ||
602 | { | ||
603 | if (sr != null) | ||
604 | sr.Close(); | ||
605 | } | ||
566 | 606 | ||
567 | return true; | 607 | return true; |
568 | 608 | ||
@@ -630,6 +670,7 @@ namespace OpenSim.Framework.Communications.Clients | |||
630 | // Let's wait for the response | 670 | // Let's wait for the response |
631 | //m_log.Info("[REST COMMS]: Waiting for a reply after DoHelloNeighbourCall"); | 671 | //m_log.Info("[REST COMMS]: Waiting for a reply after DoHelloNeighbourCall"); |
632 | 672 | ||
673 | StreamReader sr = null; | ||
633 | try | 674 | try |
634 | { | 675 | { |
635 | WebResponse webResponse = HelloNeighbourRequest.GetResponse(); | 676 | WebResponse webResponse = HelloNeighbourRequest.GetResponse(); |
@@ -638,10 +679,9 @@ namespace OpenSim.Framework.Communications.Clients | |||
638 | m_log.Info("[REST COMMS]: Null reply on DoHelloNeighbourCall post"); | 679 | m_log.Info("[REST COMMS]: Null reply on DoHelloNeighbourCall post"); |
639 | } | 680 | } |
640 | 681 | ||
641 | StreamReader sr = new StreamReader(webResponse.GetResponseStream()); | 682 | sr = new StreamReader(webResponse.GetResponseStream()); |
642 | //reply = sr.ReadToEnd().Trim(); | 683 | //reply = sr.ReadToEnd().Trim(); |
643 | sr.ReadToEnd().Trim(); | 684 | sr.ReadToEnd().Trim(); |
644 | sr.Close(); | ||
645 | //m_log.InfoFormat("[REST COMMS]: DoHelloNeighbourCall reply was {0} ", reply); | 685 | //m_log.InfoFormat("[REST COMMS]: DoHelloNeighbourCall reply was {0} ", reply); |
646 | 686 | ||
647 | } | 687 | } |
@@ -650,6 +690,11 @@ namespace OpenSim.Framework.Communications.Clients | |||
650 | m_log.InfoFormat("[REST COMMS]: exception on reply of DoHelloNeighbourCall {0}", ex.Message); | 690 | m_log.InfoFormat("[REST COMMS]: exception on reply of DoHelloNeighbourCall {0}", ex.Message); |
651 | // ignore, really | 691 | // ignore, really |
652 | } | 692 | } |
693 | finally | ||
694 | { | ||
695 | if (sr != null) | ||
696 | sr.Close(); | ||
697 | } | ||
653 | 698 | ||
654 | return true; | 699 | return true; |
655 | 700 | ||