feat(election-iomgr-refactor): add on_connected fire-once callback to endpoint_t

Add void (*on_connected)(endpoint_t *ep) field to endpoint_t with
endpoint_set_on_connected() helper. io_handler fires it exactly once
immediately after ssl_handshake_done=1 then nulls the pointer.

Enables ha_start_election_async to send OP_requestVote as soon as
the TLS handshake with a peer completes — no blocking SSL_connect.

6 new unit tests pass; controller suite 1/1 OK.
This commit is contained in:
Rongsong Shen 2026-05-30 07:34:08 +00:00
parent 4737b0f8a3
commit c3caab49a6
5 changed files with 205 additions and 1 deletions

View file

@ -35,6 +35,7 @@ extern void test_hooks(void);
extern void test_cluster(void);
extern void test_cluster_parse(void);
extern void test_libxce_retry(void);
extern void test_netio_on_connected(void);
void setUp(void) { return; }
@ -139,6 +140,7 @@ int main(int argc, char* argv[])
TEST(test_cluster);
TEST(test_cluster_parse);
TEST(test_libxce_retry);
TEST(test_netio_on_connected);
return UNITY_END();
}