On Wednesday 23 February 2005 09:54, Dossy Shiobara wrote:

> However, I have one small nit to pick: many "changes" in the patch are
> simply formatting-related (converting hard tabs to spaces) which I agree
> should be done, but could you separate that into its own patch?  It's
> hard to see what your actual proposed changes are amongst all the noise
> of changes which are strictly reformatting of existing code.
>

I guess the best way to do this is to checkout a fresh copy of config.c and
first apply any whitespace formatting changes.
After this is done, I can commit the other changes, once the below issues are
resolved.

> Since you say your change doesn't change any existing functionality,
> then the next logical step is that code should be updated to use the new
> Ns_ConfigSetValue API to record all config settings, correct?

Yes, I've already prepared the nslog module, which tests everything except
int64.

> We want
> to ensure that Ns_ConfigSetValue when called after the config interp is
> done evaluating the config.tcl and initializing all the modules, but
> before the server actually "starts up" that we set a boolean to indicate
> "from this point forward, no more changes to the config" so that
> Ns_ConfigSetValue will return an error.

Is there any example code to show where this might be done? Otherwise I'll
look around. This would break the config-test module, which isn't an issue
here, but might suggest a solution.

> Because of this, I'm not too happy with Ns_ConfigSetValue returning a
> (char *) but would rather it return (int) for NS_OK/NS_ERROR.
>
Three reasons I chose this method. First, it keeps each Set function identical
to the Get function. Second, you don't need to declare another int and check
the return. Third Ns_ConfigSetValue never fails, if it did, the purpose of
having no effect on the configuration process beyond documentation would be
lost. If a config section is missing, an Ns_Log Debug is issued during
ConfigSet.  However, after this step, Ns_ConfigSetValue just returns the
value passed in.

> > One deficiency of the new API is the inability to document the use of
> > NULL values as a default. One instance is the nslog format string.
>
> Huh?  Why not:
>
>     Ns_ConfigSetValue("ns/parameters", "key", NULL);
>
> Then, you can either test for NULL in Tcl with [ns_set isnull setId key]
> or in C with "value == NULL" tests.
>
> Or, do you mean something else and I'm misunderstanding you?

Actually all I meant was that I didn't test it. It appears that it would work
as you suggest.


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to