Age | Commit message (Collapse) | Author |
|
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
|
|
|
|
as called in crypto.erl and erlang.erl.
|
|
bmk/20190204/socket_as_nif/OTP-14831
|
|
The nif callback functions (nif_open) now instead cause an
'nosup' exception if called (instead of badarg).
The basic type uint16_t, uint32_t and int32_t (C99) replaced
"own" (that is, defined by "us") types Uint16, Uint32 and
Sint32.
The point of this is that our Windows build system seems to
be a bit lacking when it comes to types...
Removed "some stuff" that was if-defed. Different solution
when win32 support for sockets has been improved.
Make sure the socket_*.c util modules are not included
in the building for windows.
OTP-15526
|
|
Added preliminary, and temporary, windows adaptions.
Basically they amount to letting all nif-callback functions
returning badarg for all calls if on windows (this has
been accomplished by if-defing the nif-code; if win32 then
badarg else do-something).
OTP-15526
|
|
Its now possible to set a rcvbuf (otp) option value
of {N :: pos_integer(), BufSz :: pos_integer()}.
This value is used for type stream and protocol tcp,
when calling the function recv with length = 0 (zero).
The second value, BufSz, is the actual size of the receive
buffer used when calling the socket recv function, and
the first value, N, is the max number of possible reads
that will be performed (at most), even if there is more
data to read. This is limit the effect of DoS attacks.
OTP-15497
|
|
The read and write functions now *only* use the isReadable and
isWritable fields, respectively, to decide if the "socket" can be read
from and written to (previously the state field was used outside of
the mutex lock).
Also made it possible to enable / disable test suite groups individually,
via environment variables (ESOCK_TEST_...). Specifically, the ttest
group has been excluded by default (takes to long a time).
OTP-15549
|
|
Add a way to *get* the file descriptor (fd) of a socket.
Useful mostly for debugging.
OTP-15528
|
|
* maint:
Remove an unused variable
Spawn prim_file helper as a system process
|
|
|
|
The macro (define) IPTOS_MINCOST does not exist
on OpenBSD 6.3.
OTP-14831
|
|
|
|
Previously the "message interface" between the functions in
socket.erl and the nif-code (socket_nif.c) was "ad hoc".
This has now been changed so that we have a unified message
{'$socket', SockRef | undefined, Tag, Info}
This also has the added advantage of preparing the code for
when we start using the new select-fucntions (with which
its possible to specify your own message). This will be used
in order to get around our eterm "leak" (we will use a simple
counter, maintained in the nif, instead of the [Recv|Send|Acc]Ref
we generate in the erlang code today.
OTP-14831
|
|
for set_permission and set_owner.
|
|
"Dry fixed" the "same" problems as was found for nif_recv (missing
binary free(s)).
OTP-14831
|
|
Running valgrind, found a couple of cases when allocated
binaries where not released. Mostly when the recv failed
for some reason.
Also clear and free the environment associated with the
socket (resource) (in the _dtor callback function).
OTP-14831
|
|
bmk/20180918/nififying_inet/OTP-14831
|
|
* Socket close callback
Only demonitor the closer if its local (close) and its not
a direct call. There was a spurious warning message.
* Down callback
Only process this event if the socket is not closed or closing.
OTP-14831
|
|
The default read buffer size was 2K and has now been
increased to 8K.
OTP-14831
|
|
|
|
|
|
Added config checks for the sctp struct field:
sctp_event_subscribe.sctp_authentication_event
Also, if-def'ed the code accordingly.
If-def'ed code to handle the (non-) existence of IP_PMTUDISC_PROBE
and IPV6_PMTUDISC_PROBE for the IP and IPv6 MTU_DISCOVER options.
OTP-14831
|
|
Added config checks for the sctp struct field:
sctp_event_subscribe.sctp_sender_dry_event
Also, if-def'ed the code accordingly.
OTP-14831
|
|
* maint:
Fix broken assertion on monitor release
Avoid closing files in gc/monitor callbacks
|
|
Closing files in these callbacks could block scheduler progress
and cause major system instability. We now defer these operations
to a dedicated process instead.
This process may in turn block forever and prevent further orphaned
files from being closed, but it will keep the emulator itself from
misbehaving.
|
|
When type = dgram, the functions recvfrom and recvmsg did not
properly handle socket close, cuaing the caller to hang
indefinitely.
OTP-14831
|
|
When the send buffer was full (eagain), the send failed
(with the rather useless return of {ok, -1}) instead of
returning {error, eagain}.
OTP-14831
|
|
Make it possible to open a file and send debug printouts to
(instead of stdout) for debug printouts from the nif-code.
OTP-14831
|
|
An "accepted" socket will inherit the parent (listen) socket's
buffer sizes (rBufSz, rCtrlSz and wCtrlSz).
OTP-14831
|
|
We got some kind of send hang...
|
|
The send and recv test case triggered a two bugs. One was
that there was no re-selecting when only a portion of the data
was received (which meant that we stopped reading).
Also, the wrong 'current' (writer) was reset when demonitor
current reader after a successful read (which meant that
future readers would never have been monitored).
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 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
|
|
* maint:
Updated OTP version
Prepare release
erts: Fix UNC path handling on Windows
erts: Fix a compiler warning
eldap: Fix race at socket close
Fix bug for sockopt pktoptions on BSD
erts: Fix memory leak on file read errors
|
|
* john/erts/fix-unc-paths-windows/OTP-15333/ERL-737:
erts: Fix UNC path handling on Windows
erts: Fix a compiler warning
|
|
This is unlikely to be the last of the path problems seen after
OTP 21, and I'm starting to regret my decision to unconditionally
use long paths. The idea to hit all long-path problems all the time
was good in theory as it makes such bugs far more visible, but
there just aren't enough people who test pre-release versions on
Windows, making this the world's slowest game of whack-a-mole.
|
|
This would've been a bug if the value was used.
|
|
The supports function now also handles testing for SCTP and
IPv6 support. Basic test at the moment, but better then nothing.
OTP-14831
|