Age | Commit message (Collapse) | Author |
|
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.
|
|
|
|
Replace the won function for pid compare with the
(new) enif_compare_pids function.
OTP-15565
|
|
Add some more comments in order to increase readability.
OTP-15565
|
|
Implemented the activate_next function and added its
"users" acceptor, writer and reader (macro abuse).
After a request (accept, write or send) has been either
successfully completed or failed, another request should
be activated. Previously only one attempt was made, which
might leave the other (waiting) requestors hanging.
Now, instead we use a 'activate-next' function that pop's
the request (accept, wrote or read) queue until success
or its empty, thereby making sure that no waiting processes
is left hanging.
OTP-15565
|
|
Remove own function to make monitor printable (was a hack)
and make use of the new enif_make_monitor_term instead.
|
|
bmk/20190301/cleanup_through_macro_abuse/OTP-15565
|
|
Fixed some type size warnings (SCTP related). E.g:
On Solaris 11 (OpenIndiana Hipster) long and int is size 4,
but the way Sint32 def works it first "tests" for long size and
if that is correct, that is chosen (which it is on Solaris 11).
On linux long is size 8, so Sint32 will be defined as int.
...
On Solaris 11 the flags TCP_CONGESTION and SO_BINDTODEVICE
does not exist, so the function(s) n[set|get]opt_str_opt is never
used. So, in order to keep the compiler quiet, we add some if-def
to exclude these functions in this case.
|
|
|
|
The requestor (acceptor, writer and reader) functions are
virtually identical, so to ensure quality and not having
to write the exact same functions three times, we make
use of some macro magic for their declaration.
OTP-15565
|
|
Some more macro abuse for nif API callback functions.
OTP-15565
|
|
Some more macro abuse for nif API callback functions and
the operator (acceptor, writer and reader) queue wrapper functions
(search4pid, push, pop and unqueue).
OTP-15565
|
|
|
|
Make use of macro concat magic to simplify declarations.
OTP-15565
|
|
The getnameinfo function has been fixed:
1) Faulty sockaddr decode success check
2) Incorrect (name info) return value
OTP-15636
|
|
Some cleanup (of open, bind, connect) and rewrote the
accept code (moved the code into smaller functions).
OTP-14831
|
|
Better handling of socket close. The 'closeRef' needed
its own environment to make if work in both cases (both
called and scheduled).
Also Introduced the enif select wrapper functions (read,
write, stop and cancel). Also add error handling at every
time one of these functions are called.
OTP-14831
|
|
Fixed a raise condition bug in the socket_stop (callback)
function that could result in the socket actually *not*
beeing closed.
OTP-14831
|
|
Assert failed in enif_demonitor when called with "NULL-monitor".
Replaced null monitor with separate 'is_active' boolean
and added my_make_monitor_term for printing (to be replaced
with enif_make_monitor_term).
|
|
Asserts failed in debug vm as msg term was built
from mixed ErlNifEnv's.
|
|
and collapsed some duplicate code
|
|
|