From: Aki Tuomi Date: Wed, 28 Feb 2024 11:30:35 +0000 (+0200) Subject: lib: connection - Add connection_handshake_received() X-Git-Tag: 2.4.0~1733 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e0af3b3be3fea89be03ce8ccb75f8a26222a95cb;p=thirdparty%2Fdovecot%2Fcore.git lib: connection - Add connection_handshake_received() --- diff --git a/src/lib/connection.c b/src/lib/connection.c index f036ab154a..dbdece6433 100644 --- a/src/lib/connection.c +++ b/src/lib/connection.c @@ -25,6 +25,11 @@ void connection_set_handshake_ready(struct connection *conn) conn->v.handshake_ready(conn); } +bool connection_handshake_received(struct connection *conn) +{ + return conn->handshake_finished.tv_sec != 0; +} + static void connection_closed(struct connection *conn, enum connection_disconnect_reason reason) { diff --git a/src/lib/connection.h b/src/lib/connection.h index 8fbb913ba4..0cdcb13743 100644 --- a/src/lib/connection.h +++ b/src/lib/connection.h @@ -280,6 +280,9 @@ void connection_streams_changed(struct connection *conn); vfunctions return success and will call the handshake_ready() vfunction. */ void connection_set_handshake_ready(struct connection *conn); +/* Returns TRUE if handshake has been done */ +bool connection_handshake_received(struct connection *conn); + /* Returns -1 = disconnected, 0 = nothing new, 1 = something new. If input_full_behavior is ALLOW, may return also -2 = buffer full. */ int connection_input_read(struct connection *conn);