aboutsummaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2017-09-06Merge pull request #1490 from josevalim/jv-gen-server-continueRaimo Niskanen
Add {continue, Term} and handle_continue/2 to gen_server
2017-09-06Merge branch 'maint'Lukas Larsson
2017-09-06Merge branch 'ingela/ssl/clean-tests' into maintIngela Anderton Andin
* ingela/ssl/clean-tests: ssl: Make sure test initilization is clean
2017-09-05Fix xml-lint warning in docRickard Green
2017-09-05Merge branch 'maint'Anders Svensson
2017-09-05Merge branch 'anders/diameter/answer-message_decode/OTP-14596' into maintAnders Svensson
* anders/diameter/answer-message_decode/OTP-14596: Exercise answer-message/AVP decode in traffic suite Exercise answer-message/Failed-AVP decode in traffic suite
2017-09-05Merge branch 'anders/diameter/DOIC/OTP-14588' into maintAnders Svensson
* anders/diameter/DOIC/OTP-14588: Exercise avp_dictionaries in traffic suite Let generic AVPs be encoded/decoded in alternate dictionaries Rename field in codec map: dictionary -> app_dictionary Add RFC 7683 Diameter Overload Indicator Conveyance text and dictionary Fix decode undef Fix dictionary compilation error message
2017-09-05Merge branch 'maint'John Högberg
2017-09-04Exercise answer-message/AVP decode in traffic suiteAnders Svensson
In particular, that arbitrary application AVPs are decoded in an answer setting the E-bit.
2017-09-04Exercise answer-message/Failed-AVP decode in traffic suiteAnders Svensson
In particular, that application AVPs in Failed-AVP are decoded in an answer setting the E-bit.
2017-09-04Exercise avp_dictionaries in traffic suiteAnders Svensson
As introduced in the parent commit.
2017-09-04Let generic AVPs be encoded/decoded in alternate dictionariesAnders Svensson
To support specifications like RFC 7683 DOIC, that only define AVPs, not applications. AVPs that aren't known to the application dictionary in question could previously not be decoded. Configuring alternate dictionaries with the new transport/service option avp_dictionaries changes this, so that AVPs like DOIC's Grouped OC-OLR can presented in their fully decoded glory. Encode is also extended, allowing things like the following to be encoded in an outgoing message: 'AVP' => [{'OC-OLR', #{'OC-Sequence-Number' => 1, 'OC-Report-Type' => 0, 'OC-Reduction-Percentage' => [25]}}] A diameter_gen_doic_rfc7683 dictionary is installed, but avp_dictionaries isn't specific to DOIC. This commit also solves the problem demonstrated a few commits back, that application AVPs aren't decoded in answers setting the E-bit. Test coverage will come in a subsequent commit.
2017-09-04Rename field in codec map: dictionary -> app_dictionaryAnders Svensson
To better reflect what the field is: field 'module' is the dictionary module that's calling diameter_gen to decode a list of AVP, while field 'app_dictionary' is the dictionary module defining the message being decoded.
2017-09-04Add RFC 7683 Diameter Overload Indicator Conveyance text and dictionaryAnders Svensson
Which motivates the avp_dictionaries config that will be added in a subsequent commit.
2017-09-04Fix list type used in rt_mask category listingJohn Högberg
2017-09-04Fix decode undefAnders Svensson
Function avp/5 isn't exported from dictionary modules. Not necessarily intentional, but don't just export it since that requires recompilation of all dictionary modules, since the function is in diameter_gen.hrl. Not having to recompile was the main motivation for moving most of the included code to module diameter_gen in commit 205521d3. This reveals a weakness in the decode of answers setting the E-bit: any AVP that isn't defined by the common application won't be decoded; the diameter_avp records that these are packed into (in the 'AVP' field of a message record, or equivalent) will have value = undefined. This is nothing new (same in OTP 19), but the values should be decoded. Fix it (and the lack of test coverage) in a subsequent commit that will add avp_dictionaries config.
2017-09-04Fix dictionary compilation error messageAnders Svensson
Adding a second {Vendor-Id} to the common CER definition results in this error: ** AVP CER at line 85 already referenced at line 84 That is, the error incorrectly refers to the message name (CER) where the AVP name (Vendor-Id) is expected.
2017-09-04Merge branch 'maint'Ingela Anderton Andin
2017-09-04Merge branch 'ingela/ssl/session-cache-max/OTP-14556' into maintIngela Anderton Andin
* ingela/ssl/session-cache-max/OTP-14556: ssl: Mend Max session handling
2017-09-04ssl: Mend Max session handlingIngela Anderton Andin
The commit 256e01ce80b3aadd63f303b9bda5722ad313220f was a misunderstanding that actually broke the implementation. It is not so important to keep specific max, rather max is a threshold when the table should be shrinked as to not grow indefinitely. New sessions are created when the id is created and may be short lived it they are not registered for reuse due to handshake failure.
2017-09-04Merge branch 'maint'Ingela Anderton Andin
2017-09-04Merge branch 'ingela/ssl/error-msg-enhancment' into maintIngela Anderton Andin
* ingela/ssl/error-msg-enhancment: ssl: Add the role (server or client) to the alert message Addition to 972f9121311efcfb50db727ab3e930ebc95ab314 solved in OTP-14236
2017-09-03Merge branch 'maint'Anders Svensson
2017-09-03Merge branch 'anders/diameter/decode_format/OTP-14511' into maintAnders Svensson
* anders/diameter/decode_format/OTP-14511: Map less in traffic suite Fix decode_format doc oversights Rename decode_format false to none Tweak {decode_format, false} semantics Fix dialyzer spec
2017-09-03Merge branch 'anders/diameter/config_consistency/OTP-14555' into maintAnders Svensson
* anders/diameter/config_consistency/OTP-14555: Fix strict_arities blunder Fix minor error-handling blunder
2017-09-03Merge branch 'anders/diameter/Proxy-Info/OTP-9869' into maintAnders Svensson
* anders/diameter/Proxy-Info/OTP-9869: Fix handling of Proxy-Info in answers formulated by diameter
2017-09-03Merge branch 'anders/diameter/Experimental-Result/OTP-14511' into maintAnders Svensson
* anders/diameter/Experimental-Result/OTP-14511: Fix extraction of Experimental-Result for counter keys
2017-09-03Merge branch 'anders/diameter/performance/OTP-14521' into maintAnders Svensson
* anders/diameter/performance/OTP-14521: Rename variable Fix decode of too many generic AVPs Enumerate AVPs in diameter_avp.index (again)
2017-09-03Merge branch 'anders/diameter/sctp/OTP-10889' into maintAnders Svensson
* anders/diameter/sctp/OTP-10889: Send unordered on all outbound diameter_sctp streams Delay rotation of diameter_sctp outbound streams Exercise unordered delivery in traffic suite Use unordered delivery on a lone outbound stream in diameter_sctp
2017-09-01Map less in traffic suiteAnders Svensson
By just decoding to map in the client, instead of to record first. The record decode is exercised enough in the server and in other suites.
2017-09-01Fix decode_format doc oversightsAnders Svensson
diameter_codec(3) referred only to the record format in places. The configurable format was added in commits 722fa415 and then 55e65b26.
2017-09-01Rename decode_format false to noneAnders Svensson
Which reads better and makes it easier to distinguish this false from others.
2017-09-01Tweak {decode_format, false} semanticsAnders Svensson
Represent the decoded message by its atom-valued name in diameter_packet.msg, which makes trace much more readable. A diameter_avp.value is untouched (ie. undefined): the AVP name is already in the name field.
2017-09-01Fix dialyzer specAnders Svensson
Which dialyzer hasn't noticed.
2017-09-01Merge branch 'anders/diameter/config_consistency/OTP-14555' into ↵Anders Svensson
anders/diameter/decode_format/OTP-14511 * anders/diameter/config_consistency/OTP-14555: Fix strict_arities blunder Fix minor error-handling blunder Let strict_mbit and incoming_maxlen be configured per transport Let a service configure default transport options Rename type evaluable -> eval Document transport_opt() strict_capx Rename transport_opt() capx_strictness to strict_capx
2017-09-01Fix strict_arities blunderAnders Svensson
Remove value from the merged map, not from the maps being merged. Bundled in commit 5f3becad.
2017-09-01ssl: Make sure test initilization is cleanIngela Anderton Andin
Otherwhise test can be wrongly initialized and will fail as they try to run with a broken setup.
2017-09-01ssl: Add the role (server or client) to the alert messageIngela Anderton Andin
It is desirable to be as specific as possible in the info message, so there can be no mistake if the alert is form the peer or generated by us. This use to be an error message, but it is better to make it an info message as sending an ALERT ending the connection is an expected behaviour.
2017-09-01Merge pull request #1554 from bjorng/bjorn/compiler/opt-bsm/ERL-444Björn Gustavsson
Eliminate unnecessary 'move' instructions OTP-14594
2017-08-31Fix minor error-handling blunderAnders Svensson
Leading to this admonition from dialyzer: diameter_config.erl:670: The variable No can never match since previous clauses completely covered the type 'ok' The throw was caught, but resulted in an error return without the intended information.
2017-08-31Merge branch 'maint'Sverker Eriksson
2017-08-31Merge PR-1543 from gootik/gootik-ets-docSverker Eriksson
Changes confusing example of a bad guard in ets:fun2ms
2017-08-31Merge branch 'maint'Rickard Green
* maint: Upgrade to PCRE 8.41 from PCRE 8.40
2017-08-31Merge branch 'rickard/pcre-8.41' into maintRickard Green
OTP-14574 * rickard/pcre-8.41: Upgrade to PCRE 8.41 from PCRE 8.40
2017-08-31Fix handling of Proxy-Info in answers formulated by diameterAnders Svensson
RFC 6733 says this: 6.2. Diameter Answer Processing When a request is locally processed, the following procedures MUST be applied to create the associated answer, in addition to any additional procedures that MAY be discussed in the Diameter application defining the command: ... o Any Proxy-Info AVPs in the request MUST be added to the answer message, in the same order they were present in the request. This wasn't done when a handle_request callback returned a Result-Code in an 'answer-message' or protocol_error tuple, causing diameter itself to construct the answer message. This form of answer is just a convenience, since the callback can always return an answer that it constructs itself.
2017-08-31Fix extraction of Experimental-Result for counter keysAnders Svensson
The introduction of decode_format in commit 722fa415 (and then 55e65b26) meant the value was not necessarily the intended tuple.
2017-08-31Rename variableAnders Svensson
It's no longer the AVP name as of the parent commit, but the name of the field/member the value will be stored in. Typically the AVP name, but possibly 'AVP'.
2017-08-31Fix decode of too many generic AVPsAnders Svensson
That is, when the arity of an 'AVP' field has an upper bound. This shouldn't happen in practice, but if an AVP is known but its name not explicit in the message grammar then its count was confused with that of AVPs packed into the 'AVP' field.
2017-08-31Enumerate AVPs in diameter_avp.index (again)Anders Svensson
Commit 96cd627a changed the way the index field was used, but the enumeration is used in at least one known application (as a pointer from elements of diameter_packet.errors to elements of diameter_packet.avps) and the motivation for the change is questionable: the lookup that was avoided was unnecessary given that it was already performed in incrementing a counter. Revert to enumerating as before in the non-relay case, but not in the relay case since there's no corresponding usecase.
2017-08-31Eliminate unnecessary 'move' instructionsBjörn Gustavsson
The compiler could sometimes emit unnecessary 'move' instructions in the code for binary matching, for example for this function: escape(<<Byte, Rest/bits>>, Pos) when Byte >= 127 -> escape(Rest, Pos + 1); escape(<<Byte, Rest/bits>>, Pos) -> escape(Rest, Pos + Byte); escape(<<_Rest/bits>>, Pos) -> Pos. The generated code would look like this: {function, escape, 2, 2}. {label,1}. {line,[{location,"t.erl",17}]}. {func_info,{atom,t},{atom,escape},2}. {label,2}. {test,bs_start_match2,{f,1},2,[{x,0},0],{x,0}}. {test,bs_get_integer2, {f,4}, 2, [{x,0}, {integer,8}, 1, {field_flags,[{anno,[17,{file,"t.erl"}]},unsigned,big]}], {x,2}}. {'%',{bin_opt,[17,{file,"t.erl"}]}}. {move,{x,0},{x,3}}. %% UNECESSARY! {test,is_ge,{f,3},[{x,2},{integer,127}]}. {line,[{location,"t.erl",18}]}. {gc_bif,'+',{f,0},4,[{x,1},{integer,1}],{x,1}}. {move,{x,3},{x,0}}. %% UNECESSARY! {call_only,2,{f,2}}. {label,3}. {line,[{location,"t.erl",20}]}. {gc_bif,'+',{f,0},4,[{x,1},{x,2}],{x,1}}. {move,{x,3},{x,0}}. %% UNECESSARY! {call_only,2,{f,2}}. {label,4}. {move,{x,1},{x,0}}. return. The redundant 'move' instructions have been marked. To avoid the 'move' instructions, we can extend the existing function is_context_unused/1 in v3_codegen. If v3_codegen can know that the match context will not be used again, it can reuse the register for the match context and avoid the extra 'move' instructions. https://bugs.erlang.org/browse/ERL-444