1. 26 Apr, 2017 1 commit
    • Guus der Kinderen's avatar
      Replace dangling javadoc with block comment. · 65f1f7f1
      Guus der Kinderen authored
      Javadoc comment are dangling if they don't belong to any class, method or field. For example a Javadoc comment in between method declarations that have their own javadoc comments.
      
      These generate needless warnings, which are in most instances easily solved. By far most problems occur in the license block that's in most files.
      65f1f7f1
  2. 04 Jan, 2017 1 commit
  3. 18 Mar, 2016 1 commit
    • akrherz's avatar
      OF-929 prevent ghosts by removing ioSession check · e5182f23
      akrherz authored
      Since the release of Openfire 3.9.3, users have reported problems with
      "ghost" sessions left on the server. After reviewing the changes that
      went into the 3.9.3 release, it seemed the fix for OF-464 may have had
      some side effect causing this.
      
      Since Igniterealtime's Openfire was reproducing OF-829, I did a test
      whereby the functional changes of Igniterealtime/Openfire#ad08cae9
      were reverted.  After 36 hours, there were no ghosts!
      
      This will likely necessitate reopening OF-464.
      e5182f23
  4. 28 Nov, 2015 1 commit
  5. 25 Nov, 2015 6 commits
  6. 21 Nov, 2015 2 commits
    • Christian Schudt's avatar
      Language info should be in the Session, not in the Connection · 170b20cc
      Christian Schudt authored
      I feel the language (the stream's "xml:lang" attribute) should be in the Session interface rather than the Connection (similar as the stream id), because it's unrelated to the session's transport.
      
      The HttpSession already did that.
      
      Otherwise the used language is not easy to retrieve, e.g. when using SessionManager to get the session and OF-208 is hard to solve.
      
      Alternatively we can expose the Connection in the Session interface, but this approach feels wrong to me.
      
      Also use `java.util.Locale` rather than String, because it better reflects what can be in `xml:lang` (it can also have country codes, e.g. "de-CH")
      170b20cc
    • Christian Schudt's avatar
      Simplify/improve NIOConnection.deliver() by removing ByteBufferWriter. · cf6a53ee
      Christian Schudt authored
      For every packet being delivered the `ByteBufferWriter` creates a new String for every few chars written and puts it to the buffer.
      
      According to my tests it is more efficient to create only one string and put it into the buffer once.
      (10-20% better performance)
      cf6a53ee
  7. 16 Nov, 2015 1 commit
    • Tom Evans's avatar
      OF-881: Apply review feedback · aa7a5ef6
      Tom Evans authored
      - Use AtomicReference instead of synchronized block
      - Extend java.io.Closeable; document contract
      - Consolidate close/state transition logic
      aa7a5ef6
  8. 13 Nov, 2015 1 commit
  9. 09 Nov, 2015 1 commit
  10. 29 Oct, 2015 1 commit
  11. 13 Oct, 2015 1 commit
  12. 28 Jul, 2015 1 commit
    • Tom Evans's avatar
      OF-903: Simplify backup packet delivery · 477aee88
      Tom Evans authored
      Original issue (OF-857) has been addressed by providing an alternate
      packet deliverer (to offline storage). This additional logic was an
      ill-advised "belt-and-suspenders" attempt to prevent the recursion which
      was occurring before the backup deliverer was implemented.
      477aee88
  13. 08 Jul, 2015 1 commit
    • Dave Cridland's avatar
      Do not synchronize on isClosed() · 51b22088
      Dave Cridland authored
      There is a deadlock while reading the state variable if close() is running.
      
      This switches the state to be volatile instead - it's only written to inside
      the lengthy close() lock, so this should be reasonable.
      51b22088
  14. 10 Jun, 2015 2 commits
  15. 29 May, 2015 3 commits
    • Guus der Kinderen's avatar
      OF-883: Prevent sending data to known disconnected peers. · 0d75703d
      Guus der Kinderen authored
      By closing a session when the new MINA inputClosed() handler is triggered, we run
      the risk of sending data to the peer. As that peer is known to be dead, this is
      pointless (and potentially dangerous - deadlocks have been observed that are likely
      related to this scenario).
      
      To prevent sending data during session closure, the close() method has been
      overloaded with an argument that indicates if the peer is known to be dead. When
      set, its implementation will not attempt to send data.
      0d75703d
    • Guus der Kinderen's avatar
      OF-883 & OF-881: Avoid potential deadlock with close listeners. · 1b2dd66e
      Guus der Kinderen authored
      The close listeners should not be called from within a synchronized block.
      1b2dd66e
    • Guus der Kinderen's avatar
      OF-883: Prevent multiple closes of the same connection. · c51067b8
      Guus der Kinderen authored
      When a connection is closed, several events can be involved (and can be triggered).
      Some of these events will attempt to close the connection (if it hadn't been already).
      This, at best, least to multiple invocations of close-listeners. At worst, a loop of
      close-calls is created.
      
      This commit replaces the two-way boolean that guards closure (isClosed) with a
      three-way guard. Now, a distinction is made between between a connection that is
      closed, and one that is closing.
      
      Additionally, some null pointer guards have been added, as I've seen those pop up in
      my local logs during development.
      c51067b8
  16. 28 May, 2015 1 commit
    • Guus der Kinderen's avatar
      OF-883: Compensate for new half-duplex close of TCP channel in MINA · be6ee20f
      Guus der Kinderen authored
      MINA 2.0.8 introduces support for half-duplex close of TCP channels (see DIRMINA-785).
      As part of this change, IoHandlers got a new method. The default behavior of the
      IoHandlerAdapter closes the MINA session when this handler is triggered. However,
      without an Openfire-specific extension (in ConnectionHandler), this fails to close
      Openfire-maintained resources. As a result, CPUs could start to spin in NIO code,
      resulting in 100% CPU cycles.
      
      To fix this issue, ConnectionHandler now overrides the default functionality and
      triggers a normal closure of the session (both in Openfire as well as MINA context).
      
      Additionally, to prevent the CPU spin, MINA sessions need to be closed synchronously
      (as opposed to the async closure Openfire had up until now). I cannot quite explain
      the need for this change, other than a suspision of race conditions in the async
      setup.
      be6ee20f
  17. 26 May, 2015 2 commits
  18. 01 May, 2015 1 commit
  19. 14 Feb, 2015 1 commit
  20. 13 Jan, 2015 2 commits
    • Tom Evans's avatar
      OF-857: Added offline packet deliverer · 9205a2f1
      Tom Evans authored
      When a connection is closed, any further packets to be delivered need to
      be handled by the "backup" packet deliverer. The original implementation
      simply tried to reuse the primary delivery/routing mechanism, which
      resulted in a recursive call. This has been replaced with a packet
      deliverer that will route undeliverable message packets into the offline
      store.
      9205a2f1
    • Tom Evans's avatar
      OF-857: Mark connection closed before notifying · 4c4949eb
      Tom Evans authored
      The connection close listener initiates a presence broadcast to
      advertise its "unavailable" status. The current connection must be
      marked closed before this occurs, so the presence stanza will not be
      delivered to the newly closed connection.
      
      Note that the synchronized block alone does not accomplish this because
      the presence broadcast is delivered via that same thread that is
      currently closing the connection, thus it already possesses the sync
      object lock.
      
      Also, note that the SessionManager should exclude the originating JID
      when sending presence broadcasts to the user's other available
      session(s).
      4c4949eb
  21. 12 Jan, 2015 1 commit
    • Tom Evans's avatar
      OF-857: Synchronize connection/session cleanup · 348d5bdc
      Tom Evans authored
      This patch is to prevent a stack overflow in certain exception cases
      where a connection has been closed, but its corresponding session is
      still present in the routing table.
      348d5bdc
  22. 11 Jan, 2015 2 commits
  23. 17 Dec, 2014 1 commit
  24. 09 Dec, 2014 1 commit
  25. 07 Aug, 2014 1 commit
    • jackrabbit128's avatar
      Fix for OF-835: · 18fffdac
      jackrabbit128 authored
      - install ReadThrottleFilterBuilder into filter chains
      - adjust SSLFilter positioning in chain so that ReadThrottleFilter works correctly
      18fffdac
  26. 31 May, 2014 1 commit
  27. 26 Apr, 2014 1 commit
  28. 19 Feb, 2012 1 commit