aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/transport/diameter_tcp.erl
AgeCommit message (Collapse)Author
2016-03-13Let a throttling callback answer a received messageAnders Svensson
As discussed in the parent commit. This is easier said than done in practice, but there's no harm in allowing it.
2016-03-13Let a throttling callback discard a received messageAnders Svensson
This can be used as a simple form of overload protection, discarding the message before it's passed into diameter to become one more request process in a flood. Replying with 3004 would be more appropriate when the request has been directed at a specific server (the RFC's requirement) however, and possibly it should be possible for a callback to do this as well.
2016-03-13Let throttling callback return a notification pidAnders Svensson
In addition to returning ok or {timeout, Tmo}, let a throttling callback for message reception return a pid(), which is then notified if the message in question is either discarded or results in a request process. Notification is by way of messages of the form {diameter, discard | {request, pid()}} where the pid is that of a request process resulting from the received message. This allows the notification process to keep track of the maximum number of request processes a peer connection can have given rise to.
2016-03-13Make throttling callbacks on message receptionAnders Svensson
The callback is now applied to the atom 'false' when asking if another message should be received on the socket, and to a received binary message after reception. Throttling on received messages makes it possible to distinguish between requests and answers. There is no callback on outgoing messages since these don't have to go through the transport process, even if they currently do.
2016-03-13Add diameter_tcp option throttle_cbAnders Svensson
To let a callback module decide whether or to receive another message from the peer, so that backpressure can be applied when it's inappropriate. This is to let a callback protect against reading more than can be processed, which is otherwise possible since diameter_tcp otherwise always asks for more. A callback is made after each message, and can answer to continue reading or to ask again after a timeout. It's each message instead of each packet partly for simplicity, but also since this should be sufficiently fine-grained. Per packet would require some interaction with the fragment timer that flushes partial messages that haven't been completely received.
2015-02-20Adapt tcp/sctp transport modules for pool_size > 1Anders Svensson
In particular, that starts for the same transport reference can now be concurrent. Looking up a listener process and starting a new one if not found did handle this (more than one process could find no listener), and diameter_sctp assumed there could only be one transport process waiting for an association.
2013-06-10Let diameter_{tcp,sctp} be configured with permissible remote addressesAnders Svensson
Option 'accept' allows remote addresses to be configured as tuples or regular expressions. The remote addresses for any incoming (aka accepted) connection/association are matched against the configured values, any non-matching address causing the connection/association to be aborted.
2013-06-10Fix diameter_{tcp,sctp} specAnders Svensson
The third argument to start/3 was just wrong.
2013-06-10Remove trailing whitespaceAnders Svensson
2013-04-11Make explicit local address to diameter_tcp:start/3 optionalAnders Svensson
Use the default address address (as selected by gen_tcp) if none is configured, passing it in the new 'connected' message introduced by the previous commit. The corresponding update to diameter_sctp has to wait until problems with inet:sockname/1 are resolved: the function currently only returns one address, and sometimes {0,0,0,0}. See OTP-11018.
2013-02-10Only start a fragment timer when there's something to flushAnders Svensson
2013-02-10Simplify and document diameter_tcp fragment timerAnders Svensson
Don't start a new timer with each incoming message. Instead, start a timer at timeout and flush after two successive timeouts with no message reception.
2013-02-10Remove upgrade code not needed after application restartAnders Svensson
Which will be the case in R16B.
2013-02-08Remove upgrade code not needed after application restartAnders Svensson
Which will be the case with R16B in this case.
2013-01-23Spec fixAnders Svensson
2012-08-29Merge branch 'anders/diameter/R15B02_release' into maintAnders Svensson
* anders/diameter/R15B02_release: Dialyzer spec fix Learn to keep time in diameter_gen_sctp_SUITE Update command line test for changed ct:run_test/1 return value OTP-10243
2012-08-29Dialyzer spec fixAnders Svensson
2012-08-27Maintain service_info callback data in process dictionaryAnders Svensson
To be used by diameter_service in constructing service_info.
2011-10-10Register tcp listener before transport start returnAnders Svensson
2011-10-10Add port resolution interface to transport modulesAnders Svensson
2011-10-06Add tls support at connection establishmentAnders Svensson
This is the method added in draft-ietf-dime-rfc3588bis, whereby a TLS handshake immediately follows connection establishment and CER/CEA is sent over the secured connection.
2011-10-06Handle tls notification for tcpAnders Svensson
If TLS has been configured on Inband-Security-Id then the transport process receives a message from the peer_fsm process indicating whether or not to upgrade to TLS. The current draft of RFC 3588 deprecates (but retains for backwards compatibility) the use of Inband-Security-Id for negotiating TLS, adding the possibility of TLS having be negotiated before capabilities exchange. This commit handles the deprecated case.
2011-10-06Lift recursion in tcp message reception up the call chainAnders Svensson
When an initial message is received and TLS is a possibility, must wait for a message from the peer process before either commencing a handshake or receiving more messages.
2011-05-18Initial commit of the diameter application.Anders Svensson
The application provides an implementation of the Diameter protocol as defined in RFC 3588.