缓存判定未正确处理miss状态,修复此问题。

This commit is contained in:
zhengchao
2018-11-01 17:41:30 +08:00
parent 8cd2acdef8
commit 2e13728bfc
2 changed files with 10 additions and 3 deletions

View File

@@ -1007,9 +1007,9 @@ static void cache_pending_on_succ(future_result_t * result, void * user)
ctx->pending_result = PENDING_RESULT_MISS;
return;
}
if(!(meta->etag && meta->last_modified))
if( meta->etag==NULL && meta->last_modified==NULL)
{
ctx->pending_result = PENDING_RESULT_FOBIDDEN;
ctx->pending_result = PENDING_RESULT_MISS;
return;
}
ctx->pending_result=PENDING_RESULT_REVALIDATE;

View File

@@ -421,8 +421,15 @@ void cache_pending_ctx_free_cb(void* p)
const struct cached_meta* cache_pending_result_read_meta(future_result_t * result)
{
struct cache_pending_context* ctx=(struct cache_pending_context*)result;
if(ctx->status==PENDING_RESULT_MISS)
{
return NULL;
}
else
{
return &(ctx->cached_obj_meta);
}
}
static void cache_query_meta_on_succ(future_result_t * result, void * user)
{