Commit Graph

102 Commits

Author SHA1 Message Date
Evgeniy Khramtsov ffdaff3740 Make ejabberd_cluster modular
For setting the cluster backend new global option 'cluster_backend' is
introduced. The default and only available value at the moment is 'mnesia'
2017-07-06 15:47:35 +03:00
Evgeniy Khramtsov a35b9dd9cc Close accepted socket if sockname/peername has failed
Fixes #1834
2017-07-06 14:49:21 +03:00
Evgeniy Khramtsov d3c8fb7705 Check presence of some files during option validation 2017-05-12 09:34:57 +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 c923bb5c10 Avoid changing configuration on listener deletion 2017-04-23 16:42:54 +03:00
Evgeniy Khramtsov 78dba217bf Speedup configuration options lookup
We now avoid excessive ETS lookups; instead, we use dynamically
compiled module 'ejabberd_options' keeping the configuration options
2017-04-16 15:29:10 +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 b8fbac72ac Restart listeners on configuration reload 2017-02-24 15:18:10 +03:00
Evgeniy Khramtsov 67d6ca9f10 Improve startup procedure 2017-02-24 12:05:47 +03:00
Evgeniy Khramtsov d5d906184f Merge branch 'new_stream'
Conflicts:
	src/cyrsasl.erl
	src/ejabberd_c2s.erl
	src/ejabberd_cluster.erl
	src/ejabberd_frontend_socket.erl
	src/ejabberd_node_groups.erl
	src/ejabberd_router.erl
	src/mod_bosh.erl
	src/mod_ip_blacklist.erl
	src/mod_muc_mnesia.erl
	src/mod_offline.erl
	src/mod_proxy65_sm.erl
