diff options
author | James Cook <james@lindenlab.com> | 2010-05-06 16:29:51 -0700 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2010-05-06 16:29:51 -0700 |
commit | c0257c7fff8dacc83e69d39afcf522b09bdf28e9 (patch) | |
tree | caadbabd739864deaa43871c111a51dafb0220ae /indra/llmessage/llavatarnamecache.h | |
parent | 4fca2fe33013186d269f4f4f7b43d2a36089e539 (diff) |
DEV-49633 fixed, use Cache-Control max-age for display name expiration
We have no C++ libraries for parsing RFC 1123 dates, so parsing "Expires"
headers is risky. max-age delta-seconds is easier to parse and equivalent
for this use. Also added unit tests for max-age parsing. Pair-programmed
with Huseby.
Diffstat (limited to 'indra/llmessage/llavatarnamecache.h')
-rw-r--r-- | indra/llmessage/llavatarnamecache.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/indra/llmessage/llavatarnamecache.h b/indra/llmessage/llavatarnamecache.h index 26cecc5ab5..0a8b987b05 100644 --- a/indra/llmessage/llavatarnamecache.h +++ b/indra/llmessage/llavatarnamecache.h @@ -89,6 +89,15 @@ namespace LLAvatarNameCache void fetch(const LLUUID& agent_id); void insert(const LLUUID& agent_id, const LLAvatarName& av_name); + + // Compute name expiration time from HTTP Cache-Control header, + // or return default value, in seconds from epoch. + F64 nameExpirationFromHeaders(LLSD headers); } +// Parse a cache-control header to get the max-age delta-seconds. +// Returns true if header has max-age param and it parses correctly. +// Exported here to ease unit testing. +bool max_age_from_cache_control(const std::string& cache_control, S32 *max_age); + #endif |