#85 修复ssl、http业务层中的编译警告。
This commit is contained in:
36
cache/src/tango_cache_pending.cpp
vendored
36
cache/src/tango_cache_pending.cpp
vendored
@@ -31,9 +31,6 @@ time_t get_time_value(const char* field_value, const char* field_type)
|
||||
void get_request_freshness(const char *value, struct request_freshness* restrict)
|
||||
{
|
||||
const char* field_value = NULL;
|
||||
const char* cache_control_time[] = { "min-fresh", "max-age" };
|
||||
int i = 0;
|
||||
time_t relative_time;
|
||||
field_value = strstr(value, "min-fresh");
|
||||
if (field_value != NULL)
|
||||
{
|
||||
@@ -50,7 +47,6 @@ void get_request_freshness(const char *value, struct request_freshness* restrict
|
||||
|
||||
enum cache_pending_action request_cache_control(const char* value, struct request_freshness* restrict)
|
||||
{
|
||||
int i = 0;
|
||||
if (strstr(value, "no-cache") != NULL)
|
||||
{
|
||||
return REVALIDATE;
|
||||
@@ -66,7 +62,6 @@ enum cache_pending_action request_cache_control(const char* value, struct reques
|
||||
|
||||
bool cache_verify(const struct tfe_http_half *request)
|
||||
{
|
||||
int i = 0;
|
||||
if( !tfe_http_std_field_read(request,TFE_HTTP_IF_MATCH) ||
|
||||
!tfe_http_std_field_read(request,TFE_HTTP_IF_NONE_MATCH) ||
|
||||
!tfe_http_std_field_read(request,TFE_HTTP_IF_MODIFIED_SINCE) ||
|
||||
@@ -81,7 +76,7 @@ bool cache_verify(const struct tfe_http_half *request)
|
||||
|
||||
const char* get_head_value(const struct tfe_http_field *http_fields, size_t n_fields, enum tfe_http_std_field head_key)
|
||||
{
|
||||
int i = 0;
|
||||
size_t i = 0;
|
||||
for (i = 0; i < n_fields; i++)
|
||||
{
|
||||
if (http_fields[i].http_field == head_key)
|
||||
@@ -107,8 +102,6 @@ enum cache_pending_action get_pragma_action(const char * value)
|
||||
enum cache_pending_action tfe_cache_get_pending(const struct tfe_http_half *request, struct request_freshness* restrict)
|
||||
{
|
||||
enum cache_pending_action res = UNDEFINED;
|
||||
int i = 0;
|
||||
int index = 0;
|
||||
const char *value = NULL;
|
||||
memset(restrict,0,sizeof(struct request_freshness));
|
||||
if(request->req_spec.method!=TFE_HTTP_METHOD_GET)
|
||||
@@ -170,23 +163,6 @@ bool is_standard_gmt_format(const char* value)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
time_t get_relative_time(const char* value)
|
||||
{
|
||||
const char* temp_str = NULL;
|
||||
char * str_age = NULL;
|
||||
time_t time = 0;
|
||||
const char * cache_ctl_time[] = { "s-maxage","max-age" };//s-maxage优先级大于max-age优先级
|
||||
int i = 0;
|
||||
for (; i < 2; i++)
|
||||
{
|
||||
temp_str = strstr(value, cache_ctl_time[i]);
|
||||
|
||||
}
|
||||
return time;
|
||||
}
|
||||
|
||||
|
||||
time_t get_response_s_maxage(const char* cache_ctl)
|
||||
{
|
||||
const char* s_maxage = NULL;
|
||||
@@ -195,6 +171,10 @@ time_t get_response_s_maxage(const char* cache_ctl)
|
||||
{
|
||||
return get_time_value(s_maxage, "s-maxage");
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -206,6 +186,10 @@ time_t get_response_maxage(const char* cache_ctl)
|
||||
{
|
||||
return get_time_value(max_age, "max-age");
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -279,8 +263,6 @@ enum cache_pending_action response_cache_control(const char* value)
|
||||
enum cache_pending_action tfe_cache_put_pending(const struct tfe_http_half *response, struct response_freshness* freshness)
|
||||
{
|
||||
enum cache_pending_action res = UNDEFINED;
|
||||
int i = 0;
|
||||
int index = 0;
|
||||
const char *value = NULL;
|
||||
memset(freshness,0,sizeof(struct response_freshness));
|
||||
if(response->resp_spec.resp_code!=TFE_HTTP_STATUS_OK
|
||||
|
||||
Reference in New Issue
Block a user