| 215 | } |
| 216 | |
| 217 | int |
| 218 | Cache::open_done() |
| 219 | { |
| 220 | Action *register_ShowCache(Continuation * c, HTTPHdr * h); |
| 221 | Action *register_ShowCacheInternal(Continuation * c, HTTPHdr * h); |
| 222 | |
| 223 | if (total_good_nvol == 0) { |
| 224 | ready = CACHE_INIT_FAILED; |
| 225 | cacheProcessor.cacheInitialized(); |
| 226 | return 0; |
| 227 | } |
| 228 | |
| 229 | { |
| 230 | CacheHostTable *hosttable_raw = new CacheHostTable(this, scheme); |
| 231 | hosttable.reset(hosttable_raw); |
| 232 | hosttable_raw->register_config_callback(&hosttable); |
| 233 | } |
| 234 | |
| 235 | ReplaceablePtr<CacheHostTable>::ScopedReader hosttable(&this->hosttable); |
| 236 | if (hosttable->gen_host_rec.num_cachevols == 0) { |
| 237 | ready = CACHE_INIT_FAILED; |
| 238 | } else { |
| 239 | ready = CACHE_INITIALIZED; |
| 240 | } |
| 241 | |
| 242 | // TS-3848 |
| 243 | if (ready == CACHE_INIT_FAILED && cacheProcessor.waitForCache() >= 2) { |
| 244 | Emergency("Failed to initialize cache host table"); |
| 245 | } |
| 246 | |
| 247 | cacheProcessor.cacheInitialized(); |
| 248 | |
| 249 | return 0; |
| 250 | } |
| 251 | |
| 252 | int |
| 253 | Cache::open(bool clear, bool /* fix ATS_UNUSED */) |
nothing calls this directly
no test coverage detected