[CP] fix unthread safe allocator used by plan baseline manager

This commit is contained in:
obdev 2023-04-24 03:14:46 +00:00 committed by ob-robot
parent 8ea3acb795
commit 2f49f58bc7

View File

@ -70,9 +70,9 @@ static int easy_encode_uint16(char *buf, const uint64_t buf_len, int64_t *pos, u
*(buf + (*pos)++) = (char)((val) & 0xff);
}
return ret;
}
return ret;
}
static int easy_decode_uint64(char *buf, const int64_t data_len, int64_t *pos, uint64_t *val)
{
int ret = (NULL != buf && data_len - *pos >= 8) ? EASY_OK : EASY_ERROR;
@ -158,9 +158,9 @@ static int easy_decode_negotiation_msg(easy_negotiation_msg_t *ne_msg, char *rec
easy_info_log("decode msg body len failed!ret:%d.", ret);
return ret;
}
ret = easy_decode_uint64(recv_buf, recv_buf_len, &pos, &(ne_msg->msg_body.eio_magic));
if (ret != EASY_OK) {
ret = easy_decode_uint64(recv_buf, recv_buf_len, &pos, &(ne_msg->msg_body.eio_magic));
if (ret != EASY_OK) {
easy_info_log("decode eio magic failed!ret:%d.", ret);
return ret;
}
@ -282,9 +282,9 @@ int easy_send_negotiate_message(easy_connection_t *c)
int ret = EASY_OK;
easy_io_thread_t *ioth = c->ioth;
easy_io_t *eio = ioth->eio;
uint32_t conn_has_error = 0;
if ((ret = net_send_negotiate_message(eio->negotiation_enable,
c->fd,
uint32_t conn_has_error = 0;
if ((ret = net_send_negotiate_message(eio->negotiation_enable,
c->fd,
eio->magic,
ioth->idx,
&conn_has_error)) == EASY_OK) {