Skip to content

Commit

Permalink
fix for early DTLS (#341)
Browse files Browse the repository at this point in the history
* fix for early DTLS
  • Loading branch information
olofkallander authored Nov 10, 2023
1 parent 0118a45 commit dc15a1a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
18 changes: 18 additions & 0 deletions doc/ICE/ICEDTLSrace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```mermaid
sequenceDiagram
autonumber
participant A
participant SMB
A->>SMB: ICE BindRequest user SMB:A
SMB->>A: BindResponse A:SMB
note over A,SMB: SMB is not in CONNECTING yet as it lacks offer w candidates. It cannot reply to DTLS
A-->>SMB: DTLS client Hello
note over A,SMB: SMB has no preliminary rtpEndpoint to send DTLS reply over
SMB->>A: BindRequest A:SMB, nominate X
A->>SMB: BindResponse
note over A,SMB: SMB is waiting for DTLS client Hello
A->>SMB: DTLS client Hello 1s re-transmit
```
2 changes: 1 addition & 1 deletion test/integration/IntegrationCallTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ TEST_P(IntegrationCallTypesTest, party3AllModes)

EXPECT_NEAR(std::max_element(data.amplitudeProfile.begin(), data.amplitudeProfile.end())->second,
3600,
500);
550);
EXPECT_NEAR(data.rampupAbove(3100), 48000 * 1.22, 48000);
}

Expand Down
9 changes: 5 additions & 4 deletions test/integration/IntegrationTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ struct IntegrationTest : public ::testing::Test
continue;
}

if (dumpPcmData)
{
item.second->dumpPcmData();
}

result.audioSsrcCount++;

std::vector<double> freqVector;
Expand Down Expand Up @@ -232,10 +237,6 @@ struct IntegrationTest : public ::testing::Test
result.amplitudeProfile.insert(result.amplitudeProfile.begin(),
amplitudeProfile.begin(),
amplitudeProfile.end());
if (dumpPcmData)
{
item.second->dumpPcmData();
}
}

std::sort(result.dominantFrequencies.begin(), result.dominantFrequencies.end());
Expand Down
1 change: 1 addition & 0 deletions test/integration/emulator/ColibriChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class ColibriChannel : public BaseChannel
uint32_t* videoSsrcs) override
{
assert(false);
return true;
}

void configureTransport(transport::RtcTransport& transport, memory::AudioPacketPoolAllocator& allocator) override;
Expand Down
2 changes: 1 addition & 1 deletion transport/TransportImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,7 @@ void TransportImpl::onIceCandidateChanged(ice::IceSession* session,
ice::IceEndpoint* endpoint,
const SocketAddress& sourcePort)
{
if (_selectedRtp == nullptr && session->getState() > ice::IceSession::State::READY)
if (_selectedRtp == nullptr && session->getState() >= ice::IceSession::State::READY)
{
_selectedRtp = static_cast<transport::Endpoint*>(endpoint); // temporary selection
_selectedRtcp = _selectedRtp;
Expand Down

0 comments on commit dc15a1a

Please sign in to comment.