Changeset 9300
- Timestamp:
- 04/27/12 14:34:08 (13 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/acache_improvement/src/client/sysint/acache.c
r9299 r9300 31 31 #define STATIC_ACACHE_DEFAULT_TIMEOUT_MSECS 18000000 /* 5 hours */ 32 32 #define DYNAMIC_ACACHE_DEFAULT_TIMEOUT_MSECS 5000 /* 5 seconds */ 33 #define SECURITY_ACACHE_DEFAU TL_TIMEOUT_MSECS 7200000 /* 2 hours */33 #define SECURITY_ACACHE_DEFAULT_TIMEOUT_MSECS 7200000 /* 2 hours */ 34 34 35 35 … … 70 70 uint32_t mirror_copies_count; 71 71 72 uint64_t msecs_ _security; /**< Time when the security attr was refreshed. */73 uint64_t msecs_ _dynamic; /**< Time when the dynamic attrs were refreshed. */72 uint64_t msecs_security; /**< Time when the security attr was refreshed. */ 73 uint64_t msecs_dynamic; /**< Time when the dynamic attrs were refreshed. */ 74 74 }; 75 75 … … 352 352 /* struct static_payload* tmp_static_payload; */ 353 353 int status; 354 355 356 /* Get the current time */ 354 /* Storage of current time */ 357 355 struct timeval current_time = { 0, 0}; 358 356 uint64_t current_time_msecs = 0; 359 360 gettimeofday(¤t_time, NULL);361 362 current_time_msecs = current_time.sec * 1000;363 current_time_msecs += current_time.usec / 1000;364 365 357 /* Flags indicating whether dynamic attrs or security attr have expired. */ 366 358 unsigned char security_expired = 0; … … 407 399 PINT_perf_count(acache_pc, PERF_ACACHE_HITS, 1, PINT_PERF_ADD); 408 400 tmp_payload = tmp_entry->payload; 409 410 /* Check to see if either the security or dynamic attrs have expired.411 if()412 {413 security_expired = 1;414 }415 416 if()417 {418 dynamic_attrs_expired = 1;419 }420 */421 422 401 } 423 402 … … 428 407 return(ret); 429 408 } 430 409 410 gettimeofday(¤t_time, NULL); 411 current_time_msecs = current_time.tv_sec * 1000; 412 current_time_msecs += current_time.tv_usec / 1000; 413 414 /* Check to see if either the security or dynamic attrs have expired. */ 415 if((current_time_msecs - tmp_payload->msecs_security) > 416 SECURITY_ACACHE_DEFAULT_TIMEOUT_MSECS) 417 { 418 security_expired = 1; 419 420 /* Fetch/update security attr */ 421 422 } 423 424 if((current_time_msecs - tmp_payload->msecs_dynamic) > 425 DYNAMIC_ACACHE_DEFAULT_TIMEOUT_MSECS) 426 { 427 dynamic_attrs_expired = 1; 428 429 /* Fetch/update dynamic attrs */ 430 431 } 432 433 431 434 #if 0 432 435 gossip_debug(GOSSIP_ACACHE_DEBUG, "acache: "
