diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5Proxy.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5Proxy.java index f7e89270a..d12157801 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5Proxy.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/socks5/Socks5Proxy.java @@ -361,7 +361,7 @@ public final class Socks5Proxy { * * @param digest to be removed from the list of allowed transfers */ - protected void removeTransfer(String digest) { + public void removeTransfer(String digest) { this.allowedConnections.remove(digest); this.connectionMap.remove(digest); } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/components/JingleContent.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/components/JingleContent.java index 45e60dc1b..51e7b8242 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/components/JingleContent.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/components/JingleContent.java @@ -67,14 +67,39 @@ public class JingleContent implements JingleTransportCallback, JingleSecurityCal private final List callbacks = Collections.synchronizedList(new ArrayList()); private final Set transportBlacklist = Collections.synchronizedSet(new HashSet()); + private short state; + public enum STATE { - pending_accept, - pending_transmission_start, - pending_transport_replace, - transmission_in_progress, - transmission_successful, - transmission_failed, - transmission_cancelled + pending_accept((short) 1), + pending_transmission_start((short) 2), + pending_transport_replace((short) 4), + transmission_in_progress((short) 8), + transmission_successful((short) 16), + transmission_failed((short) 32), + transmission_cancelled((short) 64), + ; + + final short value; + + STATE(short value) { + this.value = value; + } + + short getValue() { + return value; + } + } + + public void addState(STATE state) { + this.state |= state.getValue(); + } + + public void removeState(STATE state) { + this.state ^= state.getValue(); + } + + public boolean hasState(STATE state) { + return (this.state & state.getValue()) == state.getValue(); } public JingleContent(JingleContentElement.Creator creator, JingleContentElement.Senders senders) { diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/components/JingleTransport.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/components/JingleTransport.java index 20ad3b59a..5054eccd6 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/components/JingleTransport.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/components/JingleTransport.java @@ -135,4 +135,6 @@ public abstract class JingleTransport e } public abstract void handleSessionAccept(JingleContentTransportElement transportElement, XMPPConnection connection); + + public abstract void cleanup(); } diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/transport/jingle_ibb/JingleIBBTransport.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/transport/jingle_ibb/JingleIBBTransport.java index 5052f92d0..818a9121b 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/transport/jingle_ibb/JingleIBBTransport.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/jingle/transport/jingle_ibb/JingleIBBTransport.java @@ -126,6 +126,11 @@ public class JingleIBBTransport extends JingleTransport candidate) { // Sorry, we don't want any candidates. @@ -133,7 +138,7 @@ public class JingleIBBTransport extends JingleTransport