On 23.08.2006, at 20:44, Zoran Vasiljevic wrote:
But lets see if there are another ideas or remarks.
Ah... damn... sometimes it's not easy to fit in new shoe on the old foot! I have been investigating all those options: a. using DOM tree as config repository b. using nsv's as config repository c. continue to use (but modify for speed) the ns_set and this is what I've found... The a. is most complex yet, will not effectively bring much as it will be almost the fast as the c. (if not slower). It needs lots of work and would definitely bring in some other nice side-effects, but at this point, and for this purpose *only*, this may be an overkill. The b. turns out to be problematic because of the case sensitivity. We need to retain user-given input, yet be able to search in case-insensitive way. The nsv's will not be the right choice for that, unfortunately. We'd have to make too many tricks to make this work and this does not pay off. The c. is also problematic as if we would like to improve ns_set speed, we'd need to modify Ns_Set strucure which is public and would require all extension that use it to be recompiled. There are some other minor issues to that as well which complicate the change, adding to the trouble. Conclusion: It seems to me that we will have to live with ns_set as the configuration repository for some time to come. Again, I'd like to know who was that smart guy who wrote this piece of code in the first place... grmpf... Now, the question about adding shared access to the config repository is simple to answer: I will not make this by default. Instead, I will make it as a compile time option and set it as disabled per default. This way, nobody will experience any (whatever) side-effects. If however the support is being compiled in, there will be one additional command available: ns_configctl and it will contain subcommands: ns_configctl save channel ns_configctl load channel This is self-explanatory, I believe. The ns_config command will be extended in the form: ns_config ?-force? section key ?value? I did not want to include yet another command to explictily set the new configuration value. Therefore I tried to squeeze it in the existing ns_config (the -force flag). This flag, if set, will require the syntax of command to be: ns_config -force section key value the value isn't optional any more; it must be given and it will be used to set/override existing config value. This also means that [ns_config -force section key] will actually trigger syntax error. (I'm not very happy about the syntax of the ns_config but I could not find a better one. If there are good alternatives please get them in.) I will also inspect callers of config from the C code and try to cache the values privately, thus avoiding frequent config lookups. This will not hurt anybody as in the non-writable config this does not matter. Basically, for all of you, the changes I'm willing to do will be invisible, unless you turn this on at compile time. I find this fair as it will give us option to get long awaited feature on board w/o impairing other users. Cheers Zoran