Commit Graph

216 Commits

Author SHA1 Message Date
Florian Schmaus ad87243060 Globally 's;stanza(/packet);stanza;' 2018-03-31 14:17:30 +02:00
Florian Schmaus 3132d9a224 Bump errorprone to 2.2.0 2018-03-28 15:56:04 +02:00
Florian Schmaus 5b9254aff5
Merge pull request #209 from fuentesj11/rename-deprecate-xmppconnection-methods
Rename and deprecate XMPPConnection methods
2018-03-28 12:11:32 +02:00
Jesus Fuentes a70063dc89 Rename and deprecate XMPPConnection methods
Rename and deprecate XMPPConnections methods as described in SMACK-802
2018-03-22 15:40:40 -05:00
Florian Schmaus f42d9137b5 Merge branch '4.2' 2018-03-21 15:22:22 +01:00
Jesus Fuentes 903f90e1c1 Update/fix javadocs 2018-03-09 07:15:46 -06:00
Florian Schmaus 42c2e4d077 Remove stanza ID ack'ed listeneres after max 3 instead of 12 hours 2018-02-23 18:53:47 +01:00
Florian Schmaus 3bdeca44f2 Merge branch '4.2' 2018-02-23 18:35:34 +01:00
Florian Schmaus 793d3c47ad Move TLS and SASL sync points into subclasses
In preperation of subclasses with different connection approaches.
2018-02-23 10:37:17 +01:00
Florian Schmaus 5333bde2e8 Merge branch '4.2' 2018-02-10 12:14:09 +01:00
Florian Schmaus 6dfc20ee5e Rename "Packet (Reader|Writer)" to just Reader or Writer 2018-02-09 10:26:42 +01:00
Florian Schmaus 3c4225d167 Merge branch '4.2' 2017-12-25 14:16:43 +01:00
Florian Schmaus 34373e8710 Enable javadoc 'html' doclint
Also make all 'test' tasks depend on the 'javadoc' task.

Fixes SMACK-650.
2017-12-25 14:08:18 +01:00
Florian Schmaus 431e5b3c67 Merge branch '4.2' into master-paul-merged 2017-12-17 11:16:02 +01:00
Paul Schaub cb18056613 Fix minor codestyle issues 2017-12-17 11:03:46 +01:00
Florian Schmaus 76a6b9f2a1 Smack 4.2.2
-----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEl3UFnzoh3OFr5PuuIjmn6PWFIFIFAloZnf5fFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk3
 NzUwNTlGM0EyMURDRTE2QkU0RkJBRTIyMzlBN0U4RjU4NTIwNTIACgkQIjmn6PWF
 IFLcIQgAsTLRI3sWIZDPRuI5YaU/y6beqqzMp5cQgk/9+9DHGBoziLEU1spkvBs2
 Yvlwu3NtHSJsI+ibzYLEFRnzEwuW07vXw7R5J+kRSZrsE40z1HCQRwUIXDkPgghe
 MuL6vT6OV+kLqKb33YLSBuT2fj2pzVE6mRmMsnFekay/weEqOGUZaY9Hd5lJ31/9
 33fQC0FQfKULQ5t7PbdfX4dDDNWn0n6v+KjvjaskHI0oA+vqPWxPkj8gNXWW8b72
 tVV4h5uXQ0ziK3oED79+GH+DSiET9N2PmsZ7woXiFy5H8KbcQDVe5Pazf+Iq2VQ+
 Vi6Vxikr6Ak+v2Xkt+e3x9E6mZDI1w==
 =CVqq
 -----END PGP SIGNATURE-----

Merge tag '4.2.2'

Smack 4.2.2
2017-11-25 18:45:32 +01:00
Florian Schmaus d804d4ed6d Do not abort if we could not get a KeyManagerFactory
using the default algorithm. Instead continue with 'null' as value of
the KeyManager[] array (kms). This makes the SSLContext.init() methods
to search the default security providers for implementations, which is
also OK.

This change is needed because it appears that on Android
KeyManagerFactory.getDefaultAlgorithm returns 'SunX509', which
subsequently results in

