Hi,

 

First of all thanks for answering my previous query on "redirecting
debug info to a separate file".

This time I have a query on a strange behaviour of my application.

 

I am using SNMPv3 and using a callback to receive the response, so that
it will not act as a blocking call.

So I filled the callback variable as

 

session.callback = response_callback;

session.callback_magic = session_handle;

 

And after filling the data I will send like this.

 

snmp_send(session_handle, my_pdu);

snmp_free_pdu(my_pdu);

 

The problem with my code is, if i compile my application with a netsnmp
v5.7 code installed with a configuration script flag

--disable-debugging

the callback is not triggered.

 

But if I compile my app with a netsnmp v5.7 code installed with a
configuration script flag

--enable-debugging

the callback is triggered and everything will work fine, but the debug
info is also printed.

 

 

The source code remained same for both cases. Only difference is the
netsnmp code used for compiling.

I'm querying a CISCO switch and it shows that the response is sent in
both cases.

In the first case the received PDU remain unhandled, but in second case
the callback function handles the PDU.

 

 

Later I found that if I remove the snmp_free_pdu(my_pdu); from my code,
it will work in both cases.

Can anyone please explain this strange behaviour?

Is this pdu necessary for triggering the callback?

 

Thanks,

Basil Joseph

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to