aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Authentication
diff options
context:
space:
mode:
authorUbitUmarov2017-05-07 00:47:45 +0100
committerUbitUmarov2017-05-07 00:47:45 +0100
commitd0912b61516914f810ba306641aaaa813134462e (patch)
treefc2592d3f9514badd547ab0bad6cf6c4b6097f05 /OpenSim/Server/Handlers/Authentication
parent oops closed too soon (diff)
downloadopensim-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/Handlers/Authentication')
-rw-r--r--OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs8
-rw-r--r--OpenSim/Server/Handlers/Authentication/OpenIdServerHandler.cs5
2 files changed, 8 insertions, 5 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