1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-05 08:05:58 +01:00
Commit graph

1811 commits

Author SHA1 Message Date
Florian Schmaus
91fd15ad86 Prefix subprojects with 'smack-'
instead of using the old baseName=smack appendix=project.name approach,
we are now going convention over configuration and renaming the
subprojects directories to the proper name.

Having a prefix is actually very helpful, because the resulting
libraries will be named like the subproject. And a core-4.0.0-rc1.jar is
not as explicit about what it actually *is* as a
smack-core-4.0.0-rc1.jar.

SMACK-265
2014-04-28 19:44:14 +02:00
Florian Schmaus
b6fb1f3743 Notify PacketReader in case of TLS exceptions
PacketReader will be waiting in startup() as long as either:
- the timeout occurs
- notify is called because the last feature stanza was parser
- notify is called because of an exception while parsing
2014-04-28 18:53:50 +02:00
Florian Schmaus
5a19668544 Add Eclipse-(PatchFragment|ExtensibleAPI) manifest data
to the jar manifests. Thanks to Jens Offenbach for reporting.
2014-04-28 17:42:23 +02:00
Florian Schmaus
bc176d72a3 Throw exceptions of SSLSocket.startHandshake() in connect()
instead of throwing a NoResponseException in case startHandshake()
throws an Exception. The NoResponseException was then thrown when
performing SASL auth, which usually directly followes securing the
connection via TLS (if enabled and provided by the server).
2014-04-28 17:36:10 +02:00
Florian Schmaus
ddb47c2d60 Don't throw XmlPullParserException
removes the need to wrap the exception in a SmackException in
XMPPTCPConnection.initConnection()
2014-04-28 17:35:59 +02:00
Florian Schmaus
06c6546d2e Strip 'smack-' prefix from artifacts
This was causing some trouble, e.g. the maven plugin resolved the
dependency only to artifactId 'core', when it should be
'smack-core'. It was previously working, but likely broke when the
configuration of the subprojects was put into their own build.gradle
files.

SMACK-265
2014-04-28 17:35:59 +02:00
Florian Schmaus
858492b177 Fix OSGi Bundle-Version
Bundle-Version's forth field, the qualifier, must be separated from
the 'micro' version with a dot.
2014-04-28 11:22:42 +02:00
Florian Schmaus
656b1c70be Only send scheduled Pings if no Pong was received
in the meantime. Also do not distinguish between successful automatic
and manual Ping. Just record the time of the last received XMPP Pong.
2014-04-28 11:20:54 +02:00
Florian Schmaus
854489e785 No need to synchronize bindingRequired
If binding is required or not is told the client by the server within
the features stanzas. Smacks guarantees that connect() blocks until the
features stanzas has been received and processed.
2014-04-28 07:58:39 +02:00
Florian Schmaus
874a22489e Remove resource binding out of sasl auth
Follow XEP-170 recommendations: Resource binding *after* compression.

Fixes also a bunch of race conditions related to the wait()/notify()
pattern used in the early stages of a Connection where
createPacketCollectorAndSend(Packet).nextResultOrThrow() can not be
used. Those wait()/notify() patterns are currently
- SASL authentication
- compression
- resource binding

Fixes SMACK-454
2014-04-28 07:58:34 +02:00
Florian Schmaus
d17f64ed9a Improve stream compression for TCP connections
Fix a race condition in useCompression where the compression request was
send outside the synchronized block, this could cause notify() to be
called without a previoius call to wait().

s/streamCompressionDenied/streamCompressionNegotiationDone/ and re-use
the method once the server ack'd stream compression.

Also don't call notifyConnectionError() when requestStreamCompression()
encounters an exception, instead throw the exception.
2014-04-27 11:39:38 +02:00
Florian Schmaus
9b235d0d8f Improve javadoc of Java7ZlibInputOutputStream 2014-04-27 11:04:15 +02:00
Florian Schmaus
86ad192bea Log connectionClosedOnError exceptions 2014-04-27 10:49:58 +02:00
Florian Schmaus
790ebeca33 Make PacketReader.resetParser() throw the exception
there is no need to catch it and disguise it.
2014-04-27 10:49:58 +02:00
Florian Schmaus
a613d5f574 Improve PacketReader startup()
Instead of using the connectionID, we now use a new boolean
lastFeaturesParsed to mark when startup() is able to continue or when a
NoResponseException should be thrown.

