Open oviano opened 3 weeks ago
If you think this might not be what is desired for all scenarios, we could make make the recheck period configurable (via plum_config_t) and likewise a flag to enable or disable "eternal cycling".
At least for our usage, we would definitely want this to be configurable at a minimum. (We currently rely on the ability to handle any failure with our own logic.)
Would it not be better to continue cycling through all three protocols indefinitely, and only stopping (as it does now) when it succeeds with one?
I'm thinking of the scenario where this code is running somewhere as a long-running service, and the user is fiddling with their router settings, turning UPnP on and off etc. It's quite possible this could result in it ending up stuck on noprotocol, and it would never detect UPnP/PCP/NAT-PMP being enabled.
I think it would be more robust to make the following three changes:
If you think this might not be what is desired for all scenarios, we could make make the recheck period configurable (via plum_config_t) and likewise a flag to enable or disable "eternal cycling".
Happy to make a PR for these changes if you agree. I already have them made for my own use, but without being configurable.