From 89082b2c1a82533847a183c81c26e57a999663df Mon Sep 17 00:00:00 2001 From: boris Date: Tue, 9 Sep 2014 14:46:01 +0000 Subject: [PATCH] Take into account the transport protocol for mapped candidates. Preserve the isSSL flag. --- .../ice/harvest/MappingCandidateHarvester.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/org/ice4j/ice/harvest/MappingCandidateHarvester.java b/src/org/ice4j/ice/harvest/MappingCandidateHarvester.java index a522847..ae3a61b 100644 --- a/src/org/ice4j/ice/harvest/MappingCandidateHarvester.java +++ b/src/org/ice4j/ice/harvest/MappingCandidateHarvester.java @@ -79,22 +79,26 @@ public class MappingCandidateHarvester { if (!(cand instanceof HostCandidate) || !cand.getTransportAddress().getHostAddress() - .equals(face.getHostAddress())) + .equals(face.getHostAddress()) + || cand.getTransport() != face.getTransport()) { continue; } + HostCandidate hostCandidate = (HostCandidate) cand; TransportAddress mappedAddress = new TransportAddress( mask.getHostAddress(), - cand.getHostAddress().getPort(), - cand.getHostAddress().getTransport()); + hostCandidate.getHostAddress().getPort(), + hostCandidate.getHostAddress().getTransport()); ServerReflexiveCandidate mappedCandidate = new ServerReflexiveCandidate( mappedAddress, - (HostCandidate)cand, - cand.getStunServerAddress(), + hostCandidate, + hostCandidate.getStunServerAddress(), CandidateExtendedType.STATICALLY_MAPPED_CANDIDATE); + if (hostCandidate.isSSL()) + mappedCandidate.setSSL(true); //try to add the candidate to the component and then //only add it to the harvest not redundant