Age | Commit message (Collapse) | Author |
|
Rename some of the structures and callback functions
(socket -> esock).
OTP-15955
|
|
Renamed constants (defines): SOCKET_ -> ESOCK_
OTP-15955
|
|
The naming "convention" for "top" functions of the esock
nif module was: The API functions where called nif_<foo>
This function did basic checks and arg extraction and then
called the a function called n<foo>, which was the one doing
the actual work.
Unfortunately, och some platforms (AIX) these second names,
n<foo>, clashed with system functions.
So, in order to avoid this, the naming of second function
has been changed to esock_<foo>.
OTP-15955
|
|
Fixed a copy-and-paste error for socket option bindtodevice.
Incorrectly used SO_BROADCAST option instead.
OTP-15904
|
|
Its now possible to bind a socket to the (limited) broadcast
address by specifying 'broadcast' as address:
socket:bind(Socket, broadcast)
This is *only* valid for family 'inet'.
Add testing of sending (broadcasting) to both "limited" broadcast address
and "subnet-directed" broadcast address.
OTP-15904
|
|
Add test case for the socket option bindtodevice. Also make
correction in the nif code. Used the wrong option (broadcast).
Also added more info to doc.
Note sure if this test case actually works. Set and get "works",
but the value returned by get is always "". So either we should
extend the test to made sure the bind actually has the expected
effect or... Something for a rainy day maybe...
OTP-15904
|
|
|
|
|
|
|
|
Corrected calculation of buffer length for format(ed) string.
OTP-15817
|
|
Debug printouts is done to "dbgout", but the dbg macro
flushed "stdout" (which was the default). So, in order
to make the macro work properly in all cases, we rename
dbgout to esock_dbgout and make it extern (was static),
and then used that in the macro.
OTP-15817
|
|
OTP-15818
|
|
'bmk/erts/esock/incorrect_map_size_check_update_membership/OTP-15908' into maint
|
|
Corrected both read pkg, byte and fail counter increment for
recvmsg (was actually missing).
OTP-15818
|
|
Corrected both read pkg and byte counter increment for recvfrom
(was actually missing).
OTP-1581
|
|
When to count read failure and read package count
used number of bytes read instead of just increment (by 1).
OTP-1581
|
|
We already had the counters. But we did not entirely handle
counter wrap, especially in related to 'iow' (Inform On Wrap).
There was also no way to get to the counter values, so a socket
specific info function was implemented (piggy back on the existing
"global" info function). And since, we have it, we also add
other info in the returned map (number of readers, writers and
acceptors).
OTP-15818
|
|
Build failed on windows because of misplaced ifdef's
(of new command functions).
OTP-15817
|
|
Add a command function to the socket API.
Currently only used for changing global debug.
OTP-15817
|
|
An invalid value test caused the
socket:setopt(Socket, ip, add_membership, ip_mreq())
to fail with badarg.
OTP-15908 (ERL-980)
|
|
Renamed the current preloaded net module to prim_net
and removed the deprecated functions (call, cast, ...).
Introduce a "new" net module (in kernel) as an interface
module to the (preloaded) prim_net. This one also contains
the deprecated functions (call, cast, ...).
OTP-15765
|
|
Add a pattern field to the (beginning of the) socket descriptor.
To make it more easy to spot memory over-writes. One pattern
for create and one for dtor. Also reset various fields of the
descriptor at dtor.
|
|
Rebase (on maint as of 20190529) resulted in a number of
issues. Mostly in the (esock) test suite.
OTP-15731
|
|
Tests on Darwin Kernel Version 18.2.0 reveled some
problems handling connect (on that platform).
It seems that calling connect the second time is not needed
(it results in eisconn), so we needed to handle that case,
which we now do.
|
|
Changed tag type tpo opaque. Also added connect (monitor and
process) cleanup.
OTP-15731
|
|
Had forgot about the connect function. But it can now also
handle the Timeout = nowait, maybe resulting in a select.
Required some nif work also...
OTP-15731
|
|
Add if-def for AF_LOCAL before using the flag.
OTP-15822
|
|
On some platforms, e.g. FreeBSD, recvmsg does *not* return address
for a Unix Domain (stream) socket. Unlike, for instance, on Linux.
OTP-15822
|
|
Fixed the spec's for function open/3,4.
Also, corrected the test for retreiving resulting
protocol when performing open with proto = 0 (default)
and domain is not local. Local may not be defined
on all platforms.
OTP-15822
|
|
|
|
The socket:supports/0,1 now also displays local (Unix Domain Socket).
OTP-15822
|
|
The flag SO_PROTOCOL does not exist on darwin 18.2.0 (atleast).
So, creating a socket with domain =/= local using the default
protocol does not work in this case.
OTP-15822
|
|
Add a sendmsg and recvmsg test case for a unix domain (stream) socket.
Found and fixed a bug for the return value for the address field
for family 'local' (encoded as 'inet').
OTP-15822
|
|
Corrected various issues and added missing stuff.
Default protocol is now indicated with the atom 'default'
instead of the atom 'null'. Also let the underlying OS
decide what protocol is actually the default protocol.
OTP-15822
|
|
|
|
'bmk/erts/esock/20190517/nsupports_options_tcp_invalid_flags/OTP-15827' into maint
|
|
We no longer use clock_gettime to get time. Instead we use
enif_monotonic_time(ERL_NIF_USEC) and enif_time_offset(ERL_NIF_USEC).
OTP-15566, OTP-15686
|
|
Explicitly autoconf check for functions localtime_r and
strftime, which are used in prettyfying timestamps. Also
make use of the results from these checks (HAVE_...)
If not found, timestamps will just be an integer
(which is better then nothing).
OTP-15566
|
|
The usage of the function clock_gettime(CLOCK_REALTIME, ...)
has been replaced with enif_monotonic_time(ERL_NIF_USEC) and
enif_time_offset(ERL_NIF_USEC). For now its if-def'ed so that
we still *can* use clock_gettime, but for the momemnt its
not used even if its available.
OTP-15566, OTP-15686
|
|
In the TCP options nsupports function, invalid flags where used
in the if-def'ing. Used TCP_ instead of TCP_MAXSEG and TCP_NODELAY.
OTP-15827
|
|
|
|
|
|
The cmsg header (decode) problems on darwin was because the
CMSG_FIRSTHDR macro is "faulty" on old versions (of darwin).
I *think* it should return a NULL-pointer if there are no
cmsg headers (but it does not). So, instead of punishing all
platforms with an explicit test
(msg_controllen >= sizeof(struct cmsghdr)) we only do this
on darwin.
|
|
When building the (activate next) select message, used terms
from different environments, which is not allowed.
This was during cancel of one request, we tries to activate
next, and then building the select message (with terms from
different environments). Arg! Details...
OTP-15496
|
|
Why can't we all just get along? Casting to shut the compiler up.
|
|
When setting (otp) debug to true, some debug printouts
could become "laaarge". Removed the data from those
printout to avoid problems.
|
|
When building the (recv) select message, used terms
from different environments, which is not allowed.
OTP-15496
|
|
When building the (accept) select message, used terms
from different environments, which is not allowed.
OTP-15496
|
|
Did the free and assign new acceptor in the wrong order,
thereby causing an (acceptor) environment leak.
OTP-15496
|
|
Building on windows broken again:
* The 'inline' keywork needs som work on windows.
* Function was outside of if-def.
* Missing prototypes resulted in default prototypes.
In this case, the actual problem was missing if-defs
for win32 (that made functions exist on windows
when they should not). Not sure why it compiled just
fine on win32 but not win64 though.
|