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:
parent
034b7f3844
commit
792a9a348b
6 changed files with 14 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue