aboutsummaryrefslogtreecommitdiff
path: root/src/mod_stream_mgmt.erl (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-11-07Add details about XEP implementations to some protocol attributesBadlop1-1/+1
2022-02-11Update copyright year to 2022Badlop1-1/+1
2022-01-24Fix typosKian-Meng Ang1-1/+1
2021-09-14Update documentation to match the implemented options values (#3675)Badlop1-1/+3
2021-08-23Use specific syntax so modules and top-level will be linksBadlop1-3/+3
If we use _`whatever`_ here in ejabberd man pages, it is converted to *`whatever`* in markdown, and docs.ejabberd.im/Makefile converts to the proper links
2021-01-27Update newest copyright year to 2021 (#3464)Badlop1-1/+1
2020-09-03Use include_lib() to include headers from dependencies (#3369)Stu Tomlinson1-2/+2
2020-06-01mod_stream_mgmt: Don't kill new PID on resumptionHolger Weiss1-35/+51
During XEP-0198 resumption, the ejabberd_c2s process that handles the new connection reopens the ejabberd_sm session of the old one. Since commit b4770815c0b0416c21d01507d2908f94c25b3097, the new process adds the new session table entry before the old process removes the old one. While adding the new one, ejabberd_sm checks for old sessions to replace. This check assumes old SIDs compare lower than new ones. This assumption didn't necessarily hold for the session resumption case, where the old SID's timestamp was copied over to the new SID and only the PID was updated. Therefore, the new process was killed if the new PID happened to be smaller than the old one. Fix this by having mod_stream_mgmt use its own SM-ID rather than copying over the old SID's timestamp to the new SID. Thanks to Thilo Molitor and Friedrich Altheide for reporting the issue, and to Thomas Leister for his help with debugging it.
2020-04-16Resending unacked stanzas should send even archived msgs if mod_offline is ↵Paweł Chmielowski1-14/+16
enabled Messages that are received when no c2s is active will be stored in offline, even when mam archived them, so i don't think we should be doing something different in this case.
2020-04-07Make resumed sessions try to deliver possibly queued messages to new sessionPaweł Chmielowski1-2/+17
Between receiving resume request and being closed by new session, it's possible (even if not very likely) that new messages would arrive to process that is resumed. In that case try to reroute messages that were received after we sent resume reply to new process.
2020-04-01Fix potential message loss in terminating c2s sessionsPaweł Chmielowski1-6/+9
Calling sync version of xmpp_stream_in/out:stop could lead to messages never being processed by c2s process if they were queued in p1_server. This could be reproduced by when having messages in offline storage, starting sessions, enabling stream_mgmt, sending initial presence, and then immediately </stream:stream>, messages that mod_offline would send process would not be bounced back by stream_mgmt.
2020-01-28Update copyright to 2020 (#3149)Badlop1-1/+1
2020-01-14mod_stream_mgmt: Don't crash on disabled ACK timerHolger Weiss1-5/+11
Don't attempt to start an ACK timer if 'ack_timeout' is set to 'infinity'. Thanks to Ingo Jürgensmann for reporting the bug.
2020-01-08Generate ejabberd.yml.5 man page from source code directlyEvgeny Khramtsov1-0/+80
Several documentation callbacks (doc/0 and mod_doc/0) are implemented and `ejabberdctl man` command is added to generate a man page. Note that the command requires a2x to be installed (which is a part of asciidoc package).
2019-09-23Correctly handle unicode in log messagesEvgeny Khramtsov1-18/+18
2019-08-08Don't use close/2: set stop_reason explicitlyEvgeny Khramtsov1-2/+3
Fixes #2984
2019-08-06Report connection error before waiting for resumptionEvgeny Khramtsov1-11/+22
In other words don't hide the reason why c2s connection has failed
2019-07-30Also catch 'shutdown' exit reasonEvgeny Khramtsov1-0/+2
2019-07-30Improve pattern matchingEvgeny Khramtsov1-1/+1
2019-07-30Fix race condition when deleting c2s session recordEvgeny Khramtsov1-1/+2
2019-07-30Fix previous commitEvgeny Khramtsov1-2/+2
2019-07-30Correctly report resume timeoutEvgeny Khramtsov1-2/+3
2019-07-25Fix default value of resume_timeoutEvgeny Khramtsov1-1/+1
2019-07-23mod_stream_mgmt: Allow flexible timeout formatHolger Weiss1-5/+8
Adjust mod_stream_mgmt and the related code in mod_push_keepalive to support the flexible timeout format.
2019-07-08Ignore late arrival of an already cancelled timerEvgeny Khramtsov1-0/+6
2019-07-01Avoid last handled stanzas cache to grow indefinitelyEvgeny Khramtsov1-3/+7
2019-06-28Avoid using broad p1_queue:queue() type wherever possibleEvgeny Khramtsov1-1/+2
2019-06-27Fix type specsEvgeny Khramtsov1-1/+1
2019-06-26Make sure queue bouncing doesn't yield into infinite recursionEvgeny Khramtsov1-11/+2
2019-06-25Use proper loglevel to log resumption failuresEvgeny Khramtsov1-16/+47
2019-06-25Don't propagate downstream already handled messageEvgeny Khramtsov1-1/+1
2019-06-24Make logging messages more consistentEvgeny Khramtsov1-1/+1
2019-06-22Improve extraction of translated stringsEvgeny Khramtsov1-17/+18
Now every such string MUST be encapsulated into ?T() macro. The macro itself is defined in include/translate.hrl. Example: -module(foo). -export([bar/1]). -include("translate.hrl"). bar(Lang) -> translate:translate(Lang, ?T("baz")).
2019-06-15Get rid of "well-known" typeEvgeny Khramtsov1-2/+2
2019-06-14Use new configuration validatorEvgeny Khramtsov1-54/+20
2019-05-29mod_stream_mgmt: Drop unused codeHolger Weiss1-25/+13
Revert the changes applied to mod_stream_mgmt in commit b76f90fe396ee7a1ed5c5f7006431879929fc2a1, as the new implementation of mod_offline's 'use_mam_for_storage' feature doesn't need them.
2019-04-26Add mod_offline option for fetching data from mam instead of from spool tablePaweł Chmielowski1-13/+25
This commit introduces `use_mam_for_storage` option that take boolean argument. Enabling it will make mod_offline not use spool table for storing offline message, but instead will use mam archive to retrieve messages stored when offline. Enabling this option have couple drawback currently, only messages that were stored in mam will be available, most of flexible message retrieval queries don't work (those that allow retrieval/deletion of messages by id).
2019-02-27Replace code using p1_time_compat wrapper with native functionsPaweł Chmielowski1-1/+1
Since we now require R19, we shouldn't need that anymore. There are still couple places where p1_time_compat:unique_timestamp() is used as there is no direct equivalent.
2019-01-08Update copyright to 2019 (#2756)Badlop1-1/+1
2018-11-30Apply new cache options on mod_stream_mgmt reloadEvgeny Khramtsov1-1/+2
2018-11-30Keep last handled stanzas number in cache rather than session tableEvgeny Khramtsov1-26/+49
2018-10-25Move some functions from xmpp back into ejabberdHolger Weiss1-1/+1
2018-09-19Switch more log message to warning levelEvgeny Khramtsov1-2/+2
The commit is supposed to improve logging at loglevel 3, which is the recommended level for high loaded ejabberd servers
2018-07-17Move cancel_timer/1 function into 'misc' moduleHolger Weiss1-13/+2
2018-07-10mod_stream_mgmt: Remove dead case clausesHolger Weiss1-6/+0
2018-07-10mod_stream_mgmt: Add descriptive text to errorsHolger Weiss1-2/+7
Closes #2485.
2018-07-01Don't crash on most common gen_server:call errorsEvgeniy Khramtsov1-0/+2
2018-06-25Don't use 'unsupported-version' inside SM <failed/> elementEvgeniy Khramtsov1-4/+9
This error condition is defined within stream errors, however, XEP-0198 says: > This element SHOULD contain an error condition, which MUST > be one of the **stanza** error conditions defined in RFC 6120.
2018-06-14Get rid of ejabberd.hrl headerEvgeniy Khramtsov1-1/+0
The header consisted of too many unrelated stuff and macros misuse. Some stuff is moved into scram.hrl and type_compat.hrl. All macros have been replaced with the corresponding function calls. TODO: probably type_compat.hrl is not even needed anymore since we support only Erlang >= OTP 17.5
2018-04-17mod_push_keepalive: Reset timeout on messages onlyHolger Weiss1-3/+18
Some mobile apps might only be notified on actual chat messages with a body, so don't let mod_push_keepalive reset the stream management timeout on other types of traffic.