From 3ecc49c204fd279f6df11a64101262eeccc0b087 Mon Sep 17 00:00:00 2001 From: BlueRabbit <515704389@qq.com> Date: Tue, 26 Sep 2023 15:21:33 +0800 Subject: [PATCH] fix the issue of 32-bit and 64-bit machines unable to communicate. --- include/rest_rpc/const_vars.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/rest_rpc/const_vars.h b/include/rest_rpc/const_vars.h index 2beb0db..cd98135 100644 --- a/include/rest_rpc/const_vars.h +++ b/include/rest_rpc/const_vars.h @@ -26,6 +26,7 @@ struct message_type { }; static const uint8_t MAGIC_NUM = 39; +#pragma pack(4) struct rpc_header { uint8_t magic; request_type req_type; @@ -33,6 +34,7 @@ struct rpc_header { uint64_t req_id; uint32_t func_id; }; +#pragma pack() static const size_t MAX_BUF_LEN = 1048576 * 10; static const size_t HEAD_LEN = sizeof(rpc_header);