Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
fixed bug in zos message parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonpille committed Jun 23, 2023
1 parent 3da9baa commit 02efd88
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions farmerbot/manager/data.v
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fn (mut d DataManager) handle_responses(mut node_twin_ids []u32) {
d.logger.error('${manager.data_manager_prefix} ${err}')
continue
}
match message.cmd {
match message.ref {
'zos.system.version' {
message.parse_system_version() or {
continue
Expand All @@ -137,7 +137,10 @@ fn (mut d DataManager) handle_responses(mut node_twin_ids []u32) {
node.pools = storage_pools
}
else {
d.logger.warn('${manager.data_manager_prefix} Unknown command ${message.cmd}')
if message.ref != '' {
d.logger.warn('${manager.data_manager_prefix} Unknown command ${message.ref}')
}
continue
}
}
// remove from list so that we know which nodes we were able to contact
Expand Down
2 changes: 1 addition & 1 deletion farmerbot/system/version.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub const (
version_major = u8(0)
version_minor = u8(2)
version_patch = u8(0)
extension = '-rc3'
extension = '-rc4'

version = '${version_major}.${version_minor}.${version_patch}${extension}'
)
2 changes: 1 addition & 1 deletion farmerbot/system/zos.v
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ pub struct RmbResponse {
pub mut:
ver int = 1
ref string
cmd string
dat string
src string
now u64
Expand Down Expand Up @@ -157,6 +156,7 @@ pub fn (mut z ZosRMBPeer) rmb_client_request(cmd string, dsts []u32, data string
msg := RmbMessage{
ver: 1
cmd: cmd
ref: cmd
exp: exp
dat: base64.encode_str(data)
dst: dsts
Expand Down

0 comments on commit 02efd88

Please sign in to comment.