1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-18 02:02:04 +01:00
No description
Find a file
Florian Schmaus 525ee09ea1 [tcp] Do not send SM ack after we send a </stream:stream>
Do net put an ack to the queue if it has already been shutdown. Some
servers, like ejabberd, like to request an ack even after we have send
a stream close (and hance the queue was shutdown). If we would not
check here, then the ack would dangle around in the queue, and be send
on the next re-connection attempt even before the stream open.

See the following trace of the MUC bookmarks integration test. The
fact that it is a MUC test does not matter, but this test does
disconnect the connection and reconnect it. Not how the server,
ejabberd in this case, requests an SM ack by sending an <r/> even
though we already send the </stream:stream>:

22:22:05 SENT (4):
<iq id='MD4UC-61' type='set'>
  <query xmlns='jabber:iq:private'>
    <storage xmlns='storage:bookmarks'>
      <conference name='Smack Inttest: 7in7j' autojoin='true' jid='y9jcn5@conference.salem.geekplace.eu'>
        <nick>
          Nick-P2VXD7
        </nick>
      </conference>
    </storage>
  </query>
</iq>
22:22:05 RECV (4):
<r xmlns='urn:xmpp:sm:3'/>
22:22:05 SENT (4):
<a xmlns='urn:xmpp:sm:3' h='29'/>
22:22:05 RECV (4):
<message to='sinttest-7in7j-4@salem.geekplace.eu' from='sinttest-7in7j-4@salem.geekplace.eu' type='headline'>
  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='storage:bookmarks'>
      <item id='current'>
        <storage xmlns='storage:bookmarks'>
          <conference name='Smack Inttest: 7in7j' autojoin='true' jid='y9jcn5@conference.salem.geekplace.eu'>
            <nick>
              Nick-P2VXD7
            </nick>
          </conference>
        </storage>
      </item>
    </items>
  </event>
  <addresses xmlns='http://jabber.org/protocol/address'>
    <address jid='sinttest-7in7j-4@salem.geekplace.eu/1415073683806426185213090' type='replyto'/>
  </addresses>
</message>
22:22:05 RECV (4):
<iq xml:lang='en-US' to='sinttest-7in7j-4@salem.geekplace.eu/1415073683806426185213090' from='sinttest-7in7j-4@salem.geekplace.eu' type='result' id='MD4UC-61'/>
22:22:05 SENT (4):
<presence id='6MS6J-20' type='unavailable'/>
<a xmlns='urn:xmpp:sm:3' h='31'/>
<!-- We have closed the stream -->
</stream:stream>
<!-- But the server still requests an SM ack -->
22:22:05 RECV (4):
<r xmlns='urn:xmpp:sm:3'/>
22:22:05 RECV (4):
</stream:stream>
22:22:05 XMPPConnection closed (XMPPTCPConnection[sinttest-7in7j-4@salem.geekplace.eu/1415073683806426185213090] (4))
22:22:05 SENT (4):
<a xmlns='urn:xmpp:sm:3' h='31'/>
22:22:05 SENT (4):
<stream:stream xmlns='jabber:client' to='salem.geekplace.eu' xmlns:stream='http://etherx.jabber.org/streams' version='1.0' from='sinttest-7in7j-4@salem.geekplace.eu' xml:lang='en-US'>
22:22:05 RECV (4): ?xml version='1.0'?>
<stream:stream id='3379123514446782311' ver
22:22:05 RECV (4): sion='1.0' xml:lang='en' xmlns:stream='http://etherx.jabber.org/streams' xmlns='jabber:client'>
<stream:error>
  <invalid-xml xmlns='urn:ietf:params:xml:ns:xmpp-streams'/>
