diff options
Diffstat (limited to 'OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs')
-rw-r--r-- | OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs index 3dce578..6681c37 100644 --- a/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs +++ b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs | |||
@@ -65,23 +65,27 @@ namespace OpenSim.Framework.Configuration.HTTP | |||
65 | byte[] buf = new byte[8192]; | 65 | byte[] buf = new byte[8192]; |
66 | HttpWebRequest request = | 66 | HttpWebRequest request = |
67 | (HttpWebRequest) WebRequest.Create(remoteConfigSettings.baseConfigURL + configFileName); | 67 | (HttpWebRequest) WebRequest.Create(remoteConfigSettings.baseConfigURL + configFileName); |
68 | HttpWebResponse response = (HttpWebResponse) request.GetResponse(); | 68 | using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) |
69 | |||
70 | Stream resStream = response.GetResponseStream(); | ||
71 | |||
72 | string tempString = null; | ||
73 | int count = 0; | ||
74 | |||
75 | do | ||
76 | { | 69 | { |
77 | count = resStream.Read(buf, 0, buf.Length); | 70 | using (Stream resStream = response.GetResponseStream()) |
78 | if (count != 0) | ||
79 | { | 71 | { |
80 | tempString = Util.UTF8.GetString(buf, 0, count); | 72 | string tempString = null; |
81 | sb.Append(tempString); | 73 | int count = 0; |
74 | |||
75 | do | ||
76 | { | ||
77 | count = resStream.Read(buf, 0, buf.Length); | ||
78 | if (count != 0) | ||
79 | { | ||
80 | tempString = Util.UTF8.GetString(buf, 0, count); | ||
81 | sb.Append(tempString); | ||
82 | } | ||
83 | } | ||
84 | while (count > 0); | ||
85 | |||
86 | LoadDataFromString(sb.ToString()); | ||
82 | } | 87 | } |
83 | } while (count > 0); | 88 | } |
84 | LoadDataFromString(sb.ToString()); | ||
85 | } | 89 | } |
86 | catch (WebException) | 90 | catch (WebException) |
87 | { | 91 | { |