nebmods API

Ian Holsman kryton at gmail.com
Thu Feb 10 01:49:31 CET 2005


On Wed, 09 Feb 2005 21:55:28 +0100, Andreas Ericsson <ae at op5.se> wrote:
> So...
> 
> I've taken up hacking on a redundancy/loadbalancing module (old news)
> and it's starting to come together quite nicely. Unfortunately, I've run
> into a couple of very irritating problems which had to be worked around
> in sometimes less than optimal ways.
 
> 3) (I've posted about this before) Most string variables are stored in
> flexible-length pointers, making it seriously difficult to handle as
> network data. It also adds a necessity for deep memory management and an
> unseemly amount of malloc()'s and free()'s. It also makes it completely
> impossible to store objects.cache in a binary file for ultrafast parsing
> by the CGI's. 
> 
> #3 requires rather careful thought and planning. What's a reasonable
> maximum length for host_name variables? I've never seen one that
> approaches 30 chars, while the alias field could well go up to 40 chars
> or so.

> Thoughts? Comments?
> 

please don't consider this. whatever length you choose will never be
enough for everyone who
has special cases, and changing the length will break binary
compabitility of whatever you store on disk.

have you thought of just storing the length and  then character
string? or for a more radical approach store the strings in a seperate
file, and store the offsets in the main file.

while #4's solution would handle the directive side of things, you
would also need to be able store data somewhere (ie.. a config option
which holds the MAC-address of each host would need a spot on the host
record somewhere).

Have a look at how apache handle's its per-directory directives. I can
dig up the code if you need.

regards
ian

> --
> Andreas Ericsson                   andreas.ericsson at op5.se
> OP5 AB                             www.op5.se
> Lead Developer
>


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click




More information about the Developers mailing list