Open reynir opened 6 months ago
We could create a fresh client
value using the Miragevpn.client
function.
A slightly annoying quirk of using a fresh client
is that it would not keep track of the last remote tried. In some cases you want to retry the same remote, in others you want to try the next remote. I would not spend time on implementing that for now unless someone has the need for this semantics.
In https://github.com/robur-coop/miragevpn/pull/247 and an earlier commit the
HALT
,EXIT
andRESTART
control channel messages were implemented. In the implementations they exit on all three commands. At an earlier point I tried to reconnect (in the client), but it was problematic because the pulled config was still present in the state's config and thus thePUSH_REPLY
sent by the server was unexpected (because our config hasifconfig
already - and this shows it is maybe not the right way to determine if this is the firstPUSH_REPLY
).Probably we can get away with using a fresh (client) state rather than try to clean up the client state when receiving
RESTART
(and maybeEXIT
as well).