1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-10 17:49:38 +02:00

Fix ugly code

This commit is contained in:
vanitasvitae 2017-08-28 11:19:28 +02:00
commit b8584c13a1
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
23 changed files with 119 additions and 155 deletions

View file

@ -136,7 +136,7 @@ public final class JingleManager extends Manager {
if (jingle.getAction() == JingleAction.session_initiate) {
//fresh. phew!
try {
LOGGER.log(Level.INFO, "Create new session with " + jingle.getFrom() + ": " + jingle.getSid());
LOGGER.log(Level.FINE, "Create new session with " + jingle.getFrom() + ": " + jingle.getSid());
session = JingleSession.fromSessionInitiate(JingleManager.this, jingle);
jingleSessions.put(fullJidAndSessionId, session);
} catch (UnsupportedDescriptionException e) {

View file

@ -182,6 +182,7 @@ public class JingleContent implements JingleTransportCallback, JingleSecurityCal
* @param connection connection.
*/
void handleContentAccept(JingleElement request, XMPPConnection connection) {
LOGGER.log(Level.FINE, "Received content-accept from " + request.getFrom() + " for session " + request.getSid() + " and content " + getName());
start(connection);
}
@ -192,7 +193,7 @@ public class JingleContent implements JingleTransportCallback, JingleSecurityCal
* @return result.
*/
IQ handleSessionAccept(JingleElement request, XMPPConnection connection) {
LOGGER.log(Level.INFO, "RECEIVED SESSION ACCEPT!");
LOGGER.log(Level.FINE, "Received session-accept from " + request.getResponder() + " for session " + request.getSid());
JingleContentElement contentElement = null;
for (JingleContentElement c : request.getContents()) {
if (c.getName().equals(getName())) {
@ -310,9 +311,10 @@ public class JingleContent implements JingleTransportCallback, JingleSecurityCal
*/
private IQ handleTransportReject(JingleElement request, final XMPPConnection connection) {
if (pendingReplacingTransport == null) {
// TODO: Throw other exception?
throw new AssertionError("We didn't try to replace the transport.");
LOGGER.log(Level.WARNING, "Received transport-reject, but apparently we did not try to replace the transport.");
return JingleElement.createJingleErrorOutOfOrder(request);
}
Async.go(new Runnable() {
@Override
public void run() {
@ -321,10 +323,11 @@ public class JingleContent implements JingleTransportCallback, JingleSecurityCal
try {
replaceTransport(transportBlacklist, connection);
} catch (SmackException.NotConnectedException | SmackException.NoResponseException | XMPPException.XMPPErrorException | InterruptedException e) {
LOGGER.log(Level.SEVERE, "Could not replace transport: " + e, e);
LOGGER.log(Level.SEVERE, "Could not replace transport.", e);
}
}
});
return IQ.createResultIQ(request);
}
@ -343,9 +346,11 @@ public class JingleContent implements JingleTransportCallback, JingleSecurityCal
@Override
public void run() {
try {
connection.createStanzaCollectorAndSend(JingleElement.createJingleErrorTieBreak(request)).nextResultOrThrow();
} catch (SmackException.NoResponseException | SmackException.NotConnectedException | InterruptedException | XMPPException.XMPPErrorException e) {
LOGGER.log(Level.SEVERE, "Could not send tie-break: " + e, e);
connection.createStanzaCollectorAndSend(JingleElement.createJingleErrorTieBreak(request))
.nextResultOrThrow();
} catch (SmackException.NoResponseException | SmackException.NotConnectedException |
InterruptedException | XMPPException.XMPPErrorException e) {
LOGGER.log(Level.SEVERE, "Could not send tie-break.", e);
}
}
});
@ -374,10 +379,13 @@ public class JingleContent implements JingleTransportCallback, JingleSecurityCal
Async.go(new Runnable() {
@Override
public void run() {
JingleElement reject = JingleElement.createTransportReject(session.getOurJid(),
session.getPeer(), session.getSessionId(), getCreator(), getName(), transportElement);
try {
getParent().getJingleManager().getConnection().createStanzaCollectorAndSend(JingleElement.createTransportReject(session.getOurJid(), session.getPeer(), session.getSessionId(), getCreator(), getName(), transportElement));
} catch (SmackException.NotConnectedException | InterruptedException e) {
LOGGER.log(Level.SEVERE, "Could not send transport-reject: " + e, e);
connection.createStanzaCollectorAndSend(reject).nextResultOrThrow();
} catch (SmackException.NotConnectedException | InterruptedException |
XMPPException.XMPPErrorException | SmackException.NoResponseException e) {
LOGGER.log(Level.SEVERE, "Could not send transport-reject.", e);
}
}
});
@ -390,10 +398,11 @@ public class JingleContent implements JingleTransportCallback, JingleSecurityCal
Async.go(new Runnable() {
@Override
public void run() {
JingleElement accept = JingleElement.createTransportAccept(session.getOurJid(), session.getPeer(), session.getSessionId(), getCreator(), getName(), transport.getElement());
try {
getParent().getJingleManager().getConnection().createStanzaCollectorAndSend(JingleElement.createTransportAccept(session.getOurJid(), session.getPeer(), session.getSessionId(), getCreator(), getName(), transport.getElement()));
} catch (SmackException.NotConnectedException | InterruptedException e) {
LOGGER.log(Level.SEVERE, "Could not send transport-accept: " + e, e);
getParent().getJingleManager().getConnection().createStanzaCollectorAndSend(accept).nextResultOrThrow();
} catch (SmackException.NotConnectedException | InterruptedException | XMPPException.XMPPErrorException | SmackException.NoResponseException e) {
LOGGER.log(Level.SEVERE, "Could not send transport-accept.", e);
}
}
});
@ -579,17 +588,17 @@ public class JingleContent implements JingleTransportCallback, JingleSecurityCal
public void run() {
try {
if (isReceiving()) {
LOGGER.log(Level.INFO, "Establish incoming bytestream.");
LOGGER.log(Level.FINE, "Establish incoming bytestream.");
getTransport().establishIncomingBytestreamSession(connection, JingleContent.this, getParent());
} else if (isSending()) {
LOGGER.log(Level.INFO, "Establish outgoing bytestream.");
LOGGER.log(Level.FINE, "Establish outgoing bytestream.");
getTransport().establishOutgoingBytestreamSession(connection, JingleContent.this, getParent());
} else {
LOGGER.log(Level.INFO, "Neither receiving, nor sending. Assume receiving.");
LOGGER.log(Level.FINE, "Neither receiving, nor sending. Assume receiving.");
getTransport().establishIncomingBytestreamSession(connection, JingleContent.this, getParent());
}
} catch (SmackException.NotConnectedException | InterruptedException e) {
LOGGER.log(Level.SEVERE, "Error establishing connection: " + e, e);
LOGGER.log(Level.SEVERE, "Error establishing connection.", e);
}
}
});
@ -597,17 +606,17 @@ public class JingleContent implements JingleTransportCallback, JingleSecurityCal
@Override
public void onTransportReady(BytestreamSession bytestreamSession) {
LOGGER.log(Level.INFO, "TransportReady: " + (isReceiving() ? "Receive" : "Send"));
LOGGER.log(Level.FINE, "TransportReady: " + (isReceiving() ? "Receive" : "Send"));
if (bytestreamSession == null) {
throw new AssertionError("bytestreamSession MUST NOT be null at this point.");
}
if (security != null) {
if (isReceiving()) {
LOGGER.log(Level.INFO, "Decrypt incoming Bytestream.");
LOGGER.log(Level.FINE, "Decrypt incoming Bytestream.");
getSecurity().decryptIncomingBytestream(bytestreamSession, this);
} else if (isSending()) {
LOGGER.log(Level.INFO, "Encrypt outgoing Bytestream.");
LOGGER.log(Level.FINE, "Encrypt outgoing Bytestream.");
getSecurity().encryptOutgoingBytestream(bytestreamSession, this);
}
} else {
@ -625,7 +634,7 @@ public class JingleContent implements JingleTransportCallback, JingleSecurityCal
try {
replaceTransport(getTransportBlacklist(), getParent().getJingleManager().getConnection());
} catch (SmackException.NotConnectedException | InterruptedException | SmackException.NoResponseException | XMPPException.XMPPErrorException e1) {
LOGGER.log(Level.SEVERE, "Could not send transport-replace: " + e, e);
LOGGER.log(Level.SEVERE, "Could not send transport-replace.", e);
}
}
}
@ -637,7 +646,7 @@ public class JingleContent implements JingleTransportCallback, JingleSecurityCal
@Override
public void onSecurityFailed(Exception e) {
LOGGER.log(Level.SEVERE, "Security failed: " + e, e);
LOGGER.log(Level.SEVERE, "Security failed.", e);
}
/**

View file

@ -163,7 +163,7 @@ public class JingleSession {
* @throws SmackException.NoResponseException
*/
public void sendAccept(XMPPConnection connection) throws SmackException.NotConnectedException, InterruptedException, XMPPException.XMPPErrorException, SmackException.NoResponseException {
LOGGER.log(Level.INFO, "Accepted session.");
LOGGER.log(Level.FINE, "Accepted session.");
if (this.sessionState != SessionState.pending) {
throw new IllegalStateException("Session is not in pending state.");
}
@ -233,17 +233,6 @@ public class JingleSession {
terminateSession(JingleReasonElement.Reason.success);
return;
}
// Session has still active contents left.
/*
try {
jingleManager.getConnection().createStanzaCollectorAndSend(JingleElement.createSessionTerminateContentCancel(
getPeer(), getSessionId(), jingleContent.getCreator(), jingleContent.getName()));
} catch (SmackException.NotConnectedException | InterruptedException e) {
LOGGER.log(Level.SEVERE, "Could not send content-cancel: " + e, e);
}
contents.remove(jingleContent.getName());
*/
}
/**
@ -253,7 +242,8 @@ public class JingleSession {
*/
void onContentCancel(JingleContent jingleContent) {
if (contents.get(jingleContent.getName()) == null) {
LOGGER.log(Level.WARNING, "Session does not contain content " + jingleContent.getName() + ". Ignore onContentCancel.");
LOGGER.log(Level.WARNING, "Session does not contain content " + jingleContent.getName() +
". Ignore onContentCancel.");
return;
}
@ -261,10 +251,13 @@ public class JingleSession {
terminateSession(JingleReasonElement.Reason.cancel);
jingleManager.removeSession(this);
} else {
JingleElement cancel = JingleElement.createSessionTerminateContentCancel(
getPeer(), getSessionId(), jingleContent.getCreator(), jingleContent.getName());
try {
jingleManager.getConnection().createStanzaCollectorAndSend(JingleElement.createSessionTerminateContentCancel(getPeer(), getSessionId(), jingleContent.getCreator(), jingleContent.getName()));
} catch (SmackException.NotConnectedException | InterruptedException e) {
LOGGER.log(Level.SEVERE, "Could not send content-cancel: " + e, e);
jingleManager.getConnection().createStanzaCollectorAndSend(cancel).nextResultOrThrow();
} catch (SmackException.NotConnectedException | InterruptedException | XMPPException.XMPPErrorException |
SmackException.NoResponseException e) {
LOGGER.log(Level.SEVERE, "Could not send content-cancel.", e);
}
contents.remove(jingleContent.getName());
}
@ -275,10 +268,11 @@ public class JingleSession {
* @param reason reason of termination.
*/
public void terminateSession(JingleReasonElement.Reason reason) {
JingleElement terminate = JingleElement.createSessionTerminate(getPeer(), getSessionId(), reason);
try {
jingleManager.getConnection().createStanzaCollectorAndSend(JingleElement.createSessionTerminate(getPeer(), getSessionId(), reason));
jingleManager.getConnection().sendStanza(terminate);
} catch (SmackException.NotConnectedException | InterruptedException e) {
LOGGER.log(Level.SEVERE, "Could not send session-terminate: " + e, e);
LOGGER.log(Level.SEVERE, "Could not send session-terminate.", e);
}
this.sessionState = SessionState.ended;
jingleManager.removeSession(this);
@ -360,10 +354,13 @@ public class JingleSession {
if (descriptionManager == null) {
LOGGER.log(Level.WARNING, "Unsupported description type: " + description.getNamespace());
JingleElement terminate = JingleElement.createSessionTerminate(getPeer(), getSessionId(),
JingleReasonElement.Reason.unsupported_applications);
try {
jingleManager.getConnection().createStanzaCollectorAndSend(JingleElement.createSessionTerminate(getPeer(), getSessionId(), JingleReasonElement.Reason.unsupported_applications));
} catch (SmackException.NotConnectedException | InterruptedException e) {
LOGGER.log(Level.SEVERE, "Could not send session-terminate: " + e, e);
jingleManager.getConnection().createStanzaCollectorAndSend(terminate).nextResultOrThrow();
} catch (SmackException.NotConnectedException | InterruptedException | XMPPException.XMPPErrorException |
SmackException.NoResponseException e) {
LOGGER.log(Level.SEVERE, "Could not send session-terminate.", e);
}
} else {
@ -440,7 +437,8 @@ public class JingleSession {
private IQ handleContentAdd(JingleElement request) {
final JingleContent proposed = getSoleProposedContentOrThrow(request);
final JingleDescriptionManager descriptionManager = jingleManager.getDescriptionManager(proposed.getDescription().getNamespace());
final JingleDescriptionManager descriptionManager = jingleManager.getDescriptionManager(proposed.getDescription()
.getNamespace());
if (descriptionManager == null) {
throw new AssertionError("DescriptionManager is null: " + proposed.getDescription().getNamespace());
@ -493,26 +491,6 @@ public class JingleSession {
*/
private IQ handleContentRemove(final JingleElement request) {
return IQ.createErrorResponse(request, XMPPError.Condition.feature_not_implemented);
/*
for (JingleContentElement r : request.getContents()) {
final JingleContent removed = contents.get(r.getName());
if (removed == null) {
throw new AssertionError("Illegal content name!");
}
contents.remove(removed.getName());
Async.go(new Runnable() {
@Override
public void run() {
removed.handleContentRemove(JingleSession.this, jingleManager.getConnection());
}
});
}
return IQ.createResultIQ(request);
*/
}
/**

View file

@ -20,6 +20,8 @@ import org.jivesoftware.smack.packet.NamedElement;
/**
* An element found usually in 'description' elements.
* <pre> {@code
*
* <jingle>
* <content>
* <description>
@ -29,7 +31,6 @@ import org.jivesoftware.smack.packet.NamedElement;
* <security/>
* </content>
* </jingle>
*
*/
public abstract class JingleContentDescriptionChildElement implements NamedElement {

View file

@ -26,6 +26,8 @@ import org.jivesoftware.smackx.jingle.component.JingleDescription;
/**
* {@link ExtensionElement} representing a {@link JingleDescription}.
* <pre> {@code
*
* <jingle>
* <content>
* <description/> <- This element is us.
@ -34,6 +36,7 @@ import org.jivesoftware.smackx.jingle.component.JingleDescription;
* </content>
* </jingle>
*
* } </pre>
*/
public abstract class JingleContentDescriptionElement implements ExtensionElement {

View file

@ -24,11 +24,15 @@ import org.jivesoftware.smackx.jingle.component.JingleContent;
/**
* {@link NamedElement} representing a {@link JingleContent}.
* <pre> {@code
*
* <jingle>
* <content> <- Me.
* ...
* </content>
* </jingle>
*
* } </pre>
*/
public final class JingleContentElement implements NamedElement {

View file

@ -21,6 +21,8 @@ import org.jivesoftware.smackx.jingle.component.JingleSecurity;
/**
* {@link ExtensionElement} representing a {@link JingleSecurity}.
* <pre> {@code
*
* <jingle>
* <content>
* <description/>
@ -28,6 +30,9 @@ import org.jivesoftware.smackx.jingle.component.JingleSecurity;
* <security/> <- That's me :)
* </content>
* </jingle>
*
* } </pre>
*
*/
public abstract class JingleContentSecurityElement implements ExtensionElement {

View file

@ -21,6 +21,8 @@ import org.jivesoftware.smackx.jingle.component.JingleTransportCandidate;
/**
* {@link NamedElement} representing a {@link JingleTransportCandidate}
*
* <pre> {@code
* <jingle>
* <content>
* <description/>
@ -30,6 +32,7 @@ import org.jivesoftware.smackx.jingle.component.JingleTransportCandidate;
* </transport>
* </content>
* </jingle>
* } </pre>
*
*/
public abstract class JingleContentTransportCandidateElement implements NamedElement {

View file

@ -25,6 +25,8 @@ import org.jivesoftware.smackx.jingle.component.JingleTransport;
/**
* {@link ExtensionElement} representing a {@link JingleTransport}.
*
* <pre> {@code
* <jingle>
* <content>
* <description/>
@ -32,6 +34,7 @@ import org.jivesoftware.smackx.jingle.component.JingleTransport;
* <security/>
* </content>
* </jingle>
* } </pre>
*
*/
public abstract class JingleContentTransportElement implements ExtensionElement {

View file

@ -22,6 +22,8 @@ import org.jivesoftware.smack.packet.NamedElement;
* Abstract JingleContentTransportInfo element.
* The JingleContentTransportInfo element can have certain states defined by the respective Transport XEP.
* Examples are Jingle Socks5Bytestream's <candidate-used/> (Example 5), <candidate-error/> (Example 7) etc.
*
* <pre> {@code
* <jingle>
* <content>
* <description/>
@ -31,6 +33,7 @@ import org.jivesoftware.smack.packet.NamedElement;
* <security/>
* </content>
* </jingle>
* } </pre>
*/
public abstract class JingleContentTransportInfoElement implements NamedElement {

View file

@ -88,11 +88,11 @@ public class JingleIBBTransport extends JingleTransport<JingleIBBTransportElemen
@Override
public void establishIncomingBytestreamSession(final XMPPConnection connection, final JingleTransportCallback callback, final JingleSession session) {
final InBandBytestreamManager inBandBytestreamManager = InBandBytestreamManager.getByteStreamManager(connection);
LOGGER.log(Level.INFO, "Listen for incoming IBB transports from " + session.getPeer() + ":" + getStreamId());
LOGGER.log(Level.FINE, "Listen for incoming IBB transports from " + session.getPeer() + ":" + getStreamId());
InBandBytestreamListener bytestreamListener = new InBandBytestreamListener() {
@Override
public void incomingBytestreamRequest(InBandBytestreamRequest request) {
LOGGER.log(Level.INFO, "Incoming IBB stream: " + request.getFrom().asFullJidIfPossible() + ":" + request.getSessionID());
LOGGER.log(Level.FINE, "Incoming IBB stream: " + request.getFrom().asFullJidIfPossible() + ":" + request.getSessionID());
if (request.getFrom().asFullJidIfPossible().equals(session.getPeer())
&& request.getSessionID().equals(getStreamId())) {

View file

@ -219,7 +219,7 @@ public class JingleS5BTransport extends JingleTransport<JingleS5BTransportElemen
@Override
public void establishIncomingBytestreamSession(XMPPConnection connection, JingleTransportCallback callback, JingleSession session)
throws SmackException.NotConnectedException, InterruptedException {
LOGGER.log(Level.INFO, "Establishing incoming bytestream.");
LOGGER.log(Level.FINE, "Establishing incoming bytestream.");
this.callback = callback;
establishBytestreamSession(connection);
}
@ -227,7 +227,7 @@ public class JingleS5BTransport extends JingleTransport<JingleS5BTransportElemen
@Override
public void establishOutgoingBytestreamSession(XMPPConnection connection, JingleTransportCallback callback, JingleSession session)
throws SmackException.NotConnectedException, InterruptedException {
LOGGER.log(Level.INFO, "Establishing outgoing bytestream.");
LOGGER.log(Level.FINE, "Establishing outgoing bytestream.");
this.callback = callback;
establishBytestreamSession(connection);
}
@ -255,7 +255,7 @@ public class JingleS5BTransport extends JingleTransport<JingleS5BTransportElemen
private JingleS5BTransportCandidate connectToCandidates(int timeout) {
if (getTheirCandidates().size() == 0) {
LOGGER.log(Level.INFO, "They provided 0 candidates.");
LOGGER.log(Level.FINE, "They provided 0 candidates.");
return CANDIDATE_FAILURE;
}
@ -265,7 +265,7 @@ public class JingleS5BTransport extends JingleTransport<JingleS5BTransportElemen
try {
return candidate.connect(_timeout, true);
} catch (IOException | TimeoutException | InterruptedException | SmackException | XMPPException e) {
LOGGER.log(Level.WARNING, "Exception while connecting to candidate: " + e, e);
LOGGER.log(Level.FINE, "Exception while connecting to candidate: " + e, e);
}
}
@ -284,17 +284,17 @@ public class JingleS5BTransport extends JingleTransport<JingleS5BTransportElemen
if (ourSelectedCandidate == null || theirSelectedCandidate == null) {
// Not yet ready if we or peer did not yet decide on a candidate.
LOGGER.log(Level.INFO, "Not ready.");
LOGGER.log(Level.FINEST, "Not ready.");
return;
}
if (ourSelectedCandidate == CANDIDATE_FAILURE && theirSelectedCandidate == CANDIDATE_FAILURE) {
LOGGER.log(Level.INFO, "Failure.");
LOGGER.log(Level.FINE, "Failure.");
callback.onTransportFailed(new FailedTransportException(null));
return;
}
LOGGER.log(Level.INFO, (session.isInitiator() ? "Initiator" : "Responder") + " is ready.");
LOGGER.log(Level.FINE, (session.isInitiator() ? "Initiator" : "Responder") + " is ready.");
//Determine nominated candidate.
JingleS5BTransportCandidate nominated;
@ -318,7 +318,7 @@ public class JingleS5BTransport extends JingleTransport<JingleS5BTransportElemen
if (nominated == theirSelectedCandidate) {
LOGGER.log(Level.INFO, "Their choice, so our proposed candidate is used.");
LOGGER.log(Level.FINE, "Their choice, so our proposed candidate is used.");
try {
nominated = nominated.connect(MAX_TIMEOUT, false);
@ -331,7 +331,7 @@ public class JingleS5BTransport extends JingleTransport<JingleS5BTransportElemen
try {
session.getJingleManager().getConnection().createStanzaCollectorAndSend(JingleS5BTransportManager.createProxyError(JingleS5BTransport.this));
} catch (SmackException.NotConnectedException | InterruptedException e1) {
LOGGER.log(Level.SEVERE, "Could not send proxy error: " + e, e);
LOGGER.log(Level.SEVERE, "Could not send proxy error.", e);
}
}
});
@ -341,7 +341,7 @@ public class JingleS5BTransport extends JingleTransport<JingleS5BTransportElemen
}
if (isProxy) {
LOGGER.log(Level.INFO, "Send candidate-activate.");
LOGGER.log(Level.FINE, "Send candidate-activate.");
JingleElement candidateActivate = JingleS5BTransportManager.createCandidateActivated((JingleS5BTransport) nominated.getParent(), nominated);
try {
@ -354,20 +354,20 @@ public class JingleS5BTransport extends JingleTransport<JingleS5BTransportElemen
}
}
LOGGER.log(Level.INFO, "Start transmission on " + nominated.getCandidateId());
LOGGER.log(Level.FINE, "Start transmission on " + nominated.getCandidateId());
this.bytestreamSession = new Socks5BytestreamSession(nominated.getSocket(), !isProxy);
callback.onTransportReady(this.bytestreamSession);
}
//Our choice
else {
LOGGER.log(Level.INFO, "Our choice, so their candidate was used.");
LOGGER.log(Level.FINE, "Our choice, so their candidate was used.");
if (!isProxy) {
LOGGER.log(Level.INFO, "Start transmission on " + nominated.getCandidateId());
LOGGER.log(Level.FINE, "Start transmission on " + nominated.getCandidateId());
this.bytestreamSession = new Socks5BytestreamSession(nominated.getSocket(), true);
callback.onTransportReady(this.bytestreamSession);
} else {
LOGGER.log(Level.INFO, "Our choice was their external proxy. wait for candidate-activate.");
LOGGER.log(Level.FINE, "Our choice was their external proxy. wait for candidate-activate.");
}
}
}
@ -419,7 +419,7 @@ public class JingleS5BTransport extends JingleTransport<JingleS5BTransportElemen
jingleManager.getConnection().sendStanza(JingleElement.createJingleErrorOutOfOrder(wrapping));
//jingleManager.getConnection().createStanzaCollectorAndSend(JingleElement.createJingleErrorOutOfOrder(wrapping));
} catch (SmackException.NotConnectedException | InterruptedException e) {
LOGGER.log(Level.SEVERE, "Could not respond to candidate-used transport-info: " + e, e);
LOGGER.log(Level.SEVERE, "Could not respond to candidate-used transport-info.", e);
}
return;
}
@ -432,8 +432,9 @@ public class JingleS5BTransport extends JingleTransport<JingleS5BTransportElemen
}
if (theirSelectedCandidate == null) {
LOGGER.log(Level.SEVERE, "ILLEGAL CANDIDATE ID!!!");
LOGGER.log(Level.SEVERE, "Unknown candidateID.");
//TODO: Alert! Illegal candidateId!
return;
}
connectIfReady();

View file

@ -103,12 +103,12 @@ public class JingleS5BTransportCandidate extends JingleTransportCandidate<Jingle
if (dstAddr == null) {
dstAddr = Socks5Utils.createDigest(transport.getStreamId(), transport.getParent().getParent().getPeer(), transport.getParent().getParent().getOurJid());
}
LOGGER.log(Level.INFO, "Connect to foreign candidate " + getCandidateId() + " using " + dstAddr);
LOGGER.log(Level.INFO, getStreamHost().getAddress() + ":" + getStreamHost().getPort() + " " + getStreamHost().getJID().toString() + " " + getType());
LOGGER.log(Level.FINE, "Connect to foreign candidate " + getCandidateId() + " using " + dstAddr);
LOGGER.log(Level.FINE, getStreamHost().getAddress() + ":" + getStreamHost().getPort() + " " + getStreamHost().getJID().toString() + " " + getType());
client = new Socks5Client(getStreamHost(), dstAddr);
} else {
LOGGER.log(Level.INFO, "Connect to our candidate " + getCandidateId() + " using " + transport.getOurDstAddr());
LOGGER.log(Level.INFO, getStreamHost().getAddress() + ":" + getStreamHost().getPort() + " " + getStreamHost().getJID().toString() + " " + getType());
LOGGER.log(Level.FINE, "Connect to our candidate " + getCandidateId() + " using " + transport.getOurDstAddr());
LOGGER.log(Level.FINE, getStreamHost().getAddress() + ":" + getStreamHost().getPort() + " " + getStreamHost().getJID().toString() + " " + getType());
JingleContent content = transport.getParent();
JingleSession session = content.getParent();
client = new Socks5ClientForInitiator(getStreamHost(), transport.getOurDstAddr(), session.getJingleManager().getConnection(), transport.getStreamId(), session.getPeer());
@ -117,7 +117,7 @@ public class JingleS5BTransportCandidate extends JingleTransportCandidate<Jingle
break;
default:
LOGGER.log(Level.INFO, "Unsupported candidate type: " + getType());
LOGGER.log(Level.FINE, "Unsupported candidate type: " + getType());
break;
}

View file

@ -276,7 +276,7 @@ public final class JingleS5BTransportManager extends Manager implements JingleTr
localStreamHosts = queryLocalStreamHosts();
availableStreamHosts = queryServersStreamHosts();
} catch (InterruptedException | SmackException.NoResponseException | SmackException.NotConnectedException | XMPPException.XMPPErrorException e) {
LOGGER.log(Level.WARNING, "Could not query available StreamHosts: " + e, e);
LOGGER.log(Level.WARNING, "Could not query available StreamHosts.", e);
}
}
}