W/AbstractXMPPConnection: Connection XMPPTCPConnection[not-authenticated] (0) closed with error
  java.security.NoSuchAlgorithmException: KeyManagerFactory SunX509 implementation not found
      at org.apache.harmony.security.fortress.Engine.notFound(Engine.java:190)
      at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:139)
      at javax.net.ssl.KeyManagerFactory.getInstance(KeyManagerFactory.java:77)
      at org.jivesoftware.smack.tcp.XMPPTCPConnection.proceedTLSReceived(XMPPTCPConnection.java:747)
      at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$1200(XMPPTCPConnection.java:149)
      at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1053)
      at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:980)
      at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:996)
      at java.lang.Thread.run(Thread.java:818)

Note that this is possibly because the Secuurity Provider was
not (yet) intialized.
2017-11-23 08:21:55 +01:00
Florian Schmaus 573358b459 Limit the scope of local variables in proceedTLSReceived() 2017-11-23 08:15:52 +01:00
Florian Schmaus 81002c4fbd Merge branch '4.2' 2017-11-22 08:37:47 +01:00
Florian Schmaus 853324a998
Merge pull request #185 from mityada/sm-resumption-race-condition
Prevent race condition after stream resumption
2017-11-22 08:29:36 +01:00
Florian Schmaus 813a5ba63f
Merge pull request #184 from mityada/stream-management-exception
Drop stream management state on StreamManagementException
2017-11-21 21:15:41 +01:00
Florian Schmaus 9e11b68144 Add comment style checkstyle rule requiring a space 2017-11-20 08:53:19 +01:00
Dmitry Deshevoy 230a226424 Prevent race condition after stream resumption
New stanzas sent directly after stream resumption might have been added
to unacknowledgedStanzas before the old unacknowledged stanzas
are resent. This caused new stanzas to be sent twice and later led
to a StreamManagementCounterError.

Fixes SMACK-786
2017-11-18 19:37:07 +03:00
Dmitry Deshevoy 4f11dc5b14 Drop stream management state on StreamManagementException 2017-11-16 19:10:52 +03:00
Florian Schmaus 65b4f506dc Add SubscribeAnswer.ApproveAndAlsoRequestIfRequired 2017-11-06 22:41:28 +01:00
Florian Schmaus 1b2521269e Make END_TAG parsing more NPE robust
by calling String.equals() on the constant string and not on the
return value of parser.getName().

Also perform the access to 'parser' on a different LOC than
equals(). This should help debugging things like

