quic: Refactor connections closing and deletion 58/20658/4
authorAloys Augustin <aloaugus@cisco.com>
Sun, 14 Jul 2019 21:48:36 +0000 (23:48 +0200)
committerDave Wallace <dwallacelf@gmail.com>
Tue, 23 Jul 2019 18:29:10 +0000 (18:29 +0000)
commitb725ebb3f47302c416e41c7be3f5a8bb3c9fe547
treef3e622e623a7032f1b4e017750bbe79bb233b226
parent6b257c64c4b44c7f9546f18645635b32e6f8b0d3
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 <aloaugus@cisco.com>
Type: feature
src/plugins/quic/quic.c
src/plugins/quic/quic.h