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()
|
||||
{
|
||||
HttpWebResponse response = null;
|
||||
Stream resStream = null;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
byte[] buf = new byte[8192];
|
||||
string tempString = null;
|
||||
|
@ -547,7 +548,7 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
|||
|
||||
Status = (int)response.StatusCode;
|
||||
|
||||
Stream resStream = response.GetResponseStream();
|
||||
resStream = response.GetResponseStream();
|
||||
|
||||
do
|
||||
{
|
||||
|
@ -605,6 +606,8 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
|||
}
|
||||
finally
|
||||
{
|
||||
if (resStream != null)
|
||||
resStream.Close();
|
||||
if (response != null)
|
||||
response.Close();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue