Commit Graph

384 Commits

Author SHA1 Message Date
Holger Weiss 30e814dd4b XEP-0198: Add 'h' attribute to <failed/> element
If a resume request is rejected because the session timed out, indicate
the number of handled stanzas as per version 1.5 of XEP-0198.
2016-05-24 22:20:58 +02:00
Holger Weiss ba74c1c367 Move CSI queue handling into mod_client_state
Let mod_client_state handle the queueing of stanzas, not just their
classification.  This simplifies the ejabberd_c2s code and gives
(custom) CSI modules more flexibility.
2016-05-17 19:27:18 +02:00
Evgeniy Khramtsov be2a9e35ae Fix C2S session data leak (#1078) 2016-05-09 14:18:47 +03:00
Holger Weiss ff4a0e1808 XEP-0198: Use different error message for bounces
When stanzas are bounced from the stream management queue (because the
session timed out or was closed for some other reason), use a different
error message so that this situation can be distinguished from other
cases.
2016-05-06 14:12:22 +02:00
Holger Weiss 36164d9446 Return error when blocking last activity request
As per XEP-0016 and XEP-0191, return a service-unavailable error when an
incoming last activity query was blocked by a privacy list (just as we
do for other IQ requests).
2016-04-25 09:33:47 +02:00
Holger Weiss 58478e52bf Don't omit bounces for messages of type "result" 2016-04-24 22:47:53 +02:00
Paweł Chmielowski 86dfbe6ece Make sure that ejabberd_sm sid are unique 2016-04-08 10:52:29 +02:00
Evgeniy Khramtsov b83ec483e9 Send stream trailer at the very end 2016-04-08 11:49:50 +03:00
Evgeniy Khramtsov fced8dc3d9 Replace some ?ERR_* macros with ?ERRT_* 2016-03-31 11:00:29 +03:00
Evgeniy Khramtsov 46568fb959 Merge commit 'refs/pull/524/head' of github.com:processone/ejabberd into sasl-api-change 2016-03-25 18:16:50 +03:00
Paweł Chmielowski ef02053a9d Fix issue #1015 2016-03-17 18:41:39 +01:00
Paweł Chmielowski efbaba5d04 Make auto generated resources shorter 2016-03-16 11:30:45 +01:00
Balázs Galambosi 83accedded fix syntax highlighting by keeping "~s" together 2016-03-07 16:06:18 +01:00
Holger Weiss 5b4aefbacd Accept stream compression request after SASL
This is an updated version of the patch submitted to EJAB-1382 by
Alexey (thanks!).
2016-02-19 18:53:28 +01:00
Evgeniy Khramtsov 4839ba5ae4 XEP-0013: Flexible Offline Message Retrieval support 2016-02-09 17:59:54 +03:00
Holger Weiss a31f59ea31 XEP-0198: Fix session timeout corner case
If the "resend_on_timeout" option is set to 'if_offline' and a pending
stream management session is terminated because a new session is opened
by the same resource (while no other resource is online), resend
unacknowledged messages rather than bouncing error messages.
2016-02-06 22:28:55 +01:00
Pablo Polvorin 942072cf9d Make hibernate timeouts configurable
Two *global* options added:
c2s_hibernate and receiver_hibernate.

Default if not specified is 90000, the previous hardcoded value.
2016-02-04 15:45:29 -03:00
Mickael Remond dfc29ea03c Switch to Fast XML module 2016-02-03 19:03:17 +01:00
Mickael Remond 71ee0d56fa Switch to fast_tls and update app names 2016-02-03 16:13:16 +01:00
Alexey Shchepin a150bf8fdc Make C2S session establishment optional (ECS-11) 2016-01-18 16:33:57 +03:00
Holger Weiss ddaa409ee2 XEP-0198: Let MAM take care of pending messages
If a stream management session times out for a user who appears to be
using MAM, drop any unacknowledged messages rather than resending or
bouncing them.  This avoids duplicates or bogus error messages.

However, this is only done if the new mod_mam option "assume_mam_usage"
is set to 'if_enabled' or 'on_request'.  In the former case, a user is
assumed to be using MAM if archiving is enabled for his account.  In the
latter case, MAM usage is assumed only if archiving was explicitly
requested by the client, or if archiving was enabled by means of
mod_mam's "request_activates_archiving" option.
2016-01-15 01:08:22 +01:00
Badlop f448ff608a Update copyright to 2016 (#901) 2016-01-13 12:29:14 +01:00
Holger Wei 64d96778b4 Don't return error for blocked MUC messages
If a message stanza is blocked as per XEP-0016 or XEP-0191, return an
error only if the type of the blocked message is "normal" or "chat".
This makes sure users won't be kicked from MUC rooms when blocking other
participants.

Closes #897.
2016-01-12 10:20:35 +01:00
Paweł Chmielowski 29db302808 More now() replacements 2015-12-07 16:09:48 +01:00
Holger Weiss ba916c3162 XEP-0198: Fix stanza counting corner case issue
Don't forget to count outgoing stanzas that are processed while the
ejabberd_c2s process is already waiting for stream resumption.
2015-12-02 19:25:10 +01:00
Evgeniy Khramtsov 95265dd3ad Move JID related functions to jid.erl (#847) 2015-11-24 18:44:13 +03:00
Christophe Romain 341be9b682 Remove supervisor option, disable it for c2s and muc 2015-11-04 16:24:35 +01:00
Holger Weiss 5e467b96a1 ejabberd_c2s: Let stop/1 close XEP-0198 sessions
The stop/1 function now terminates stream management sessions
immediately, just as it does for other sessions.  The new
ejabberd_c2s:close/1 function can be used to close the socket without
terminating the stream management session, like stop/1 did before.
2015-10-17 23:15:31 +02:00
Holger Weiss 53bd0ee818 ejabberd_c2s: Close socket when waiting for resume
Make sure the socket is closed when mod_ping calls ejabberd_c2s:stop/1
for an XEP-0198 session.
2015-10-17 22:07:29 +02:00
Christophe Romain 6aeb9dcb38 cosmetic cleanup 2015-10-07 14:18:38 +02:00
Evgeniy Khramtsov c7750689e8 Fix force_update_presence 2015-10-02 16:06:47 +02:00
Holger Weiss 59321ac56e XEP-0198: Improve handling of non-message stanzas
When an XEP-0198 session times out, always return an error for
unacknowledged IQ stanzas, and always drop presence stanzas.  That is,
the "resend_on_timeout" option no longer applies to those stanzas types,
but only to messages.
2015-09-15 22:42:22 +02:00
Holger Weiss 5095fdb6b0 New XEP-0198 option: "max_resume_timeout"
In the past, the "resume_timeout" option defined both the default resume
timeout and the maximum resume timeout clients are permitted to request.
Admins might want to allow clients to request a timeout value that's
larger than the default, though.  This can now be done by specifying the
"max_resume_timeout" option.
2015-09-03 21:20:15 +02:00
Holger Weiss 1048e21643 XEP-0198: Don't add <delay/> tags to IQ stanzas 2015-07-28 21:00:12 +02:00
Paweł Chmielowski 8df134e025 Don't crash web admin when displaying info about websocket using users 2015-07-22 11:54:11 +02:00
Holger Weiss b7d7dc5201 XEP-0198: Increase timeout during resumption
Give gen_fsm:sync_send_all_state_event/3 a little more time to transfer
the (possibly somewhat large) c2s #state during session resumption.
2015-07-03 11:35:22 +02:00
Holger Weiss 5856f6d06a XEP-0198: Increase default "max_ack_queue" value
During login, clients might receive a relatively large number of stanzas
in one go.  For some users, the default value of the "max_ack_queue"
option turned out to be too small in that situation.
2015-07-03 11:35:22 +02:00
Evgeniy Khramtsov 83cce468a5 Add MAM (XEP-0313) support 2015-06-22 16:56:08 +03:00
Badlop 1cf2dfe63a New hide_sensitive_log_data option to hide client IP in log (#452 #471) 2015-06-17 11:32:42 +02:00
Alexey Shchepin 2110b929bc Merge pull request #581 from weiss/dh-param-file
New options: dhfile and s2s_dhfile
2015-06-16 11:59:06 +03:00
Evgeniy Khramtsov fb6267f38e Add config validation at startup 2015-06-01 15:38:27 +03:00
Evgeniy Khramtsov 48213b09ce Get rid of some fuzzy macros as it makes syntax tools getting mad 2015-06-01 15:19:56 +03:00
Holger Weiss 5585fb1ecf New options: dhfile and s2s_dhfile
Let admins specify a file that contains custom parameters for
Diffie-Hellman key exchange.
2015-05-26 21:06:04 +02:00
Alexey Shchepin b2f98099bb Merge pull request #569 from weiss/send-element-error-checking
Update send_element error checking (EJAB-1739)
2015-05-26 15:59:50 +03:00
Badlop 0c725b5fac Document protocol support (EJABS-1620) 2015-05-21 17:04:05 +02:00
Holger Weiss 6efce7f706 Cosmetic change: Simplify error checking
Let send_stanza_and_ack_req/2 update the #state instead of propagating
the value returned by send_element/2.  This doesn't change the behavior.
2015-05-14 01:04:23 +02:00
Holger Weiss 42c7205739 Don't assume send_element/2 returns ok or error
Let send_text/2 and (therefore) send_element/2 return {error, Reason}
instead of error for consistency, and let send_stanza_and_ack_req/2
interpret any non-ok value as an error.  (EJAB-1739)
2015-05-14 00:58:36 +02:00
Badlop f7d9bb7ce4 Don't announce register feature once user is authenticated (#41) 2015-05-07 11:41:59 +02:00
Ben Langfeld 917d48f30b Use SASL PLAIN authzid as client identity if auth module permits it
This allows the authentication modules to perform SASL proxy authentication. It puts the onus on them to authorize the authcid to masquerade as the authzid. Doesn't currently implement such functionality in existing auth modules, since they cannot currently codify a relationship between the two identities. Does not permit the authzid to use a domain differently from the one of the connection.

Note: digest might not work, but I have no interest in it, being deprecated.
2015-05-06 14:12:15 -03:00
Holger Weiss 94936b261e Add privacy error stanza to XEP-0198 queue 2015-04-20 22:03:18 +02:00