Mercurial > prosody-hg
diff util/sasl.lua @ 1725:fb3137652ea6
Uncertain merge with 0.5's SASL
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Thu, 20 Aug 2009 13:57:50 +0100 |
| parents | 1fe566011e2b 7682a34c13d0 |
| children | a5f154548154 |
line wrap: on
line diff
--- a/util/sasl.lua Tue Aug 18 22:00:37 2009 +0200 +++ b/util/sasl.lua Thu Aug 20 13:57:50 2009 +0100 @@ -38,9 +38,9 @@ function object.feed(self, message) if message == "" or message == nil then return "failure", "malformed-request" end local response = message - local authorization = s_match(response, "([^&%z]+)") - local authentication = s_match(response, "%z([^&%z]+)%z") - local password = s_match(response, "%z[^&%z]+%z([^&%z]+)") + local authorization = s_match(response, "([^%z]+)") + local authentication = s_match(response, "%z([^%z]+)%z") + local password = s_match(response, "%z[^%z]+%z([^%z]+)") if authentication == nil or password == nil then return "failure", "malformed-request" end self.username = authentication @@ -128,7 +128,7 @@ return t_concat(p); end local function parse(data) - message = {} + local message = {} for k, v in gmatch(data, [[([%w%-]+)="?([^",]*)"?,?]]) do -- FIXME The hacky regex makes me shudder message[k] = v; end
