On Mon, 2005-01-10 at 05:25, Wes Hardaker wrote:
> Dave> Firstly, adding this stash-caching to an existing MIB
> Dave> relies on injecting the stash-cache handler *after* having
> Dave> registered the handler chain with the main agent (so that
> Dave> the stash-cache kicks in before the normal processing).
> 
> Um, well I wouldn't use the word "rely" there, but ok.  The current
> documentation says to inject it within the snmpd.conf file.

Hmmm...
I'd say the current documentation is fairly vague about how to
use it.  That's partly why I'm writing the book :-)

  The stash_cache documentation just talks about a handler that
"can be injected" into the chain, without saying much about when
and how to do this.
  The 'snmpd.conf(5)' man page certainly mention this (though
it uses an undocumented form of the "injectHandler" directive!),
but there's no warning in the 'netsnmp_inject_handler'
documentation against using particular helpers.



> Dave> Secondly, I've tweaked the stash-cache handler to automatically
> Dave> inject the new stash-to-next handler into the chain if it
> Dave> detects that this is needed.
> Dave> Can you suggest a better way?
> 
> Depends on where you do it.  Neither you nor Robert clarified
> what you meant by "active".

During the course of processing a request.

I'm pretty sure I recall someone (possibly Robert?) suggesting
tinkering with the handler chain from within a user-provided
handler, in response to a user problem - I forget the details.
  This is doing the same thing, but within a helper handler.


>       Generally, handler chains should be messed with
> only when they're being built (IMHO, of course).
> Handler chains, I'd argue, are probably fairly safe to mess with
> during startup but probably shouldn't be tinkered with during
> processing.

That's what I'd half-expected (and precisely why I asked the question!)
OK - so we've probably got three options:

  a)  Live dangerously, and inject the stash_to_next handler
      into the chain while it's processing the (first) request,
          [ The current mode of operation ]

  b)  Have 'netsnmp_get_stash_cache_handler()' return a
      mini-chain of *both* the stash_cache and stash_to_next
      handlers, and inject these two into the handler chain
          [ assuming 'netsnmp_inject_handler' supports
            working with more than one handler, of course ]

  c)  Merge 'stash_to_next' into the main stash_cache helper

Oh, and I probably ought to include a fourth:

  d)  Forget about extending stash_cache support altogether.


Thoughts?

Dave



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to