Skip to content

Commit a0ec7c3

Browse files
committed
fix: decoder.process must return void
1 parent 979a28a commit a0ec7c3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/decoder.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class RpcDecoder {
1919

2020

2121
void process(){
22-
if (advance()) return parse_packet();
22+
if (advance()) parse_packet();
2323
}
2424

2525
// Fill the raw buffer to its capacity
@@ -78,13 +78,13 @@ class RpcDecoder {
7878
if (unpacker.size() < min_packet_indices) return false;
7979
int type;
8080
if (unpacker.deserialize(type)) {
81-
if (type == 0 || type == 1) { // request or response
81+
if (type == CALL_MSG || type == RESP_MSG) { // request or response
8282
int _id;
8383
MsgPack::str_t callback;
8484
MsgPack::arr_size_t param_size;
8585
unpacker.deserialize(_id, callback, param_size);
8686
return (unpacker.size() == min_packet_indices + param_size.size());
87-
} else if (type == 2) { // notification
87+
} else if (type == NOTIFY_MSG) { // notification
8888
MsgPack::str_t callback;
8989
MsgPack::arr_size_t param_size;
9090
unpacker.deserialize(callback, param_size);

0 commit comments

Comments
 (0)