Skip to content

Commit 744fb96

Browse files
committed
fix: RpcResult should break out of its while loop only if the packet was consumed but notify PARSING_ERR
1 parent db9a288 commit 744fb96

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/bridge.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,11 @@ class RpcResult {
4343
if (k_mutex_lock(read_mutex, K_MSEC(10)) == 0 ) {
4444
if (client->get_response(msg_id_wait, result, error)) {
4545
k_mutex_unlock(read_mutex);
46-
break;
47-
} else if (error.code != NO_ERR) {
48-
k_mutex_unlock(read_mutex);
49-
k_mutex_lock(write_mutex, K_FOREVER);
50-
client->notify(BRIDGE_ERROR, error.traceback);
51-
k_mutex_unlock(write_mutex);
46+
if (error.code == PARSING_ERR) {
47+
k_mutex_lock(write_mutex, K_FOREVER);
48+
client->notify(BRIDGE_ERROR, error.traceback);
49+
k_mutex_unlock(write_mutex);
50+
}
5251
break;
5352
}
5453
k_mutex_unlock(read_mutex);

0 commit comments

Comments
 (0)