From cb27db40f242ba54db4d4bfee5326e86fa993f40 Mon Sep 17 00:00:00 2001 From: Lu Qiuwen Date: Sun, 14 Oct 2018 14:29:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Cache-Control=E7=9B=B8?= =?UTF-8?q?=E5=85=B3HTTP=E5=A4=B4=E9=83=A8=E5=AD=97=E6=AE=B5=E6=A0=87?= =?UTF-8?q?=E5=87=86=E5=9F=9F=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/src/tfe_http.cpp | 8 +++++++- platform/src/proxy.cpp | 4 ++-- plugin/protocol/http/src/http_half.cpp | 8 +++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/common/src/tfe_http.cpp b/common/src/tfe_http.cpp index cf5bf53..53196ef 100644 --- a/common/src/tfe_http.cpp +++ b/common/src/tfe_http.cpp @@ -40,7 +40,13 @@ static const char * __str_std_header_field_map[] = [TFE_HTTP_CONT_TYPE] = "Content-Type", [TFE_HTTP_CONT_DISPOSITION] = "Content-Disposition", [TFE_HTTP_EXPIRES] = "Expires", - [TFE_HTTP_ACCEPT_ENCODING] = "Accept-Encoding" + [TFE_HTTP_ACCEPT_ENCODING] = "Accept-Encoding", + [TFE_HTTP_CACHE_CONTROL] = "Cache-Control", + [TFE_HTTP_IF_MATCH] = "If-Match", + [TFE_HTTP_IF_NONE_MATCH] = "If-None-Match", + [TFE_HTTP_IF_MODIFIED_SINCE] = "If-Modified-Since", + [TFE_HTTP_IF_UNMODIFIED_SINCE] = "If-Unmodified-Since", + [TFE_HTTP_LAST_MODIFIED] = "Last-Modified" }; static const char * __str_std_method_map[1024] = {}; diff --git a/platform/src/proxy.cpp b/platform/src/proxy.cpp index 96f0c68..68c0472 100644 --- a/platform/src/proxy.cpp +++ b/platform/src/proxy.cpp @@ -274,7 +274,7 @@ int main(int argc, char *argv[]) } - + future_promise_library_init(); tango_cache_global_init(); @@ -348,7 +348,7 @@ unsigned int tfe_proxy_get_thread_count(void) struct event_base * tfe_proxy_get_evbase(unsigned int thread_id) { assert(thread_idnr_work_threads); - return g_default_proxy->work_threads[thread_id].evbase; + return g_default_proxy->work_threads[thread_id]->evbase; } diff --git a/plugin/protocol/http/src/http_half.cpp b/plugin/protocol/http/src/http_half.cpp index b5149b7..50d3117 100644 --- a/plugin/protocol/http/src/http_half.cpp +++ b/plugin/protocol/http/src/http_half.cpp @@ -41,7 +41,13 @@ static const char * __str_std_header_field_map[] = [TFE_HTTP_CONT_TYPE] = "Content-Type", [TFE_HTTP_CONT_DISPOSITION] = "Content-Disposition", [TFE_HTTP_EXPIRES] = "Expires", - [TFE_HTTP_ACCEPT_ENCODING] = "Accept-Encoding" + [TFE_HTTP_ACCEPT_ENCODING] = "Accept-Encoding", + [TFE_HTTP_CACHE_CONTROL] = "Cache-Control", + [TFE_HTTP_IF_MATCH] = "If-Match", + [TFE_HTTP_IF_NONE_MATCH] = "If-None-Match", + [TFE_HTTP_IF_MODIFIED_SINCE] = "If-Modified-Since", + [TFE_HTTP_IF_UNMODIFIED_SINCE] = "If-Unmodified-Since", + [TFE_HTTP_LAST_MODIFIED] = "Last-Modified" }; static enum tfe_http_std_field __str_header_field_to_std_field_id(const char * str_field, size_t len)