Page 1 of 1

Re: [Nagios-devel] objects.c and tempbuffer variable

Posted: Tue Jun 20, 2006 4:26 pm
by Guest
william(at)elan.net wrote:
> As far as I can see in objects.c tempbuffer is defined as a static array
> of fixed size MAX_INPUT_BUFFER in each and every function with its use
> limited to when error needs to be reported. While I understand that you
> want it as static array instead of doing malloc as it could produce an
> error (and you have no buffer then to use to report it), doing separate
> temp_buffer seems very wasteful and increases program size considerably
> especially when one needs to increase default MAX_INPUT_BUFFER size.
> And in general use of static buffers is not recommended for multi-threaded
> programs though I understand in this case it's not a problem as you only
> use it during program initialization when its not yet multi-threaded.
>
> I think its reasonable to instead have one global buffer variable
> (error_temp_buffer) and have all functions use that instead when doing
> error reporting. Even better alternative maybe to use separate function
> or MACRO that would actually do error reporting.
>
> ---
> William Leibzon
> Elan Networks
> [email protected]

The good news is that the Nagios CVS HEAD code (pre-3.0) has done away
with fixed buffer lengths for the processing of config definitions. I'm
trying to focus on 3.x, rather than fix a lot of ugliness in 2.x, so
this will remain a limitation until 3.0 is released.


Ethan Galstad,
Nagios Developer
---
Email: [email protected]
Website: http://www.nagios.org





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]