aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/common
diff options
context:
space:
mode:
authorJonas Falkevik <[email protected]>2012-07-20 00:05:30 +0200
committerHenrik Nord <[email protected]>2012-10-08 11:00:53 +0200
commit5030da383c44c66aca861b3a56d0e310d7de6997 (patch)
treee4d1619a2c01c3050f682a6e050e6afaf3dad894 /erts/emulator/drivers/common
parent1b034d4f9511d5ff62c3fc9ed6f9632cc8e8b7d7 (diff)
downloadotp-5030da383c44c66aca861b3a56d0e310d7de6997.tar.gz
otp-5030da383c44c66aca861b3a56d0e310d7de6997.tar.bz2
otp-5030da383c44c66aca861b3a56d0e310d7de6997.zip
Set new peeled off SCTP socket to nonblocking socket
Peeloff feature of SCTP association creates a new socket which is not set to nonblocking. Function for receving data is shared with udp which has a default loop when reading packets which is set to 5. Calling the receive function more then once, is fine as long as there are more data to receive or socket are nonblocking. Set new peeled off socket to be nonblocking to prevent a erlang vm hangup.
Diffstat (limited to 'erts/emulator/drivers/common')
-rw-r--r--erts/emulator/drivers/common/inet_drv.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/erts/emulator/drivers/common/inet_drv.c b/erts/emulator/drivers/common/inet_drv.c
index dea910e89f..80f504a361 100644
--- a/erts/emulator/drivers/common/inet_drv.c
+++ b/erts/emulator/drivers/common/inet_drv.c
@@ -10095,6 +10095,7 @@ static ErlDrvSSizeT packet_inet_ctl(ErlDrvData e, unsigned int cmd, char* buf,
}
new_udesc->inet.state = INET_STATE_CONNECTED;
new_udesc->inet.stype = SOCK_STREAM;
+ SET_NONBLOCKING(new_udesc->inet.s);
inet_reply_ok_port(desc, new_udesc->inet.dport);
(*rbuf)[0] = INET_REP;