vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| this one seems to be of non-stupendous value, but barring me misunderstanding, does it make the code more consistent with itself? basically, in the switch/case (that is probably the wrong term to use) in main(), -c gets its argument tested against MAXCON, but -B doesn't. after the switch/case is over, there's an if test for if we're not greylisting, make maxblack = maxcon, else if maxblack > maxcon then belch usage(). since maxblack and maxcon are both set to be equal to the value of MAXCON up above, is the reason to do this if test at the bottom something like: - if we're not greylisting, just set it to whatever maxcon is so that we don't have some unreasonably high value in maxblack down the road - if we are greylisting, make sure it's not too big. if so, by virtue of maxblack already being set to equal MAXCON earlier on, does it make sense to put the same 'if (i > MAXCON)' test in the 'B' case as 'c' gets? ( also, as an aside, is there merit in checking that the args to B and c are 'or less than one' ? ) Index: spamd.c ================================================== ================= RCS file: /cvs/src/libexec/spamd/spamd.c,v retrieving revision 1.83 diff -u -u -r1.83 spamd.c --- spamd.c 15 May 2006 16:47:48 -0000 1.83 +++ spamd.c 13 Nov 2006 04:37:44 -0000 @@ -970,6 +970,8 @@ break; case 'B': i = atoi(optarg); + if (i > MAXCON) + usage(); maxblack = i; break; case 'c': @@ -1036,11 +1038,6 @@ break; } } - - if (!greylist) - maxblack = maxcon; - else if (maxblack > maxcon) - usage(); rlp.rlim_cur = rlp.rlim_max = maxcon + 15; if (setrlimit(RLIMIT_NOFILE, &rlp) == -1) -- jared |
| Thread Tools | |
| Display Modes | |
|
|