You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Resolv APIs this plugin uses throw exceptions when there is no name associated with an address (or vice versa; read: lookup miss, not lookup failure), and our implmentation relies on these costly exceptions for flow control (Resolv#getname(address), Resolv#getaddress(name)).
But Resolv also provides public APIs that treat a lookup misses as non-exceptional (Resolv#each_name(address,&block), Resolv#each_address(name,&block), which still handle lookup failure exceptionally). I believe that we should look into using these APIs, and will need to modify our implementation to handle these lookup misses in the normal (non-exceptional) flow control.
The text was updated successfully, but these errors were encountered:
By using `Resolv#each_name` and `Resolv#each_address`, and returning the first
match from the block or returning nil if no matches were found, we can mirror
the behavior of `Resolv#getname` and `Resolv#getaddress` without raising
exceptions on lookup misses.
Adjusts flow-control to handle a nil return value as a lookup miss instead of
relying on exception handlers.
Resolves: logstash-plugins#60
By using `Resolv#each_name` and `Resolv#each_address`, and returning the first
match from the block or returning nil if no matches were found, we can mirror
the behavior of `Resolv#getname` and `Resolv#getaddress` without raising
exceptions on lookup misses.
Adjusts flow-control to handle a nil return value as a lookup miss instead of
relying on exception handlers.
Resolves: #60
The
Resolv
APIs this plugin uses throw exceptions when there is no name associated with an address (or vice versa; read: lookup miss, not lookup failure), and our implmentation relies on these costly exceptions for flow control (Resolv#getname(address)
,Resolv#getaddress(name)
).But
Resolv
also provides public APIs that treat a lookup misses as non-exceptional (Resolv#each_name(address,&block)
,Resolv#each_address(name,&block)
, which still handle lookup failure exceptionally). I believe that we should look into using these APIs, and will need to modify our implementation to handle these lookup misses in the normal (non-exceptional) flow control.The text was updated successfully, but these errors were encountered: