Age | Commit message (Collapse) | Author |
|
|
|
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
|
|
"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
|
|
|
|
It's impossible to call NIF with wrong argc from Erlang
and thus pointless to throw badarg.
|
|
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.
|
|
|
|
|