Fix direct load data buffer members inconsistent lifecycle

This commit is contained in:
obdev
2023-04-23 10:44:32 +00:00
committed by ob-robot
parent f5d814801f
commit d663d4218e
3 changed files with 13 additions and 15 deletions

View File

@ -52,9 +52,9 @@ static int easy_encode_uint64(char *buf, const uint64_t buf_len, int64_t *pos, u
*(buf + (*pos)++) = (char)(((val) >> 40) & 0xff);
*(buf + (*pos)++) = (char)(((val) >> 32) & 0xff);
*(buf + (*pos)++) = (char)(((val) >> 24) & 0xff);
*(buf + (*pos)++) = (char)(((val) >> 16) & 0xff);
*(buf + (*pos)++) = (char)(((val) >> 8) & 0xff);
*(buf + (*pos)++) = (char)((val) & 0xff);
*(buf + (*pos)++) = (char)(((val) >> 16) & 0xff);
*(buf + (*pos)++) = (char)(((val) >> 8) & 0xff);
*(buf + (*pos)++) = (char)((val) & 0xff);
}
return ret;
@ -176,9 +176,9 @@ static int easy_decode_negotiation_msg(easy_negotiation_msg_t *ne_msg, char *rec
PACKET HEADER:
+------------------------------------------------------------------------+
| negotiation packet header magic(8B) | msg body len (2B)
+------------------------------------------------------------------------+
PACKET MSG BODY:
+------------------------------------------------------------------------+
PACKET MSG BODY:
+------------------------------------------------------------------------+
| io thread corresponding eio magic(8B) | io thread index (1B)
+------------------------------------------------------------------------+
@ -264,9 +264,9 @@ void net_consume_negotiation_msg(int fd, uint64_t magic)
if (ne_msg.msg_header.header_magic == EASY_NEGOTIATION_PACKET_HEADER_MAGIC &&
(ne_msg.msg_body.eio_magic == magic || easy_magic_in_support_list(ne_msg.msg_body.eio_magic))) {
while ((rcv_bytes = recv(fd, (char *) recv_buf, decode_len, 0)) < 0 && errno == EINTR);
if (rcv_bytes <= 0) {
easy_error_log("consume negotiaion buffer failed! fd:%d, errno:%d", fd, errno);
} else {
if (rcv_bytes <= 0) {
easy_error_log("consume negotiaion buffer failed! fd:%d, errno:%d", fd, errno);
} else {
easy_info_log("consume negotiation buffer %d bytes!", rcv_bytes);
}
} else {