#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)
|
void get_request_freshness(const char *value, struct request_freshness* restrict)
|
||||||
{
|
{
|
||||||
const char* field_value = NULL;
|
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");
|
field_value = strstr(value, "min-fresh");
|
||||||
if (field_value != NULL)
|
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)
|
enum cache_pending_action request_cache_control(const char* value, struct request_freshness* restrict)
|
||||||
{
|
{
|
||||||
int i = 0;
|
|
||||||
if (strstr(value, "no-cache") != NULL)
|
if (strstr(value, "no-cache") != NULL)
|
||||||
{
|
{
|
||||||
return REVALIDATE;
|
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)
|
bool cache_verify(const struct tfe_http_half *request)
|
||||||
{
|
{
|
||||||
int i = 0;
|
|
||||||
if( !tfe_http_std_field_read(request,TFE_HTTP_IF_MATCH) ||
|
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_NONE_MATCH) ||
|
||||||
!tfe_http_std_field_read(request,TFE_HTTP_IF_MODIFIED_SINCE) ||
|
!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)
|
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++)
|
for (i = 0; i < n_fields; i++)
|
||||||
{
|
{
|
||||||
if (http_fields[i].http_field == head_key)
|
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 tfe_cache_get_pending(const struct tfe_http_half *request, struct request_freshness* restrict)
|
||||||
{
|
{
|
||||||
enum cache_pending_action res = UNDEFINED;
|
enum cache_pending_action res = UNDEFINED;
|
||||||
int i = 0;
|
|
||||||
int index = 0;
|
|
||||||
const char *value = NULL;
|
const char *value = NULL;
|
||||||
memset(restrict,0,sizeof(struct request_freshness));
|
memset(restrict,0,sizeof(struct request_freshness));
|
||||||
if(request->req_spec.method!=TFE_HTTP_METHOD_GET)
|
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)
|
time_t get_response_s_maxage(const char* cache_ctl)
|
||||||
{
|
{
|
||||||
const char* s_maxage = NULL;
|
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");
|
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");
|
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 tfe_cache_put_pending(const struct tfe_http_half *response, struct response_freshness* freshness)
|
||||||
{
|
{
|
||||||
enum cache_pending_action res = UNDEFINED;
|
enum cache_pending_action res = UNDEFINED;
|
||||||
int i = 0;
|
|
||||||
int index = 0;
|
|
||||||
const char *value = NULL;
|
const char *value = NULL;
|
||||||
memset(freshness,0,sizeof(struct response_freshness));
|
memset(freshness,0,sizeof(struct response_freshness));
|
||||||
if(response->resp_spec.resp_code!=TFE_HTTP_STATUS_OK
|
if(response->resp_spec.resp_code!=TFE_HTTP_STATUS_OK
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#define likely(expr) __builtin_expect((expr), 1)
|
#define likely(expr) __builtin_expect((expr), 1)
|
||||||
#define unlikely(expr) __builtin_expect((expr), 0)
|
#define unlikely(expr) __builtin_expect((expr), 0)
|
||||||
|
#define UNUSED __attribute__((unused))
|
||||||
|
|
||||||
extern void * g_default_logger;
|
extern void * g_default_logger;
|
||||||
#define TFE_LOG_ERROR(handler, fmt, ...) \
|
#define TFE_LOG_ERROR(handler, fmt, ...) \
|
||||||
|
|||||||
@@ -521,7 +521,7 @@ struct key_keeper* key_keeper_init(const char * profile, const char* section, vo
|
|||||||
keeper->htable = create_hash_table(keeper->hash_slot_size, keeper->hash_expire_seconds);
|
keeper->htable = create_hash_table(keeper->hash_slot_size, keeper->hash_expire_seconds);
|
||||||
if(0==strcmp(keeper->untrusted_ca_path, keeper->trusted_ca_path))
|
if(0==strcmp(keeper->untrusted_ca_path, keeper->trusted_ca_path))
|
||||||
{
|
{
|
||||||
TFE_LOG_ERROR(logger, "Warnning: Trusted and Untrusted Root CA share the same path % .", keeper->trusted_ca_path);
|
TFE_LOG_ERROR(logger, "Warnning: Trusted and Untrusted Root CA share the same path %s .", keeper->trusted_ca_path);
|
||||||
}
|
}
|
||||||
if(keeper->work_mode==KK_MODE_DEBUG)
|
if(keeper->work_mode==KK_MODE_DEBUG)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1126,7 +1126,7 @@ static int ossl_session_ticket_key_callback(SSL *ssl_conn,
|
|||||||
if(0!=memcmp(name, key[0].name, 16))
|
if(0!=memcmp(name, key[0].name, 16))
|
||||||
{
|
{
|
||||||
TFE_LOG_INFO(mgr->logger, "ssl session ticket decrypt, key: \"%*s\" not found"
|
TFE_LOG_INFO(mgr->logger, "ssl session ticket decrypt, key: \"%*s\" not found"
|
||||||
,tfe_hexdump(buf, name ,16)-buf, buf);
|
,(int)(tfe_hexdump(buf, name ,16)-buf), buf);
|
||||||
ATOMIC_INC(&(mgr->stat_val[SSL_DOWN_TICKET_NOTFOUND]));
|
ATOMIC_INC(&(mgr->stat_val[SSL_DOWN_TICKET_NOTFOUND]));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -1430,7 +1430,6 @@ static void ssl_client_connected_eventcb(struct bufferevent * bev, short events,
|
|||||||
|
|
||||||
struct ssl_stream * s_stream = ctx->downstream;
|
struct ssl_stream * s_stream = ctx->downstream;
|
||||||
struct ssl_mgr* mgr=s_stream->mgr;
|
struct ssl_mgr* mgr=s_stream->mgr;
|
||||||
SSL_SESSION * ssl_sess = NULL;
|
|
||||||
const char* sni=ctx->origin_ssl->client_hello->sni?ctx->origin_ssl->client_hello->sni:"null";
|
const char* sni=ctx->origin_ssl->client_hello->sni?ctx->origin_ssl->client_hello->sni:"null";
|
||||||
char error_str[TFE_STRING_MAX]={0};
|
char error_str[TFE_STRING_MAX]={0};
|
||||||
if (events & BEV_EVENT_ERROR)
|
if (events & BEV_EVENT_ERROR)
|
||||||
@@ -1511,7 +1510,6 @@ void ssl_async_downstream_create(struct future * f, struct ssl_mgr * mgr, struct
|
|||||||
{
|
{
|
||||||
|
|
||||||
assert(upstream->dir == CONN_DIR_UPSTREAM);
|
assert(upstream->dir == CONN_DIR_UPSTREAM);
|
||||||
int * previous_verfiy_result=NULL;
|
|
||||||
const char* sni=NULL;
|
const char* sni=NULL;
|
||||||
struct ssl_connect_client_ctx * ctx = ALLOC(struct ssl_connect_client_ctx, 1);
|
struct ssl_connect_client_ctx * ctx = ALLOC(struct ssl_connect_client_ctx, 1);
|
||||||
ctx->keyring_id = keyring_id;
|
ctx->keyring_id = keyring_id;
|
||||||
@@ -1581,7 +1579,6 @@ static void pxy_ssl_shutdown_cb(evutil_socket_t fd, short what, void * arg)
|
|||||||
struct ssl_mgr* mgr=ctx->s_stream->mgr;
|
struct ssl_mgr* mgr=ctx->s_stream->mgr;
|
||||||
short want = 0;
|
short want = 0;
|
||||||
int rv = 0, sslerr = 0;
|
int rv = 0, sslerr = 0;
|
||||||
char tmp[1024];
|
|
||||||
if (ctx->ev)
|
if (ctx->ev)
|
||||||
{
|
{
|
||||||
event_free(ctx->ev);
|
event_free(ctx->ev);
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ struct ssl_trusted_cert_storage
|
|||||||
BIO *bio=NULL;
|
BIO *bio=NULL;
|
||||||
X509* x=NULL;
|
X509* x=NULL;
|
||||||
X509_CRL* x_crl=NULL;
|
X509_CRL* x_crl=NULL;
|
||||||
int error;
|
|
||||||
|
|
||||||
bio=BIO_new_file(filename, "r");
|
bio=BIO_new_file(filename, "r");
|
||||||
if(bio==NULL)
|
if(bio==NULL)
|
||||||
@@ -79,7 +78,7 @@ struct ssl_trusted_cert_storage
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int filter_pem_fn(const struct dirent * ent)
|
UNUSED static int filter_pem_fn(const struct dirent * ent)
|
||||||
{
|
{
|
||||||
const char* fn_suffix=".pem";
|
const char* fn_suffix=".pem";
|
||||||
if(strlen(ent->d_name)< strlen(fn_suffix))
|
if(strlen(ent->d_name)< strlen(fn_suffix))
|
||||||
@@ -152,7 +151,7 @@ static X509_STORE* _X509_store_create(const char* pem_bundle, const char* pem_di
|
|||||||
|
|
||||||
static MESA_htable_handle _create_mesa_htable(void)
|
static MESA_htable_handle _create_mesa_htable(void)
|
||||||
{
|
{
|
||||||
int ret=0;
|
UNUSED int ret=0;
|
||||||
MESA_htable_handle htable = MESA_htable_born();
|
MESA_htable_handle htable = MESA_htable_born();
|
||||||
ret = __wrapper_MESA_htable_set_opt_int(htable, MHO_SCREEN_PRINT_CTRL, 0);
|
ret = __wrapper_MESA_htable_set_opt_int(htable, MHO_SCREEN_PRINT_CTRL, 0);
|
||||||
ret = __wrapper_MESA_htable_set_opt_int(htable, MHO_THREAD_SAFE, 0);
|
ret = __wrapper_MESA_htable_set_opt_int(htable, MHO_THREAD_SAFE, 0);
|
||||||
@@ -172,7 +171,6 @@ static MESA_htable_handle _create_mesa_htable(void)
|
|||||||
struct ssl_trusted_cert_storage* ssl_trusted_cert_storage_create(const char* pem_bundle,
|
struct ssl_trusted_cert_storage* ssl_trusted_cert_storage_create(const char* pem_bundle,
|
||||||
const char* pem_dir, struct cert_store_param* param)
|
const char* pem_dir, struct cert_store_param* param)
|
||||||
{
|
{
|
||||||
int ret=0;
|
|
||||||
struct ssl_trusted_cert_storage* storage=ALLOC(struct ssl_trusted_cert_storage, 1);
|
struct ssl_trusted_cert_storage* storage=ALLOC(struct ssl_trusted_cert_storage, 1);
|
||||||
storage->param=*param;
|
storage->param=*param;
|
||||||
storage->effective_store=_X509_store_create(pem_bundle, pem_dir, &(storage->param));
|
storage->effective_store=_X509_store_create(pem_bundle, pem_dir, &(storage->param));
|
||||||
|
|||||||
@@ -275,7 +275,7 @@ void trusted_CA_update_crl_cb(int table_id,const char* table_line,void* u_para)
|
|||||||
ret=tfe_proxy_ssl_add_crl(crl_file);
|
ret=tfe_proxy_ssl_add_crl(crl_file);
|
||||||
if(ret<0)
|
if(ret<0)
|
||||||
{
|
{
|
||||||
TFE_LOG_ERROR(g_pangu_rt->local_logger, "Trusted CA Store add crl failed %d:%s:%s", crl_id, cert_id, crl_file);
|
TFE_LOG_ERROR(g_pangu_rt->local_logger, "Trusted CA Store add crl failed %d:%d:%s", crl_id, cert_id, crl_file);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -287,7 +287,7 @@ void trusted_CA_update_crl_cb(int table_id,const char* table_line,void* u_para)
|
|||||||
ret=tfe_proxy_ssl_del_crl(crl_file);
|
ret=tfe_proxy_ssl_del_crl(crl_file);
|
||||||
if(ret<0)
|
if(ret<0)
|
||||||
{
|
{
|
||||||
TFE_LOG_ERROR(g_pangu_rt->local_logger, "Trusted CA Store del crl failed %d:%s:%s", crl_id, cert_id, crl_file);
|
TFE_LOG_ERROR(g_pangu_rt->local_logger, "Trusted CA Store del crl failed %d:%d:%s", crl_id, cert_id, crl_file);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -298,7 +298,6 @@ void trusted_CA_update_crl_cb(int table_id,const char* table_line,void* u_para)
|
|||||||
}
|
}
|
||||||
void trusted_CA_update_finish_cb(void* u_para)
|
void trusted_CA_update_finish_cb(void* u_para)
|
||||||
{
|
{
|
||||||
int is_last_updating_table=0, ret=0;
|
|
||||||
if(g_pangu_rt->ca_store_reseting>0)
|
if(g_pangu_rt->ca_store_reseting>0)
|
||||||
{
|
{
|
||||||
g_pangu_rt->ca_store_reseting--;
|
g_pangu_rt->ca_store_reseting--;
|
||||||
@@ -885,7 +884,7 @@ enum pangu_action http_scan(const struct tfe_http_session * session, enum tfe_ht
|
|||||||
struct http_field_name field_name;
|
struct http_field_name field_name;
|
||||||
struct Maat_rule_t result[MAX_SCAN_RESULT];
|
struct Maat_rule_t result[MAX_SCAN_RESULT];
|
||||||
char buff[TFE_STRING_MAX], * p = NULL;
|
char buff[TFE_STRING_MAX], * p = NULL;
|
||||||
int scan_ret = 0, table_id = 0, read_rule_ret = 0;
|
int scan_ret = 0, table_id = 0;
|
||||||
size_t hit_cnt = 0, i = 0;
|
size_t hit_cnt = 0, i = 0;
|
||||||
|
|
||||||
if (events & EV_HTTP_REQ_HDR)
|
if (events & EV_HTTP_REQ_HDR)
|
||||||
@@ -1185,7 +1184,6 @@ static void cache_pending_on_fail(enum e_future_error err, const char * what, vo
|
|||||||
|
|
||||||
void cache_pending(const struct tfe_http_session * session, unsigned int thread_id, struct pangu_http_ctx * ctx)
|
void cache_pending(const struct tfe_http_session * session, unsigned int thread_id, struct pangu_http_ctx * ctx)
|
||||||
{
|
{
|
||||||
enum cache_pending_result ret;
|
|
||||||
ctx->f_cache_pending=future_create("cache_pend", cache_pending_on_succ, cache_pending_on_fail, ctx);
|
ctx->f_cache_pending=future_create("cache_pend", cache_pending_on_succ, cache_pending_on_fail, ctx);
|
||||||
ctx->ref_session=tfe_http_session_allow_write(session);
|
ctx->ref_session=tfe_http_session_allow_write(session);
|
||||||
ctx->pending_result=web_cache_async_pending(g_pangu_rt->cache, thread_id, session->req, &(ctx->cmid), ctx->f_cache_pending);
|
ctx->pending_result=web_cache_async_pending(g_pangu_rt->cache, thread_id, session->req, &(ctx->cmid), ctx->f_cache_pending);
|
||||||
@@ -1274,12 +1272,13 @@ void pangu_on_http_end(const struct tfe_stream * stream,
|
|||||||
const struct tfe_http_session * session, unsigned int thread_id, void ** pme)
|
const struct tfe_http_session * session, unsigned int thread_id, void ** pme)
|
||||||
{
|
{
|
||||||
struct pangu_http_ctx * ctx = *(struct pangu_http_ctx **) pme;
|
struct pangu_http_ctx * ctx = *(struct pangu_http_ctx **) pme;
|
||||||
int i=0, j=0,ret=0;
|
size_t i=0, j=0;
|
||||||
|
int ret=0;
|
||||||
if(ctx->action == PG_ACTION_REPLACE && ctx->rep_ctx->actually_replaced==0)
|
if(ctx->action == PG_ACTION_REPLACE && ctx->rep_ctx->actually_replaced==0)
|
||||||
{
|
{
|
||||||
for(i=0; i< ctx->n_enforce; i++)
|
for(i=0; i< ctx->n_enforce; i++)
|
||||||
{
|
{
|
||||||
if(ctx->enforce_rules[i].action == PG_ACTION_REPLACE)
|
if((unsigned char)ctx->enforce_rules[i].action == PG_ACTION_REPLACE)
|
||||||
{
|
{
|
||||||
if(i+1 > ctx->n_enforce)
|
if(i+1 > ctx->n_enforce)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -77,8 +77,8 @@ struct cache_param
|
|||||||
int min_use;
|
int min_use;
|
||||||
time_t pinning_time_sec;
|
time_t pinning_time_sec;
|
||||||
time_t inactive_time_sec;
|
time_t inactive_time_sec;
|
||||||
long max_cache_size;
|
size_t max_cache_size;
|
||||||
long max_cache_obj_size;
|
size_t max_cache_obj_size;
|
||||||
pthread_mutex_t lock;
|
pthread_mutex_t lock;
|
||||||
};
|
};
|
||||||
struct cache_bloom
|
struct cache_bloom
|
||||||
@@ -132,7 +132,7 @@ static void web_cache_stat_cb(evutil_socket_t fd, short what, void * arg)
|
|||||||
memset(&client_stat_sum, 0, sizeof(client_stat_sum));
|
memset(&client_stat_sum, 0, sizeof(client_stat_sum));
|
||||||
long long *val_sum = (long long *)&client_stat_sum;
|
long long *val_sum = (long long *)&client_stat_sum;
|
||||||
long long *val = NULL;
|
long long *val = NULL;
|
||||||
int i=0, j=0;
|
unsigned int i=0, j=0;
|
||||||
for(i=0; i<cache->thread_count;i++)
|
for(i=0; i<cache->thread_count;i++)
|
||||||
{
|
{
|
||||||
tango_cache_get_statistics(cache->clients[i], &client_stat);
|
tango_cache_get_statistics(cache->clients[i], &client_stat);
|
||||||
@@ -346,7 +346,7 @@ char is_dynamic_url(const char* url)
|
|||||||
|
|
||||||
char * cookie_scanvalue(const char * key, const char * cookies, char * val, size_t val_len)
|
char * cookie_scanvalue(const char * key, const char * cookies, char * val, size_t val_len)
|
||||||
{
|
{
|
||||||
int i=0, j=0, k=0, key_len=0;
|
unsigned int i=0, j=0, k=0;
|
||||||
int found=1;
|
int found=1;
|
||||||
char* key_dup=ALLOC(char, strlen(key)+2);
|
char* key_dup=ALLOC(char, strlen(key)+2);
|
||||||
char* cookie_dup=ALLOC(char, strlen(cookies)+1);
|
char* cookie_dup=ALLOC(char, strlen(cookies)+1);
|
||||||
@@ -401,7 +401,7 @@ char* url_remove_qs(const char* url, int qs_num, char* ignore_qs[])
|
|||||||
query_string=strchr(url_copy, '?');
|
query_string=strchr(url_copy, '?');
|
||||||
if(query_string!=NULL)
|
if(query_string!=NULL)
|
||||||
{
|
{
|
||||||
strncat(target_url, url_copy, MIN(query_string-url_copy,target_size));
|
strncat(target_url, url_copy, MIN((unsigned int)(query_string-url_copy),target_size));
|
||||||
query_string++;
|
query_string++;
|
||||||
for (token = query_string; ; token= NULL)
|
for (token = query_string; ; token= NULL)
|
||||||
{
|
{
|
||||||
@@ -470,10 +470,10 @@ void cache_param_new(int idx, const struct Maat_rule_t* rule, const char* srv_de
|
|||||||
MAAT_RULE_EX_DATA* ad, long argl, void *argp)
|
MAAT_RULE_EX_DATA* ad, long argl, void *argp)
|
||||||
{
|
{
|
||||||
struct cache_handle* cache=(struct cache_handle*) argp;
|
struct cache_handle* cache=(struct cache_handle*) argp;
|
||||||
int i=0;
|
unsigned int i=0;
|
||||||
size_t len=0;
|
size_t len=0;
|
||||||
*ad=NULL;
|
*ad=NULL;
|
||||||
if(rule->serv_def_len<strlen("{}")+1)
|
if((unsigned int)rule->serv_def_len<strlen("{}")+1)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -553,7 +553,7 @@ void cache_param_new(int idx, const struct Maat_rule_t* rule, const char* srv_de
|
|||||||
}
|
}
|
||||||
void cache_param_free(int idx, const struct Maat_rule_t* rule, const char* srv_def_large, MAAT_RULE_EX_DATA* ad, long argl, void *argp)
|
void cache_param_free(int idx, const struct Maat_rule_t* rule, const char* srv_def_large, MAAT_RULE_EX_DATA* ad, long argl, void *argp)
|
||||||
{
|
{
|
||||||
int i=0;
|
unsigned int i=0;
|
||||||
if(*ad==NULL)
|
if(*ad==NULL)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -617,9 +617,8 @@ struct cache_handle* create_web_cache_handle(const char* profile_path, const cha
|
|||||||
(int*)&(cache->cache_key_bloom_size), 16*1000*1000);
|
(int*)&(cache->cache_key_bloom_size), 16*1000*1000);
|
||||||
MESA_load_profile_int_def(profile_path, section, "cache_key_bloom_life",
|
MESA_load_profile_int_def(profile_path, section, "cache_key_bloom_life",
|
||||||
&(cache->cache_key_bloom_life), 30*60);
|
&(cache->cache_key_bloom_life), 30*60);
|
||||||
char bloom_filename[TFE_PATH_MAX]{0};
|
|
||||||
struct timeval gc_refresh_delay = {cache->cache_key_bloom_life, 0};
|
struct timeval gc_refresh_delay = {cache->cache_key_bloom_life, 0};
|
||||||
int i=0;
|
unsigned int i=0;
|
||||||
|
|
||||||
struct tango_cache_parameter *cache_client_param=tango_cache_parameter_new(profile_path, section, logger);
|
struct tango_cache_parameter *cache_client_param=tango_cache_parameter_new(profile_path, section, logger);
|
||||||
for(i=0; i<cache->thread_count; i++)
|
for(i=0; i<cache->thread_count; i++)
|
||||||
@@ -956,7 +955,6 @@ enum cache_pending_result web_cache_async_pending(struct cache_handle* handle, u
|
|||||||
const struct tfe_http_half * request, struct cache_mid** mid, struct future* f_revalidate)
|
const struct tfe_http_half * request, struct cache_mid** mid, struct future* f_revalidate)
|
||||||
{
|
{
|
||||||
enum cache_pending_result result=PENDING_RESULT_FOBIDDEN;
|
enum cache_pending_result result=PENDING_RESULT_FOBIDDEN;
|
||||||
int is_undefined_obj=0;
|
|
||||||
struct Maat_rule_t cache_policy;
|
struct Maat_rule_t cache_policy;
|
||||||
struct cache_param* param=&(handle->default_cache_policy);
|
struct cache_param* param=&(handle->default_cache_policy);
|
||||||
MAAT_RULE_EX_DATA ex_data=NULL;
|
MAAT_RULE_EX_DATA ex_data=NULL;
|
||||||
@@ -1030,7 +1028,6 @@ enum cache_pending_result web_cache_async_pending(struct cache_handle* handle, u
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
is_undefined_obj=1;
|
|
||||||
ATOMIC_INC(&(handle->stat_val[STAT_CACHE_OVERRIDE_QUERY]));
|
ATOMIC_INC(&(handle->stat_val[STAT_CACHE_OVERRIDE_QUERY]));
|
||||||
result=PENDING_RESULT_ALLOWED;
|
result=PENDING_RESULT_ALLOWED;
|
||||||
}
|
}
|
||||||
@@ -1098,10 +1095,8 @@ enum cache_pending_result web_cache_async_pending(struct cache_handle* handle, u
|
|||||||
int web_cache_async_query(struct cache_handle* handle, unsigned int thread_id,
|
int web_cache_async_query(struct cache_handle* handle, unsigned int thread_id,
|
||||||
const struct tfe_http_half * request, struct cache_mid** mid, struct future* f)
|
const struct tfe_http_half * request, struct cache_mid** mid, struct future* f)
|
||||||
{
|
{
|
||||||
enum cache_pending_action get_action;
|
|
||||||
struct cache_query_context* query_ctx=NULL;
|
struct cache_query_context* query_ctx=NULL;
|
||||||
struct promise* p=NULL;
|
struct promise* p=NULL;
|
||||||
struct future* _f=NULL;
|
|
||||||
struct cache_mid* _mid=*mid;
|
struct cache_mid* _mid=*mid;
|
||||||
assert(_mid->result!=PENDING_RESULT_FOBIDDEN);
|
assert(_mid->result!=PENDING_RESULT_FOBIDDEN);
|
||||||
|
|
||||||
|
|||||||
@@ -137,8 +137,6 @@ size_t select_replace_rule(enum replace_zone zone, const struct replace_rule * r
|
|||||||
|
|
||||||
size_t replace_string(const char * in, size_t in_sz, const struct replace_rule * zone, char** out)
|
size_t replace_string(const char * in, size_t in_sz, const struct replace_rule * zone, char** out)
|
||||||
{
|
{
|
||||||
size_t replace_len = strlen(zone->replace_with);
|
|
||||||
|
|
||||||
assert(strlen(zone->find) != 0);
|
assert(strlen(zone->find) != 0);
|
||||||
|
|
||||||
int error;
|
int error;
|
||||||
|
|||||||
Reference in New Issue
Block a user