| 3038 | } |
| 3039 | |
| 3040 | TSReturnCode |
| 3041 | TSCacheKeyHostNameSet(TSCacheKey key, const char *hostname, int host_len) |
| 3042 | { |
| 3043 | sdk_assert(sdk_sanity_check_cachekey(key) == TS_SUCCESS); |
| 3044 | sdk_assert(sdk_sanity_check_null_ptr((void *)hostname) == TS_SUCCESS); |
| 3045 | sdk_assert(host_len > 0); |
| 3046 | |
| 3047 | if ((reinterpret_cast<CacheInfo *>(key))->magic != CACHE_INFO_MAGIC_ALIVE) { |
| 3048 | return TS_ERROR; |
| 3049 | } |
| 3050 | |
| 3051 | CacheInfo *i = reinterpret_cast<CacheInfo *>(key); |
| 3052 | /* need to make a copy of the hostname. The caller |
| 3053 | might deallocate it anytime in the future */ |
| 3054 | i->hostname = static_cast<char *>(ats_malloc(host_len)); |
| 3055 | memcpy(i->hostname, hostname, host_len); |
| 3056 | i->len = host_len; |
| 3057 | return TS_SUCCESS; |
| 3058 | } |
| 3059 | |
| 3060 | TSReturnCode |
| 3061 | TSCacheKeyPinnedSet(TSCacheKey key, time_t pin_in_cache) |
nothing calls this directly
no test coverage detected