24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-12 21:52:07 +02:00
Commit Graph

455 Commits

Author SHA1 Message Date
Evgeniy Khramtsov
01a2c9fe12 Add type specs for Module:opt_type/1 2017-05-08 12:59:28 +03:00
Evgeniy Khramtsov
f2dc8c0442 Emit deprecation warning for SM related listening options 2017-05-05 12:31:17 +03:00
Evgeniy Khramtsov
fddd6110e0 Don't validate an option in gen_mod:get*opt() functions
The changes are very similar to those from previous commit:
* Now there is no need to pass validating function in
  gen_mod:get_opt() and gen_mod:get_module_opt() functions,
  because the modules' configuration keeps already validated values.
* New functions gen_mod:get_opt/2 and gen_mod:get_module_opt/3 are
  introduced.
* Functions gen_mod:get_opt/4 and get_module_opt/5 are deprecated.
  If the functions are still called, the "function" argument is
  simply ignored.
* Validating callback Mod:listen_opt_type/1 is introduced to validate
  listening options at startup.
2017-04-30 19:01:47 +03:00
Evgeniy Khramtsov
b82b93f8f0 Don't validate an option in ejabberd_config:get_option() functions
The commit introduces the following changes:
* Now there is no need to pass validating function in
  ejabberd_config:get_option() functions, because the configuration
  keeps already validated values.
* New function ejabberd_config:get_option/1 is introduced
* Function ejabberd_config:get_option/3 is deprecated. If the function
  is still called, the second argument (validating function) is simply
  ignored.
* The second argument for ejabberd_config:get_option/2 is now
  a default value, not a validating function.
2017-04-29 11:39:40 +03:00
Evgeniy Khramtsov
7129aebe76 Don't re-define validation functions in multiple places 2017-04-28 13:23:32 +03:00
Holger Weiss
b8a7720986 ejabberd_c2s: Don't close session on stream resume
Don't let ejabberd_c2s close the session and unset presence if a
'c2s_terminated' callback stops hook execution, as is done in
mod_stream_mgmt:c2s_terminated/2 on resumption.

Fixes #1680.
2017-04-19 01:20:28 +02:00
Evgeniy Khramtsov
7c9415356d Function fix_from_to/2 should not crash when 'from' is undefined
Fixes #1678
2017-04-18 01:38:35 +03:00
Evgeniy Khramtsov
5774edfe79 Improve ejabberd_c2s:close() 2017-04-15 08:30:41 +03:00
Christophe Romain
b1acd1183f Rename aux.erl as misc.erl
Thanks Microsoft Windows to not support some filenames
2017-04-11 12:13:58 +02:00
Evgeniy Khramtsov
7bcbea2108 Deprecate jlib.erl in favor of aux.erl
Since the main goal of jlib.erl is lost, all auxiliary functions
are now moved to aux.erl, and the whole jlib.erl is now deprecated.
2017-03-30 14:17:13 +03:00
Evgeniy Khramtsov
dd11ed82d7 Report more TLS errors 2017-03-08 08:27:54 +03:00
Evgeniy Khramtsov
d0a185f2d9 Report some TLS errors 2017-03-07 18:46:02 +03:00
Evgeniy Khramtsov
489385d565 Make sure all hooks are called with proper host in ejabberd_c2s 2017-02-28 16:47:31 +03:00
Evgeniy Khramtsov
c1439ddd5b Get rid of jid:to_string/1 and jid:from_string/1 2017-02-26 10:07:12 +03:00
Evgeniy Khramtsov
5b112c86bf Fix a case clause and run c2s_filter_send on send_error/3 2017-02-24 07:57:57 +03:00
Evgeniy Khramtsov
7d68112265 Start/stop virtual hosts when reloading configuration file 2017-02-23 10:12:19 +03:00
Holger Weiss
61cdee97fc ejabberd_c2s: Don't drop 'user_send_packet' result
When handling a <session/> IQ, use the stanza returned by the
'user_send_packet' hook.

Thanks to Evgeniy for spotting this.
2017-02-20 13:07:34 +01:00
Holger Weiss
7c159e3881 Let ejabberd_c2s handle <session/> IQ
This fixes the counting of incoming stanzas for stream management.
2017-02-19 22:43:10 +01:00
Evgeniy Khramtsov
940ca9311d Fix some dialyzer warnings 2017-02-18 09:36:27 +03:00
Evgeniy Khramtsov
8b2d308498 Change routing API
Now 'From' and 'To' arguments must be omitted in functions
and structures related to routing.
The commit deprecates the following functions:
     ejabberd_router:route/3 in favor of ejabberd_router:route/1
     ejabberd_router:route_error/4 in favor of ejabberd_router:route_error/2
     ejabberd_local:route_iq/4 in favor of ejabberd_local:route_iq/2
     ejabberd_local:route_iq/5 in favor of ejabberd_local:route_iq/3
