Improving loadparm design to fix bug in configuration reloading

Matt McCutchen matt at
Sat Jan 31 05:27:19 GMT 2009

On Fri, 2009-01-16 at 22:36 -0500, Matt McCutchen wrote: 
> On Fri, 2009-01-16 at 19:23 -0800, Wayne Davison wrote:
> > On Wed, Jan 14, 2009 at 02:25:33AM -0500, Matt McCutchen wrote:
> > > I think I'll take the opportunity to improve the design a bit by
> > > actually adding a section structure representing the global values of
> > > section parameters to the global structure
> > 
> > I was thinking we could get rid of the big, must-keep-sorted, statically
> > initialized structure and make use of the init_globals() function to set
> > the initial values.  However, if you've got something you've done
> > already, I'd be glad to consider it.
> My proposal to make sDefaults part of the globals (like the &include is
> essentially already doing) is independent of whether we initialize the
> resulting combination by copying from a statically initialized structure
> or by individual assignments in init_globals.


I see that you introduced a Defaults structure with both global and
local defaults, which fixes the bug, but I'd like to propose some
further refactoring.  The Globals and Locals structures might as well be
combined into a single "struct all_vars"; that will shorten the
section-stack code by a few lines.  Then "struct global_vars" would not
be used anywhere except as part of a "struct all_vars", so I am tempted
to inline it there as either an anonymous structure or even separate
members.  What do you think?


More information about the rsync mailing list