mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-09 18:29:45 +02:00
Merge branch '4.2'
This commit is contained in:
commit
81002c4fbd
63 changed files with 391 additions and 266 deletions
|
@ -45,7 +45,7 @@ public abstract class JingleNegotiator {
|
|||
|
||||
private static final Logger LOGGER = Logger.getLogger(JingleNegotiator.class.getName());
|
||||
|
||||
//private XMPPConnection connection; // The connection associated
|
||||
// private XMPPConnection connection; // The connection associated
|
||||
|
||||
protected JingleSession session;
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
public JingleSession(XMPPConnection conn, JingleSessionRequest request, Jid initiator, Jid responder,
|
||||
List<JingleMediaManager> jingleMediaManagers) {
|
||||
this(conn, initiator, responder, generateSessionId(), jingleMediaManagers);
|
||||
//sessionRequest = request; // unused
|
||||
// sessionRequest = request; // unused
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -317,7 +317,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
// Acknowledge the IQ reception
|
||||
// Not anymore. The state machine generates an appropriate response IQ that
|
||||
// gets sent back at the end of this routine.
|
||||
//sendAck(iq);
|
||||
// sendAck(iq);
|
||||
|
||||
} catch (JingleException e) {
|
||||
// Send an error message, if present
|
||||
|
@ -829,7 +829,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
addExpectedId(jout.getStanzaId());
|
||||
sendStanza(jout);
|
||||
|
||||
//triggerSessionEstablished();
|
||||
// triggerSessionEstablished();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1143,7 +1143,7 @@ public class JingleSession extends JingleNegotiator implements MediaReceivedList
|
|||
*/
|
||||
public void startIncoming() {
|
||||
|
||||
//updatePacketListener();
|
||||
// updatePacketListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -118,7 +118,7 @@ public class JingleSessionRequest {
|
|||
session = manager.createIncomingJingleSession(this);
|
||||
// Acknowledge the IQ reception
|
||||
session.setSid(this.getSessionID());
|
||||
//session.sendAck(this.getJingle());
|
||||
// session.sendAck(this.getJingle());
|
||||
session.updatePacketListener();
|
||||
session.receivePacketAndRespond(this.getJingle());
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ public class JingleSessionRequest {
|
|||
session = manager.createIncomingJingleSession(this);
|
||||
// Acknowledge the IQ reception
|
||||
session.setSid(this.getSessionID());
|
||||
//session.sendAck(this.getJingle());
|
||||
// session.sendAck(this.getJingle());
|
||||
session.updatePacketListener();
|
||||
session.terminate("Declined");
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -93,7 +93,7 @@ public class JingleSessionStatePending extends JingleSessionState {
|
|||
|
||||
default:
|
||||
// Anything other action is an error.
|
||||
//response = createJingleError(inJingle, JingleError.OUT_OF_ORDER);
|
||||
// response = createJingleError(inJingle, JingleError.OUT_OF_ORDER);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -106,8 +106,8 @@ public class JingleSessionStatePending extends JingleSessionState {
|
|||
private IQ receiveContentAcceptAction(Jingle inJingle) {
|
||||
|
||||
// According to XEP-167 the only thing we can do is ack.
|
||||
//setSessionState(JingleSessionStateEnum.ACTIVE);
|
||||
//return createAck(inJingle);
|
||||
// setSessionState(JingleSessionStateEnum.ACTIVE);
|
||||
// return createAck(inJingle);
|
||||
|
||||
// This is now handled by the media negotiator for the matching <content> segment.
|
||||
return null;
|
||||
|
|
|
@ -49,7 +49,7 @@ public class MediaNegotiator extends JingleNegotiator {
|
|||
|
||||
private static final Logger LOGGER = Logger.getLogger(MediaNegotiator.class.getName());
|
||||
|
||||
//private JingleSession session; // The session this negotiation
|
||||
// private JingleSession session; // The session this negotiation
|
||||
|
||||
private final JingleMediaManager mediaManager;
|
||||
|
||||
|
@ -252,7 +252,7 @@ public class MediaNegotiator extends JingleNegotiator {
|
|||
// If there are suitable/matching payload types then accept this content.
|
||||
if (bestCommonAudioPt != null) {
|
||||
// Let thre transport negotiators sort-out connectivity and content-accept instead.
|
||||
//response = createAudioPayloadTypesOffer();
|
||||
// response = createAudioPayloadTypesOffer();
|
||||
setNegotiatorState(JingleNegotiatorState.PENDING);
|
||||
} else {
|
||||
// Don't really know what to send here. XEP-166 is not clear.
|
||||
|
@ -291,7 +291,7 @@ public class MediaNegotiator extends JingleNegotiator {
|
|||
// and send an accept if we have an agreement...
|
||||
ptChange = !bestCommonAudioPt.equals(oldBestCommonAudioPt);
|
||||
if (oldBestCommonAudioPt == null || ptChange) {
|
||||
//response = createAcceptMessage();
|
||||
// response = createAcceptMessage();
|
||||
}
|
||||
} else {
|
||||
throw new JingleException(JingleError.NO_COMMON_PAYLOAD);
|
||||
|
@ -319,7 +319,7 @@ public class MediaNegotiator extends JingleNegotiator {
|
|||
if (bestCommonAudioPt == null) {
|
||||
// Update the best common audio PT
|
||||
bestCommonAudioPt = calculateBestCommonAudioPt(remoteAudioPts);
|
||||
//response = createAcceptMessage();
|
||||
// response = createAcceptMessage();
|
||||
}
|
||||
|
||||
offeredPayloads = description.getAudioPayloadTypesList();
|
||||
|
|
|
@ -117,7 +117,7 @@ public class JMFInit extends Frame implements Runnable {
|
|||
throw td;
|
||||
}
|
||||
catch (Throwable t) {
|
||||
//Do nothing
|
||||
// Do nothing.
|
||||
}
|
||||
|
||||
Class<?> jsauto;
|
||||
|
@ -226,7 +226,7 @@ public class JMFInit extends Frame implements Runnable {
|
|||
}
|
||||
}
|
||||
catch (Throwable tt) {
|
||||
//Do nothing
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -270,7 +270,7 @@ public class JMFInit extends Frame implements Runnable {
|
|||
}
|
||||
}
|
||||
catch (Throwable tt) {
|
||||
//Do nothing
|
||||
// Do nothing.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -152,9 +152,9 @@ public class JmfMediaManager extends JingleMediaManager {
|
|||
// should be and put it there.
|
||||
runLinuxPreInstall();
|
||||
|
||||
//if (jmfProperties.length() == 0) {
|
||||
// if (jmfProperties.length() == 0) {
|
||||
new JMFInit(null, false);
|
||||
//}
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -146,7 +146,7 @@ public class ImageReceiver extends Canvas {
|
|||
|
||||
public void drawTile(int x, int y, BufferedImage bufferedImage) {
|
||||
tiles[x][y] = bufferedImage;
|
||||
//repaint(x * tileWidth, y * tileWidth, tileWidth, tileWidth);
|
||||
// repaint(x * tileWidth, y * tileWidth, tileWidth, tileWidth);
|
||||
this.getGraphics().drawImage(bufferedImage, tileWidth * x, tileWidth * y, this);
|
||||
}
|
||||
|
||||
|
|
|
@ -221,8 +221,8 @@ public class ICECandidate extends TransportCandidate implements Comparable<ICECa
|
|||
*/
|
||||
@Override
|
||||
public void check(final List<TransportCandidate> localCandidates) {
|
||||
//TODO candidate is being checked trigger
|
||||
//candidatesChecking.add(cand);
|
||||
// TODO candidate is being checked trigger
|
||||
// candidatesChecking.add(cand);
|
||||
|
||||
final ICECandidate checkingCandidate = this;
|
||||
|
||||
|
@ -287,8 +287,8 @@ public class ICECandidate extends TransportCandidate implements Comparable<ICECa
|
|||
|
||||
triggerCandidateChecked(result.isReachable());
|
||||
|
||||
//TODO candidate is being checked trigger
|
||||
//candidatesChecking.remove(cand);
|
||||
// TODO candidate is being checked trigger
|
||||
// candidatesChecking.remove(cand);
|
||||
}
|
||||
}, "Transport candidate check");
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class ICEResolver extends TransportResolver {
|
|||
String server;
|
||||
int port;
|
||||
static Map<String, ICENegociator> negociatorsMap = new HashMap<String, ICENegociator>();
|
||||
//ICENegociator iceNegociator = null;
|
||||
// ICENegociator iceNegociator = null;
|
||||
|
||||
public ICEResolver(XMPPConnection connection, String server, int port) {
|
||||
super();
|
||||
|
|
|
@ -110,7 +110,7 @@ public class TcpUdpBridgeClient {
|
|||
byte[] b = new byte[500];
|
||||
|
||||
int s = in.read(b);
|
||||
//if (s == -1) continue;
|
||||
// if (s == -1) continue;
|
||||
|
||||
LOGGER.fine("TCP Client:" + new String(b, 0, s, "UTF-8"));
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ public class TcpUdpBridgeServer {
|
|||
byte[] b = new byte[500];
|
||||
|
||||
int s = in.read(b);
|
||||
//if (s == -1) continue;
|
||||
// if (s == -1) continue;
|
||||
|
||||
LOGGER.fine("TCP Server:" + new String(b, 0, s, "UTF-8"));
|
||||
|
||||
|
|
|
@ -352,8 +352,8 @@ public abstract class TransportCandidate {
|
|||
* Subclasses should provide better methods if they can...
|
||||
*/
|
||||
public void check(final List<TransportCandidate> localCandidates) {
|
||||
//TODO candidate is being checked trigger
|
||||
//candidatesChecking.add(cand);
|
||||
// TODO candidate is being checked trigger
|
||||
// candidatesChecking.add(cand);
|
||||
|
||||
Thread checkThread = new Thread(new Runnable() {
|
||||
@Override
|
||||
|
@ -372,8 +372,8 @@ public abstract class TransportCandidate {
|
|||
}
|
||||
triggerCandidateChecked(isUsable);
|
||||
|
||||
//TODO candidate is being checked trigger
|
||||
//candidatesChecking.remove(cand);
|
||||
// TODO candidate is being checked trigger
|
||||
// candidatesChecking.remove(cand);
|
||||
}
|
||||
}, "Transport candidate check");
|
||||
|
||||
|
@ -680,7 +680,7 @@ public abstract class TransportCandidate {
|
|||
|
||||
socket.receive(packet);
|
||||
|
||||
//LOGGER.fine("ECHO Packet Received in: " + socket.getLocalAddress().getHostAddress() + ":" + socket.getLocalPort() + " From: " + packet.getAddress().getHostAddress() + ":" + packet.getPort());
|
||||
// LOGGER.fine("ECHO Packet Received in: " + socket.getLocalAddress().getHostAddress() + ":" + socket.getLocalPort() + " From: " + packet.getAddress().getHostAddress() + ":" + packet.getPort());
|
||||
|
||||
boolean accept = false;
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
public final static int CANDIDATES_ACCEPT_PERIOD = 4000;
|
||||
|
||||
// The session this nenotiator belongs to
|
||||
//private final JingleSession session;
|
||||
// private final JingleSession session;
|
||||
|
||||
// The transport manager
|
||||
private final TransportResolver resolver;
|
||||
|
@ -137,7 +137,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
*/
|
||||
private void setAcceptedLocalCandidate(TransportCandidate bestLocalCandidate) {
|
||||
for (int i = 0; i < resolver.getCandidateCount(); i++) {
|
||||
//TODO FIX The EQUAL Sentence
|
||||
// TODO FIX The EQUAL Sentence
|
||||
if (resolver.getCandidate(i).getIp().equals(bestLocalCandidate.getIp())
|
||||
&& resolver.getCandidate(i).getPort() == bestLocalCandidate.getPort()) {
|
||||
acceptedLocalCandidate = resolver.getCandidate(i);
|
||||
|
@ -145,7 +145,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
}
|
||||
}
|
||||
LOGGER.fine("BEST: ip=" + bestLocalCandidate.getIp() + " port=" + bestLocalCandidate.getPort() + " has not been offered.");
|
||||
//throw new XMPPException("Local transport candidate has not be offered.");
|
||||
// throw new XMPPException("Local transport candidate has not be offered.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -316,7 +316,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
// Once we are in pending state, look for any valid remote
|
||||
// candidate, and send an "accept" if we have one...
|
||||
TransportCandidate bestRemote = getBestRemoteCandidate();
|
||||
//State state = getState();
|
||||
// State state = getState();
|
||||
|
||||
if ((bestRemote != null)
|
||||
&& ((getNegotiatorState() == JingleNegotiatorState.PENDING))) {
|
||||
|
@ -359,7 +359,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
if (candidate instanceof ICECandidate) {
|
||||
ICECandidate iceCandidate = (ICECandidate) candidate;
|
||||
if (iceCandidate.getType().equals(Type.relay)) {
|
||||
//TODO Check if the relay is reacheable
|
||||
// TODO Check if the relay is reacheable.
|
||||
addValidRemoteCandidate(iceCandidate);
|
||||
foundRemoteRelay = true;
|
||||
}
|
||||
|
@ -409,7 +409,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
}
|
||||
|
||||
bestRemote = getBestRemoteCandidate();
|
||||
//State state = getState();
|
||||
// State state = getState();
|
||||
if ((bestRemote != null)
|
||||
&& ((getNegotiatorState() == JingleNegotiatorState.PENDING))) {
|
||||
if (!acceptedRemoteCandidates.contains(bestRemote)) {
|
||||
|
@ -699,7 +699,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
IQ response = null;
|
||||
|
||||
// Parse the Jingle and get any proposed transport candidates
|
||||
//addRemoteCandidates(obtainCandidatesList(jin));
|
||||
// addRemoteCandidates(obtainCandidatesList(jin));
|
||||
|
||||
// Start offering candidates
|
||||
sendTransportCandidatesOffer();
|
||||
|
@ -723,7 +723,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
IQ response = null;
|
||||
|
||||
// Parse the Jingle and get any proposed transport candidates
|
||||
//addRemoteCandidates(obtainCandidatesList(jin));
|
||||
// addRemoteCandidates(obtainCandidatesList(jin));
|
||||
|
||||
// // Start offering candidates
|
||||
// sendTransportCandidatesOffer();
|
||||
|
@ -771,7 +771,7 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
|
||||
if (isEstablished()) {
|
||||
LOGGER.fine(cand.getIp() + " is set active");
|
||||
//setNegotiatorState(JingleNegotiatorState.SUCCEEDED);
|
||||
// setNegotiatorState(JingleNegotiatorState.SUCCEEDED);
|
||||
}
|
||||
}
|
||||
return response;
|
||||
|
@ -785,9 +785,9 @@ public abstract class TransportNegotiator extends JingleNegotiator {
|
|||
IQ response = null;
|
||||
|
||||
LOGGER.fine("Transport stabilished");
|
||||
//triggerTransportEstablished(getAcceptedLocalCandidate(), getBestRemoteCandidate());
|
||||
// triggerTransportEstablished(getAcceptedLocalCandidate(), getBestRemoteCandidate());
|
||||
|
||||
//setNegotiatorState(JingleNegotiatorState.SUCCEEDED);
|
||||
// setNegotiatorState(JingleNegotiatorState.SUCCEEDED);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
|
|
@ -232,7 +232,7 @@ public abstract class JingleTransportProvider extends ExtensionElementProvider<J
|
|||
String name = parser.getAttributeValue("", "name");
|
||||
String port = parser.getAttributeValue("", "port");
|
||||
|
||||
//LOGGER.debug();
|
||||
// LOGGER.debug();
|
||||
|
||||
if (generation != null) {
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue