Skip to content

Commit

Permalink
Fix bug reading from ws
Browse files Browse the repository at this point in the history
  • Loading branch information
OlivierHecart committed Mar 14, 2024
1 parent 9c2cf4c commit eedcfa8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/system/emscripten/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,8 @@ size_t _z_read_ws(const _z_sys_net_socket_t sock, uint8_t *ptr, size_t len) {
z_sleep_ms(WS_LINK_SLEEP); // WARNING: workaround need to give the hand to the emscripten threads
rb = recv(sock._ws._fd, ptr, len, 0);
}
// WARNING: workaround as the recv returns -1 not only in case of errors
if (rb < 0) {
rb = 0;
rb = SIZE_MAX;
}
return rb;
}
Expand Down

0 comments on commit eedcfa8

Please sign in to comment.