Age | Commit message (Collapse) | Author |
|
Add test cases for udp local socket close for UDP recvfrom and
recvmsg.
OTP-14831
|
|
When calling the recvfrom function when there is no data,
we should be made wait (for the specified amount of time).
But this did not work because the "current reader" structure
was not initiated.
OTP-14831
|
|
The receive response local close tcp cases was extended
wityh two more handler (readers).
OTP-14831
|
|
Add name to evaluator printouts. Also added timetraps to all test-
cases to shorten the time to wait in case a test case fails.
OTP-14831
|
|
|
|
OTP-14831
|
|
The level argument for IPv6 can be either SOL_IPV6 or
IPPROTO_IPV6, whichever is defined. But it was hard-
coded to SOL_IPV6, which is not defined on FreeBSD.
OTP-14831
|
|
bmk/20180918/nififying_inet/OTP-14831
|
|
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
|
|
Fixed a number of issues regarding monitor handling.
Monitors are now wrapped in its own type (ESockMonitor).
This is hopefully temporary!
The reason for this is that there is no way to "initialize"
a monitor after a demonitor. This could mean that after a
successful demonitor, you could still get a down-callback,
and thenh compare with, for instance, ctrlMOn field and get
a match, even though it was just (successfully) demonitor'ed.
To make debugging easier, the monitor and demonitor calls
are now wrapped in their own functions, with debug printouts
before and in case of failure, also after the actual calls
Also, fixed a number of problems with cancel, where monitors
where left still active after cleaning up current and active
reader, writer and acceptor.
OTP-14831
|
|
Fixed more issues regarding closing sockets. Specifically
with respect to recv calls.
Also, added demonitor for all *current* processes.
Also fixed a buffer overflow problem when writing an
warning message (the timestamp buffer was not large
enough).
OTP-14831
|
|
The handling of terminating controlling-process was
incomplete.
Also added state check (CLOSED and CLOSING) in all
nif-functions to prevent access for a closed (or
closing) socket.
OTP-14831
|
|
The supports function now also handles testing for SCTP and
IPv6 support. Basic test at the moment, but better then nothing.
OTP-14831
|
|
"Completed" the socket options part of the supports function.
OTP-14831
|
|
Add the options for level socket (full), ip and ipv6 to the
supports function.
OTP-14831
|
|
Added the first three socket (level socket) options to the
supports function(s).
OTP-14831
|
|
|
|
bmk/20180918/nififying_inet/OTP-14831
|
|
Before allowing setopt(Sock, opt, controlling_process, NewPid),
verify that the caller is actually the current controlling_process.
OTP-14831
|
|
Add explicitly handling the default case, when not flags
are provided (value of zero).
OTP-14831
|
|
Internally in the socket module we accessed domain, type and
protocol for an open socket. But as it turns out, domain (family)
is not actually available as a socket option on all platforms.
FreeBSD in this case. So, since we store these values in the socket
descriptor anyway, we switch to use these values for our internal
use instead.
OTP-14831
|
|
Add support for otp level socket options rcvbuf, rcvctrlbuf and
sndctrlbuf. These options define default sizes for these
buffers.
The 'rcvbuf' is used when receiving messages when calling
the recv, recvfrom and recvmsg functions.
The 'rcvctrlbuf' is used for the control message header info
when calling the recvmsg function.
The 'sndctrlbuf' is used for the control message header info
when calling the sendmsg function.
OTP-14831
|
|
Make sure the current whatever (writer, reader or writer) is
not the closer pid before *attempting* to sending the abort message.
And if that fails, issue a warning message (not aborting).
OTP-14831
|
|
Added proper recv timeout handling.
Made use of the enif_select(mode = cancel) feature. Each
time a timeout expires, the "active" recv (the surrent reader
select) has to be cancelled. Not yet tested...something for
the new test suite...
Also, added support for getopt(controlling_pprocess) that,
for some reason, was not yet implemented.
OTP-14831
|
|
bmk/20180918/nififying_inet/OTP-14831
Also needed to "revert" two of the chnages, related to assoc id.
This is in FreeBSD defined as an uint32 but on linux as a int32.
|
|
|
|
|
|
|
|
Added proper send timeout handling.
Made use of the enif_select(mode = cancel) feature. Each
time a timeout expires, the "active" send (the surrent write
select) has to be cancelled.
OTP-14831
|
|
Added proper connect and accept timeout handling.
Made use of the enif_select(mode = cancel) feature. Each
time a timeout expires, the previous operation (connect or accept)
has to be cancelled (actually its the select operation that has
to be cancelled). Only partial implementation of cancel for now
(connect and accept). More to follow...
OTP-14831
|
|
Fixed various issues with regard to encode of CMsgHdrs
during sendmsg.
OTP-14831
|
|
Updated the (send) cmsghdr type and the handling of it
(in the nif code). Still not tested!
Removed the is_loaded nif function.
Tried to get fix the doc build problem (socket.erl *i think*),
which causes socket.html generation to fail with:
"cannot find module exporting type"
To solve this I tried to run dialyzer on preloaded, and ran into
problems with enc_setopt_value. Update various specs and types
to "solve" this (which did not work).
Updated the nif-stub functions to make dialyzer happy.
|
|
Added support for (recvmsg) control message ipv6_pktinfo, for
level = ipv6 and type = pktinfo. This is enabled by setting the
socket option: recvpktinfo for level ipv6.
Not yet tested!
OTP-14831
|
|
Add more debug printouts for the new sendmsg. Also added
new (erlang) types with doc.
OTP-14831
|
|
Added function sendmsg/2,3,4. Actually worked on the first try.
Something must be wrong...
Still no supported cmsghdr's (only support headers where the
data part is already a binary, which therefor does not require
any processing). So if the cmsghdrs actually work is unclear.
OTP-14831
|
|
Added processing or more cmsg headers (for more options).
Now (also) supports: socket:timestamp.
Also various fixes and cleanups.
For some reason calling getopt(Sock, 0, {13, int}) (or similar)
fails with badarg even though the nif-function (nif_getopt) actually
returns a valid value (for instance: {ok, 0}).
OTP-14831
|
|
Added decoding of the "known" control message options: pktinfo,
recvtos, recvttl and recvorigdstaddr).
OTP-14831
|
|
It seems to work, with atleast some of the cmsg options.
More testing needed...
OTP-14831
|
|
Added preliminary support for function recvmsg. At the moment
this only works on *nix (Windows has another function, WSARecvMsg,
which has a slightly different API).
Also we have "no" cmsg decode at the moment (just level and type).
OTP-14831
|
|
Added support for ip level socket option SENDSRCADDR.
This option requires sendmsg to actually use, so we
cannot test this fully at the moment.
OTP-14831
|
|
Added support for ip level socket option RECVORIGDSTADDR.
This option requires recvmsg to actually use, so we cannot
test this fully at the moment (although both set and get works).
OTP-14831
|
|
Added support for ip level socket option RETOPTS.
OTP-14831
|
|
Added support for ip level socket option TRANSPARENT.
OTP-14831
|
|
Added support for ip level socket option PKTINFO.
This option requires sendmsg and/or recvmsg to actually use,
so we cannot test this fully at the moment (although both set
and get works).
OTP-14831
|
|
Added support for ip level socket option HDRINCL.
As this option is raw only, it has not yet been tested!
OTP-14831
|
|
Added support for ip level socket option MSFILTER.
This option has not been tested *in any way*...
OTP-14831
|
|
Added support for the IPv6 socket option RECVERR.
To actually make use of this option, we need the recvmsg
function, which we don't have yet. Baby steps.
OTP-14831.
|
|
Added support for the IP socket option RECVERR.
To actually make use of this option, we need the recvmsg
function, which we don't have yet. Baby steps.
OTP-14831.
|
|
Added support for the IPv6 socket option ADDRFORM.
Only allowed for IPv6 sockets that are connected and bound to a
v4-mapped-on-v6 address.
OTP-14831.
|
|
Added support for the IPv6 socket option ROUTER_ALERT.
Only supported for raw sockets.
OTP-14831.
|