diff options
author | Clombrong <cromblong@egregore.fun> | 2025-08-15 00:54:58 +0200 |
---|---|---|
committer | Clombrong <cromblong@egregore.fun> | 2025-08-15 00:54:58 +0200 |
commit | 8305428d609db6cd81d2ce941b25cc02f919f24d (patch) | |
tree | 081dcc93c654867c6a16e433e3b1886254055780 | |
parent | 8eb14d509ff9eb6eaa4350686849cad860ec7841 (diff) |
feat(stream): remove indifferent function, dump optional features
-rw-r--r-- | lib/stream.ml | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/stream.ml b/lib/stream.ml index 1b6489f..cfde160 100644 --- a/lib/stream.ml +++ b/lib/stream.ml @@ -91,14 +91,12 @@ let negotiate feature portal {starttls; sasl; _} : unit Lwt.t = else Lwt.fail InsufficientEncryption in let open Feature in - (* Most features don't care about whether they're mandatory or optional. *) - let indifferent = function - | Mechanisms mechs -> authenticate mechs - | _ -> Lwt.return_unit - in match feature with | Mandatory STARTTLS -> Starttls.upgrade portal | Optional STARTTLS -> if starttls.prefer then Starttls.upgrade portal else Lwt.return_unit - | f -> unwrap f |> indifferent + | Mandatory (Mechanisms mechs) -> authenticate mechs + | Mandatory (Other _) -> Lwt.return_unit + (* So far, for convenience, when something is optional, we just don't do it. *) + | Optional _ -> Lwt.return_unit |