From 2e13728bfc268eba287a62be74420f12347bf0d0 Mon Sep 17 00:00:00 2001 From: zhengchao Date: Thu, 1 Nov 2018 17:41:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=93=E5=AD=98=E5=88=A4=E5=AE=9A=E6=9C=AA?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE=E5=A4=84=E7=90=86miss=E7=8A=B6=E6=80=81?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=AD=A4=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/business/pangu-http/src/pangu_http.cpp | 4 ++-- plugin/business/pangu-http/src/pangu_web_cache.cpp | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/plugin/business/pangu-http/src/pangu_http.cpp b/plugin/business/pangu-http/src/pangu_http.cpp index 07117e4..d631749 100644 --- a/plugin/business/pangu-http/src/pangu_http.cpp +++ b/plugin/business/pangu-http/src/pangu_http.cpp @@ -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; diff --git a/plugin/business/pangu-http/src/pangu_web_cache.cpp b/plugin/business/pangu-http/src/pangu_web_cache.cpp index eae6a3e..27182ea 100644 --- a/plugin/business/pangu-http/src/pangu_web_cache.cpp +++ b/plugin/business/pangu-http/src/pangu_web_cache.cpp @@ -421,7 +421,14 @@ 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; - return &(ctx->cached_obj_meta); + 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)