Skip to content
Snippets Groups Projects
Commit 060b1fc6 authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

ice_transport: trim only if the limit is reached per components

PJ_ICE_ST_MAX_CAND is a limit PER components, not for the whole
list

Change-Id: I51252b01170bbf5274a3e5c2d079fe37fed25fff
GitLab: #539
parent 0f491796
No related branches found
No related tags found
No related merge requests found
...@@ -1100,7 +1100,8 @@ IceTransport::startIce(const Attribute& rem_attrs, std::vector<IceCandidate>&& r ...@@ -1100,7 +1100,8 @@ IceTransport::startIce(const Attribute& rem_attrs, std::vector<IceCandidate>&& r
return false; return false;
} }
if (rem_candidates.size() > PJ_ICE_ST_MAX_CAND - 1) { auto comp_cnt = std::max(1u, getComponentCount());
if (rem_candidates.size() / comp_cnt > PJ_ICE_ST_MAX_CAND - 1) {
std::vector<IceCandidate> rcands; std::vector<IceCandidate> rcands;
rcands.reserve(PJ_ICE_ST_MAX_CAND - 1); rcands.reserve(PJ_ICE_ST_MAX_CAND - 1);
JAMI_WARN("[ice:%p] too much candidates detected, trim list.", pimpl_.get()); JAMI_WARN("[ice:%p] too much candidates detected, trim list.", pimpl_.get());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment