When sending http requests, close the response stream instead of waiting
for the finalizer to do it, if it ever does.avinationmerge
parent
9c552212a9
commit
4002cd96a5
|
@ -465,6 +465,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||||
public void SendRequest()
|
public void SendRequest()
|
||||||
{
|
{
|
||||||
HttpWebResponse response = null;
|
HttpWebResponse response = null;
|
||||||
|
Stream resStream = null;
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
byte[] buf = new byte[8192];
|
byte[] buf = new byte[8192];
|
||||||
string tempString = null;
|
string tempString = null;
|
||||||
|
@ -547,7 +548,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||||
|
|
||||||
Status = (int)response.StatusCode;
|
Status = (int)response.StatusCode;
|
||||||
|
|
||||||
Stream resStream = response.GetResponseStream();
|
resStream = response.GetResponseStream();
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -605,6 +606,8 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
if (resStream != null)
|
||||||
|
resStream.Close();
|
||||||
if (response != null)
|
if (response != null)
|
||||||
response.Close();
|
response.Close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue