aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sasl.ml8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sasl.ml b/lib/sasl.ml
index 4498fec..3cd1220 100644
--- a/lib/sasl.ml
+++ b/lib/sasl.ml
@@ -10,7 +10,7 @@ type config = {
preferred_mechanisms : mechanism list;
}
-type sasl_error =
+type error =
| NotAuthorized
| MalformedRequest
@@ -22,12 +22,12 @@ let parse_mechanism = function
| "PLAIN" -> PLAIN
| other -> Unknown other
-let parse_sasl_error = function
+let parse_error = function
| "not-authorized" -> NotAuthorized
| "malformed-request" -> MalformedRequest
| _ -> failwith "Unsupported SASL error returned by the server."
-type sasl_auth = (string option, sasl_error * (string * string) option) result
+type sasl_auth = (string option, error * (string * string) option) result
let send_auth_stanza ({stream; push; _} : Portal.t) localpart pass mechanism =
let gen_auth = function
@@ -50,7 +50,7 @@ let send_auth_stanza ({stream; push; _} : Portal.t) localpart pass mechanism =
| ("success", []) -> Ok None
| ("success", [Right rest]) -> Ok (Some rest)
| ("failure", [Left {local_name=error; children; _}]) ->
- Error (parse_sasl_error error, parse_descriptive_text children)
+ Error (parse_error error, parse_descriptive_text children)
| _ -> raise (Xml.InvalidStanza (Xml.element_to_string stanza))
in let stanza_list = [`Start_element
((Xmlns.sasl, "auth"),