okt 25, 2017 2:02:54 PM org.jivesoftware.smack.AbstractXMPPConnection callConnectionClosedOnErrorListener
WARNING: Connection XMPPTCPConnection[***@***/***] (0) closed with error
java.lang.NullPointerException
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1194)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:982)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:998)
	at java.lang.Thread.run(Thread.java:745)

which where recently reported on the forums.
2017-10-27 17:48:00 +02:00
Florian Schmaus 43abd52d76 Smack 4.2.1
-----BEGIN PGP SIGNATURE-----
 
 iQGTBAABCgB9FiEEl3UFnzoh3OFr5PuuIjmn6PWFIFIFAlmR75tfFIAAAAAALgAo
 aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDk3
 NzUwNTlGM0EyMURDRTE2QkU0RkJBRTIyMzlBN0U4RjU4NTIwNTIACgkQIjmn6PWF
 IFLeXggAjdgj7YVUe22NtamnROBj1c3PaWwgSY0gEjcyDPsOz5qeqNUdQLHbmt2j
 XQQpYZWKg1/1uoQHlsixaFKbGVctKRk72aNEodRfd1osta11WTOwZKEb8nI411Tt
 7M0Fhf430WZY6nioZiZIorsmid57fftJ2EMPlmjEDp2FD0AVGAXkEhCneGaPtt9Q
 hbWbepIy9tApeIH+QgmFLBmPLnFCaSg+X6NUden3Z21bUz5vH8pmcbeUVfsNB7kW
 nkkDuNwKHPFLgjuhcq7D+KAKRwNU7n8WEuHseRzM7bMCEB+S/rZok5KPXe/tV4v+
 YZKN2e+2yh4j5l4FT/fCzELfWcvrgA==
 =MV3G
 -----END PGP SIGNATURE-----

Merge tag '4.2.1'

Smack 4.2.1
2017-08-14 21:01:36 +02:00
Florian Schmaus b8ee8d808f Rework Smack debugger.
Also fixes SMACK-728.
2017-07-28 12:01:11 +02:00
Florian Schmaus 685edde308 Don't hardcode "SunX509" as key algorithm
in XMPPTCPConnection. Instead use the default algorithm.

Fixes SMACK-771.
2017-07-02 18:30:53 +02:00
Florian Schmaus 3d032298a5 Deal with cases wehre HostAddress.fqdn is null
Fixes SMACK-772
2017-07-02 18:09:15 +02:00
Florian Schmaus 2b11074950 Merge branch '4.2' 2017-06-17 15:55:38 +02:00
Florian Schmaus 08e897113d Add CustomImportOrder checkstyle rule
And matching ImportOrder settings for Eclipse in
resources/eclipse/smack.importorder
2017-06-14 17:12:43 +02:00
Florian Schmaus 7a5f9e6a03 Merge branch '4.2' 2017-05-25 11:25:36 +02:00
Florian Schmaus ce1cddc722 More checkstyle whitespace related checks 2017-05-24 14:42:38 +02:00
Florian Schmaus 08c228ef99 Merge branch '4.2' 2017-03-20 14:57:42 +01:00
Florian Schmaus 3ce5973915 Also add stanzas to unacknowledgedStanzas while shutting down
This caused the WaitForClosingStreamElementTest integration test to
fail, because the last presences stanzas, which are send after done()
in the writer thread would return true, are not added to the
unacknowledgedStanzas queue.

The result was:

SEVERE: WaitForClosingStreamElementTest.waitForClosingStreamElementTest (LowLevel): Failed
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.invokeLowLevel(SmackIntegrationTestFramework.java:466)
        at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.runTests(SmackIntegrationTestFramework.java:375)
        at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.run(SmackIntegrationTestFramework.java:165)
        at org.igniterealtime.smack.inttest.SmackIntegrationTestFramework.main(SmackIntegrationTestFramework.java:84)
Caused by: java.lang.AssertionError: Sync poing yielded failure exception
        at org.jivesoftware.smack.WaitForClosingStreamElementTest.waitForClosingStreamElementTest(WaitForClosingStreamElementTest.java:46)
        ... 8 more
Caused by: org.jivesoftware.smack.sm.StreamManagementException$StreamManagementCounterError: There was an error regarding the Stream Mangement counters. Server reported 3 handled stanzas, which means that the 3 recently send stanzas by client are now acked by the server. But Smack had only 1 to acknowledge. The stanza id of the last acked outstanding stanza is FqL1X-144
        at org.jivesoftware.smack.tcp.XMPPTCPConnection.processHandledCount(XMPPTCPConnection.java:1847)
        at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$2600(XMPPTCPConnection.java:149)
        at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1176)
        at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:980)
        at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:996)
        at java.lang.Thread.run(Thread.java:745)
2017-03-18 17:49:38 +01:00
Florian Schmaus c81f28a3a2 Update Error Prone to 2.0.18
and update errorprone-plugin to 0.0.9.
2017-03-07 11:00:47 +01:00
Florian Schmaus 4c646436a5 Bump "Error Prone" to 2.0.15
and fix a few things :)
2017-02-11 16:16:41 +01:00
Florian Schmaus 51d3c31766 Initialize Socket in TCP connection when proxy is used
Thanks to Grigory Fedorov for reporting this.
2017-01-08 22:58:23 +01:00
Florian Schmaus bfc14227ca Propagate stream errors on connect/login to the caller
Before this, if there was a stream error response by the server to our
stream open, that error response would only be handled in the reader
thread, and the user would get a message like:

"org.jivesoftware.smack.SmackException$NoResponseException: No
response received within reply timeout. Timeout was
5000ms (~5s). While waiting for SASL mechanisms stream feature from
server"

while the server may actually sent something like

<stream:stream
  xmlns='jabber:client'
  xmlns:stream='http://etherx.jabber.org/streams'
  id='6785787028201586334'
  from='jabbim.com'
  version='1.0'
  xml:lang='en'>
  <stream:error>
    <policy-violation xmlns='urn:ietf:params:xml:ns:xmpp-streams'>
	</policy-violation>
	<text xml:lang='en' xmlns='urn:ietf:params:xml:ns:xmpp-streams'>
	  Too many (2) failed authentications from this IP
      address (1xx.66.xx.xxx). The address will be unblocked at 04:24:00
      06.01.2017 UTC
    </text>
  </stream:error>
</stream:stream>

It was necessary to change saslFeatureReceived from SmackException to
XMPPException in order to return the StreamErrorException at this sync
point. But this change in return required the introduction of a
tlsHandled sync point for SmackException (which just acts as a wrapper
for the various exception types that could occurn when establishing
TLS). The tlsHandled sync point is marked successful even if no TLS
was established in case none was required and/or if not supported by
the server.
2017-01-07 10:38:41 +01:00
Florian Schmaus e9bbe9a475 Fix OOB exception when setHostAddress(InetAddress) is used.
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
  at java.lang.String.charAt(String.java:658)
  at org.jivesoftware.smack.util.dns.HostAddress.<init>(HostAddress.java:48)
  at org.jivesoftware.smack.util.dns.HostAddress.<init>(HostAddress.java:62)
2017-01-04 15:35:47 +01:00
Florian Schmaus a8429d45f6 Do not wait for the closing stream element on instant shutdown 2017-01-03 11:44:44 +01:00
Florian Schmaus 90a5e289f8 s/processPacket/processStanza/ s/PacketCollector/StanzaCollector/ 2017-01-03 11:35:04 +01:00
Florian Schmaus b558a128c3 Merge remote-tracking branch 'my/master' 2016-12-07 21:20:02 +01:00
Florian Schmaus d976434bb3 Improve message of XMPPErrorException
by including the XMPP entity which send the XMPP error reply to us.

Also cleanup the no longer used constructors.
2016-11-29 16:40:08 +01:00
Florian Schmaus 1f1bc236fd Ads support for SCRAM-SHA-1-PLUS
Related to SMACK-398.
2016-11-20 19:34:17 +01:00
Florian Schmaus a9d5cd4a61 Move TLS Required check at the end of connect()
It was a *very* bad idea to perform the SecurityMode.Required check in
the connection's reader thread and not at the end of
AbstractXMPPConnectin's connect(). :/

This behavior dates back to 8e750912a7

Fixes SMACK-739
2016-11-12 11:59:06 +01:00
Florian Schmaus 013f4d630a Move duplicate code in AbstractXMPPConnection
from XMPP(TCP|BOSH)Connection.
2016-11-12 11:03:44 +01:00
Florian Schmaus a1630d033e Add support for DNSSEC/DANE
This closes the cycle which started with a GSOC 2015 project under the
umbrella of the XSF adding DNSSEC/DANE support to MiniDNS.

Fixes SMACK-366.
2016-10-31 10:45:38 +01:00
Florian Schmaus c379ae07d5 Initialize the Key Store
as otherwhise the following could happen:

WARNING: Connection XMPPTCPConnection[not-authenticated] (0) closed with error
java.security.KeyStoreException: Uninitialized keystore
	at java.security.KeyStore.aliases(KeyStore.java:1233)
	at sun.security.ssl.SunX509KeyManagerImpl.<init>(SunX509KeyManagerImpl.java:127)
	at sun.security.ssl.KeyManagerFactoryImpl$SunX509.engineInit(KeyManagerFactoryImpl.java:70)
	at javax.net.ssl.KeyManagerFactory.init(KeyManagerFactory.java:256)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection.proceedTLSReceived(XMPPTCPConnection.java:739)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection.access$1000(XMPPTCPConnection.java:146)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1026)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:960)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:975)
	at java.lang.Thread.run(Thread.java:745)

org.jivesoftware.smack.SmackException: java.security.KeyStoreException: Uninitialized keystore
  org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1033)
  org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:960)
  org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:975)
  java.lang.Thread.run(Thread.java:745)
java.security.KeyStoreException: Uninitialized keystore
  java.security.KeyStore.aliases(KeyStore.java:1233)
  sun.security.ssl.SunX509KeyManagerImpl.<init>(SunX509KeyManagerImpl.java:127)
  sun.security.ssl.KeyManagerFactoryImpl$SunX509.engineInit(KeyManagerFactoryImpl.java:70)
  javax.net.ssl.KeyManagerFactory.init(KeyManagerFactory.java:256)
  org.jivesoftware.smack.tcp.XMPPTCPConnection.proceedTLSReceived(XMPPTCPConnection.java:739)
  org.jivesoftware.smack.tcp.XMPPTCPConnection.access$1000(XMPPTCPConnection.java:146)
  org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:1026)
  org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$300(XMPPTCPConnection.java:960)
  org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:975)
  java.lang.Thread.run(Thread.java:745)
2016-10-20 21:54:24 +02:00
Florian Schmaus 73fcbc6b27 Do not re-use the Socket after connect() failed
Fixes SMACK-724.
2016-06-21 21:23:30 +02:00
Florian Schmaus 30861fb7ce Add comment about dropping SM state on stream errors.
Related to SMACK-696.
2016-06-15 09:19:25 +02:00
Florian Schmaus 08c93da56a Delay notifyConnectionError in writer shutdown 2016-06-09 09:20:09 +02:00
Florian Schmaus 8deac592fb Finer logs in XMPPTCPConnection.shutdown() 2016-06-09 09:20:09 +02:00
Florian Schmaus 90f52fcc3b Suppress 'unused' warning in XMPPTCPConnection 2016-05-22 22:50:49 +02:00
Florian Schmaus 4c63cfafd7 Rework support for Proxy connections
in order to improve support for Tor connections.

This makes it possible to establish a connection to an .onion domain by
manually setting host and port in the ConnectionConfiguration and
configuring a Socks5Proxy pointing to a Tor node.

Fixes SMACK-720.
2016-05-10 18:57:04 +02:00
Florian Schmaus b94b2586e2 Smack 4.1.7
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQF8BAABCgBmBQJXD/2lXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
 ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxMzU3QjAxODY1QjI1MDNDMTg0NTNEMjA4
 Q0FDMkE5Njc4NTQ4RTM1AAoJEIysKpZ4VI41rggH/0DjBLpCfTSdjjKGFNChc+1V
 dW9PaPGFUiPuTt3T2NEa74jGYe4PsPpy5zDsJ8uYi2aq3LAiCQvfk+F5LXjRJFoa
 eftz0GtPvfP42oFg8wyDAebFtb0OtE7aJueSRkYGhA1+kzHBbJ9s6TxqDWcB0UWC
 puLh/DEWDFGX5njln+l10O7b10G0+bSrvece22eP0sQIv4hvZJoPQ5rOpCR1wibL
 ldp6wXI6C/b/oQS9MjHq9SV10S+5GykBqN/UzcFnwRVHLbasqnXeNFLGOnMtx0g9
 DmOolAYKGBN5m7m0rqEj9R+OyNgtefV8sCHE69iNAlpQhbmTqPd5rIhIXIII4U4=
 =yWKV
 -----END PGP SIGNATURE-----

Merge tag '4.1.7'

Smack 4.1.7
2016-04-14 22:30:34 +02:00
Tomas Nosek cf3024668e Fix XMPPTCPConnection.setEnabledSSL(Protocols|Ciphers)
The problem caused by opening input/ output stream before setting ssl
parameters to SSLSession and fixed by changing order of this operations.

Fixes SMACK-712.

Minor-Modifications-By: Florian Schmaus <flo@geekplace.eu>
2016-02-17 09:18:36 +01:00
Florian Schmaus 5c00172f6a Remove log statement
was added to diagnose an issue, should have never made it into master.
2016-02-10 14:54:32 +01:00
Florian Schmaus e0cbb95b5d Check callbackHandler/keystorePath for null
before using it.
2016-01-23 14:16:38 +01:00
Florian Schmaus d5c7eb7349 Remove unnecessary code in XMPPTCPConnection 2016-01-23 14:16:37 +01:00
Florian Schmaus 085c3469e9 Fix XMPPTCPConnection.proceedTLSReceived()
The method was changed in c6594aec2f, but
this change causes issues if Smack is used on Android *without* a custom
SSLContext:

Caused by: java.security.KeyStoreException: java.security.NoSuchAlgorithmException: KeyStore jks implementation not found
 at java.security.KeyStore.getInstance(KeyStore.java:119)
 at org.jivesoftware.smack.tcp.XMPPTCPConnection.proceedTLSReceived(XMPPTCPConnection.java:697)

Caused by: java.security.NoSuchAlgorithmException: KeyManagerFactory SunX509 implementation not found
 at org.apache.harmony.security.fortress.Engine.notFound(Engine.java:177)
 at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:151)
 at javax.net.ssl.KeyManagerFactory.getInstance(KeyManagerFactory.java:77)
 at org.jivesoftware.smack.tcp.XMPPTCPConnection.proceedTLSReceived(XMPPTCPConnection.java:708)
2016-01-23 14:16:37 +01:00
Florian Schmaus 85e818cffb Smack 4.1.6
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQF8BAABCgBmBQJWo2DDXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
 ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxMzU3QjAxODY1QjI1MDNDMTg0NTNEMjA4
 Q0FDMkE5Njc4NTQ4RTM1AAoJEIysKpZ4VI41Q0AH/22s1WOI0mgFjQnuSRoZwtNQ
 WN7eudnKlnknmNrJwPcbW1EYO/kNj1SQnqv7ed2aVpyeFFOf1/CUIgq57K1hBjA0
 gTVtv0vK9pABZOmYY5UYURF6AZqKC2s5grHzOgIQbEhT0IOxc/Kz3/ubRxYwvxQl
 lKenkNw75NMViylC0wFQc673SUuwPKyS3PjFm44ASxhbHNIexqagsxNU3MICmCWr
 vGuyv2pGuVvVbILdqqoRGJhucHUs8HnYjA/H1lAlXH4FE0k3EXnjtztHaiLXQoxC
 I2MbunwlVWcE5099V85wcgBbtMWqgljyz+Yh8MmkPojZTVnWjYPUWybK4G8TREg=
 =1rYD
 -----END PGP SIGNATURE-----

Merge tag '4.1.6'

Smack 4.1.6
2016-01-23 13:27:16 +01:00
Florian Schmaus 57838f1ffe Enable Stream Management by default
Fixes SMACK-655.
2016-01-10 18:57:19 +01:00
Florian Schmaus 7845f21465 Only create the socket once
in XMPPTCPConnection.connectUsingConfiguration().
2016-01-10 18:34:54 +01:00
Florian Schmaus 7a8d66e9e6 Improve logging of failed connection attempts
also improve XMPPTCPConnection.connectUsingConfiguration(): Try further
hostAddresses if getAllByName failes.

Fixes SMACK-711
2016-01-10 18:34:54 +01:00
Florian Schmaus 45feaecdf7 Make XMPPError imutable and add stanza reference 2015-12-09 10:48:52 +01:00
Florian Schmaus 352e422562 Drop SM state *before* binding the resource
as otherwise <bind/> and <session/> may be duplicated on reconnect.

Fixes SMACK-706.
2015-12-03 13:47:08 +01:00
Florian Schmaus 8dcb3c11ff Smack 4.1.5
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQF8BAABCgBmBQJWUjTuXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
 ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxMzU3QjAxODY1QjI1MDNDMTg0NTNEMjA4
 Q0FDMkE5Njc4NTQ4RTM1AAoJEIysKpZ4VI41zp8H/iRB0CtFvxVBFwRpP2HB0Iyc
 VzdxJTVXgJ7s8V3Us2Gmm0chUvs1wybshIdZ090NX7huZ4F1rWrOP7qt9S4soKgX
 LNdKTKTTNJ61jktLkG1HjA8yJr1Zu+XFK10Ne8997N9TnhbcVYAhsuTb8SRE8dlE
 G1Qihe2guJCCnWJhz9bsCXyAFt/fM5rSb/sgs/kXkE1W5bYeMHpFMvqMfab8NPBP
 fkt/NSxfqLfrRJneynnSwGSvRitDxpfRCcxLktTdDO31eryayIyiQIhaUhFYIGJQ
 tKx0/7HdCkgdUueBdtoQ/O02rjJ+kYqN2F3CErcIbB//3R6WKNF61XzOY81egYc=
 =dklO
 -----END PGP SIGNATURE-----

Merge tag '4.1.5'

Smack 4.1.5
2015-11-22 23:14:02 +01:00
Florian Schmaus cc758b8f59 Use ackedStanzasCount instead of handledCount in processHandledCount
for the initial size of the ackedStanzas list.

Thanks to Juan Antonio for reporting.
2015-10-21 17:51:08 +02:00
Florian Schmaus 9c9d1f893a Typo in XMPPTCPConnection s/ResumptiodDefault/ResumptionDefault/ 2015-10-21 16:04:26 +02:00
Florian Schmaus 640849dac5 Revert "Typo in XMPPTCPConnection s/ResumptiodDefault/ResumptionDefault/"
This reverts commit 7ceb5f09df.

Somehow 7ceb5f09 introduced from the master branch into the 4.1 branch.
2015-10-21 16:04:26 +02:00
Florian Schmaus f5115f4666 Empty unacknowledgedStanzas when 'resumed' is received
by changing

stanzasToResend.addAll(unacknowledgedStanzas);

to

unacknowledgedStanzas.drainTo(stanzasToResend);

Also use sendStanzaInternal to call the callbacks, which also requires
the smEnabledSyncPoint to got signaled.

Fixes SMACK-700. Thanks to Juan Antonio for reporting this.
2015-10-21 16:04:02 +02:00
Florian Schmaus 4f39c5b9c9 Remove not thrown NotConnectedException in XMPPTCPConnection 2015-09-26 12:42:35 +02:00
Florian Schmaus 7ceb5f09df Typo in XMPPTCPConnection s/ResumptiodDefault/ResumptionDefault/ 2015-09-26 12:42:35 +02:00
Florian Schmaus 8aa3f94c90 Drop stream state after stream error
Fixes SMACK-696.
2015-08-26 21:55:02 +02:00
Florian Schmaus d54dafc499 Don't return if securityMode is 'disabled'
in afterFeaturesReceived. As this will cause
maybeCompressFeaturesReceived.reportSuccess() never to be called if the
server announces 'starttls' but security mode is set to 'disabled' and
if 'compression' is also announced.

Fixes SMACK-678.
2015-06-25 11:07:25 +02:00
Florian Schmaus 576980097e Request SM ack when re-sending after stream resumption
Fixes SMACK-667.
2015-05-19 14:21:52 +02:00
Florian Schmaus dabbb40de6 Fix isSmResumptionPossible() returning wrong values
The cases where reversed. Change the condition for better readability.

Also fix int and long handling in the computation of
maxResumptionMillies.

Fixes SMACK-654.
2015-04-07 08:51:03 +02:00
Florian Schmaus 3b6891b0d0 Fix integer overflow if no max resumption time
is specified by client and server.

Fixes SMACK-653.
2015-04-07 08:51:03 +02:00
Florian Schmaus 5e86db4f80 Substitute 'packet' with 'stanza(/packet)' in javadoc 2015-03-21 09:36:28 +01:00
Florian Schmaus 92c76d1023 Only reset smSessionId if the stream is no longer resumeable 2015-03-10 13:17:18 +01:00
Florian Schmaus ed4fa3390f Add XMPPConnection.sendStanza(Stanza)
and deprecate sendPacket().
2015-03-04 21:46:44 +01:00
Florian Schmaus 96bb37f924 Fix counting bug Stream Management implementation
Previously Smack would put messages in the unacknowledgedStanzas queue
after it received the 'enabled' element, when it should do so right
after sending the 'enable' stream element.

Imagine a session where '-->' denotes "received from server" and '<--'
"sent to server"

<-- enable
--> iq roster push set
--> presence some presence
<-- iq roster push result
--> enabled

then Smack would not add the iq roster push result stanza to the
unacknowledgedStanzas queue.

This fixes the issue by initializing the unacknowledgedStanzas queue
when the writer thread encounters a 'Enable' stream element.

The additional 'instanceof' invocation in the writer thread should not
be a big performance issue, since the existing "instanceof Stanza" check
should be the common case and the "instanceof Enable" is an exclusive
alternative to this case.
2015-03-02 16:17:47 +01:00
Florian Schmaus 75ec271c6c Rename PacketListener to StanzaListener
and add the PacketListener as deprecated interface.
2015-03-02 15:49:56 +01:00
Florian Schmaus d4a6d8e653 Rename PacketFilter (and implementing classes) and PacketExtension
to StanzaFilter and ExtensionElement.
2015-02-28 13:49:38 +01:00
Florian Schmaus 4b7a396b9b Improve logging wrt XMPPTCPConnection.shutdownDone 2015-02-26 08:27:19 +01:00
Florian Schmaus 90969e252a Improve the bundle and defer mechanism
Instead of always bundling when the queue is empty, only bundle once the
queue has become empty and then only if it has been become empty again.

The previous algorithm would also bundle and defer the last element
found in the queue. This is not the case now.
2015-02-22 10:51:44 +01:00
Florian Schmaus 8b0ccd7420 Minor javadoc fixes and improvements 2015-02-22 10:41:53 +01:00
Florian Schmaus bfcb403673 Fix Stream Management ack listner invocation
aborting to early, because of a 'return' statement, when 'continue'
should be used.

Thanks to Daniele Ricci for reporting this bug.
2015-02-19 23:01:38 +01:00
Florian Schmaus 5f4374ec26 Use host(name) to construct the SSLSocket
in XMPPTCPConnection.

So that the hostname and not the IP is available to the SSLSocket and
the SSLSession, which handed over to HostnameVerifier. This leaves the
HostnameVerifier with the

- name of the XMPP service (first argument of verify(String, SSLSession)
- name of the used host (found in the SSLSession)

allowing more complex verification mechanisms performed by the
HostnameVerifier.
2015-02-19 12:14:16 +01:00
Florian Schmaus d415661e35 Add BundleAndDeferCallback to smack-tcp 2015-02-19 12:14:10 +01:00
Florian Schmaus aa8daba1cf Add StreamManagemtCounterError
to allow graceful connectionClosedOnError() disconnects, since we
received a bunch of reports where the counter seems wrong, which is
causing a NPE in a thread pool executor, causing the VM or Android App
to terminate.

Now we throw the StreamManagementCounterError instead.
2015-02-18 12:07:44 +01:00
Florian Schmaus 7897fca876 Add comment about Stream Management's unacked stanzas queue 2015-02-18 11:59:45 +01:00
Florian Schmaus 57c1b57b7c s/ a XMPP/ an XMPP/ 2015-02-12 12:13:19 +01:00
Florian Schmaus 96e3d5c533 Add XMPPTCPConnection(CharSequence, String) constructor 2015-02-09 07:35:16 +01:00
Florian Schmaus 1630b44b8d Reset smSessionId on XMPPTCPConnection.disconnect() 2015-02-09 07:35:15 +01:00
Florian Schmaus 3b8f4c144e Add missing space in log statement within XMPPTCPConnection 2015-02-09 07:35:15 +01:00
Florian Schmaus 4698805a34 Rename 'Packet' class to 'Stanza'
Smack still uses the term 'Packet' in some places. This is just the
first step towards using correct XMPP terms in Smack.
2015-02-06 09:34:51 +01:00
Florian Schmaus 5a56ff011b Add XMPPConnection.getStreamId()
and remove getConnectionID().

Also make streamId a field of AbstractXMPPConnection. Most XMPP
connection types have a streamId, it appears to be optional when BOSH
is used though.
2015-01-28 17:14:33 +01:00