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

FIX F%?§@N SOCKS5

This commit is contained in:
vanitasvitae 2017-08-07 23:55:32 +02:00
parent 034b7f3844
commit 792a9a348b
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
6 changed files with 14 additions and 8 deletions

View file

@ -92,7 +92,7 @@ public class JingleSession {
return session;
}
public void initiate(XMPPConnection connection) throws SmackException.NotConnectedException, InterruptedException, XMPPException.XMPPErrorException, SmackException.NoResponseException {
public void sendInitiate(XMPPConnection connection) throws SmackException.NotConnectedException, InterruptedException, XMPPException.XMPPErrorException, SmackException.NoResponseException {
if (this.sessionState != SessionState.fresh) {
throw new IllegalStateException("Session is not in fresh state.");
}
@ -101,7 +101,7 @@ public class JingleSession {
this.sessionState = SessionState.pending;
}
public void accept(XMPPConnection connection) throws SmackException.NotConnectedException, InterruptedException, XMPPException.XMPPErrorException, SmackException.NoResponseException {
public void sendAccept(XMPPConnection connection) throws SmackException.NotConnectedException, InterruptedException, XMPPException.XMPPErrorException, SmackException.NoResponseException {
LOGGER.log(Level.INFO, "Accepted session.");
if (this.sessionState != SessionState.pending) {
throw new IllegalStateException("Session is not in pending state.");
@ -379,6 +379,9 @@ public class JingleSession {
}
public void addContent(JingleContent content) {
if (contents.get(content.getName()) != null) {
throw new IllegalArgumentException("Session already contains a content with the name " + content.getName());
}
contents.put(content.getName(), content);
content.setParent(this);
}

View file

@ -202,7 +202,7 @@ public class JingleS5BTransport extends JingleTransport<JingleS5BTransportElemen
public void prepare(XMPPConnection connection) {
JingleSession session = getParent().getParent();
if (getOurDstAddr() == null) {
ourDstAddr = Socks5Utils.createDigest(session.getSessionId(), session.getOurJid(), session.getPeer());
ourDstAddr = Socks5Utils.createDigest(getSid(), session.getOurJid(), session.getPeer());
Socks5Proxy.getSocks5Proxy().addTransfer(ourDstAddr);
}

View file

@ -99,8 +99,9 @@ public final class JingleS5BTransportManager extends Manager implements JingleTr
@Override
public JingleTransport<?> createTransportForInitiator(JingleContent content) {
JingleSession session = content.getParent();
String sid = StringUtils.randomString(24);
List<JingleTransportCandidate<?>> candidates = collectCandidates();
return new JingleS5BTransport(session.getInitiator(), session.getResponder(), StringUtils.randomString(24), Bytestream.Mode.tcp, candidates);
return new JingleS5BTransport(session.getInitiator(), session.getResponder(), sid, Bytestream.Mode.tcp, candidates);
}
@Override