aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs28
1 files changed, 14 insertions, 14 deletions
diff --git a/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs b/OpenSim/Server/Handlers/Authentication/AuthenticationServerPostHandler.cs
index 6ee98b3..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;
@@ -132,41 +132,41 @@ namespace OpenSim.Server.Handlers.Authentication
132 case "authenticate": 132 case "authenticate":
133 if (!request.ContainsKey("PASSWORD")) 133 if (!request.ContainsKey("PASSWORD"))
134 return FailureResult(); 134 return FailureResult();
135 135
136 token = m_AuthenticationService.Authenticate(principalID, request["PASSWORD"].ToString(), lifetime); 136 token = m_AuthenticationService.Authenticate(principalID, request["PASSWORD"].ToString(), lifetime);
137 137
138 if (token != String.Empty) 138 if (token != String.Empty)
139 return SuccessResult(token); 139 return SuccessResult(token);
140 return FailureResult(); 140 return FailureResult();
141 141
142 case "setpassword": 142 case "setpassword":
143 if (!m_AllowSetPassword) 143 if (!m_AllowSetPassword)
144 return FailureResult(); 144 return FailureResult();
145 145
146 if (!request.ContainsKey("PASSWORD")) 146 if (!request.ContainsKey("PASSWORD"))
147 return FailureResult(); 147 return FailureResult();
148 148
149 if (m_AuthenticationService.SetPassword(principalID, request["PASSWORD"].ToString())) 149 if (m_AuthenticationService.SetPassword(principalID, request["PASSWORD"].ToString()))
150 return SuccessResult(); 150 return SuccessResult();
151 else 151 else
152 return FailureResult(); 152 return FailureResult();
153 153
154 case "verify": 154 case "verify":
155 if (!request.ContainsKey("TOKEN")) 155 if (!request.ContainsKey("TOKEN"))
156 return FailureResult(); 156 return FailureResult();
157 157
158 if (m_AuthenticationService.Verify(principalID, request["TOKEN"].ToString(), lifetime)) 158 if (m_AuthenticationService.Verify(principalID, request["TOKEN"].ToString(), lifetime))
159 return SuccessResult(); 159 return SuccessResult();
160 160
161 return FailureResult(); 161 return FailureResult();
162 162
163 case "release": 163 case "release":
164 if (!request.ContainsKey("TOKEN")) 164 if (!request.ContainsKey("TOKEN"))
165 return FailureResult(); 165 return FailureResult();
166 166
167 if (m_AuthenticationService.Release(principalID, request["TOKEN"].ToString())) 167 if (m_AuthenticationService.Release(principalID, request["TOKEN"].ToString()))
168 return SuccessResult(); 168 return SuccessResult();
169 169
170 return FailureResult(); 170 return FailureResult();
171 171
172 case "getauthinfo": 172 case "getauthinfo":