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 | |
parent | oops closed too soon (diff) | |
download | opensim-SC_OLD-d0912b61516914f810ba306641aaaa813134462e.zip opensim-SC_OLD-d0912b61516914f810ba306641aaaa813134462e.tar.gz opensim-SC_OLD-d0912b61516914f810ba306641aaaa813134462e.tar.bz2 opensim-SC_OLD-d0912b61516914f810ba306641aaaa813134462e.tar.xz |
let StreamReader be in using statements
Diffstat (limited to 'OpenSim')
22 files changed, 81 insertions, 88 deletions
diff --git a/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs index af00770..51f3ec1 100644 --- a/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs +++ b/OpenSim/Addons/Groups/Hypergrid/HGGroupsServiceRobustConnector.cs | |||
@@ -115,9 +115,10 @@ namespace OpenSim.Groups | |||
115 | protected override byte[] ProcessRequest(string path, Stream requestData, | 115 | protected override byte[] ProcessRequest(string path, Stream requestData, |
116 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 116 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
117 | { | 117 | { |
118 | StreamReader sr = new StreamReader(requestData); | 118 | string body; |
119 | string body = sr.ReadToEnd(); | 119 | using(StreamReader sr = new StreamReader(requestData)) |
120 | sr.Close(); | 120 | body = sr.ReadToEnd(); |
121 | |||
121 | body = body.Trim(); | 122 | body = body.Trim(); |
122 | 123 | ||
123 | //m_log.DebugFormat("[XXX]: query String: {0}", body); | 124 | //m_log.DebugFormat("[XXX]: query String: {0}", body); |
diff --git a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs index 598e7a5..8502bb5 100644 --- a/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs +++ b/OpenSim/Addons/Groups/Remote/GroupsServiceRobustConnector.cs | |||
@@ -91,9 +91,10 @@ namespace OpenSim.Groups | |||
91 | protected override byte[] ProcessRequest(string path, Stream requestData, | 91 | protected override byte[] ProcessRequest(string path, Stream requestData, |
92 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 92 | IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
93 | { | 93 | { |
94 | StreamReader sr = new StreamReader(requestData); | 94 | string body; |
95 | string body = sr.ReadToEnd(); | 95 | using(StreamReader sr = new StreamReader(requestData)) |
96 | sr.Close(); | 96 | body = sr.ReadToEnd(); |
97 | |||
97 | body = body.Trim(); | 98 | body = body.Trim(); |
98 | 99 | ||
99 | //m_log.DebugFormat("[XXX]: query String: {0}", body); | 100 | //m_log.DebugFormat("[XXX]: query String: {0}", body); |
diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index fb92b92..c32ee28 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | |||
@@ -399,11 +399,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
399 | 399 | ||
400 | Stream requestStream = req.InputStream; | 400 | Stream requestStream = req.InputStream; |
401 | 401 | ||
402 | string requestBody; | ||
402 | Encoding encoding = Encoding.UTF8; | 403 | Encoding encoding = Encoding.UTF8; |
403 | StreamReader reader = new StreamReader(requestStream, encoding); | 404 | using(StreamReader reader = new StreamReader(requestStream, encoding)) |
404 | 405 | requestBody = reader.ReadToEnd(); | |
405 | string requestBody = reader.ReadToEnd(); | ||
406 | reader.Close(); | ||
407 | 406 | ||
408 | Hashtable keysvals = new Hashtable(); | 407 | Hashtable keysvals = new Hashtable(); |
409 | Hashtable headervals = new Hashtable(); | 408 | Hashtable headervals = new Hashtable(); |
@@ -567,13 +566,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
567 | IGenericHTTPHandler HTTPRequestHandler = requestHandler as IGenericHTTPHandler; | 566 | IGenericHTTPHandler HTTPRequestHandler = requestHandler as IGenericHTTPHandler; |
568 | Stream requestStream = request.InputStream; | 567 | Stream requestStream = request.InputStream; |
569 | 568 | ||
569 | string requestBody; | ||
570 | Encoding encoding = Encoding.UTF8; | 570 | Encoding encoding = Encoding.UTF8; |
571 | StreamReader reader = new StreamReader(requestStream, encoding); | 571 | using(StreamReader reader = new StreamReader(requestStream, encoding)) |
572 | 572 | requestBody = reader.ReadToEnd(); | |
573 | string requestBody = reader.ReadToEnd(); | ||
574 | |||
575 | reader.Close(); | ||
576 | //requestStream.Close(); | ||
577 | 573 | ||
578 | Hashtable keysvals = new Hashtable(); | 574 | Hashtable keysvals = new Hashtable(); |
579 | Hashtable headervals = new Hashtable(); | 575 | Hashtable headervals = new Hashtable(); |
@@ -690,7 +686,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
690 | } | 686 | } |
691 | } | 687 | } |
692 | 688 | ||
693 | request.InputStream.Close(); | 689 | request.InputStream.Dispose(); |
694 | 690 | ||
695 | if (buffer != null) | 691 | if (buffer != null) |
696 | { | 692 | { |
@@ -998,7 +994,7 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
998 | { | 994 | { |
999 | String requestBody; | 995 | String requestBody; |
1000 | 996 | ||
1001 | Stream requestStream = request.InputStream; | 997 | Stream requestStream = Util.Copy(request.InputStream); |
1002 | Stream innerStream = null; | 998 | Stream innerStream = null; |
1003 | try | 999 | try |
1004 | { | 1000 | { |
@@ -1009,9 +1005,8 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1009 | } | 1005 | } |
1010 | 1006 | ||
1011 | using (StreamReader reader = new StreamReader(requestStream, Encoding.UTF8)) | 1007 | using (StreamReader reader = new StreamReader(requestStream, Encoding.UTF8)) |
1012 | { | ||
1013 | requestBody = reader.ReadToEnd(); | 1008 | requestBody = reader.ReadToEnd(); |
1014 | } | 1009 | |
1015 | } | 1010 | } |
1016 | finally | 1011 | finally |
1017 | { | 1012 | { |
@@ -1263,12 +1258,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1263 | //m_log.Warn("[BASE HTTP SERVER]: We've figured out it's a LLSD Request"); | 1258 | //m_log.Warn("[BASE HTTP SERVER]: We've figured out it's a LLSD Request"); |
1264 | Stream requestStream = request.InputStream; | 1259 | Stream requestStream = request.InputStream; |
1265 | 1260 | ||
1261 | string requestBody; | ||
1266 | Encoding encoding = Encoding.UTF8; | 1262 | Encoding encoding = Encoding.UTF8; |
1267 | StreamReader reader = new StreamReader(requestStream, encoding); | 1263 | using(StreamReader reader = new StreamReader(requestStream, encoding)) |
1268 | 1264 | requestBody= reader.ReadToEnd(); | |
1269 | string requestBody = reader.ReadToEnd(); | ||
1270 | reader.Close(); | ||
1271 | requestStream.Close(); | ||
1272 | 1265 | ||
1273 | //m_log.DebugFormat("[OGP]: {0}:{1}", request.RawUrl, requestBody); | 1266 | //m_log.DebugFormat("[OGP]: {0}:{1}", request.RawUrl, requestBody); |
1274 | response.KeepAlive = true; | 1267 | response.KeepAlive = true; |
@@ -1592,15 +1585,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
1592 | byte[] buffer; | 1585 | byte[] buffer; |
1593 | 1586 | ||
1594 | Stream requestStream = request.InputStream; | 1587 | Stream requestStream = request.InputStream; |
1595 | 1588 | string requestBody; | |
1596 | Encoding encoding = Encoding.UTF8; | 1589 | Encoding encoding = Encoding.UTF8; |
1597 | StreamReader reader = new StreamReader(requestStream, encoding); | 1590 | using(StreamReader reader = new StreamReader(requestStream, encoding)) |
1598 | 1591 | requestBody = reader.ReadToEnd(); | |
1599 | string requestBody = reader.ReadToEnd(); | ||
1600 | // avoid warning for now | ||
1601 | reader.ReadToEnd(); | ||
1602 | reader.Close(); | ||
1603 | requestStream.Close(); | ||
1604 | 1592 | ||
1605 | Hashtable keysvals = new Hashtable(); | 1593 | Hashtable keysvals = new Hashtable(); |
1606 | Hashtable headervals = new Hashtable(); | 1594 | Hashtable headervals = new Hashtable(); |
diff --git a/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs b/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs index 0305dee..dfc2715 100644 --- a/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs +++ b/OpenSim/Framework/Servers/HttpServer/RestStreamHandler.cs | |||
@@ -50,11 +50,10 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
50 | 50 | ||
51 | protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 51 | protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
52 | { | 52 | { |
53 | string requestBody; | ||
53 | Encoding encoding = Encoding.UTF8; | 54 | Encoding encoding = Encoding.UTF8; |
54 | StreamReader streamReader = new StreamReader(request, encoding); | 55 | using(StreamReader streamReader = new StreamReader(request,encoding)) |
55 | 56 | requestBody = streamReader.ReadToEnd(); | |
56 | string requestBody = streamReader.ReadToEnd(); | ||
57 | streamReader.Close(); | ||
58 | 57 | ||
59 | string param = GetParam(path); | 58 | string param = GetParam(path); |
60 | string responseString = m_restMethod(requestBody, path, param, httpRequest, httpResponse); | 59 | string responseString = m_restMethod(requestBody, path, param, httpRequest, httpResponse); |
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs index b3e3ac3..e8387e3 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/RegionConsoleModule.cs | |||
@@ -185,8 +185,9 @@ namespace OpenSim.Region.ClientStack.Linden | |||
185 | 185 | ||
186 | protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 186 | protected override byte[] ProcessRequest(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) |
187 | { | 187 | { |
188 | StreamReader reader = new StreamReader(request); | 188 | string message; |
189 | string message = reader.ReadToEnd(); | 189 | using(StreamReader reader = new StreamReader(request)) |
190 | message = reader.ReadToEnd(); | ||
190 | 191 | ||
191 | OSD osd = OSDParser.DeserializeLLSDXml(message); | 192 | OSD osd = OSDParser.DeserializeLLSDXml(message); |
192 | 193 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs index 81aa882..091b197 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsRequestHandler.cs | |||
@@ -65,9 +65,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
65 | protected override byte[] ProcessRequest( | 65 | protected override byte[] ProcessRequest( |
66 | string path, Stream requestData, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | 66 | string path, Stream requestData, 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 | |||
71 | body = body.Trim(); | 72 | body = body.Trim(); |
72 | 73 | ||
73 | //m_log.DebugFormat("[XXX]: query String: {0}", body); | 74 | //m_log.DebugFormat("[XXX]: query String: {0}", body); |
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateRequestHandler.cs b/OpenSim/Region/CoreModules/World/Estate/EstateRequestHandler.cs index 7ab92d1..5eda8ab 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateRequestHandler.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateRequestHandler.cs | |||
@@ -60,9 +60,10 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
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 | |||
66 | body = body.Trim(); | 67 | body = body.Trim(); |
67 | 68 | ||
68 | // m_log.DebugFormat("[XESTATE HANDLER]: query String: {0}", body); | 69 | // m_log.DebugFormat("[XESTATE HANDLER]: query String: {0}", body); |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs index c0de3d9..a5dc0ad 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs | |||
@@ -460,9 +460,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge | |||
460 | 460 | ||
461 | if (resp.ContentLength > 0) | 461 | if (resp.ContentLength > 0) |
462 | { | 462 | { |
463 | StreamReader content = new StreamReader(resp.GetResponseStream()); | 463 | using(StreamReader content = new StreamReader(resp.GetResponseStream())) |
464 | m_log.ErrorFormat("[Concierge] response from {0} content: {1}", bs.Uri, content.ReadToEnd()); | 464 | m_log.ErrorFormat("[Concierge] response from {0} content: {1}", bs.Uri, content.ReadToEnd()); |
465 | content.Close(); | ||
466 | } | 465 | } |
467 | } | 466 | } |
468 | } | 467 | } |
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 |
diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs index 939059d..5f075ac 100644 --- a/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs +++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs | |||
@@ -183,8 +183,8 @@ namespace OpenSim.Services.Connectors | |||
183 | { | 183 | { |
184 | using (StreamReader sr = new StreamReader(s)) | 184 | using (StreamReader sr = new StreamReader(s)) |
185 | { | 185 | { |
186 | sr.ReadToEnd(); // just try to read | ||
186 | //reply = sr.ReadToEnd().Trim(); | 187 | //reply = sr.ReadToEnd().Trim(); |
187 | sr.ReadToEnd().Trim(); | ||
188 | //m_log.InfoFormat("[REST COMMS]: DoHelloNeighbourCall reply was {0} ", reply); | 188 | //m_log.InfoFormat("[REST COMMS]: DoHelloNeighbourCall reply was {0} ", reply); |
189 | } | 189 | } |
190 | } | 190 | } |