Age | Commit message (Collapse) | Author |
|
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.
|
|
Make use of the new select functions; enif_select_[read|write],
for read and write select. These functions allows us to construct
the select message ourseves:
{'$socket', Socket, select, Ref}
This is in preparations for when we introduce the 'nowait'
(or something similar) value for the timeout argument (in accept,
read and write funcions).
It also solves (we hope) the term leakage problems (it was difficult
to free the environment when there was only one/socket).
OTP-15496
|
|
Firstly, make sure socket (and own) options manipulations
are safe by adding a mutex that we take in the setopt and
getopt functions.
Secondly, change type prefix of various types from
'Socket' to 'ESock' (for instance; SocketDescriptor ->
ESockDescriptor).
OTP-15496
|
|
To increase readability the close function has been slightly
restructured.
|
|
To increase readability the recvmsg result check has been slightly
restructured. In this case we made use of the error case function
(fail) of the recv result check.
|
|
To increase readability the recvfrom result check has been slightly
restructured. In this case we made use pf the error case function
(fail) of the recv result check.
|
|
To increase readability the recv result check has been slightly
restructured.
|
|
To increase readability the send result check has been slightly
restructured.
|
|
The messages sent from the nif code to an erlang process
has been changed to:
{'$socket', Socket :: socket(), Tag :: atom(), Info :: term()}
This is in preparation for (using) the new enif select API.
OTP-15496
|
|
Used ref from wrong environment when building reply.
|
|
* john/erts/unc-path-size-fix/OTP-15693:
erts: Fix incorrect UNC path length calculation
|
|
This didn't cause any issues for the most part since the path was
still properly formed, but it broke down when appending the
wildcards in file:list_dir/1. The ASSERT_PATH_FORMAT macro would
have caught this in no time, but it went unnoticed because we don't
run debug builds on Windows.
|
|
|
|
|
|
During socket stop the close environment somehow has
been NULLed. Check this before using when sending the
close message.
|
|
We use clock_gettime(CLOCK_REALTIME, ...) to create a simple
timestamp. This is used both for debugging and when writing
error/warning messages (from the nif-code).
The workaround for the absence of this function (on some platforms,
old versions of darwin for example) is to simply skip the timestamp.
|
|
|
|
|
|
Fixed an issue (I think) that during socket close
could cause a core.
|
|
Fixed a memory leak in the function for address infos encoding.
|
|
A debug printout in the socket_stop fucntion used the wrong
requestor record for the pid, which may leasd to a confusing
debug printout.
|
|
The activate-next (reader|writer|acceptor) always
*incorrectly* used the read select function.
This has now been changed so that the functions
are created via a macro with an argument specifying
which select function to use.
|