diff options
author | UbitUmarov | 2017-05-07 00:47:45 +0100 |
---|---|---|
committer | UbitUmarov | 2017-05-07 00:47:45 +0100 |
commit | d0912b61516914f810ba306641aaaa813134462e (patch) | |
tree | fc2592d3f9514badd547ab0bad6cf6c4b6097f05 /OpenSim/Server | |
parent | oops closed too soon (diff) | |
download | opensim-SC-d0912b61516914f810ba306641aaaa813134462e.zip opensim-SC-d0912b61516914f810ba306641aaaa813134462e.tar.gz opensim-SC-d0912b61516914f810ba306641aaaa813134462e.tar.bz2 opensim-SC-d0912b61516914f810ba306641aaaa813134462e.tar.xz |
let StreamReader be in using statements
Diffstat (limited to 'OpenSim/Server')
13 files changed, 41 insertions, 39 deletions
diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs index d3ea7e2..4f03cf4 100644 --- a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs | |||
@@ -82,11 +82,11 @@ namespace OpenSim.Server.Handlers.Authentication | |||
82 | switch (p[0]) | 82 | switch (p[0]) |
83 | { | 83 | { |
84 | case "plain": | 84 | case "plain": |
85 | StreamReader sr = new StreamReader(request); | 85 | string body; |
86 | string body = sr.ReadToEnd(); | 86 | using(StreamReader sr = new StreamReader(request)) |
87 | sr.Close(); | 87 | body = sr.ReadToEnd(); |
88 | |||
89 | return DoPlainMethods(body); | 88 | return DoPlainMethods(body); |
89 | |||
90 | case "crypt": | 90 | case "crypt": |
91 | byte[] buffer = new byte[request.Length]; | 91 | byte[] buffer = new byte[request.Length]; |
92 | long length = request.Length; | 92 | long length = request.Length; |
diff --git a/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs b/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs index a6605a1..254b82f 100644 --- a/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs +++ b/OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs | |||
@@ -222,7 +222,10 @@ For more information, see <a href='http://openid.net/'>http://openid.net/</a>. | |||
222 | 222 | ||
223 | try | 223 | try |
224 | { | 224 | { |
225 | NameValueCollection postQuery = HttpUtility.ParseQueryString(new StreamReader(httpRequest.InputStream).ReadToEnd()); | 225 | string forPost; |
226 | using(StreamReader sr = new StreamReader(httpRequest.InputStream)) | ||
227 | forPost = sr.ReadToEnd(); | ||
228 | NameValueCollection postQuery = HttpUtility.ParseQueryString(forPost); | ||
226 | NameValueCollection getQuery = HttpUtility.ParseQueryString(httpRequest.Url.Query); | 229 | NameValueCollection getQuery = HttpUtility.ParseQueryString(httpRequest.Url.Query); |
227 | NameValueCollection openIdQuery = (postQuery.GetValues("openid.mode") != null ? postQuery : getQuery); | 230 | NameValueCollection openIdQuery = (postQuery.GetValues("openid.mode") != null ? postQuery : getQuery); |
228 | 231 | ||
diff --git a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs index 69c1a89..b8fdacf 100644 --- a/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Avatar/AvatarServerPostHandler.cs | |||
@@ -60,9 +60,9 @@ namespace OpenSim.Server.Handlers.Avatar | |||
60 | protected override byte[] ProcessRequest(string path, Stream requestData, | 60 | protected override byte[] ProcessRequest(string path, Stream requestData, |
61 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 61 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
62 | { | 62 | { |
63 | StreamReader sr = new StreamReader(requestData); | 63 | string body; |
64 | string body = sr.ReadToEnd(); | 64 | using(StreamReader sr = new StreamReader(requestData)) |
65 | sr.Close(); | 65 | body = sr.ReadToEnd(); |
66 | body = body.Trim(); | 66 | body = body.Trim(); |
67 | 67 | ||
68 | //m_log.DebugFormat("[XXX]: query String: {0}", body); | 68 | //m_log.DebugFormat("[XXX]: query String: {0}", body); |
diff --git a/OpenSim/Server/Handlers/BakedTextures/XBakesPostHandler.cs b/OpenSim/Server/Handlers/BakedTextures/XBakesPostHandler.cs index 24f63d9..d16000d 100644 --- a/OpenSim/Server/Handlers/BakedTextures/XBakesPostHandler.cs +++ b/OpenSim/Server/Handlers/BakedTextures/XBakesPostHandler.cs | |||
@@ -65,10 +65,8 @@ namespace OpenSim.Server.Handlers.BakedTextures | |||
65 | return new byte[0]; | 65 | return new byte[0]; |
66 | } | 66 | } |
67 | 67 | ||
68 | StreamReader sr = new StreamReader(request); | 68 | using(StreamReader sr = new StreamReader(request)) |
69 | 69 | m_BakesService.Store(p[0],sr.ReadToEnd()); | |
70 | m_BakesService.Store(p[0], sr.ReadToEnd()); | ||
71 | sr.Close(); | ||
72 | 70 | ||
73 | return new byte[0]; | 71 | return new byte[0]; |
74 | } | 72 | } |
diff --git a/OpenSim/Server/Handlers/Estate/EstateDataRobustConnector.cs b/OpenSim/Server/Handlers/Estate/EstateDataRobustConnector.cs index e0c2810..b7558ec 100644 --- a/OpenSim/Server/Handlers/Estate/EstateDataRobustConnector.cs +++ b/OpenSim/Server/Handlers/Estate/EstateDataRobustConnector.cs | |||
@@ -282,9 +282,10 @@ namespace OpenSim.Server.Handlers | |||
282 | // /estates/estate/?eid=int®ion=uuid | 282 | // /estates/estate/?eid=int®ion=uuid |
283 | if ("estate".Equals(resource)) | 283 | if ("estate".Equals(resource)) |
284 | { | 284 | { |
285 | StreamReader sr = new StreamReader(request); | 285 | string body; |
286 | string body = sr.ReadToEnd(); | 286 | using(StreamReader sr = new StreamReader(request)) |
287 | sr.Close(); | 287 | body = sr.ReadToEnd(); |
288 | |||
288 | body = body.Trim(); | 289 | body = body.Trim(); |
289 | 290 | ||
290 | Dictionary<string, object> requestData = ServerUtils.ParseQueryString(body); | 291 | Dictionary<string, object> requestData = ServerUtils.ParseQueryString(body); |
diff --git a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs index 3aab30b..d6668ab 100644 --- a/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Friends/FriendsServerPostHandler.cs | |||
@@ -61,9 +61,9 @@ namespace OpenSim.Server.Handlers.Friends | |||
61 | protected override byte[] ProcessRequest(string path, Stream requestData, | 61 | protected override byte[] ProcessRequest(string path, Stream requestData, |
62 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 62 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
63 | { | 63 | { |
64 | StreamReader sr = new StreamReader(requestData); | 64 | string body; |
65 | string body = sr.ReadToEnd(); | 65 | using(StreamReader sr = new StreamReader(requestData)) |
66 | sr.Close(); | 66 | body = sr.ReadToEnd(); |
67 | body = body.Trim(); | 67 | body = body.Trim(); |
68 | 68 | ||
69 | //m_log.DebugFormat("[XXX]: query String: {0}", body); | 69 | //m_log.DebugFormat("[XXX]: query String: {0}", body); |
diff --git a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs index f51c4ee..44d4654 100644 --- a/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Grid/GridServerPostHandler.cs | |||
@@ -65,9 +65,9 @@ namespace OpenSim.Server.Handlers.Grid | |||
65 | protected override byte[] ProcessRequest(string path, Stream requestData, | 65 | protected override byte[] ProcessRequest(string path, Stream requestData, |
66 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 66 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
67 | { | 67 | { |
68 | StreamReader sr = new StreamReader(requestData); | 68 | string body; |
69 | string body = sr.ReadToEnd(); | 69 | using(StreamReader sr = new StreamReader(requestData)) |
70 | sr.Close(); | 70 | body = sr.ReadToEnd(); |
71 | body = body.Trim(); | 71 | body = body.Trim(); |
72 | 72 | ||
73 | //m_log.DebugFormat("[XXX]: query String: {0}", body); | 73 | //m_log.DebugFormat("[XXX]: query String: {0}", body); |
diff --git a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs index 8806c2c..1f691d6 100644 --- a/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs +++ b/OpenSim/Server/Handlers/GridUser/GridUserServerPostHandler.cs | |||
@@ -60,9 +60,9 @@ namespace OpenSim.Server.Handlers.GridUser | |||
60 | protected override byte[] ProcessRequest(string path, Stream requestData, | 60 | protected override byte[] ProcessRequest(string path, Stream requestData, |
61 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 61 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
62 | { | 62 | { |
63 | StreamReader sr = new StreamReader(requestData); | 63 | string body; |
64 | string body = sr.ReadToEnd(); | 64 | using(StreamReader sr = new StreamReader(requestData)) |
65 | sr.Close(); | 65 | body = sr.ReadToEnd(); |
66 | body = body.Trim(); | 66 | body = body.Trim(); |
67 | 67 | ||
68 | //m_log.DebugFormat("[XXX]: query String: {0}", body); | 68 | //m_log.DebugFormat("[XXX]: query String: {0}", body); |
diff --git a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs index 8116050..fc1a77d 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs | |||
@@ -71,9 +71,9 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
71 | protected override byte[] ProcessRequest(string path, Stream requestData, | 71 | protected override byte[] ProcessRequest(string path, Stream requestData, |
72 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 72 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
73 | { | 73 | { |
74 | StreamReader sr = new StreamReader(requestData); | 74 | string body; |
75 | string body = sr.ReadToEnd(); | 75 | using(StreamReader sr = new StreamReader(requestData)) |
76 | sr.Close(); | 76 | body = sr.ReadToEnd(); |
77 | body = body.Trim(); | 77 | body = body.Trim(); |
78 | 78 | ||
79 | //m_log.DebugFormat("[XXX]: query String: {0}", body); | 79 | //m_log.DebugFormat("[XXX]: query String: {0}", body); |
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index 4400395..742d1a0 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | |||
@@ -95,9 +95,9 @@ namespace OpenSim.Server.Handlers.Inventory | |||
95 | protected override byte[] ProcessRequest(string path, Stream requestData, | 95 | protected override byte[] ProcessRequest(string path, Stream requestData, |
96 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 96 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
97 | { | 97 | { |
98 | StreamReader sr = new StreamReader(requestData); | 98 | string body; |
99 | string body = sr.ReadToEnd(); | 99 | using(StreamReader sr = new StreamReader(requestData)) |
100 | sr.Close(); | 100 | body = sr.ReadToEnd(); |
101 | body = body.Trim(); | 101 | body = body.Trim(); |
102 | 102 | ||
103 | //m_log.DebugFormat("[XXX]: query String: {0}", body); | 103 | //m_log.DebugFormat("[XXX]: query String: {0}", body); |
diff --git a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs index 7611f53..bfd73a2 100644 --- a/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapAddServerConnector.cs | |||
@@ -104,9 +104,9 @@ namespace OpenSim.Server.Handlers.MapImage | |||
104 | protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 104 | protected override byte[] ProcessRequest(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
105 | { | 105 | { |
106 | // m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path); | 106 | // m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path); |
107 | StreamReader sr = new StreamReader(requestData); | 107 | string body; |
108 | string body = sr.ReadToEnd(); | 108 | using(StreamReader sr = new StreamReader(requestData)) |
109 | sr.Close(); | 109 | body = sr.ReadToEnd(); |
110 | body = body.Trim(); | 110 | body = body.Trim(); |
111 | 111 | ||
112 | try | 112 | try |
diff --git a/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs b/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs index ffd8ef6..8a3875d 100644 --- a/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs +++ b/OpenSim/Server/Handlers/Map/MapRemoveServerConnector.cs | |||
@@ -102,9 +102,9 @@ namespace OpenSim.Server.Handlers.MapImage | |||
102 | public override byte[] Handle(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 102 | public override byte[] Handle(string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
103 | { | 103 | { |
104 | // m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path); | 104 | // m_log.DebugFormat("[MAP SERVICE IMAGE HANDLER]: Received {0}", path); |
105 | StreamReader sr = new StreamReader(requestData); | 105 | string body; |
106 | string body = sr.ReadToEnd(); | 106 | using(StreamReader sr = new StreamReader(requestData)) |
107 | sr.Close(); | 107 | body = sr.ReadToEnd(); |
108 | body = body.Trim(); | 108 | body = body.Trim(); |
109 | 109 | ||
110 | try | 110 | try |
diff --git a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs index a02255f..bc12ef9 100644 --- a/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs +++ b/OpenSim/Server/Handlers/UserAccounts/UserAccountServerPostHandler.cs | |||
@@ -72,9 +72,9 @@ namespace OpenSim.Server.Handlers.UserAccounts | |||
72 | protected override byte[] ProcessRequest(string path, Stream requestData, | 72 | protected override byte[] ProcessRequest(string path, Stream requestData, |
73 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 73 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
74 | { | 74 | { |
75 | StreamReader sr = new StreamReader(requestData); | 75 | string body; |
76 | string body = sr.ReadToEnd(); | 76 | using(StreamReader sr = new StreamReader(requestData)) |
77 | sr.Close(); | 77 | body = sr.ReadToEnd(); |
78 | body = body.Trim(); | 78 | body = body.Trim(); |
79 | 79 | ||
80 | // We need to check the authorization header | 80 | // We need to check the authorization header |