domain icon indicating copy to clipboard operation
domain copied to clipboard

StubResolver::lookup_srv: TTL is not exposed

Open WhyNotHugo opened this issue 1 year ago • 0 comments

I'm using StubResolver::lookup_srv to resolve the location of CalDav/CardDav servers via rfc6764.

My implementation works fine so far, but the lookup_srv does not return the TTL, so my application cannot know how long it should cache these results.

Currently, lookup_srv returns Result<Option<FoundSrvs>, SrvError>.

I believe that the FoundSrvs could have an additional property describing the TTL of the result. This change would be backwards compatible, since it would merely add a new field to a returned field.

I'm not sure what the best format is to return the TTL. Returning the raw integer means that the caller needs to immediately convert it into a timestamp, but might be a sensible choice to keep domain's implementation and API the simplest.

WhyNotHugo avatar Dec 03 '24 08:12 WhyNotHugo