mirror of
https://github.com/lxsang/antd-tunnel-plugin
synced 2025-09-01 08:42:15 +02:00
fix overflow bug
This commit is contained in:
BIN
dist/tunnel-0.1.0b.tar.gz
vendored
BIN
dist/tunnel-0.1.0b.tar.gz
vendored
Binary file not shown.
4
tunnel.c
4
tunnel.c
@@ -63,7 +63,7 @@ typedef struct {
|
|||||||
bst_node_t* channels;
|
bst_node_t* channels;
|
||||||
pthread_t tid;
|
pthread_t tid;
|
||||||
int hotline;
|
int hotline;
|
||||||
uint32_t id_allocator;
|
uint16_t id_allocator;
|
||||||
uint8_t initialized;
|
uint8_t initialized;
|
||||||
} antd_tunnel_t;
|
} antd_tunnel_t;
|
||||||
|
|
||||||
@@ -760,7 +760,7 @@ static void process_client_message(antd_tunnel_msg_t* msg, antd_client_t* client
|
|||||||
if(msg->header.type == CHANNEL_SUBSCRIBE)
|
if(msg->header.type == CHANNEL_SUBSCRIBE)
|
||||||
{
|
{
|
||||||
g_tunnel.id_allocator++;
|
g_tunnel.id_allocator++;
|
||||||
channel->subscribers = bst_insert(channel->subscribers, g_tunnel.id_allocator, client);
|
channel->subscribers = bst_insert(channel->subscribers, (int)g_tunnel.id_allocator, client);
|
||||||
// sent ok to client
|
// sent ok to client
|
||||||
msg->header.type = CHANNEL_OK;
|
msg->header.type = CHANNEL_OK;
|
||||||
msg->header.channel_id = hash_val;
|
msg->header.channel_id = hash_val;
|
||||||
|
Reference in New Issue
Block a user