01-02-2017, 12:15 AM
Sounds reasonable, though I object with the interpretation of "default". It should be considered a list of protocols that we know are "stable enough". In my opinion, currently the 1.8 - 1.10 protocols are stable enough to be used regularly.
This will also need some helper function for parsing the protocol versions to protocol numbers, possibly with range interpretation ("1.10 - 1.10.2"), which could be used for the "and up" ("1.9 -"). The ideal would be to have a function that parses the entire value and returns an array of protocol numbers, and a sub-function that parses one value from the comma-separated list and returns an array of protocol numbers it represents.
Also, the value should probably be called "Protocols" or even "AllowedProtocols", and its value should be logged upon server start, instead of the currently logged entire support (should we keep that?).
What about error handling - if there is an unknown protocol specified, should the server output an error and terminate? Seems like the reasonable thing to do.
This will also need some helper function for parsing the protocol versions to protocol numbers, possibly with range interpretation ("1.10 - 1.10.2"), which could be used for the "and up" ("1.9 -"). The ideal would be to have a function that parses the entire value and returns an array of protocol numbers, and a sub-function that parses one value from the comma-separated list and returns an array of protocol numbers it represents.
Also, the value should probably be called "Protocols" or even "AllowedProtocols", and its value should be logged upon server start, instead of the currently logged entire support (should we keep that?).
What about error handling - if there is an unknown protocol specified, should the server output an error and terminate? Seems like the reasonable thing to do.