Commit Graph

333 Commits

Author SHA1 Message Date
Paweł Chmielowski ba69c469b5 Remove http_poll module
For couple years browsers did limit ability to change cookies from js
for different domains, this made http_poll connections practically not
usuable. I don't think this module is used at all so it's time to put it
to rest.
2015-04-15 10:47:10 +02:00
Badlop 0cf8d1fa6e Copy multicast code from ejabberd-contrib to provide XEP-0033 (#521) 2015-04-08 14:01:16 +02:00
Holger Weiss 2a94c68724 Don't call send_element/2 if previous call failed
Be sure not to try sending data over a TCP socket that is no longer
usable.
2015-04-06 22:34:48 +02:00
Evgeny Khramtsov 305b281c15 Merge pull request #493 from weiss/rfc-6121-routing
Update ejabberd_sm's routing rules as per RFC 6121
2015-04-01 11:41:05 +03:00
Badlop 176114d28e Try to fix more Dialyzer warnings 2015-03-27 15:55:57 +01:00
Badlop 9c96d30719 Ensure set_presence changes are kept in state (thanks to Davide Colombo)(EJAB-1184) 2015-03-27 15:03:14 +01:00
Badlop 30dc82a98a Fix even more dialyzer warnings 2015-03-27 12:28:24 +01:00
Badlop 8707c0b045 Fix set_presence command (ejabberd-contrib#61) 2015-03-27 11:43:56 +01:00
Holger Weiss f40e6a0421 Don't bother with filtering out PEP error messages
Now that ejabberd_sm won't deliver error messages that were sent to bare
JIDs anymore, PEP error messages should no longer arrive.
2015-03-25 02:02:08 +01:00
Holger Weiss 33c9f21171 Return error when incoming message is blocked
As per XEP-0016 and XEP-0191, return a service-unavailable error when an
incoming message was blocked by a privacy list.  This lets the user
appear offline to the contact.
2015-03-24 23:10:47 +01:00
Paweł Chmielowski 8e33f31f50 Try not to use c2s:send_text, it causes problem with websocket 2015-02-25 13:57:03 +01:00
Badlop 5a35405cd5 Update copyright dates to 2015 (EJAB-1733) 2015-01-08 17:34:43 +01:00
Holger Weiss a78a0a65fe Let CSI code add timestamp at later point in time
As a small optimization, make sure we won't add timestamps to presence
stanzas which end up being thrown away by the CSI code.
2014-12-07 16:27:51 +01:00
Holger Weiss ba8f38e2eb XEP-0198: Add timestamp to resent stanzas
When an unacknowledged stanza is resent from the Stream Management
queue, add a timestamp so that the receiving client can display the time
at which the stanza was originally sent.
2014-12-07 16:12:06 +01:00
Holger Weiss 9899935e42 Improve interface for adding timestamps
Provide a simpler interface for adding <delay/> and <x/> timestamps to
stanzas.  This also makes sure that only one <delay/> tag and one <x/>
tag is added to a given stanza.
2014-12-07 15:55:18 +01:00
Holger Weiss 2cb16bc509 Remove unused field from c2s #state 2014-11-26 00:15:19 +01:00
Evgeny Khramtsov e97e56d776 Merge pull request #363 from weiss/drop-pep-errors
Don't route PEP error messages to clients
2014-11-25 14:20:11 +03:00
Holger Weiss 16311b73c8 Add new hook: c2s_filter_packet_in
The c2s_filter_packet_in hook can be used to modify or drop incoming
packets before they are transmitted to the client.
2014-11-24 20:55:18 +01:00
Holger Weiss c566b1d01e Respect privacy lists for incoming PEP messages 2014-11-18 01:25:12 +01:00
Evgeny Khramtsov d5ecd32cec Merge pull request #345 from weiss/last-pep-items
Fix sending of last published PEP items to newly-available resources
2014-11-14 21:27:24 +03:00
Holger Weiss 2446b66016 Use correct type for initial c2s #state.user value 2014-11-14 15:32:48 +01:00
Holger Weiss 830fdccd21 Don't broadcast last published PEP items
When a client becomes available, don't send the last published PEP items
of all his peers to all his other peers, but only to that client.
2014-11-14 01:03:26 +01:00
Holger Weiss 2d748115ee Don't advertise auth mechanisms too early
If "starttls_required: true" is specified for c2s connections,
authentication mechanisms shouldn't be offered before negotiating the
TLS connection.
2014-10-23 10:04:14 +02:00
Holger Weiss 0c24e18b5e XEP-0198: Abort immediately on queue overflow
Terminate the ejabberd_c2s process immediately once stanza queue
overflow is detected.  This makes sure the FSM won't process additional
stanzas before terminating if the recipient is flooded.
2014-10-17 01:35:30 +02:00
Holger Weiss 1ccc0d8bcb XEP-0198: Set #state.conn field on session resume 2014-10-12 19:44:35 +02:00
Holger Weiss 7bdc1151b1 Make sure "starttls_required" can't be bypassed
Don't allow clients to circumvent the "starttls_required" option by
enabling XMPP stream compression.
2014-10-12 02:08:08 +02:00
Holger Weiss 277e1dc3ff Offer CSI stream feature only if configured
Don't offer the CSI stream feature when mod_client_state isn't actually
configured to filter stanzas.  This makes sure clients won't send CSI
tags that end up being ignored.
2014-09-25 18:28:20 +02:00
Holger Weiss 56175fef1b Add new hook: c2s_post_auth_features
The c2s_post_auth_features hook can be used to extend the list of stream
features offered after authentication.
2014-09-25 18:15:33 +02:00
Holger Weiss 7aec0337e1 Remove invisible presence fields from c2s #state
Invisible presence isn't supported anymore, so the corresponding
ejabberd_c2s #state fields were unused.
2014-09-25 00:08:56 +02:00
Holger Weiss 0a9212583d XEP-0198: Support "resend_on_timeout: if_offline"
If "resend_on_timeout" is set to "if_offline", resend unacknowledged
stanzas only if no other resource is online when the session times out.
In other words, allow for sending them to offline storage, but nowhere
else.
2014-09-16 22:42:34 +02:00
Holger Weiss b8c98232b8 Support XEP-0352: Client State Indication 2014-09-11 17:44:29 +02:00
Evgeny Khramtsov 7a48e30523 Merge pull request #296 from weiss/remove-unused-clause
XEP-0198: Remove unused function clause
2014-09-07 07:27:17 +04:00
Holger Weiss 2ca563e328 XEP-0198: Remove unused function clause
In the 'wait_for_resume' state, #state.mgmt_pending_since is always
initialized.  fsm_next_state/2 takes care of that.
2014-09-06 20:39:38 +02:00
Holger Weiss 2e169167d4 XEP-0198: Change state on gen_tcp:send/2 failure
When Stream Management is enabled and a gen_tcp:send/2 call fails, go
into the 'wait_for_resume' state immediately.  This makes sure that
gen_tcp:send/2 won't be called again, which might avoid an Erlang issue
where gen_tcp:send/2 apparently hangs despite 'send_timeout' (and
'send_timeout_close') being set.
2014-09-06 20:34:32 +02:00
Holger Weiss 11b2921971 XEP-0198: Let fsm_next_state/2 check timeout value
Don't force the fsm_next_state/2 caller to check for 'mgmt_timeout = 0'.
2014-09-06 20:29:02 +02:00
Evgeniy Khramtsov fda73c3d16 Fix privacy checks of presence probes 2014-09-01 16:39:02 +04:00
Evgeniy Khramtsov a1ce33ebf8 Automatically remove IPs from ban, add the documentation 2014-08-27 13:25:49 +04:00
Evgeniy Khramtsov 2430e6691b Add mod_fail2ban 2014-08-27 13:17:56 +04:00
Holger Weiss 2802b6cee2 Allow for "max_ack_queue: infinity", as documented 2014-08-20 12:53:26 +02:00
Holger Weiss 2d4c39cd54 XEP-0198: Create shorter resume IDs
Omit the user and server name from the 'previd' value.
2014-08-15 10:56:59 +02:00
Holger Weiss 848e1497d1 XEP-0198: Gracefully handle broken 'previd'
Produce a proper error message instead of crashing when the 'previd'
value of a <resume/> request has an unexpected format.
2014-08-15 01:54:41 +02:00
Holger Weiss 2daf95e93f XEP-0198: Gracefully handle wrong credentials
Produce a proper error message instead of crashing when the JID encoded
in the 'previd' value of a <resume/> request is different from the
authenticated JID.
2014-08-15 01:53:47 +02:00
Evgeniy Khramtsov 3d3a4f7543 Fix events broadcasting via C2S 2014-07-22 19:42:49 +04:00
Holger Weiss 0cb9ea3643 XEP-0198: Cosmetic change: Reuse event handler
On stanza queue overflow, pass a message to self() using the exclamation
mark operator instead of send_all_state_event/2.  This allows for
reusing the existing handler for 'kick' events.
2014-05-28 11:24:38 +02:00
Holger Weiss 99ca8281fa XEP-0198: Terminate session on queue overflow
On queue overflow, terminate the c2s session instead of just dropping
items from the queue.  This makes sure all stanzas are either delivered
or bounced.
2014-05-27 22:56:33 +02:00
Evgeny Khramtsov 3a27b1dd0c Merge pull request #226 from weiss/simplify-state-change
XEP-0198: Cosmetic change: Simplify state change
2014-05-27 23:30:30 +04:00
Holger Weiss 50a4c5a6ab XEP-0198: Cosmetic change: Simplify state change
When the FSM goes into the 'wait_for_resume' state, let fsm_next_state/2
take care of updating #state.mgmt_state and of writing the log line.
This doesn't change the behavior, but simplifies the code.
2014-05-27 21:14:49 +02:00
Holger Weiss ed0c89f876 Let ejabberd_c2s always use fsm_next_state/2
Make sure any logic implemented in ejabberd_c2s:fsm_next_state/2 is
always applied.
2014-05-27 21:07:53 +02:00
Evgeny Khramtsov 702cddd4ff Merge pull request #220 from weiss/handle-send-failure
XEP-0198: Don't exit on socket send failure
2014-05-27 15:44:04 +04:00
Evgeny Khramtsov 4d1332c30f Merge pull request #222 from weiss/keep-session-on-failed-resume
XEP-0198: Don't drop session on failed resume
2014-05-27 15:38:26 +04:00