2017-01-20 19:35:46 +03:00
Evgeniy Khramtsov 22ee16fd9d Get rid of ejabberd_frontend_socket 2017-01-17 14:00:01 +03:00
Evgeniy Khramtsov 1e55e018e5 Adopt remaining code to support new hooks 2017-01-09 17:02:17 +03:00
Badlop 5fdd1c39fe Update copyright date automatically (#1442) 2017-01-02 21:42:06 +01:00
Evgeniy Khramtsov 309bdfbe28 Add xmpp_stream_out behaviour and rewrite s2s/SM code 2016-12-28 09:47:11 +03:00
Badlop f448ff608a Update copyright to 2016 (#901) 2016-01-13 12:29:14 +01:00
Alexey Shchepin c6798fc515 Add accept_interval option in ejabberd_listener 2015-12-16 17:26:44 +03:00
Evgeniy Khramtsov 99f506135b Fix ipv6 configuration processing (#803) 2015-10-30 17:20:32 +03:00
Holger Weiss 28e28e926a ejabberd_listener: Fix ETS update on port reuse 2015-10-18 01:14:48 +02: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
Evgeniy Khramtsov fb6267f38e Add config validation at startup 2015-06-01 15:38:27 +03:00
Holger Weiss e408276283 Don't forget gen_tcp:listen/2 options
Fixes #530.
2015-04-14 20:22:34 +02:00
Holger Weiss 0fd4984c23 ejabberd_listener: Remove Erlang/OTP version check
We don't support Erlang/OTP versions older than R16 anyway.
2015-04-07 09:47:05 +02:00
liudan f981a53f9a fix otp version check in listen_tcp/5 2015-04-07 09:28:35 +08:00
Holger Weiss 27a4d783a5 Fix "IP address not available" error message 2015-03-24 17:32:57 +01:00
Badlop 5a35405cd5 Update copyright dates to 2015 (EJAB-1733) 2015-01-08 17:34:43 +01:00
Evgeniy Khramtsov 1d782db84f Process XML-RPC requests via p1_xml and ejabberd_http 2014-10-04 12:49:12 +04:00
Holger Weiss e0e74a9d5e Don't "forget" listener options
If a listener is started or stopped via ejabberd_listener:add_listener/3
or ejabberd_listener:delete_listener/3, the configuration for all
listener modules is updated using the Module:transform_listen_option/2
function for each listener module that exports such a function.
However, for listener modules that don't provide that function (such as
ejabberd_stun), all but one option was dropped.  This is now fixed.

The issue could be triggered e.g. by enabling mod_proxy65 in the modules
section.
2014-06-04 20:54:26 +02:00
Evgeniy Khramtsov 90a5c054d4 TURN support (EJAB-1017) 2014-05-08 16:14:21 +04:00
Evgeniy Khramtsov d0ffcb7fd4 Assume udp_recv/5 now returns new options 2014-05-03 17:48:26 +04:00
Evgeniy Khramtsov 955487391d Assume tcp_init/2 and udp_init/2 now return new options 2014-05-03 17:48:17 +04:00
Evgeniy Khramtsov 02e0649d18 SIP support
Conflicts:
	configure
	configure.ac
	doc/guide.tex
2014-04-30 19:38:15 +04:00
badlop 285c4c17cf Merge pull request #146 from jamielinux/master
Update FSF address
2014-04-11 13:35:46 +02:00
Evgeniy Khramtsov a21edc2f3a Pretty print accepted transport address 2014-04-11 12:30:58 +02:00
Badlop 633d47f784 Update copyright dates to 2014 (EJAB-1679) 2014-03-13 12:30:57 +01:00
Jamie Nguyen 8538997d61 Update FSF address 2014-02-22 10:27:40 +00:00
Evgeniy Khramtsov c0240e7249 Do not try to start STUN application during config checks 2013-11-02 10:30:19 +10:00
Evgeniy Khramtsov 91a74e3e27 Change configuration file format to YAML 2013-08-21 22:17:59 +10:00
Evgeniy Khramtsov b50a4948ed Fix the error report of an incorrect certfile 2013-06-17 16:04:43 +03:00
Evgeniy Khramtsov 4d8f770624 Switch to rebar build tool
Use dynamic Rebar configuration
Make iconv dependency optional
Disable transient_supervisors compile option
Add hipe compilation support
Only compile ibrowse and lhttpc when needed
Make it possible to generate an OTP application release
Add --enable-debug compile option
Add --enable-all compiler option
Add --enable-tools configure option
Add --with-erlang configure option.
Add --enable-erlang-version-check configure option.
Add lager support
Improve the test suite
2013-06-13 11:11:02 +02:00
Badlop c0bf054583 Tweak ejabberd_listener to allow ejabberd_xmlrpc work properly 2013-05-14 18:50:54 +02:00
Badlop 9deb294328 Accumulated patch to binarize and indent code 2013-03-14 10:33:02 +01:00
Alexey Shchepin 0ae400533c Update copyright dates 2013-01-24 16:25:13 +02:00
Evgeniy Khramtsov 3a51c801e1 Change log level from informational to error 2012-03-19 18:52:20 +10:00
Alexey Shchepin b1e2538488 Update copyright dates 2012-02-23 17:52:34 +02:00
Christophe Romain fd52f2cb7d update copyright up to 2011 2011-02-14 13:50:55 +01:00
Andreas Köhler 18ef908759 Before binding tcp ports, checks the socket type and listener options
If the callback module has a socket type of independent and needs to
create the listener itself, do not pre-bind the port. The same holds if
there are errors in the listener configuration.
2010-11-10 23:46:18 +01:00
Andreas Köhler 1f1d2bd5f5 Bind listener ports early and start accepting connections later
It may happen that auth or rdbms client tcp connections bind a local
socket to a port number required by a configered listener. The ejabberd
applications fails to start up and needs to be restarted.

In plain C you would bind(2) the listener port and listen(2) later on.
gen_tcp:listen/2 does not allow to separate these two steps though, so
another way is not to accept connections while start up. OTOH, the
kernel will syn/ack incoming connections and receive data, leaving them
in a buffer for the ejabberd to read from. If this is unwanted, a load
balancer would need to receive data from the ejabberd server before
adding the node to its pool.

This patch binds tcp ports while initializing the ejabberd_listener
process, storing ListenSockets in an ets table. start_listeners/0 will
reuse these ports later on.
2010-11-10 23:46:16 +01:00
Badlop 86794b1d23 Fix OTP version detection to work with old supported R10 and R11
SVN Revision: 2906
2010-01-16 12:24:11 +00:00