On Thu, Feb 13, 2003 at 02:42:44AM -0000, Dave Hooper wrote: > > % is simply a different kind of comment. It indicates that the setup > > program knows about this option, but that it should be set to the node > > default because the user has not expressed a preference. > > ... I realise this. However it is not just a 'comment', but rather an > indication that the setting defines a default value. The value of > "%xyz=abc" in the conf file therefore indicates nothing more than "there is > a config parameter called xyz, which has a default value defined within > fred, and currently fred is using that default". It isn't a comment, as it > defines useful a config value (assuming I am correct in thinking that *all* > config parameters appear in the conf file, either as "xyz=abc" or > "%xyz=abc"), and it isn't a config value as the actual value currently used > by the node cannot be determined from parsing the config file! (As an > aside, therefore, actually defining that value *within* the conf file seems > a bit redundant, i.e. "%mainport.Port=8888" might be better expressed as > just "%mainport.Port=") It is for the convenience of the user editing the file by hand. And yes, now, all config params appear in the config file. And it IS a comment since it is completely ignored by the node. > > > The important thing is that a setup program MUST comment out or not > > write options that do not need to be overridden. > > Forget setup programs for the moment... my original message was more > general. If an application wants to talk to fproxy, the recommended way > (according to the list archives :-) is to look for mainport.Port= in the > conf file, but if the line is %mainport.Port=8888 it can mean one of two > things: Yuck. The default is likely to remain 8888 for the foreseeable future. Check the config file if you like, but the default is 8888. > > 1. mainport.Port=8888 > 2. mainport.Port!=8888 and fred's default mainport.Port has changed > internally but the conf file value was never updated > > So, as originally stated, how to find the *actual* mainport.Port used by > fred in such a case? And in general terms how to achieve this for any %'d > conf value. The only solution I could think of was to query fred for all > its default values and parse that file too. The only way of obtaining a > defaults file would be to "freenet.config.Setup freenet.defaults --silent". > I just wanted confirmation that this was the case and that there wasn't an > easier way :-) You do not need to. Just default to 8888 and if the config file overrides it, then use that. And provide a way for the user to override it. We could provide this information via FCP, but then the FCP port (8481) could change too if we decided to do something arbitrary just to annoy you. > > d
--
msg06827/pgp00000.pgp
Description: PGP signature
