Hi, On Mon, Sep 26, 2022 at 12:13:57AM +0200, Antonio Quartulli wrote: > For now I will just remove the brackets from case 2, where they are not > needed.
TBH, I think we should just not use switch/case here.
It might seem elegant, to do this with a fall-through switch/case, but
it turns out to be not very elegant due to the restrictions on local
variables. Also, if someone ends up setting push-peer-info to 4,
they will get "nothing at all" now, instead of "everything".
To keep to your idea of doing this in blocks "3", "2+3", "1+2+3" one
could do
int detail = session->opt->push_peer_info_detail;
if (detail >= 3)
{
...
}
if (detail > 2)
{
...
}
if (detail > 1)
{
...
}
so it has less twisted conditions.
gert
--
"If was one thing all people took for granted, was conviction that if you
feed honest figures into a computer, honest figures come out. Never doubted
it myself till I met a computer with a sense of humor."
Robert A. Heinlein, The Moon is a Harsh Mistress
Gert Doering - Munich, Germany [email protected]
signature.asc
Description: PGP signature
_______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
