[AGENT++] Handling result of missing object?

Jochen Katz katz at agentpp.com
Tue Jan 25 22:00:34 CET 2011


Am 25.01.2011 08:30, schrieb dominik.vogt at external.thalesgroup.com:
> On Tue, Jan 25, 2011 at 07:35:26AM +0100, Dominik Vogt wrote:
>>    For the records:  With the patch, Vb::get_value() returns
>>    SNMP_CLASS_INVALID, so it's not necessary to add an additional
>>    get_syntax() or get_exception_status().
> 
> *rolleyes*  I should have tested that instead of just reading the
> source code.  get_value() does *not* return ...INVALID.  However,
> I think it should.  This can be done by calling get_syntax()
> indirectly through Vb::get_syntax() instead of directly through
> SnmpSyntax->get_syntax().  See attached patch.

>     if (iv_vb_value &&
>         iv_vb_value->valid() &&
> -       (iv_vb_value->get_syntax() == sNMP_SYNTAX_INT32 ))
> +       (get_syntax() == sNMP_SYNTAX_INT32 ))

Like you, reading the source code, I don't see any possibility for
get_value() returning anything different than INVALID after the
exception status has been set, as iv_vb_value is freed and set to 0. So
my guess would be, that something with the rebuild after the change to
vb.h failed.

Regards,
  Jochen



More information about the AGENTPP mailing list