#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

@@ -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);