Commit Graph

4662 Commits

Author SHA1 Message Date
Florian Schmaus 66370c7ef5 [core] Add SmackConfiguration.TRUELY_ASYNC_SENDS
This option is meant a quick and dirty hack until
XMPPConnection.sendStanza() throws a dedicated Exception in case the
connection's outgoing queue is full.
2022-06-06 09:52:57 +02:00
Florian Schmaus 8ebe453363 [bosh] Fix BOSHConfiguration.getURI()
Reported-by: Damian Minkov <damencho@jitsi.org>
Fixes: aa441d743c ("[bosh] Use ConnectionConfiguration.getHostString() in BOSHConfiguration")
2022-05-26 19:53:06 +02:00
Florian Schmaus c9af6576c0
Merge pull request #529 from Flowdalic/fix-sd-memleak
[disco] Fix memory leak in ServiceDiscoveryManager
2022-05-26 18:11:54 +02:00
Florian Schmaus 69e81b748e [disco] Only perform entity capabilities work if there are any listeners 2022-05-26 18:03:36 +02:00
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 f402a9d12d
Merge pull request #528 from Flowdalic/fix-mux-presence-interceptor
[muc] Fix Presence interceptors
2022-05-23 12:30:58 +02:00
Florian Schmaus 60fee7b318 [muc] Fix Presence interceptors
Presence interceptors where hooked into stanza sending listeners,
which are called *after* the stanza has been put on the wire, i.e., to
late for interceptors that any modifications, they may perform, to
take effect.

Fixes SMACK-925.

We now also dynamically add the MUC's main presence interceptor to the
connection.

