diff options
author | Micael Karlberg <[email protected]> | 2018-10-18 17:18:10 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2018-10-18 17:18:10 +0200 |
commit | 3eb4d5160f6a9f7cca799c97daf33b1a8b154f5d (patch) | |
tree | 03673b22e927b7b1cb9677dafeb9fad190ebc8c3 /erts | |
parent | 598ecec8b59509f223807d36e9dd1244d7d80fa2 (diff) | |
download | otp-3eb4d5160f6a9f7cca799c97daf33b1a8b154f5d.tar.gz otp-3eb4d5160f6a9f7cca799c97daf33b1a8b154f5d.tar.bz2 otp-3eb4d5160f6a9f7cca799c97daf33b1a8b154f5d.zip |
[socket-nif] Initiation of "current reader" missing for recvmsg
When calling the recvmsg function when there is no data,
we should be wait (for the specified amount of time).
But this not not wotk because the "current reader" structure
was not initiated.
OTP-14831
Diffstat (limited to 'erts')
-rw-r--r-- | erts/emulator/nifs/common/socket_nif.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/erts/emulator/nifs/common/socket_nif.c b/erts/emulator/nifs/common/socket_nif.c index 5d2cfbc10b..2eddcb5658 100644 --- a/erts/emulator/nifs/common/socket_nif.c +++ b/erts/emulator/nifs/common/socket_nif.c @@ -12334,9 +12334,13 @@ ERL_NIF_TERM recvmsg_check_result(ErlNifEnv* env, } else if ((saveErrno == ERRNO_BLOCK) || (saveErrno == EAGAIN)) { + char* xres; SSDBG( descP, ("SOCKET", "recvmsg_check_result -> eagain\r\n") ); + if ((xres = recv_init_current_reader(env, descP, recvRef)) != NULL) + return esock_make_error_str(env, xres); + SELECT(env, descP->sock, (ERL_NIF_SELECT_READ), descP, NULL, recvRef); |