From f83f3a48f9e334cd9f349cbbf1f36c053bb53956 Mon Sep 17 00:00:00 2001 From: zhangchengwei Date: Wed, 14 Nov 2018 15:06:02 +0800 Subject: [PATCH] =?UTF-8?q?strftime=E5=89=8D=E5=AF=B9struct=20tm=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cache/include/cache_evbase_client.h | 4 ++-- cache/include/tango_cache_client.h | 2 +- cache/src/tango_cache_tools.cpp | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cache/include/cache_evbase_client.h b/cache/include/cache_evbase_client.h index 8b910c9..46db0ea 100644 --- a/cache/include/cache_evbase_client.h +++ b/cache/include/cache_evbase_client.h @@ -28,10 +28,10 @@ void cache_evbase_get_statistics(const struct cache_evbase_instance *instance, s void cache_evbase_global_init(void); -//每个minio集群和bucket创建一个parameter +//每个minio集群和bucket创建一个parameter,多个instance可共享一个parameter; struct tango_cache_parameter *cache_evbase_parameter_new(const char* profile_path, const char* section, void *runtimelog); -/*创建实例,每线程一个,或使用时加锁*/ +/*创建实例,线程安全,内部会启动一个线程*/ struct cache_evbase_instance *cache_evbase_instance_new(struct tango_cache_parameter *param, void *runtimelog); diff --git a/cache/include/tango_cache_client.h b/cache/include/tango_cache_client.h index 2473916..cf7294a 100644 --- a/cache/include/tango_cache_client.h +++ b/cache/include/tango_cache_client.h @@ -106,7 +106,7 @@ void tango_cache_get_statistics(const struct tango_cache_instance *instance, str /*每个进程执行一次初始化*/ void tango_cache_global_init(void); -//每个minio集群和bucket创建一个parameter +//每个minio集群和bucket创建一个parameter,多个instance可共享一个parameter struct tango_cache_parameter *tango_cache_parameter_new(const char* profile_path, const char* section, void *runtimelog); /*以下所有API线程不安全*/ //每个监听线程创建一个instance diff --git a/cache/src/tango_cache_tools.cpp b/cache/src/tango_cache_tools.cpp index 1c821a1..0b78468 100644 --- a/cache/src/tango_cache_tools.cpp +++ b/cache/src/tango_cache_tools.cpp @@ -232,6 +232,7 @@ time_t expires_hdr2timestamp(const char *expires_val, int len) return 0; } + memset(&tm, 0, sizeof(struct tm)); if(strptime(expires_val, "%a, %d %b %Y %T", &tm) == NULL) { return 0;