aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Avatar/Voice
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/Voice')
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs21
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs12
2 files changed, 19 insertions, 14 deletions
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index f292a75..0cec959 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -551,13 +551,20 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
551 reqStream.Close(); 551 reqStream.Close();
552 } 552 }
553 553
554 HttpWebResponse fwdrsp = (HttpWebResponse)forwardreq.GetResponse(); 554 using (HttpWebResponse fwdrsp = (HttpWebResponse)forwardreq.GetResponse())
555 Encoding encoding = Util.UTF8; 555 {
556 StreamReader fwdresponsestream = new StreamReader(fwdrsp.GetResponseStream(), encoding); 556 Encoding encoding = Util.UTF8;
557 fwdresponsestr = fwdresponsestream.ReadToEnd(); 557
558 fwdresponsecontenttype = fwdrsp.ContentType; 558 using (Stream s = fwdrsp.GetResponseStream())
559 fwdresponsecode = (int)fwdrsp.StatusCode; 559 {
560 fwdresponsestream.Close(); 560 using (StreamReader fwdresponsestream = new StreamReader(s))
561 {
562 fwdresponsestr = fwdresponsestream.ReadToEnd();
563 fwdresponsecontenttype = fwdrsp.ContentType;
564 fwdresponsecode = (int)fwdrsp.StatusCode;
565 }
566 }
567 }
561 568
562 response["content_type"] = fwdresponsecontenttype; 569 response["content_type"] = fwdresponsecontenttype;
563 response["str_response_string"] = fwdresponsestr; 570 response["str_response_string"] = fwdresponsestr;
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
index 7da1de6..e756c70 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
@@ -1123,18 +1123,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1123 // Otherwise prepare the request 1123 // Otherwise prepare the request
1124// m_log.DebugFormat("[VivoxVoice] Sending request <{0}>", requrl); 1124// m_log.DebugFormat("[VivoxVoice] Sending request <{0}>", requrl);
1125 1125
1126 HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requrl); 1126 HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requrl);
1127 HttpWebResponse rsp = null;
1128 1127
1129 // We are sending just parameters, no content 1128 // We are sending just parameters, no content
1130 req.ContentLength = 0; 1129 req.ContentLength = 0;
1131 1130
1132 // Send request and retrieve the response 1131 // Send request and retrieve the response
1133 rsp = (HttpWebResponse)req.GetResponse(); 1132 using (HttpWebResponse rsp = (HttpWebResponse)req.GetResponse())
1134 1133 using (Stream s = rsp.GetResponseStream())
1135 XmlTextReader rdr = new XmlTextReader(rsp.GetResponseStream()); 1134 using (XmlTextReader rdr = new XmlTextReader(s))
1136 doc.Load(rdr); 1135 doc.Load(rdr);
1137 rdr.Close();
1138 } 1136 }
1139 catch (Exception e) 1137 catch (Exception e)
1140 { 1138 {