aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie Thielker2014-09-20 20:42:07 +0200
committerMelanie Thielker2014-09-20 20:42:07 +0200
commit4002cd96a52eaefa94e1fe032c90826b5210bb9a (patch)
treee537c372aeacf1ff584064255a71203e05f84ab5 /OpenSim
parentexclude npcs from baked cache (diff)
downloadopensim-SC_OLD-4002cd96a52eaefa94e1fe032c90826b5210bb9a.zip
opensim-SC_OLD-4002cd96a52eaefa94e1fe032c90826b5210bb9a.tar.gz
opensim-SC_OLD-4002cd96a52eaefa94e1fe032c90826b5210bb9a.tar.bz2
opensim-SC_OLD-4002cd96a52eaefa94e1fe032c90826b5210bb9a.tar.xz
When sending http requests, close the response stream instead of waiting
for the finalizer to do it, if it ever does.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
index 5541063..d27869a 100644
--- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
+++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs
@@ -465,6 +465,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
465 public void SendRequest() 465 public void SendRequest()
466 { 466 {
467 HttpWebResponse response = null; 467 HttpWebResponse response = null;
468 Stream resStream = null;
468 StringBuilder sb = new StringBuilder(); 469 StringBuilder sb = new StringBuilder();
469 byte[] buf = new byte[8192]; 470 byte[] buf = new byte[8192];
470 string tempString = null; 471 string tempString = null;
@@ -547,7 +548,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
547 548
548 Status = (int)response.StatusCode; 549 Status = (int)response.StatusCode;
549 550
550 Stream resStream = response.GetResponseStream(); 551 resStream = response.GetResponseStream();
551 552
552 do 553 do
553 { 554 {
@@ -605,6 +606,8 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
605 } 606 }
606 finally 607 finally
607 { 608 {
609 if (resStream != null)
610 resStream.Close();
608 if (response != null) 611 if (response != null)
609 response.Close(); 612 response.Close();
610 } 613 }