diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2024-02-01 17:01:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-01 17:01:31 +0100 |
commit | cdb4673f4841e8e7a25f98497720a45db39787cf (patch) | |
tree | 23ce354db8d5cf2adca511e8d70bbf1846d75ae8 /src | |
parent | 86d080b328b4367984cd7932bd1ce676e9ca5103 (diff) | |
parent | 5b4221462b9a0edcddd0221bb6d26d6a20cc40a2 (diff) | |
download | fork-godot-webrtc-native-cdb4673f4841e8e7a25f98497720a45db39787cf.tar.gz fork-godot-webrtc-native-cdb4673f4841e8e7a25f98497720a45db39787cf.tar.bz2 fork-godot-webrtc-native-cdb4673f4841e8e7a25f98497720a45db39787cf.zip |
Merge pull request #135 from Faless/bump/deps
Update to libdatachannel 0.20.1, OpenSSL 3.0.13
Diffstat (limited to 'src')
-rw-r--r-- | src/WebRTCLibDataChannel.cpp | 4 | ||||
-rw-r--r-- | src/WebRTCLibPeerConnection.cpp | 6 |
2 files changed, 4 insertions, 6 deletions
diff --git a/src/WebRTCLibDataChannel.cpp b/src/WebRTCLibDataChannel.cpp index 6577433..442caf0 100644 --- a/src/WebRTCLibDataChannel.cpp +++ b/src/WebRTCLibDataChannel.cpp @@ -143,12 +143,12 @@ int32_t WebRTCLibDataChannel::_get_id() const { int32_t WebRTCLibDataChannel::_get_max_packet_life_time() const { ERR_FAIL_COND_V(!channel, 0); - return channel->reliability().type == rtc::Reliability::Type::Timed ? std::get<std::chrono::milliseconds>(channel->reliability().rexmit).count() : -1; + return channel->reliability().maxPacketLifeTime.has_value() ? channel->reliability().maxPacketLifeTime.value().count() : -1; } int32_t WebRTCLibDataChannel::_get_max_retransmits() const { ERR_FAIL_COND_V(!channel, 0); - return channel->reliability().type == rtc::Reliability::Type::Rexmit ? std::get<int>(channel->reliability().rexmit) : -1; + return channel->reliability().maxRetransmits.value_or(-1); } String WebRTCLibDataChannel::_get_protocol() const { diff --git a/src/WebRTCLibPeerConnection.cpp b/src/WebRTCLibPeerConnection.cpp index 88bd29a..69bb89f 100644 --- a/src/WebRTCLibPeerConnection.cpp +++ b/src/WebRTCLibPeerConnection.cpp @@ -96,11 +96,9 @@ Error WebRTCLibPeerConnection::_parse_channel_config(rtc::DataChannelInit &r_con // Channels cannot be both time-constrained and retry-constrained. ERR_FAIL_COND_V(p_dict.has("maxPacketLifeTime") && p_dict.has("maxRetransmits"), ERR_INVALID_PARAMETER); if (p_dict.has("maxPacketLifeTime")) { - r_config.reliability.type = rtc::Reliability::Type::Timed; - r_config.reliability.rexmit = std::chrono::milliseconds(p_dict["maxPacketLifeTime"].operator int32_t()); + r_config.reliability.maxPacketLifeTime = std::chrono::milliseconds(p_dict["maxPacketLifeTime"].operator int32_t()); } else if (p_dict.has("maxRetransmits")) { - r_config.reliability.type = rtc::Reliability::Type::Rexmit; - r_config.reliability.rexmit = p_dict["maxRetransmits"].operator int32_t(); + r_config.reliability.maxRetransmits = p_dict["maxRetransmits"].operator int32_t(); } if (p_dict.has("ordered") && p_dict["ordered"].operator bool() == false) { r_config.reliability.unordered = true; |