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:
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user