Commit Graph

61 Commits

Author SHA1 Message Date
Florian Schmaus 5b6dd8e3f7 [disco] Fix memory leak in ServiceDiscoveryManager
The lambda we schedule in 25ms captures a strong reference to the
XMPPConnection. However the lambda is part of the scheduled action,
which we save in the renewEntityCapsScheduledAction field. This causes
a memory leak, since the ServiceDiscoveryManager now holds a strong
reference to its XMPPConnection.

Fix this by obtaining the strong reference to the XMPPConnection, if
one still exists, within the lambda.

Fixes SMACK-926.

Reported-by: Damian Minkov <damencho@jitsi.org>
2022-05-26 15:39:41 +02:00
Florian Schmaus 3f9ca68134 Delete TypedCloneable 2020-06-14 17:38:51 +02:00
Florian Schmaus 2679c72f0f [disco] Move logic that was previously in EntityCapsManager in SDM 2020-05-18 09:15:15 +02:00
Florian Schmaus 46ba273689 [disco] Delay the entity caps renewal
This avoids the calculation of the caps hash while the managers become
registered with the connection and add their features.
2020-05-18 09:15:14 +02:00
Florian Schmaus dc443bccd4 disco: allow multiple data forms for extended discovery information
Previously Smack only supported a single data form as extended
discovery information.
2020-04-18 19:04:21 +02:00
Florian Schmaus 863d0bf403 Fix NPE in ServiceDiscoveryManager 2020-03-09 14:41:52 +01:00
Florian Schmaus 6e32305987 Apply builder pattern to DiscoverInfo
This is the first transformation of an IQ type to the builder type.
2019-10-29 11:14:55 +01:00
Florian Schmaus 5db6191110 Introduce StanzaBuilder
As first step to immutable Stanza types.
2019-10-25 21:41:55 +02:00
Florian Schmaus 1a3067c89b Enable werror for javadoc and fix javadoc issues 2019-08-30 12:08:30 +02:00
Florian Schmaus 91ec6cc955 Javadoc changes for Java 11 compatibility 2019-07-19 23:05:46 +02:00
Florian Schmaus 9c30e4f3cc Merge branch '4.3' 2019-04-16 09:27:48 +02:00
Florian Schmaus 0ec7e84cbc Update link to XMPP Registry for Service Discovery Identities 2019-04-09 14:26:15 +02:00
Florian Schmaus 9ad162af6e Use correct field in ServiceDiscoveryManager.getIdentities()
Fixes SMACK-863.
2019-04-09 12:14:12 +02:00
Florian Schmaus 8841c4aed2 Remove deprecated method sin SDM and AdHocCommandManager
These methods are related to functionality which is no longer existend
in XEP-0030.
2018-06-14 09:59:46 +02:00
Florian Schmaus 72de6540b2 Add DiscoInfoLookupShortcutMechanism and EntityCapabilitiesChangedListener
to allow for plugable XEP-0115 like mechanisms. For example XEP-0390.
2018-05-10 20:30:23 +02:00
Florian Schmaus e8923b9d16 Enable trailing whitespace checkstyle check
for all source code regions, including javadoc.
2018-05-09 23:26:39 +02:00
Florian Schmaus 2065a7ed01 Add findServicesDiscoverInfo() with service argument
to ServiceDiscoveryManager.
2018-04-23 20:41:33 +02:00
Florian Schmaus 2efec89050 Rename XMPPError to StanzaError
Fixes SMACK-769.
2018-04-07 22:59:25 +02:00
Florian Schmaus 9b5dafe541 Enable LeftCurly checkstyle check 2018-04-06 10:25:06 +02:00
Florian Schmaus ad87243060 Globally 's;stanza(/packet);stanza;' 2018-03-31 14:17:30 +02:00
Florian Schmaus ec4be1963a Deprecate legacy disco-publish API of ServiceDiscoveryManager 2018-02-21 20:43:56 +01:00
Florian Schmaus 41f5cf8435 Remove unused LOGGER from ServiceDiscoveryManager 2018-02-21 20:21:10 +01:00
Florian Schmaus 98708d67a2 Make ServiceDiscoveryManager.findService() consider all services
with the same matching feature announced.

Consider for example PubSub where usually the service itself announces
the PubSub feature as part of PEP, and where an additional PubSub
component exists. The old logic will just lookup the first matching
service with a PubSub feature announcement and check if for a matching
identiy. If we look for a real PubSub service, but stumble first over
user's service with PEP, then findService() will return 'null' although
there would have been a valid PubSub service.

Fixes SMACK-805.
2018-02-21 20:09:11 +01:00
Paul Schaub cb18056613 Fix minor codestyle issues 2017-12-17 11:03:46 +01:00
Florian Schmaus 9e11b68144 Add comment style checkstyle rule requiring a space 2017-11-20 08:53:19 +01:00
Florian Schmaus a66c42834f Add findServicesDiscoveryInfo() variant
which does not log some exceptions, but instead comes with an optional
output paramater which returns the encountered exceptions.
2017-11-09 18:16:08 +01:00
Florian Schmaus 0729392ab8 Fix isSupported discovery of "Push Notifications"
Fixes SMACK-780.
2017-10-14 14:12:28 +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 ce1cddc722 More checkstyle whitespace related checks 2017-05-24 14:42:38 +02: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 90a5e289f8 s/processPacket/processStanza/ s/PacketCollector/StanzaCollector/ 2017-01-03 11:35:04 +01:00
Florian Schmaus 183c605278 Bump JXMPP to 0.5.0 2017-01-02 09:40:46 +01:00
Florian Schmaus 45feaecdf7 Make XMPPError imutable and add stanza reference 2015-12-09 10:48:52 +01:00
Florian Schmaus 33e5c37af8 Refactor PEP to use PubSub API.
Fixes SMACK-416.
2015-08-17 12:45:23 +02:00
Florian Schmaus f369a009ac Rename 'serviceName' to 'xmppServiceDomain'
Also use 'null' as default value for the resource, to enforce server
generated resources.

