Configuration parser and integers

Julien ÉLIE julien at trigofacile.com
Fri Nov 6 23:17:33 UTC 2009


Hi Russ,

>> Is that the right thing to do?
>
> I think so.  It's a fair bit of work, but it's the best way to get
> comprehensive error checking.

All done.  Lots of adaptations:
    http://inn.eyrie.org/trac/changeset/8709/trunk


>> Or did you mean not to change lib/confparse.c and keep signed numbers
>> in the code, only checking for those which are mentioned to be unsigned
>> whether they are >= 0 in lib/innconf.c, just after they have been parsed?
>
> We could do that, and it would be simpler, but I suspect we'll do better
> in the long run by doing the work of putting them into the language.

Sure.


>> Hmm...  I am under the impression that all the numeric inn.conf parameters
>> currently require a positive value.
>> Even rlimitnofile could be set to 0 if it should not be limited.
>> nice(1) values for nnrpd are also expected to be positive in the code.
>> So in fact, nisi fallor, only unsigned numbers will be used after the patch!
>
> Hm, that makes it tempting to just redefine numbers as unsigned and add
> signed numbers later if they're really required.

nicekids and rlimitnofile are the only signed numbers I left.
Though they could probably be switched to unsigned without difficulty.

-- 
Julien ÉLIE

« A facto ad ius non datur consequentia. » 




More information about the inn-workers mailing list