> On Fri, 1 Oct 2004 13:50:17 -0600 Carlos wrote:
> CC> So my problem seems to be this.  On doing Sets to my box, I'm 
getting the
> CC> Mode as FREE (4).  Looking at the tutorial, it seems this should 
happen if
> CC> RESERVE1 or RESERVE2 fail.  Is there a way to skip the reservation 
part?

> No, there shouldn't be. Though it could be possible that a higher level 
handler
> is taking care of those modes for you. But if you handler isn't called 
for the
> reserver modes, I wouldn't expect it to be called for the free mode 
either.

> What kind of table are you using?

This might take a while to describe, but I'll try to be as brief as 
possible.

Picture this broken code if you would:
  A large case statement for processing the incoming request packet. 
Switch on:
  GET:
  NEXT:
  SET:
  COMMIT:
  UNDO:
  default:

The deficiency, while maybe obvious to the gurus here, wasn't clearly 
visible to
me.  The set process includes the "tester" packet, namely 'RESERVE1'. 
There's
also 'RESERVE2', but I wasn't seeing that one.

And so the bug here is that there is no switch for RESERVE1, RESERVE2, or 
FREE.
What happened when a RESERVE1 packet came in was that we hit the 'default'
switch.  Bad news because that returns 'GEN_ERR'.  This in turn causes the 
FREE
packet to be generated.  And actually the packet may actually just be a 
message,
I'm not sure. 

But you get the point.  On a Set, we were never hitting the SET switch 
because
we'd bail out on the Reserve.  Doing nothing more than just adding a 
switch for
RESERVE1 & RESERVE2 such that we don't return 'GEN_ERR' anymore fixed this 
bug
straight away.


> CC>  Maybe more to the point: what do
> CC> people do in routines to handle the Reserve packets?

> Allocate any resources you need to reserve to process a request (memory
> allocation, file locking, etc).

Okay I'll need to work on this.  This may take a while since most of the 
checks
are in the Set area.  Hopefully this is modular enough to cleanly copy 
over to
the Reserve area.  Does anything ever work cleanly on the 1st attempt in 
this 
business?  :-(

Carlos



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Net-snmp-users mailing list
[EMAIL PROTECTED]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to