File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -4565,16 +4565,18 @@ SPIDER_IP_PORT_CONN* spider_create_ipport_conn(SPIDER_CONN *conn)
4565
4565
goto err_malloc_key;
4566
4566
}
4567
4567
4568
- ret->key = (char *) my_malloc (ret->key_len , MY_ZEROFILL | MY_WME);
4568
+ ret->key = (char *) my_malloc (ret->key_len + conn->tgt_host_length + 1 ,
4569
+ MY_ZEROFILL | MY_WME);
4569
4570
if (!ret->key ) {
4570
4571
pthread_cond_destroy (&ret->cond );
4571
4572
pthread_mutex_destroy (&ret->mutex );
4572
4573
goto err_malloc_key;
4573
4574
}
4575
+ ret->remote_ip_str = ret->key + ret->key_len ;
4574
4576
4575
4577
memcpy (ret->key , conn->conn_key , ret->key_len );
4576
4578
4577
- strncpy (ret->remote_ip_str , conn->tgt_host , sizeof (ret-> remote_ip_str ) );
4579
+ memcpy (ret->remote_ip_str , conn->tgt_host , conn-> tgt_host_length );
4578
4580
ret->remote_port = conn->tgt_port ;
4579
4581
ret->conn_id = conn->conn_id ;
4580
4582
ret->ip_port_count = 1 ; // init
Original file line number Diff line number Diff line change @@ -14131,7 +14131,7 @@ int spider_mbase_handler::simple_action(
14131
14131
SPIDER_DB_RESULT *res;
14132
14132
SPIDER_SHARE *share = spider->share ;
14133
14133
uint pos = spider->conn_link_idx [link_idx];
14134
- spider_string *str;
14134
+ spider_string *str = NULL ;
14135
14135
DBUG_ENTER (" spider_mbase_handler::simple_action" );
14136
14136
switch (simple_action)
14137
14137
{
@@ -14172,7 +14172,7 @@ int spider_mbase_handler::simple_action(
14172
14172
#endif
14173
14173
default :
14174
14174
DBUG_ASSERT (0 );
14175
- break ;
14175
+ DBUG_RETURN ( 0 ) ;
14176
14176
}
14177
14177
pthread_mutex_lock (&conn->mta_conn_mutex );
14178
14178
SPIDER_SET_FILE_POS (&conn->mta_conn_mutex_file_pos );
Original file line number Diff line number Diff line change @@ -1452,7 +1452,7 @@ typedef struct st_spider_ip_port_conn {
1452
1452
#ifdef SPIDER_HAS_HASH_VALUE_TYPE
1453
1453
my_hash_value_type key_hash_value;
1454
1454
#endif
1455
- char remote_ip_str[SPIDER_CONN_META_BUF_LEN] ;
1455
+ char * remote_ip_str;
1456
1456
long remote_port;
1457
1457
ulong ip_port_count;
1458
1458
volatile ulong waiting_count;
You can’t perform that action at this time.
0 commit comments