Skip to content

Commit 95d374e

Browse files
authored
Merge pull request #22 from bcmi-labs/hot_fix_msgid_type
Hot fix msgid type
2 parents 3dc190e + 8508d6e commit 95d374e

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/client.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class RPCClient {
99
RpcDecoder<>* decoder = nullptr;
10-
int _waiting_msg_id;
10+
uint32_t _waiting_msg_id;
1111

1212
public:
1313
RpcError lastError;
@@ -22,7 +22,7 @@ class RPCClient {
2222

2323
template<typename... Args>
2424
void notify(const MsgPack::str_t method, Args&&... args) {
25-
int _id;
25+
uint32_t _id;
2626
decoder->send_call(NOTIFY_MSG, method, _id, std::forward<Args>(args)...);
2727
}
2828

@@ -46,7 +46,7 @@ class RPCClient {
4646

4747
template<typename... Args>
4848
bool send_rpc(const MsgPack::str_t method, Args&&... args) {
49-
int msg_id;
49+
uint32_t msg_id;
5050
if (decoder->send_call(CALL_MSG, method, msg_id, std::forward<Args>(args)...)) {
5151
_waiting_msg_id = msg_id;
5252
return true;

src/decoder.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class RpcDecoder {
1919
RpcDecoder(ITransport& transport) : _transport(transport) {}
2020

2121
template<typename... Args>
22-
bool send_call(const int call_type, const MsgPack::str_t method, int& msg_id, Args&&... args) {
22+
bool send_call(const int call_type, const MsgPack::str_t method, uint32_t& msg_id, Args&&... args) {
2323

2424
if (call_type!=CALL_MSG && call_type!=NOTIFY_MSG) return false;
2525

@@ -58,7 +58,7 @@ class RpcDecoder {
5858

5959
MsgPack::arr_size_t resp_size;
6060
int resp_type;
61-
int resp_id;
61+
uint32_t resp_id;
6262

6363
if (!unpacker.deserialize(resp_size, resp_type, resp_id)) return false;
6464
if (resp_size.size() != RESPONSE_SIZE) return false;
@@ -157,7 +157,7 @@ class RpcDecoder {
157157
size_t _bytes_stored = 0;
158158
int _packet_type = NO_MSG;
159159
size_t _packet_size = 0;
160-
int _msg_id = 0;
160+
uint32_t _msg_id = 0;
161161

162162
inline bool buffer_full() const { return _bytes_stored == BufferSize; }
163163

src/server.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class RPCServer {
5858
}
5959

6060
int msg_type;
61-
int msg_id;
61+
uint32_t msg_id;
6262
MsgPack::str_t method;
6363
MsgPack::arr_size_t req_size;
6464

0 commit comments

Comments
 (0)