Hardcoded limit on the number of meta-connections
zorun
zorun at polyno.me
Sun Jul 6 09:27:37 CEST 2014
Hi,
I was quite surprised to see commmit 332b55d4 ("Change AutoConnect
from int to bool"). Is there experimental evidence supporting 3 as
the hardcoded maximum number of meta-connections?
If there is a good reason for this limit on the number of
meta-connections, maybe it should apply whatever the value of
AutoConnect (currently, it is only enforced when AutoConnect is on).
We may actually need a "MaxMetaConnections" variable, defaulting to 3,
with 0 meaning "unlimited". As noted above, it should probably be
logically independent from AutoConnect (this would change the default
behaviour, however, as some ConnectTo statements would be ignored if
there are more than 3 of them).
My feeling is that hardcoding a parameter is generally a bad idea.
One of the greatest things that can happen to a tool is an usage its
creators hadn't thought of, and hardcoded parameters make this
difficult. That being said, would something bad happen if different
nodes used a different limit in the same network? I see that the code
in periodic_handler() is already being careful not to disconnect
another node if we are its only link to the rest of the network.
If that's ok, I can write patches for this (apply the limit whatever
the value of AutoConnect, and add the new "MaxMetaConnections" option
-- or whatever more descriptive name we may find for this option).
More information about the tinc
mailing list