aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClombrong <cromblong@egregore.fun>2025-08-27 00:35:58 +0200
committerClombrong <cromblong@egregore.fun>2025-08-27 00:35:58 +0200
commitbda066a4643c74983871087e541ae90e16a467af (patch)
tree26b7013d7fdb498939de5af8723860c3de03bd9b
parent18d42dba3b3d8485dde3184883ce7c8d6e8ab52c (diff)
refactor(portal): make starttls immutably wrap a socket
-rw-r--r--portal/portal.mli9
1 files changed, 4 insertions, 5 deletions
diff --git a/portal/portal.mli b/portal/portal.mli
index 55cea74..604e360 100644
--- a/portal/portal.mli
+++ b/portal/portal.mli
@@ -31,12 +31,11 @@ val xmlns : string
(** [connect domain] returns a socket connected to the XMPP server [domain]. *)
val connect : domain -> socket Lwt.t
-(** [starttls portal] mutates [portal] into a TLS-encrypted stream with the same state.
+(** [starttls socket] returns a TLS-encrypted [socket] wrapping the original socket.
- Note that when you call this function, the [stream] and [push] of the Portal are
- invalidated, and need to be regenerated using [header] (this should always be done
- anyways, according to the XMPP spec). *)
-val starttls : t -> unit Lwt.t
+ Once this function is called, the old socket and the portal depending on this socket
+ MUST NOT be used. *)
+val starttls : socket -> socket Lwt.t
(** [stream socket] sends an initial stream header to the XMPP server [socket]. It
returns a Portal, connected to the given socket.