diff options
| author | zhengchao <[email protected]> | 2018-10-21 11:07:20 +0800 |
|---|---|---|
| committer | zhengchao <[email protected]> | 2018-10-21 11:07:20 +0800 |
| commit | 09db5de25b33b77bc42efd2e42ff5f14de9c4c4e (patch) | |
| tree | de32c2a3866400cef2ded5e5848b98efb2b3867d /cache | |
| parent | af4f470fe732b1357470f36f463bd93c972ed74f (diff) | |
修复缓存判定时,last modifide和expire字段的GMT的assert,改为if。
Diffstat (limited to 'cache')
| -rw-r--r-- | cache/src/tango_cache_pending.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cache/src/tango_cache_pending.cpp b/cache/src/tango_cache_pending.cpp index 2a5d928..22a42b3 100644 --- a/cache/src/tango_cache_pending.cpp +++ b/cache/src/tango_cache_pending.cpp @@ -148,7 +148,7 @@ time_t absolute_to_relative_time(const char* gmt_time) bool is_standard_gmt_format(const char* value) { int str_len = strlen(value); - if ((value[str_len - 1] == 'T') && (value[str_len - 2] == 'M') && (value[str_len - 3] == 'G')) + if(0==strcasecmp(value+str_len-3,"GMT")) { return true; } @@ -215,9 +215,8 @@ void get_response_freshness(const struct tfe_http_half *response, struct respons else { field_value = tfe_http_std_field_read(response, TFE_HTTP_EXPIRES); - if (field_value != NULL) + if (field_value != NULL && is_standard_gmt_format(field_value)) { - assert(is_standard_gmt_format(field_value)); expire_rel_time = absolute_to_relative_time(field_value); const time_t cur_ct_time = time(NULL); if (gmtime_r(&cur_ct_time, &cur_gmt_time) == NULL) |