</stream:error>
</stream:stream>
22:22:05 XMPPConnection closed due to an exception (XMPPTCPConnection[sinttest-7in7j-4@salem.geekplace.eu/1415073683806426185213090] (4))
org.jivesoftware.smack.XMPPException$StreamErrorException: invalid-xml You can read more about the meaning of this stream error at http://xmpp.org/rfcs/rfc6120.html#streams-error-conditions
<stream:error><invalid-xml xmlns='urn:ietf:params:xml:ns:xmpp-streams'/></stream:error>
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.parsePackets(XMPPTCPConnection.java:981)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader.access$700(XMPPTCPConnection.java:913)
	at org.jivesoftware.smack.tcp.XMPPTCPConnection$PacketReader$1.run(XMPPTCPConnection.java:936)
	at java.base/java.lang.Thread.run(Thread.java:834)
2020-09-18 14:36:26 +02:00
.github Add Github Pull Request Template 2019-03-20 20:05:43 +01:00
config [checkstyle] Bump to 8.27 2020-05-23 23:36:58 +02:00
documentation Add support for XEP-0420: Stanza Content Encryption 2020-07-23 11:02:28 +02:00
resources fix-a-javadoc.sh: add FailedNonzaException 2020-04-04 13:03:36 +02:00
smack-android gradle: use compileClasspath instead of compileOnly 2020-03-07 20:13:05 +01:00
smack-android-extensions gradle: add Android jar to smack-android-extensions compile classpath 2020-03-07 20:13:05 +01:00
smack-bosh Introduce Smack's Modular Connection Architecture 2020-04-04 13:03:31 +02:00
smack-core [tcp] Do not send SM ack after we send a </stream:stream> 2020-09-18 14:36:26 +02:00
smack-debug [core] Deprecate AbstractConnectionListener 2020-05-13 22:14:43 +02:00
smack-debug-slf4j [core] Deprecate AbstractConnectionListener 2020-05-13 22:14:43 +02:00
smack-experimental Introduce and use XmlStringBuilder.text() 2020-09-17 14:20:11 +02:00
smack-extensions Merge pull request #412 from Flowdalic/data-form-type-annotations 2020-07-23 17:24:48 +02:00
smack-im Delete TypedCloneable 2020-06-14 17:38:51 +02:00
smack-integration-test Add SimpleXmppConnectionIntegrationTest 2020-07-22 16:35:56 +05:30
smack-java7 smack-java7: Add missing smack-xmlparser-stax dependency 2019-09-23 16:12:48 +02:00
smack-java8-full Remove smack-java8-full dependency on smack-omemo-signal 2020-06-16 13:58:27 +02:00
smack-jingle-old Introduce test fixtures 2020-04-11 22:05:36 +02:00
smack-legacy Re-work data form API 2020-05-13 20:14:41 +02:00
smack-omemo [extensions] Deprecate old-style PepManager PEP listeners 2020-05-25 20:32:47 +02:00
smack-omemo-signal [checkstyle] Tighten JavadocMethod checkstyle rule 2020-05-23 22:43:29 +02:00
smack-omemo-signal-integration-test SmackReactor/NIO, Java8/Android19, Pretty print XML, FSM connections 2019-02-05 13:18:03 +01:00
smack-openpgp Bump pgpainless version to 0.1.0 2020-08-30 23:08:26 +02:00
smack-repl Remove smack-java8-full dependency on smack-omemo-signal 2020-06-16 13:58:27 +02:00
smack-resolver-dnsjava resolver-dnsjava: bump to dnsjava 3.0 series 2020-04-12 22:21:30 +02:00
smack-resolver-javax Introduce Smack's Modular Connection Architecture 2020-04-04 13:03:31 +02:00
smack-resolver-minidns Introduce Smack's Modular Connection Architecture 2020-04-04 13:03:31 +02:00
smack-resolver-minidns-dox Introduce test fixtures 2020-04-11 22:05:36 +02:00
smack-sasl-javax Introduce test fixtures 2020-04-11 22:05:36 +02:00
smack-sasl-provided Introduce test fixtures 2020-04-11 22:05:36 +02:00
smack-streammanagement Create smack-streammanagement project and move o.j.smack.sm code there 2020-08-15 14:03:57 +02:00
smack-tcp [tcp] Do not send SM ack after we send a </stream:stream> 2020-09-18 14:36:26 +02:00
smack-xmlparser smack-xmlparser: Improve ISE message 2019-09-23 16:12:48 +02:00
smack-xmlparser-stax Introduce test fixtures 2020-04-11 22:05:36 +02:00
smack-xmlparser-xpp3 Introduce test fixtures 2020-04-11 22:05:36 +02:00
.gitignore Add local.properties to gitignore 2019-06-30 16:00:31 +02:00
.travis.yml [travis] Only run javadocAll on Java 11 or higher 2020-05-25 11:14:47 +02:00
build.gradle [build] Use ranged version [1.0.0, 1.0.999] for jXMPP and MiniDNS 2020-08-06 15:19:42 +02:00
LICENSE Add Appendix to LICENSE 2017-04-24 15:12:27 +02:00
README.md update Travis-CI badge on README.md 2020-04-11 10:36:58 -05:00
repl Bump Ammonite REPL to 1.3.2 2018-10-27 15:41:17 +02:00
settings.gradle Create smack-streammanagement project and move o.j.smack.sm code there 2020-08-15 14:03:57 +02:00
version Smack 4.4.0-beta2-SNAPSHOT 2020-08-07 22:06:32 +02:00

