|
@@ -151,9 +151,16 @@ void DtlsTransport::incoming(message_ptr message) {
|
|
|
}
|
|
|
|
|
|
bool DtlsTransport::outgoing(message_ptr message) {
|
|
|
- if (message->dscp == 0)
|
|
|
- message->dscp = mCurrentDscp;
|
|
|
-
|
|
|
+ if (message->dscp == 0) {
|
|
|
+ // DTLS handshake packet
|
|
|
+ if (state() == State::Connecting) {
|
|
|
+ // Set recommended high-priority DSCP value
|
|
|
+ // See https://www.rfc-editor.org/rfc/rfc8837.html#section-5
|
|
|
+ message->dscp = 18; // AF21(18), Assured Forwarding class 2, low drop probability
|
|
|
+ } else {
|
|
|
+ message->dscp = mCurrentDscp;
|
|
|
+ }
|
|
|
+ }
|
|
|
return Transport::outgoing(std::move(message));
|
|
|
}
|
|
|
|
|
@@ -501,7 +508,7 @@ void DtlsTransport::incoming(message_ptr message) {
|
|
|
bool DtlsTransport::outgoing(message_ptr message) {
|
|
|
if (message->dscp == 0) {
|
|
|
// DTLS handshake packet
|
|
|
- if (state() != DtlsTransport::State::Connected) {
|
|
|
+ if (state() == State::Connecting) {
|
|
|
// Set recommended high-priority DSCP value
|
|
|
// See https://www.rfc-editor.org/rfc/rfc8837.html#section-5
|
|
|
message->dscp = 18; // AF21(18), Assured Forwarding class 2, low drop probability
|