From 2f49f58bc75c1902eb5213c0f7e7e13c53330c50 Mon Sep 17 00:00:00 2001 From: obdev Date: Mon, 24 Apr 2023 03:14:46 +0000 Subject: [PATCH] [CP] fix unthread safe allocator used by plan baseline manager --- deps/easy/src/io/easy_negotiation.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/deps/easy/src/io/easy_negotiation.c b/deps/easy/src/io/easy_negotiation.c index 287aa6e82..38b58ebe7 100644 --- a/deps/easy/src/io/easy_negotiation.c +++ b/deps/easy/src/io/easy_negotiation.c @@ -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) {