Smack

Build Status Coverage Status Project Stats Link to XMPP chat smack@conference.igniterealtime.org

About

Smack is an open source, highly modular, easy to use, XMPP client library written in Java for Java SE compatible JVMs and Android.

A pure Java library, it can be embedded into your applications to create anything from a full XMPP instant messaging client to simple XMPP integrations such as sending notification messages and presence-enabling devices. Smack and XMPP allows you to easily exchange data, in various ways e.g. fire-and-forget, publish-subscribe, between human and non-human endpoints (M2M, IoT, …).

More information are provided by the Overview.

Getting started

Start with having a look at the Documentation and the Javadoc.

Instructions on how to use Smack in your Java or Android project are provided in the Smack Readme and Upgrade Guide.

Professional Services

Smack is a collaborative effort of many open source, professionally and spare-time, paid and unpaid, contributors. While we try to provide the best possible XMPP library for Android and Java SE compatible execution environments by following state of the art software engineering practices, the API may not always perfectly fit your requirements. We welcome contributions and encourage discussion about how Smack can be further improved. We also provide paid services ranging from XMPP/Smack related consulting to designing and developing features in order to accommodate your needs. Please contact Florian Schmaus for further information.

Bug Reporting

Only a few users have access for filling bugs in the tracker. New users should:

  1. Read "How to ask for help or report an issue"
  2. Create a discourse account (you can also sign up with your Google account).
  3. Login to the forum account
  4. Press "New Topic" in your toolbar and choose the 'Smack Support' sub-category.

Please search for your issues in the bug tracker before reporting.

Donate

If you find Smack useful and feel like donating, then you can use one of the following systems:

  • Donate via Bitcoin: 1LiU78z3498wu3jwRPKbvovKAHjTcpVbuK

Contact

The developers hang around in #smack (freenode, IRC) and open_chat@conference.igniterealtime.org (XMPP MUC room). Remember that it may take some time (~hours) to get a response.

You can also reach us via the Smack Support Forum if you have questions or need support, or the Smack Developers Forum if you want to discuss Smack development.

Contributing

If you want to start developing for Smack and eventually contribute code back, then please have a look at the Guidelines for Smack Developers and Contributors. The guidelines also contain development quickstart instructions.

Resources

Ignite Realtime

Ignite Realtime is an Open Source community composed of end-users and developers around the world who are interested in applying innovative, open-standards-based RealTime Collaboration to their businesses and organizations. We're aimed at disrupting proprietary, non-open standards-based systems and invite you to participate in what's already one of the biggest and most active Open Source communities.

Smack - an Ignite Realtime community project.