Fixes Smack-665
2015-05-19 09:26:59 +02:00
Florian Schmaus 001e824fb9 Improve PubSub API
Use Manager pattern for PubSubManager.

Also improve the API of ServiceDiscoverManager.
2015-05-12 17:56:06 +02:00
Florian Schmaus b4694ec152 Add FinalClass checkstyle check
And mark affected classes final.
2015-04-06 10:45:12 +02:00
Florian Schmaus 64d134052d Enable javadoc checkstyle
and fix violations.
2015-03-29 12:29:32 +02:00
Florian Schmaus 83b84c5bd3 Merge branch '4.1'
Conflicts:
	smack-core/src/main/java/org/jivesoftware/smack/StanzaListener.java
	smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
	smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java
	smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java
	version.gradle
2015-03-24 17:16:18 +01:00
Florian Schmaus 49c2c35609 Synchronize SDM methods that change the state
Other Managers, e.g. EntityCapsManager, may be notified if e.g. a
feature is added or removed. While they are notified, the state of SDM
must be consistent, therefore synchronize SDM methods that modify the
state.
2015-03-24 11:59:35 +01:00
Florian Schmaus 5e86db4f80 Substitute 'packet' with 'stanza(/packet)' in javadoc 2015-03-21 09:36:28 +01:00
Florian Schmaus 701aa7d9c4 Merge branch '4.1'
Conflicts:
	smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
	smack-core/src/main/java/org/jivesoftware/smack/PacketCollector.java
	smack-core/src/main/java/org/jivesoftware/smack/PacketListener.java
	smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
	smack-core/src/main/java/org/jivesoftware/smack/debugger/SmackDebugger.java
	smack-core/src/main/java/org/jivesoftware/smack/packet/Packet.java
	smack-core/src/main/java/org/jivesoftware/smack/util/XmlStringBuilder.java
	smack-core/src/test/java/org/jivesoftware/smack/ThreadedDummyConnection.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/address/provider/MultipleAddressesProvider.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/bytestreams/ibb/DataListener.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/FaultTolerantNegotiator.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/IBBTransferNegotiator.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/Socks5TransferNegotiator.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/filetransfer/StreamNegotiator.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/LeafNode.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/Node.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/PubSubManager.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/packet/PubSub.java
	smack-extensions/src/main/java/org/jivesoftware/smackx/vcardtemp/VCardManager.java
	smack-extensions/src/test/java/org/jivesoftware/smackx/receipts/DeliveryReceiptTest.java
	smack-im/src/main/java/org/jivesoftware/smack/chat/ChatManager.java
	smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/JingleSession.java
	smack-jingle-old/src/main/java/org/jivesoftware/smackx/jingleold/provider/JingleProvider.java
	smack-legacy/src/main/java/org/jivesoftware/smackx/workgroup/packet/UserID.java
	smack-legacy/src/main/java/org/jivesoftware/smackx/xroster/provider/RosterExchangeProvider.java
	smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
	version.gradle
2015-03-04 22:42:36 +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 5bb4727c57 Use Jid (and subclasses) from jxmpp-jid
Fixes SMACK-634
2015-02-17 16:07:16 +01:00
Florian Schmaus bc61527bd2 Expose InterruptedException
SMACK-632
2015-02-14 14:57:33 +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 98c69f6895 Add ServiceDiscoveryManager.serverSupportsFeature() 2015-01-10 19:36:33 +01:00
Florian Schmaus bb8dcc9874 Add IQ request handler API
This also moves the logic to send error IQ replies from "when there is
no IQ provider registerd" to "when there is no IQ request handler
registered". Which has for example the advantage that IQ parsing no
longer asks for a connection instance.
2015-01-08 23:15:24 +01:00
Florian Schmaus 717090d272 Rework incoming packet listeners and Roster
Differentiate between asynchronous and synchronous ones. Asynchronous
are the ones where the invocation order may not be the same as the order
in which the stanzas arrived.

Since it's no longer guaranteed that when a unit test calls

processPacket(stanza)

the stanza will be completely processed when the call returns, it was
necessary to extend the unit tests (mostly Roster and ChatManager) with
a packet listener that waits for his invocation. Since we now also use
LinkedHashMaps as Map for the packet listeners (SMACK-531, SMACK-424),
adding a packet listeners as last also means that it will be called as
last. We exploit this behavior change now in the unit tests.

Rename 'recvListeners' to 'syncRecvListeners' in AbstractXMPPConnection.

Rename 'rosterInitialized' to 'loaded' in Roster.

Add Roster.isLoaded().

Reset 'loaded' to false in
Roster.setOfflinePresencesAndResetLoaded() (was setOfflinePresences()).

Fixes SMACK-583, SMACK-532, SMACK-424
2015-01-07 14:35:23 +01:00
Florian Schmaus 56bf54eab5 Don't use synchonrizedMap() for INSTANCES
in Managers. The getInstanceFor() method is already synchronized.
2014-12-27 20:55:30 +01:00