xrtHttpCacheTimeInit

初始化不存在 Date、Age 和 Expires 字段的空时间元数据。

void xrtHttpCacheTimeInit( xhttpcachetime* pTime );
参数说明
xhttpcachetime* pTime出:时间
返回:初始化不存在 Date、Age 和 Expires 字段的空时间元数据。

示例已编译验证

httpcachetimeinit obj;
xrtHttpCacheTimeInit(&obj, pTime);

xrtHttpCacheTimeValid

判断公开时间元数据是否满足字段计数、标志和值约束。

bool xrtHttpCacheTimeValid( const xhttpcachetime* pTime );
参数说明
const xhttpcachetime* pTime出:时间
返回:判断公开时间元数据是否满足字段计数、标志和值约束。

示例已编译验证

/* 判断公开时间元数据是否满足字段计数、标志和值约束。 */
result = xrtHttpCacheTimeValid(pTime);

xrtHttpCacheTimeParse

XRT_API bool xrtHttpCacheTimeParse( const xhttpfield* pFields, size_t iCount, xhttpcachetime* pTime );

;
返回:XRT_API bool xrtHttpCacheTimeParse( const xhttpfield* pFields, size_t iCount, xhttpcachetime* pTime );

示例已编译验证

/* XRT_API bool xrtHttpCacheTimeParse( const xhttpfield* pFields, size_t iCount, xhttpcachetime* pTime ); */
result = xrtHttpCacheTimeParse();

xrtHttpCacheCurrentAge

XRT_API xhttpcachecalc xrtHttpCacheCurrentAge( const xhttpcachetime* pTime, xtime ResponseTime, uint64 RequestClock, uint64 ResponseClock, uint64 NowClock, xhttpcacheage* pAge );

;
返回:XRT_API xhttpcachecalc xrtHttpCacheCurrentAge( const xhttpcachetime* pTime, xtime ResponseTime, uint64 RequestClock, uint64 ResponseClock, uint64 NowClock, xhttpcacheage* pAge );

示例已编译验证

/* XRT_API xhttpcachecalc xrtHttpCacheCurrentAge( const xhttpcachetime* pTime, xtime ResponseTime, uint64 RequestClock, uint64 ResponseClock, uint64 NowClock, xhttpcacheage* pAge ); */
result = xrtHttpCacheCurrentAge();

xrtHttpCacheFreshness

XRT_API xhttpcachecalc xrtHttpCacheFreshness( const xhttpcachecontrol* pControl, const xhttpcachetime* pTime, xtime ResponseTime, bool Shared, xhttpcachefreshness* pFreshness );

;
返回:XRT_API xhttpcachecalc xrtHttpCacheFreshness( const xhttpcachecontrol* pControl, const xhttpcachetime* pTime, xtime ResponseTime, bool Shared, xhttpcachefreshness* pFreshness );

示例已编译验证

/* XRT_API xhttpcachecalc xrtHttpCacheFreshness( const xhttpcachecontrol* pControl, const xhttpcachetime* pTime, xtime ResponseTime, bool Shared, xhttpcachefreshness* pFreshness ); */
result = xrtHttpCacheFreshness();

xrtHttpCacheAgeValid

判断年龄公式的全部公开中间量是否相互一致。

bool xrtHttpCacheAgeValid( const xhttpcacheage* pAge );
参数说明
const xhttpcacheage* pAgeAge 参数
返回:判断年龄公式的全部公开中间量是否相互一致。

示例已编译验证

/* 判断年龄公式的全部公开中间量是否相互一致。 */
result = xrtHttpCacheAgeValid(pAge);

xrtHttpCacheFreshnessValid

XRT_API bool xrtHttpCacheFreshnessValid( const xhttpcachefreshness* pFreshness );

;
返回:XRT_API bool xrtHttpCacheFreshnessValid( const xhttpcachefreshness* pFreshness );

示例已编译验证

/* XRT_API bool xrtHttpCacheFreshnessValid( const xhttpcachefreshness* pFreshness ); */
result = xrtHttpCacheFreshnessValid();

xrtHttpCacheFresh

按 freshness_lifetime > current_age 判断响应是否仍然新鲜。

bool xrtHttpCacheFresh( const xhttpcacheage* pAge, const xhttpcachefreshness* pFreshness );
参数说明
const xhttpcacheage* pAgeAge 参数
const xhttpcachefreshness* pFreshnessFreshness 参数
返回:按 freshness_lifetime > current_age 判断响应是否仍然新鲜。

示例已编译验证

/* 按 freshness_lifetime > current_age 判断响应是否仍然新鲜。 */
result = xrtHttpCacheFresh(pAge, pFreshness);