2009/8/10 Tomas Macek <[email protected]>:
> Do I have to call snmp_free_pdu() after calling snmp_fix_pdu()?

That depends on what you intend to do with the response PDU
(containing the error) after you have constructed a "fixed" version.

If you intend to do more processing on the first response, then you
shouldn't release it (obviously!).   If you intend to resend the fixed
request (as in the command-line tools), then this will result in a
new 'response' PDU, which will override the existing one.  So you
probably should call 'snmp_free_pdu()' on the original response.


>                                               Looking at
> the library source code did not help me - it's not clear to me what
> is happening there.

The routine 'snmp_fix_pdu' makes a copy of the response PDU,
but omitting the varbind referenced by 'errindex'.


>                 I found some posts saying, that I don't need to call
> snmp_free_pdu() after fixing and also found some examples with
> snmp_free_pdu() after fixing. What is right?

Impossible to say, without knowing which posts you are referring to.
The example code (which does release the first response) looks OK
to me in that particular context.   But I'm not prepared to say that
the posts are wrong, without known what they actually say, and
in what context.

Dave

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to