Skip to main content

adopt

Function adopt 

Source
pub fn adopt(
    response: Option<SessionExpires>,
    asked_for: Option<Duration>,
) -> Option<Session>
Expand description

What a UAC learns from the 2xx to its own session refresh request (RFC 4028 §7.2).

asked_for is the interval this side put in the request, if any. It matters because a 2xx with no Session-Expires from a peer that never claimed to support timers does not mean “no timer” — §7.2 says the UAC may run one anyway, as refresher, purely for its own benefit.

The agreed interval is floored at ABSOLUTE_MIN_INTERVAL. §9 forbids a UAS from returning anything shorter, and §11.2 explains what a shorter one would be: a way to make this side emit requests as fast as the far end likes. Trusting the number because it arrived in a 2xx would leave the defence entirely in the hands of the party it defends against.