diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | 21 |
1 files changed, 14 insertions, 7 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; |