Fix socket-api send/recv issue and c-api sample callback_chain issue (#1158)

Re-implement socket api send/recv in an atomic-like way, fix the return value
check in posix.c.
And fix wasm-c-api sample callback_chain calling malloc issue.
This commit is contained in:
liang.he
2022-05-09 16:52:43 +08:00
committed by GitHub
parent 362bd0cc5c
commit 3ba2d7e7de
3 changed files with 99 additions and 35 deletions

View File

@ -3041,7 +3041,7 @@ wasmtime_ssp_sock_recv(
ret = os_socket_recv(fd_number(fo), buf, buf_len);
fd_object_release(fo);
if (BHT_OK != ret) {
if (-1 == ret) {
return convert_errno(errno);
}
@ -3067,7 +3067,7 @@ wasmtime_ssp_sock_send(
ret = os_socket_send(fd_number(fo), buf, buf_len);
fd_object_release(fo);
if (BHT_OK != ret) {
if (-1 == ret) {
return convert_errno(errno);
}