… | |
… | |
152 | } |
152 | } |
153 | |
153 | |
154 | use Net::SNMP (); |
154 | use Net::SNMP (); |
155 | use AnyEvent (); |
155 | use AnyEvent (); |
156 | |
156 | |
157 | our $VERSION = '6.0'; |
157 | our $VERSION = '6.02'; |
158 | |
158 | |
159 | $Net::SNMP::DISPATCHER = instance Net::SNMP::Dispatcher; |
159 | $Net::SNMP::DISPATCHER = instance Net::SNMP::Dispatcher; |
160 | |
160 | |
161 | our $MESSAGE_PROCESSING = $Net::SNMP::Dispatcher::MESSAGE_PROCESSING; |
161 | our $MESSAGE_PROCESSING = $Net::SNMP::Dispatcher::MESSAGE_PROCESSING; |
162 | |
162 | |
… | |
… | |
257 | |
257 | |
258 | # Set the error if applicable. |
258 | # Set the error if applicable. |
259 | $msg->error ($MESSAGE_PROCESSING->error) if $MESSAGE_PROCESSING->error; |
259 | $msg->error ($MESSAGE_PROCESSING->error) if $MESSAGE_PROCESSING->error; |
260 | |
260 | |
261 | # Notify the command generator to process the response. |
261 | # Notify the command generator to process the response. |
262 | $msg->process_response_pdu; |
262 | # Net::SNMP calls process_response_pdu, which simply calls callback_execute, |
|
|
263 | # but some errors cause $msg to be of type Net::SNMP::Message, not Net::SMMP::PDU, |
|
|
264 | # so we call the underlying callback_execute method which exists on both and |
|
|
265 | # seems to do the right thing. |
|
|
266 | $msg->callback_execute; |
263 | |
267 | |
264 | # Cancel the timeout. |
268 | # Cancel the timeout. |
265 | my $rtimeout_w = $msg->timeout_id; |
269 | my $rtimeout_w = $msg->timeout_id; |
266 | if ($$rtimeout_w) { |
270 | if ($$rtimeout_w) { |
267 | undef $$rtimeout_w; |
271 | undef $$rtimeout_w; |