Fixes the problem when the connectionId was set and the wait() would
timeout, resulting in startup() believing that everything was ok, while
in fact the features where not yet received (or parsed). SMACK-558.
2014-04-27 10:49:56 +02:00
Florian Schmaus
76ce883ef3 Simplify PacketReader wait/notify code
by removing the support for non XMPP 1.0 servers.
2014-04-27 10:49:23 +02:00
Florian Schmaus
2cd7bbadc5 Remove try/catch in startTLSReceived
as exceptions are catched further up the call stack.
2014-04-26 19:19:29 +02:00
Florian Schmaus
08cec251c7 Add missing HOXT entry in toc.html 2014-04-26 19:19:29 +02:00
Florian Schmaus
6e08a10186 Move Packet 'properties' from core to extensions
Code for Jive's packet properties should not be in 'core'. Also
de-serializing input from network causes some security implications, it
is therefore disabled as default.
2014-04-26 19:13:27 +02:00
Florian Schmaus
c2b214f8d8 Remove reply timeout from RemoteCommand
it was unused because of the value from nextResultOrThrow() was used
anyways (which uses the default of the connection instance).
2014-04-23 10:08:54 +02:00
Florian Schmaus
f5276a78c2 Fix javadoc of useCompression()
smackx.jar no longer need to be in the classpath in order to use
compression.
2014-04-23 10:08:54 +02:00
Florian Schmaus
069e7d7e60 Use connection specific reply timeout value
instead of the global default one.
2014-04-23 10:08:51 +02:00
Florian Schmaus
439f4cd291 Use volatile instead of synchronized
in LastActivityManager.
2014-04-23 09:43:48 +02:00
Florian Schmaus
0996a44a61 Replace sync block with sync method
in XMPPTCPConnection.
2014-04-23 09:43:22 +02:00
Florian Schmaus
5b8fd51345 Replace printStackTrace() with call to Logger 2014-04-23 09:37:16 +02:00
Florian Schmaus
cf6076ce43 Remove unnecessary try/catch blocks in DirectoryRosterStore 2014-04-23 09:31:52 +02:00
Florian Schmaus
4e43292f1d Don't overwrite SSLSocket settings
SoTimeout defaults to 0 anyways, and keep alive should be
enabled/disabled on the underlying socket.
2014-04-22 22:50:17 +02:00
Florian Schmaus
e2bca403e0 Improve proceedTLSReceived() documentation 2014-04-22 22:45:20 +02:00
Florian Schmaus
3de8af6865 callConnectionAuthenticatedListener() should call authenticated()
not connected().
2014-04-22 21:36:05 +02:00
Florian Schmaus
865168688d Fix PrivateDataManager getInstanceFor() always returns null 2014-04-22 21:36:05 +02:00
Florian Schmaus
075308a7cd Fix typo in Roster.java: s/iss/is/ 2014-04-22 21:36:05 +02:00
Florian Schmaus
b4c338b6e5 Smack 4.0.0-rc2-SNAPSHOT 2014-04-22 21:35:54 +02:00
Florian Schmaus
9e79fa4d12 Smack 4.0.0-rc1 2014-04-17 13:47:19 +02:00
Florian Schmaus
02d73f723f Change keyringfile example to real file
I'm always using the file and forget to s/foo/flo/
2014-04-17 13:47:19 +02:00
Florian Schmaus
4483e2bbd0 Make gradle use the local maven cache 2014-04-17 13:43:36 +02:00
Florian Schmaus
649f7af276 Move gradle signing code out of allprojects
because it caused asking for the key passphrase multiple times, i.e. for
every subproject.
2014-04-17 12:53:39 +02:00
Florian Schmaus
bd5ceded37 Provide a MUC method to create *or* join a room
MulitUserChat.create() will throw an SmackException if the MUC service
does not return a 201 status when entering a room. Some MUC
implementations don't return the 201 status but instead behave like
the room already existed.

If the user doesn't care about the room beeing locked until the
initial configuration has been send, he can now use the new
MutliUserChat.createOrJoin(String) method.

Also remove some duplicate code by creating the private enter() method.

Fixes SMACK-557
2014-04-17 12:14:35 +02:00
Florian Schmaus
8ba0715cc3 Bump jbosh to 0.8.0 2014-04-17 12:13:56 +02:00
Florian Schmaus
b4eb8ad182 Javadoc fixes
- Add hint to reconnection configuration
- s/connection.getChatManager/ChatManager.getInstanceFor(connection)
- typos
2014-04-15 11:31:47 +02:00
Florian Schmaus
0136c3eb81 Return List instead of Collection where appropriate 2014-04-14 14:09:53 +02:00
Florian Schmaus
61fd3c9dd0 Add FromMode regarding 'from' attribute of outgoing stanzas
XMPP Servers should ignore the 'from' attribute of outgoing
stanzas. Makes the behavior how Smack populates the 'from' attribute of
outgoing stanzas configurable. Fixes SMACK-547
2014-04-14 11:01:26 +02:00
Florian Schmaus
c3cb98a116 Make ConnectionConfugration getters public
No need to keep them package-private. SMACK-556
2014-04-10 21:12:12 +02:00
Florian Schmaus
4cff008708 Return Collections (or sublcasses) instead of Iterators
This allows us to exploid Java 8 streams and Java 5 for-each
loops. The returned Collections are usually unmodifiable. We decided
against returning Iterable because this would mean determining the
size in O(n) compared to Collection.size() which is often faster
(e.g. O(1)).
2014-04-09 20:03:10 +02:00
Florian Schmaus
6ea1d65e73 Remove star imports in VCardProvider 2014-04-09 20:03:10 +02:00
Florian Schmaus
f33b9f08d4 VCardProvider should treat tel code element optional
SMACK-555
2014-04-09 20:03:10 +02:00
Georg Lukas
ab70cfec24 Refactoring: All connection classes begin with XMPP now
This commit renames classes as follows:
 * TCPConnection --> XMPPTCPConnection
 * BOSHConnection --> XMPPBOSHConnection

There are two reasons for this rename. First, it is there to indicate
that the classes actually _are_ XMPP connections, using different
transport mechanisms. Second, it makes auto-completion in IDEs easier,
the developer can type XMPP<complete> and choose the right backend.
2014-04-09 20:03:07 +02:00
Florian Schmaus
c86d6e3b61 Update README.md's ChatManager example to new API 2014-04-08 18:26:47 +02:00
XiaoweiYan
afa4ce5773 Fix not-well-format packet exception when set property for packet 2014-04-08 12:04:56 +02:00
Florian Schmaus
5832236578 Cleanup SASLErrorException
Reuse the constructor and append only the SASLError String to the
Exceptions message (previously the full SASLError stanza was printed).
2014-04-05 18:42:32 +02:00
Florian Schmaus
0c29fdb769 Use WeakHashMap in BookmarkManager and PrivateDataManager
Also remove the "other user" constructor fo PrivateDataManager, as
this feature is not specified by XEP-49.

Fixes SMACK-554
2014-04-04 11:55:06 +02:00