Reported-by: Damian Minkov <damencho@jitsi.org>
2022-05-22 10:51:45 +02:00
Florian Schmaus aa441d743c [bosh] Use ConnectionConfiguration.getHostString() in BOSHConfiguration 2022-05-18 21:45:32 +02:00
Florian Schmaus 00bcbff5ee [core] Add ConnectionConfiguration.getHostString() 2022-05-18 21:45:00 +02:00
Florian Schmaus 9b6e209b5f
Merge pull request #526 from damencho/fix-bosh-ip-address-4.4
fix: Bosh configuration when bosh URI contains IP address.
2022-05-18 16:50:16 +02:00
Дамян Минков d0db485c24 fix: Bosh configuration when bosh URI contains IP address. 2022-05-18 08:08:47 -05:00
Florian Schmaus 881ebe731d [core] Fix typo in javadoc 2022-04-30 15:15:51 +02:00
Florian Schmaus 1f5326abb2 [core] Inline waitForConditionOrConnectionException
Using any of the two methods is error prone, see 0e0c0a4093 ("[tcp]
Fix handling in connection exceptions when resuming a stream"), as one
can easily forget to check for connection exceptions after it
returned. There are also no longer any call sites of those methods.

Let's inline both variants of this method.
2022-04-30 15:15:42 +02:00
Florian Schmaus 0e0c0a4093 [tcp] Fix handling in connection exceptions when resuming a stream
Smack would previous run into "assert smResumptionFailed != null;" at
line 407, since if a connection exception was encountered,
waitForConditionOrConnectionException() would return, but we afterards
just assumed that either SM resumption was successful or not.
2022-04-30 15:06:15 +02:00
Florian Schmaus 95ff591c14 [xdata] Only emit warning about unregistered fields once per field 2022-03-06 21:44:33 +01:00
Florian Schmaus 162d8ba30b Smack 4.4.6-SNAPSHOT 2022-03-02 22:22:16 +01:00
Florian Schmaus cccf3ce5f3 Smack 4.4.5 2022-03-02 19:30:01 +01:00
Florian Schmaus 229a6edb1b Switch to CHANGELOG.md
Bye Bye changelog.html. You have served us good old friend. But JIRA
does no longer create compatible HTML changelogs. And markdown seems
to be the better alternative anyway.
2022-03-02 18:48:31 +01:00
cmeng-git 4d026d8ae8 [jingle] Add element and text to JingleReason's XML 2022-02-18 21:29:32 +01:00
Florian Schmaus 3885153ea1
Merge pull request #518 from Flowdalic/ssl-context-config
SSLContext config
2022-02-18 21:28:31 +01:00
Florian Schmaus ba2e36dbc3 [core] Deprecate some SSLContext config options and add KeyManager option
Smack historically provided fine-grained options for the
SSLContext. This is however not flexible enough, as an option to
specifiy the KeyManager(s) was missing.

This deprecated the options for keystore path, keystore type, and
PKCS#11 library, in favor of an option to set the KeyManager, which
could be aware of the keystore path and type, and the PKCS#11
library. At some point, Smack may provide some high-level methods to
create a KeyManager from provided keystore path, keytsore type and
PKCS#11 library.
2022-02-17 12:17:54 +01:00
Florian Schmaus 4622d00d9e [tcp] Unravel SSLSocketFactory.createSocket() invocation 2022-02-17 11:58:02 +01:00
Florian Schmaus 4e715a35e5
Merge pull request #512 from bgrozev/fix-smack-reactor-select
fix: Correctly handle the case when the action due time is 0.
2022-02-06 17:47:50 +01:00
Boris Grozev 67a5c3a41a [core] Correctly handle due time of '0' in SmackReactor
Scheduled actions that are due in 0 milliseconds are due
immediately. Otherwise we would invoke select() with 0.

Fixes SMACK-923.
2022-02-06 17:38:50 +01:00
Florian Schmaus 5cd7a6c60e
Merge pull request #509 from Flowdalic/jingle-reason-extension-element
Jingle reason extension element
2022-02-03 07:58:29 +01:00
Florian Schmaus e25be8fea4
Merge pull request #510 from Flowdalic/future-invoke-at-most-once
[SmackFuture] Invoke the callbacks at most once
2022-02-03 07:58:19 +01:00
Florian Schmaus 3ff553549a [SmackFuture] Invoke the callbacks at most once
Previously, if a SmackFuture both was successful and unsuccessful, it
was possible that the onSuccess() callback was invoked twice.

Reported-by: Boris Grozev <boris@jitsi.org>
2022-02-02 20:47:31 +01:00
cmeng-git 4cdb4acf26 [core] Fix IQProvider javadoc
It is IqProvider that should be used instead.
2022-02-02 12:13:25 +01:00
Florian Schmaus 7fad14ac0c [jingle] Improve Jingle <reason/> support
Fixes SMACK-922.
2022-02-02 12:10:53 +01:00
Florian Schmaus c06cf72337 [core] Support IqProvider in SmackTestUtil 2022-02-02 10:41:00 +01:00
Florian Schmaus 0e637068e6 [core] Factor PacketParserUtils.parseIqData() in extra method 2022-02-02 10:41:00 +01:00
Florian Schmaus 1dae0c0c32 [core] Use Enum.toString() in XmlStringBuilder.attribute(String, Enum<?>)
All other enum-using methods of XmlStringBuilder already use
Enum.toString(), as opposed to Enum.name(), this was the only left. I
do not remember why I did not to change this method too, probably
because of its plenty call sites.

But since this method already broke Jingle XML serializaton,
JingleAction was e.g., 'session_accept' when it should be
'session-accept', we change it now.

Fixes SMACK-921.
2022-01-22 11:08:35 +01:00
Florian Schmaus 1a727c152e [core] Improve warning message of ExceptionThrowingCallbackWithHint 2022-01-22 10:24:01 +01:00
Florian Schmaus 5c46451cd2 [xdata] Add BooleanFormField.getValueAsBooleanOrNull()
This method is meant to provide 'raw' access to what has been sent
over the wire. It is assumed to be not of much use in the typically
case, but provided for completeness.
2021-12-27 21:24:19 +01:00
Florian Schmaus 940d7bf02a [xdata] Adjust behavior of BooleanFormField.getValueAsBoolean()
According to XEP-0004 § 3.3, the default value of a boolean form field
is 'false'. And since users are typically interested in getting the
value, and not potentially 'null' as result, we adjust the behavior of
the getValueAsBoolean() method consider the default value.
2021-12-27 21:17:57 +01:00
Florian Schmaus 178e82a3aa
Merge pull request #506 from Flowdalic/gssapi-no-password
Prevent password enforcement for SASL GSSAPI
2021-12-21 13:37:31 +01:00
Florian Schmaus 817dc0ed3a Prevent password enforcement for SASL GSSAPI
Similar fix as 9b339efbc1 ("Prevent password enforcement for SASL
anonymous") just for SASL GSSAPI. Fixes SMACK-920.

Fixes: 92f4aadfdc ("[sasl] Avoid mechanisms that need a password when none is available")
2021-12-21 12:53:10 +01:00
Florian Schmaus 993a307222 Add o.j.smackx.softwareinfo.form.SoftwareInfoForm to startup classes
This ensures that the form fields are registered.
2021-12-17 09:51:19 +01:00
Florian Schmaus 182d01a4b0 [softwareinfo] Register urn:xmpp:dataforms:softwareinfo's field types 2021-12-15 20:17:23 +01:00
Florian Schmaus e1845a52ca [formtypes] Add FormFieldRegistry.register(String, FormField.Type, String...) 2021-12-15 20:17:23 +01:00
Florian Schmaus fc7fc10c69 [pubsub] Allow for character data before <item/>'s payload
Fixes SMACK-918.
2021-12-13 21:50:10 +01:00
Florian Schmaus e39adff40f [muc] Only notify() about processed self-presence once
Since notify() is a rather expensive operation, we should only invoke
it once. Especially since some servers include 110 in all self
presences, not just the initially reflected one on MUC join.
2021-12-13 21:20:40 +01:00
Florian Schmaus d1273532ce [muc] Correctly processes self-presences
The change in 52a49769f9 ("[muc] Check for self-presence first in
presence listener") caused all self-presences (MUC user status 110) to
be ignored in the further processing chain eventually invoking
checkRoleModifications() and checkAffiliationModifications(). However,
some servers (e.g., ejabberd) include 110 not only in the initial
presence but in all following, and we ant to process these.

Fixes SMACK-918

Fixes: 52a49769f9
2021-12-13 21:15:30 +01:00
Florian Schmaus 8736e3e434 [core] Remove erroneous "assert !connected" in connect()
Connections like XMPPTCPConnection may still reported connected, if
they are, for example disconnected but resumable. This is already
accounted for in throwAlreadyConnectedExceptionIfAppropriate(), hence
the assert is unnecessary and leads to false negatives for
XMPPTCPConnection.

For the sake of completeness, the right condition, assuming
XMPPTCPConnection is used, for the assert would be:

	assert !connected || disconnectedButResumable;
2021-11-05 10:19:26 +01:00
Florian Schmaus 403890d988 Smack 4.4.5-SNAPSHOT 2021-11-01 18:10:35 +01:00
Florian Schmaus 5731e61782 Smack 4.4.4 2021-11-01 17:54:01 +01:00
Florian Schmaus 22cf7bace8 [resources] Rename get-contributors.sh to generate-notice-file 2021-11-01 17:53:01 +01:00
Florian Schmaus 22b2efc6a6 Update NOTICE file 2021-10-25 17:00:14 +02:00
Florian Schmaus 7fd300888e
Merge pull request #504 from JonathanLennox/StanzaBuilder-remove-extension
Add removeExtension methods to StanzaBuilder.
2021-10-25 16:58:49 +02:00
Jonathan Lennox 4ae3fbb073 Add removeExtension methods to StanzaBuilder. 2021-10-25 14:50:45 +00:00