- Make MultipleAddress.Type a enum
- Change the signature of the methods to use Collection instead of List
- Use for-each loops instead of iterators
- Switch Provider to new provider pattern (using switch-case)
- Use XmlStringBuilder (extend the API by two new methods)
Allows interceptor to remove themselves in the interceptPacket() method.
Same change for Interceptors as was done in
15d59299a2 for (send|recv)Listeners.
instead of rely on ListenerWrapper checking the PacketFilter *and*
invoking the PacketListener we now use two for-each loops, where the
first filters the PacketListeners that should get invoked and use the
second for-each loop to actually invoke the PacketListener.
Before, the code was not thread safe if a PacketListener would remove
itself from the (send|recv)Listeners.
Also make packet(Listener|Filter) in ListenerWrapper final.
this is the first stop towards fixing "SMACK-65: parsing should look for
depth", by providing the initial parsing depth to the provider. Some
methods (.e.g parseMessage) now use the depth as abort condition,
instead of a unclean String equals check.
parseIQ() and parseExtension() where both renamed to parse.
This also restricts the Exceptions thrown by the parse method, to just
XmlPullParserException, IOException and SmackException (not really a big
victory, but nevertheless a slight improvement).
StreamFeatureProvider is now gone, we simply use PacketExtensionProvider
for stream features.
so that APIs that need a fully connected but not yet authenticated
connection (e.g. AccountManager) can use the connection after connect()
returns.
Also move "connected = true" after saslFeatureReceived check, as if the
check would throw, the boolean would still be 'true' resulting in an
inconsistent state.
Otherwise this could result in
D/SMACK﹕ SENT (12): <stream:stream xmlns='jabber:client' to='*server*' xmlns:stream='http://etherx.jabber.org/streams' version='1.0'>
D/SMACK﹕ SENT (12): <iq id='miS03-37' to='*server*' type='get'><query xmlns='jabber:iq:register'></query></iq>
D/SMACK﹕ RCV (12): <?xml version='1.0'?><stream:stream xmlns='jabber:client' xmlns:stream='http://etherx.jabber.org/streams' id='4280133582' from='*server*' version='1.0' xml:lang='en'><stream:features><starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/><mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'><mechanism>PLAIN</mechanism><mechanism >DIGEST-MD5</mechanism><mechanism>SCRAM-SHA-1</mechanism></mechanisms><c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='http://www.process-one.net/en/ejabberd/' ver='a4WL1hRFRX38OouQz3okC+ayK2o='/><register xmlns='http://jabber.org/features/iq-register'/></stream:features>
D/SMACK﹕ SENT (12): <starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'></starttls>
D/SMACK﹕ RCV (12): <iq from='*server*' id='miS03-37' type='result'><query xmlns='jabber:iq:register'><instructions>Choose a username and password to register with this server</instructions><username></username><password/></query></iq>
D/SMACK﹕ SENT (12): <iq id='miS03-39' to='*server*' type='set'><query xmlns='jabber:iq:register'><password>s0r73pgojeopmssjaairu6kcmk3v4l</password>< username>nqcjloj4v6uk52bug16hrrhspfanlr</username></query></iq>
D/SMACK﹕ RCV (12): <proceed xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>
W/AbstractXMPPConnection﹕ Connection closed with error
javax.net.ssl.SSLException: Connection closed by peer
at com.android.org.conscrypt.NativeCrypto.SSL_do_handshake(Native Method)
at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.ja va:405)
at com.android.org.conscrypt.OpenSSLSocketImpl$SSLInputStream.<init>(OpenSSLSocket Impl.java:661)
at com.android.org.conscrypt.OpenSSLSocketImpl.getInputStream(OpenSSLSocketImpl.ja va:632)
at org.jivesoftware.smack.tcp.XMPPTCPConnection.initReaderAndWriter(XMPPTCPConnect ion.java:661)
at org.jivesoftware.smack.tcp.XMPPTCPConnection.proceedTLSReceived(XMPPTCPConnecti on.java:768)
Quoting Jens Offenbach:
"The header entry [sun.* in Import-Package] MUST be removed because
its a native package and not exported by the OSGi framework. The bundle
cannot be resolved. It is up to the OSGi framework deployer to declare
this package as beeing "bootdelegated". This tells the classloader of
the bundle to delegate a corresponding package request to the installed
JRE. Only remove this entry and leave the "magic" of resolution to OSGi"
SMACK-343