Commit f5b76d8c authored by Kentoku's avatar Kentoku Committed by Kentoku SHIBA

fix compiler warnings

parent aab6cefe
......@@ -4565,16 +4565,18 @@ SPIDER_IP_PORT_CONN* spider_create_ipport_conn(SPIDER_CONN *conn)
goto err_malloc_key;
}
ret->key = (char *) my_malloc(ret->key_len, MY_ZEROFILL | MY_WME);
ret->key = (char *) my_malloc(ret->key_len + conn->tgt_host_length + 1,
MY_ZEROFILL | MY_WME);
if (!ret->key) {
pthread_cond_destroy(&ret->cond);
pthread_mutex_destroy(&ret->mutex);
goto err_malloc_key;
}
ret->remote_ip_str = ret->key + ret->key_len;
memcpy(ret->key, conn->conn_key, ret->key_len);
strncpy(ret->remote_ip_str, conn->tgt_host, sizeof(ret->remote_ip_str));
memcpy(ret->remote_ip_str, conn->tgt_host, conn->tgt_host_length);
ret->remote_port = conn->tgt_port;
ret->conn_id = conn->conn_id;
ret->ip_port_count = 1; // init
......
......@@ -14131,7 +14131,7 @@ int spider_mbase_handler::simple_action(
SPIDER_DB_RESULT *res;
SPIDER_SHARE *share = spider->share;
uint pos = spider->conn_link_idx[link_idx];
spider_string *str;
spider_string *str = NULL;
DBUG_ENTER("spider_mbase_handler::simple_action");
switch (simple_action)
{
......@@ -14172,7 +14172,7 @@ int spider_mbase_handler::simple_action(
#endif
default:
DBUG_ASSERT(0);
break;
DBUG_RETURN(0);
}
pthread_mutex_lock(&conn->mta_conn_mutex);
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
......
......@@ -1452,7 +1452,7 @@ typedef struct st_spider_ip_port_conn {
#ifdef SPIDER_HAS_HASH_VALUE_TYPE
my_hash_value_type key_hash_value;
#endif
char remote_ip_str[SPIDER_CONN_META_BUF_LEN];
char *remote_ip_str;
long remote_port;
ulong ip_port_count;
volatile ulong waiting_count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment