rust-public-ip icon indicating copy to clipboard operation
rust-public-ip copied to clipboard

Filter resolvers to compatible address type instead of trying resolvers until a compatible address type comes out

Open jcgruenhage opened this issue 2 years ago • 2 comments

Right now, when querying for a specific address family, this generates a stream of results that query any resolvers, and will potentially query an incompatible resolver, just to throw away the result because the result is incompatible. This potentially delays the result and causes unnecessary load on the backend providers side.

I'd be willing to implement this, but I'd like to wait for feedback here if this is wanted and whether you have any strong opinions on how this should be implemented.

jcgruenhage avatar Jan 15 '23 10:01 jcgruenhage

Is this really the case? The family is passed to the resolver, see: https://github.com/avitex/rust-public-ip/blob/675505fd52d56805a3684004ad5d0a6523def2b7/src/lib.rs#L195-L201

It is not expected that a different family is returned, but checked still.

aWeinzierl avatar Jan 31 '24 00:01 aWeinzierl