summaryrefslogtreecommitdiff
path: root/cache
diff options
context:
space:
mode:
Diffstat (limited to 'cache')
-rw-r--r--cache/include/tango_cache_client.h1
-rw-r--r--cache/src/tango_cache_client.cpp11
2 files changed, 11 insertions, 1 deletions
diff --git a/cache/include/tango_cache_client.h b/cache/include/tango_cache_client.h
index 1ed9695..eac19bf 100644
--- a/cache/include/tango_cache_client.h
+++ b/cache/include/tango_cache_client.h
@@ -144,6 +144,7 @@ struct tango_cache_meta_put
const char* std_hdr[HDR_CONTENT_NUM]; //����ͷ������"Content-Type: text/html"����Ҫ�������У�NULL��ʾû�и�ͷ����
const char* usertag; //�������������ݣ�GETʱ��ԭ������
size_t usertag_len; //��󳤶�USER_TAG_MAX_LEN��0��ʾû�и�ͷ��
+ size_t user_log_name;
struct response_freshness put;
};
diff --git a/cache/src/tango_cache_client.cpp b/cache/src/tango_cache_client.cpp
index 520ba53..cdfb1bc 100644
--- a/cache/src/tango_cache_client.cpp
+++ b/cache/src/tango_cache_client.cpp
@@ -414,7 +414,16 @@ struct tango_cache_ctx *tango_cache_update_prepare(struct tango_cache_instance *
if(instance->param->hash_object_key)
{
caculate_sha256(meta->url, strlen(meta->url), buffer, 72);
- snprintf(ctx->object_key, 256, "%s/%c%c_%c%c_%s", instance->param->bucketname, buffer[0], buffer[1], buffer[2], buffer[3], buffer+4);
+ if(meta->user_log_name)
+ {
+ struct timespec start_time;
+ clock_gettime(CLOCK_REALTIME,&start_time);
+ snprintf(ctx->object_key, 256, "%s/%lu_%c%c_%c%c_%s", instance->param->bucketname, start_time.tv_nsec, buffer[0], buffer[1], buffer[2], buffer[3], buffer+4);
+ }
+ else
+ {
+ snprintf(ctx->object_key, 256, "%s/%c%c_%c%c_%s", instance->param->bucketname, buffer[0], buffer[1], buffer[2], buffer[3], buffer+4);
+ }
//����ԭʼURL
snprintf(buffer, 2064, "x-amz-meta-url: %s", meta->url);
ctx->headers = curl_slist_append(ctx->headers, buffer);