The format of {route, From, To, Packet} is changed in favor of {route, Packet}
2017-02-16 11:10:24 +03:00
Evgeniy Khramtsov
6fd89f5fe0 Attach IP metadata to every stanza received from stream 2017-02-14 17:09:25 +03:00
Evgeniy Khramtsov
9d144bd495 Do not drop default TLS options
Fixes #1484
2017-01-26 10:58:26 +03:00
Evgeniy Khramtsov
48d8498dbb Avoid using maps:get/2 to keep compatibility with OTP 17.5 2017-01-23 16:30:16 +03:00
Evgeniy Khramtsov
435e5e6263 Make test suite working again 2017-01-23 13:51:05 +03:00
Evgeniy Khramtsov
17fe272dc5 Update copyright headers in new files 2017-01-20 19:56:19 +03:00
Alexey Shchepin
b080b8f54d Use user_receive_packet hook in mod_block_strangers 2017-01-16 18:40:30 +03:00
Alexey Shchepin
fedfe5427c Add mod_block_strangers 2017-01-16 18:14:14 +03:00
Evgeniy Khramtsov
31491ebe16 Fix some corner cases while re-reading RFC6120 2017-01-13 11:35:47 +03:00
Evgeniy Khramtsov
5cfe57ece5 Add 'supervisor' listening option
If set to 'true' (this is the default), new processes spawned by
ejabberd_listener will be attached to the corresponding supervisor.
No such processes will be attached to a supervisor otherwise.
Setting this to 'false' will improve performance of high loaded
systems where new C2S/S2S processes are spawned very rapidly.
2017-01-11 10:56:04 +03:00
Evgeniy Khramtsov
1e55e018e5 Adopt remaining code to support new hooks 2017-01-09 17:02:17 +03:00
Evgeniy Khramtsov
cf87c5664f Reflect cyrsasl API changes in remaining code 2016-12-31 13:48:55 +03:00
Evgeniy Khramtsov
e7fe4dc474 More refactoring on session management 2016-12-30 00:00:36 +03:00
Evgeniy Khramtsov
309bdfbe28 Add xmpp_stream_out behaviour and rewrite s2s/SM code 2016-12-28 09:47:11 +03:00
Evgeniy Khramtsov
7f653cfe76 Rewrite ejabberd_service to use new XMPP stream API 2016-12-11 18:24:51 +03:00
Evgeniy Khramtsov
5cc8e807df Initial version of new XMPP stream behaviour (for review) 2016-12-11 15:03:37 +03:00
Holger Weiss
3325e69ae6 Let mod_carboncopy mark copied messages
Carbon copies are now marked with a 'carbon_copy' flag.  This makes it
easier to identify them.
2016-11-22 22:21:34 +01:00
Evgeniy Khramtsov
78a44e0176 Merge branch 'master' into xml-ng
Conflicts:
	src/adhoc.erl
	src/cyrsasl_oauth.erl
	src/ejabberd_c2s.erl
	src/ejabberd_config.erl
	src/ejabberd_service.erl
	src/gen_mod.erl
	src/mod_admin_extra.erl
	src/mod_announce.erl
	src/mod_carboncopy.erl
	src/mod_client_state.erl
	src/mod_configure.erl
	src/mod_echo.erl
	src/mod_mam.erl
	src/mod_muc.erl
	src/mod_muc_room.erl
	src/mod_offline.erl
	src/mod_pubsub.erl
	src/mod_stats.erl
	src/node_flat_sql.erl
	src/randoms.erl
2016-11-12 13:27:15 +03:00
Evgeniy Khramtsov
f6236d456d Add more tests for privacy lists and blocking command 2016-10-22 13:01:45 +03:00
Holger Weiss
e54ba3db5b XEP-0198: Cope with invalid 'from'/'to' attributes
Check whether the 'from' and 'to' attributes are valid before bouncing
or resending a stanza from the stream management queue.  They might be
invalid in certain corner cases.

Thanks to Evgeniy for spotting this.
2016-10-06 23:20:45 +02:00
Evgeniy Khramtsov
3112a7187f Test anonymous auth 2016-09-25 09:57:56 +03:00
Evgeniy Khramtsov
fa31e3ef23 Deprecate jlib:integer_to_binary/1 and jlib:binary_to_integer/1 2016-09-24 23:34:28 +03:00
Evgeniy Khramtsov
58969fb854 Improve namespace handling 2016-09-24 14:17:21 +03:00
Evgeniy Khramtsov
53209b9ab1 Add tests for s2s code 2016-09-23 12:30:33 +03:00
Evgeniy Khramtsov
ceda073766 Add tests for external component 2016-09-21 10:45:11 +03:00
Evgeniy Khramtsov
a4ec064455 Add more tests for C2S 2016-09-20 14:04:07 +03:00
Christophe Romain
c39501a48d Merge branch 'push-requirements' of https://github.com/weiss/ejabberd into weiss-push-requirements 2016-09-13 14:29:14 +02:00
Evgeniy Khramtsov
e987b88848 Make common tests working again 2016-09-13 12:30:05 +03:00
Holger Weiss
d222fed228 XEP-0198: Cancel timer when waiting for resumption
If an ACK timer is active while going into the 'wait_for_resume' state,
cancel that timer.
2016-09-09 00:21:36 +02:00
Evgeniy Khramtsov
c29a48695d Rename #error{} record to #stanza_error{} 2016-09-08 17:08:48 +03:00
Holger Weiss
621f0e2b7c New stream management option: ack_timeout
Close the connection if a stream management client fails to respond to
an acknowledgement request within 60 seconds.  This number of seconds
can be changed with the new "ack_timeout" option, and the mechanism can
be disabled by specifying 'infinity'.

As a side effect of this change, a new acknowledgement is no longer
requested before the response to the previous request is received.
2016-09-07 23:16:54 +02:00