Den 12-11-2011 13:58, [email protected] skrev:

> 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.

It is probably related to memory corruption. Read "man snmp_api", and

>  Error return status from  snmp_close  and  snmp_send  is  indicated  by
>  return  of  0.   A successful status will return a 1 for snmp_close and
>  the request id of the packet for  snmp_send.   Upon  successful  return
>  from snmp_send the pdu will be freed by the library.

so only free your pdu if snmp_send return 0

/Niels

-- 
Niels Baggesen -- @home -- Ã…rhus -- Denmark -- [email protected]
The purpose of computing is insight, not numbers  --  R W Hamming

------------------------------------------------------------------------------
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