#85 修复ssl、http业务层中的编译警告。

This commit is contained in:
zhengchao
2018-11-20 19:34:27 +08:00
parent 866883a1f7
commit 6c9ff10aa7
8 changed files with 29 additions and 59 deletions

View File

@@ -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);
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
{
@@ -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);
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
{
@@ -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)
{
int is_last_updating_table=0, ret=0;
if(g_pangu_rt->ca_store_reseting>0)
{
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 Maat_rule_t result[MAX_SCAN_RESULT];
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;
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)
{
enum cache_pending_result ret;
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->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)
{
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)
{
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)
{

View File

@@ -77,8 +77,8 @@ struct cache_param
int min_use;
time_t pinning_time_sec;
time_t inactive_time_sec;
long max_cache_size;
long max_cache_obj_size;
size_t max_cache_size;
size_t max_cache_obj_size;
pthread_mutex_t lock;
};
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));
long long *val_sum = (long long *)&client_stat_sum;
long long *val = NULL;
int i=0, j=0;
unsigned int i=0, j=0;
for(i=0; i<cache->thread_count;i++)
{
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)
{
int i=0, j=0, k=0, key_len=0;
unsigned int i=0, j=0, k=0;
int found=1;
char* key_dup=ALLOC(char, strlen(key)+2);
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, '?');
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++;
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)
{
struct cache_handle* cache=(struct cache_handle*) argp;
int i=0;
unsigned int i=0;
size_t len=0;
*ad=NULL;
if(rule->serv_def_len<strlen("{}")+1)
if((unsigned int)rule->serv_def_len<strlen("{}")+1)
{
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)
{
int i=0;
unsigned int i=0;
if(*ad==NULL)
{
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);
MESA_load_profile_int_def(profile_path, section, "cache_key_bloom_life",
&(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};
int i=0;
unsigned int i=0;
struct tango_cache_parameter *cache_client_param=tango_cache_parameter_new(profile_path, section, logger);
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)
{
enum cache_pending_result result=PENDING_RESULT_FOBIDDEN;
int is_undefined_obj=0;
struct Maat_rule_t cache_policy;
struct cache_param* param=&(handle->default_cache_policy);
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
{
is_undefined_obj=1;
ATOMIC_INC(&(handle->stat_val[STAT_CACHE_OVERRIDE_QUERY]));
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,
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 promise* p=NULL;
struct future* _f=NULL;
struct cache_mid* _mid=*mid;
assert(_mid->result!=PENDING_RESULT_FOBIDDEN);

View File

@@ -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_len = strlen(zone->replace_with);
assert(strlen(zone->find) != 0);
int error;