From b725ebb3f47302c416e41c7be3f5a8bb3c9fe547 Mon Sep 17 00:00:00 2001 From: Aloys Augustin Date: Sun, 14 Jul 2019 23:48:36 +0200 Subject: quic: Refactor connections closing and deletion This code should handle the 3 following cases: - Active close quic_proto_on_close sets state to ACTIVE_CLOSING send packets eventually returns an error, calling quic_connection_closed which deletes the connection - Passive close quic_on_closed_by_peer -> set state to PASSIVE_CLOSING "race" between app confirmation (calling quic_proto_on_close) and quicly signalling that it's done (triggers call to quic_connection_closed). If quic_connection_closed is called first, it sets the state to PASSIVE CLOSING QUIC CLOSED, then when quic_proto_on_close is called it frees the connection. If quic_proto_on_close is called first, it sets the state to PASSIVE CLOSING APP CLOSED, then when quic_connection_closed is called it frees the connection - Error close (reset) quic_connection_closed is called in state READY. This means a timeout or protocol error happened. This calls session_transport_reset_notify, the app should confirm the deletion and quic_proto_on_close will be called to delete the connection. Change-Id: I3acbf9b079ed2439bdbb447197c428c78915d8c0 Signed-off-by: Aloys Augustin Type: feature --- src/plugins/quic/quic.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/plugins/quic/quic.h') diff --git a/src/plugins/quic/quic.h b/src/plugins/quic/quic.h index 80f2664a6ec..de27f2ac7d5 100644 --- a/src/plugins/quic/quic.h +++ b/src/plugins/quic/quic.h @@ -71,6 +71,9 @@ typedef enum quic_ctx_conn_state_ QUIC_CONN_STATE_HANDSHAKE, QUIC_CONN_STATE_READY, QUIC_CONN_STATE_PASSIVE_CLOSING, + QUIC_CONN_STATE_PASSIVE_CLOSING_APP_CLOSED, + QUIC_CONN_STATE_PASSIVE_CLOSING_QUIC_CLOSED, + QUIC_CONN_STATE_ACTIVE_CLOSING, } quic_ctx_conn_state_t; -- cgit 1.2.3-korg