Commit Graph

79 Commits

Author SHA1 Message Date
Alexey Shchepin 2905b90c41 Update copyright dates 2012-02-23 17:47:43 +02:00
Pablo Polvorin df2e050780 Prevent overload of incomming s2s connections
Three changes were introduced:

1) ejabberd_s2s_in now uses p1_fsm instead of gen_fsm.  And uses
   the {max_queue, N} option to kill the process if its input
   queue grows too much.
2) If a ejabberd_s2s_in process is overload and killed, the server
   that originated that connection is not allowed to connect back
   to us for X seconds (set to 60seconds on the source)
3) The list of blocked (both statically and dynamically by the above
   method) host is now also checked for hosts authenticating by
   starttls+sasl. Previusly it was only used during dialback.
2011-12-02 15:36:51 -03:00
Christophe Romain 4a2005f7cc update copyright up to 2011 2011-02-14 13:47:22 +01:00
Christopher tofu Zorn dad3297c9c expose find_connection for routing in other modules (if needed) 2010-11-29 20:06:02 +01:00
Badlop d1f5fb4aa9 Speed up ejabberd_s2s:is_service/2, allow_host/2 (thanks to Andreas Köhler)(EJAB-1319)
Iterating through the list of possible parent domains of a given domain
and comparing with the list of hosts or routes is almost always faster
than doing it the other way around. It naturally returns the shortest or
longest parent domain satisfying a predicate, whereas the possibly long
list compared with would need to be sorted by length first.
2010-10-14 21:14:46 +02:00
Badlop 82a8dc7b3a Cosmetic code changes to support emacs indentation 2010-10-07 17:38:18 +02:00
Evgeniy Khramtsov 2187bccc38 consistent hashing support. WARNING: update exmpp before running this 2010-06-03 00:01:36 +10:00
Badlop 5cb10cf9fa Fix outgoing s2s 2010-04-14 21:08:24 +02:00
Evgeniy Khramtsov 62ad40b1e4 now using mnesia:async_dirty when cleaning table from failed node 2010-02-19 16:41:13 +09:00
Badlop 887a65aa18 exmpp in pubsub doc and retrocompatibility comments (thanks to Karim Gemayel)
SVN Revision: 2934
2010-01-27 18:53:56 +00:00
Badlop 1bcd481fdc Update year of ProcessOne copyright from 2009 to 2010 (EJAB-1159)
SVN Revision: 2892
2010-01-12 16:15:16 +00:00
Evgeniy Khramtsov 99a6f12026 fixes allow_host/2 on subdomains. added hook s2s_allow_host: the hook should return deny or allow
SVN Revision: 2739
2009-11-13 16:22:54 +00:00
Karim Gemayel 7eb395b87d API renaming : ldomain_as_list -> prep_domain_as_list
SVN Revision: 2124
2009-06-01 16:38:28 +00:00
Karim Gemayel 19d7d79229 API renaming : ldomain -> prep_domain
SVN Revision: 2123
2009-06-01 16:37:15 +00:00
Karim Gemayel 5dbc4f9954 API renaming : jid_to_bare_jid > bare
SVN Revision: 2120
2009-06-01 16:30:15 +00:00
Karim Gemayel 447d3818f5 API renaming : make_jid -> make
SVN Revision: 2119
2009-06-01 16:26:00 +00:00
Badlop b473862da6 Added API function to get current S2S connections with information
get_info_s2s_connections(Type) returns a list of incoming (or outgoing)
S2S connections with information for each one including IP address,
port number, TLS options... (thanks to Juan Pablo Carlino)

SVN Revision: 2089
2009-05-19 09:39:13 +00:00
Badlop 1d3947c0da Replace TYPE/1 with is_TYPE/1 (EJAB-922)
SVN Revision: 2057
2009-05-06 16:54:43 +00:00
Jean-Sébastien Pédron 842ebfcca0 A lot of bug fixes regarding attribute values type:
o  Fix some bugs by getting attributes as list() instead of binary().
o  Instead creating #xmlattr directly, use the new ?XMLATTR macro; it'll
take care of the anything-to-binary() conversion.
o  Fix a bug where recipient and sender were used as binary() instead of
list(), which is required by the rest of the S2S code.
o  Fix a bug where binary_to_list/1 was called on a list().

Now concerning JIDs :
o  Now that #jid{} isn't part of the API of Exmppp anymore, replace
remaining direct usages by calls to exmpp_jid.
o  Replace exmpp_jid:make_bare_jid() by exmpp_jid:make_jid().
o  Replace exmpp_jid:*_to_jid/1 by exmpp_jid:parse_jid/1.

PR:		EJABP-1

SVN Revision: 1841
2009-01-21 13:34:26 +00:00
Jean-Sébastien Pédron ff500d8297 Merge from trunk (r1787 to r1804).
Included are fixes to src/mod_configure.erl and src/mod_caps.erl.

Note: this merge doesn't include the following revisions because it was
made by previous commits:
r1766, r1768, r1781, r1783, r1794, r1797, r1799, r1802.

Warning: Ejabberd may be broken until the merge is completly finished.

PR:		EJABP-1

SVN Revision: 1829
2009-01-19 14:47:33 +00:00
Pablo Polvorin 98f51dc91f Adapt to new exmpp API where get_id/1, get_lang/1, get_initiating_entity/1, get_receiving_entity/1 and get_type/1 returns binary().
SVN Revision: 1791
2009-01-09 19:18:46 +00:00
Pablo Polvorin 4827db4f56 Big #jid to binary() conversion.
Internal tables (ejabberd_router, ejabberd_sm, ejabberd_hooks, mod_last, mod_roster) use binary() as storage.
Basic test using the ODBC backend.

SVN Revision: 1770
2009-01-03 15:15:38 +00:00
Jean-Sébastien Pédron ab2b70f189 Merge from trunk (r1613 to 1649).
PR:		EJABP-1

SVN Revision: 1650
2008-10-13 10:11:19 +00:00
Jean-Sébastien Pédron 4eaa8e19c9 Merge from trunk (r1457 to r1563).
SVN Revision: 1564
2008-09-16 14:39:57 +00:00
Jean-Sébastien Pédron 9f0d79da9a o Use the new functions from jlib.
o  Remove the compatibility code. It's becoming confusing to handle every
case every where. Also, in JIDs (normal and short), the atom "undefined'
is expected, not the empty string anymore!

SVN Revision: 1546
2008-08-26 13:38:49 +00:00
Jean-Sébastien Pédron 13b78b1ad2 Routing is now done with #xmlel. A warning is printed if those modules
have to route an old #xmlelement.

SVN Revision: 1406
2008-07-01 15:51:34 +00:00
Jean-Sébastien Pédron 8c33e12616 Use the new clause of exmpp_stanza:reply_with_error/2, exmpp_iq:error/2,
exmpp_iq:error_without_original/2 and the new exmpp_jid:make_bare_jid/1.

SVN Revision: 1394
2008-07-01 08:01:06 +00:00
Jean-Sébastien Pédron 06965000a5 Before doing any routing, the router print a warning if old structures
are used. Then it converts the structures to the old format and route
them. The router doesn't care about the structures format but the
conversion is necesary for code called from this module.

In C2S and S2S, no conversion is done before calling
ejabberd_router:route/3.

SVN Revision: 1392
2008-06-30 16:55:03 +00:00
Jean-Sébastien Pédron cc033b3b98 o Use the new functions from jlib.
o  Use the new exmpp_xml:node_to_list/3.

SVN Revision: 1391
2008-06-30 15:51:23 +00:00
Jean-Sébastien Pédron 264e72830b Convert to exmpp.
SVN Revision: 1389
2008-06-30 14:04:31 +00:00
Mickaël Rémond 5e9576ffa3 * src/ejabberd_s2s.erl: Added s2s_send_packet and s2s_receive_packet hooks (EJAB-635).
* src/ejabberd_s2s_in.erl: Likewise.

SVN Revision: 1342
2008-05-22 10:53:49 +00:00
Badlop ee6aae8211 * src/ejabberd_s2s_out.erl: Fix long timeout when reconnecting s2s
after a remote server crash (EJAB-540)
* src/ejabberd_s2s_in.erl: Likewise
* src/ejabberd_s2s.erl: Likewise
* doc/guide.tex: Likewise

SVN Revision: 1296
2008-04-18 12:19:45 +00:00
Christophe Romain b2bd9759c8 Rewrite io:format calls to loglevel macros (EJAB-555)
SVN Revision: 1239
2008-03-21 14:44:16 +00:00
Mickaël Rémond 320c266276 * src/ejabberd_s2s.erl: Only trigger s2s_connect_hook on successful connection (EJAB-566)
* src/ejabberd_s2s_out.erl: Likewise

SVN Revision: 1235
2008-03-17 10:16:21 +00:00
Mickaël Rémond 295da9cf02 * src/ejabberd_s2s.erl: API improvement: Added s2s_connect_hook (EJAB-566).
SVN Revision: 1232
2008-03-15 09:35:33 +00:00
Badlop 2d2fcc8210 * doc/guide.tex: Updated copyright dates to 2008
* src/*: Likewise

SVN Revision: 1153
2008-01-15 17:02:57 +00:00
Mickaël Rémond 56fe3579bb * Applied copyright update patch 1.
SVN Revision: 1110
2007-12-24 11:41:41 +00:00
Badlop d625fc80fc * src/acl.erl and other 64 files: Remove Erlang module attribute
'vsn' because it doesn't provide any worth feature, and it
difficults hot code update (EJAB-440)

SVN Revision: 1044
2007-12-06 22:12:27 +00:00
Mickaël Rémond 2100ea63ca * Making sure SVN properties are correctly set.
SVN Revision: 970
2007-11-15 10:33:18 +00:00
Jérôme Sautret 96ded4535d * src/ejabberd_s2s.erl: don't use the resource of the sender to choose
a s2s connection to ensure that a muc room always uses the same
connection

Merge branch 'ejabberd_s2s'

Conflicts:

.gitignore
src/configure
src/ejabberd_c2s.erl
src/ejabberd_s2s.erl

SVN Revision: 963
2007-10-30 17:38:40 +00:00
Alexey Shchepin f82b84158e * src/ejabberd_s2s.erl: Max number of connections and max number
of connections per node now can be specified via
max_s2s_connections and max_s2s_connections_per_node acl rules

SVN Revision: 950
2007-09-25 16:32:18 +00:00
Mickaël Rémond 31449bc720 * src/ejabberd_s2s.erl: open all missing connections if needed.
SVN Revision: 945
2007-09-14 14:20:43 +00:00
Mickaël Rémond f6d376a4fc * src/ejabberd_s2s.erl: untabify
SVN Revision: 944
2007-09-14 14:20:30 +00:00
Mickaël Rémond 5a0b8288d4 * src/ejabberd_s2s.erl: don't check blacklist for services.
SVN Revision: 943
2007-09-14 14:20:15 +00:00
Mickaël Rémond de63c622c2 * src/ejabberd_s2s.erl: Fixed merge conflict (duplicate functions).
SVN Revision: 942
2007-09-14 14:20:01 +00:00
Mickaël Rémond b3fb9d9100 Try to open all s2s connections at the same time, to guarantee the right order of the packets.
SVN Revision: 941
2007-09-14 14:19:48 +00:00
Mickaël Rémond 653e6c1791 Comment.
SVN Revision: 938
2007-09-14 14:19:07 +00:00
Mickaël Rémond 78e6eb58d4 max_s2s_connexions_number local parameter added.
SVN Revision: 937
2007-09-14 14:18:51 +00:00
Mickaël Rémond 9fc203ee6d open up to 3 s2s outgoing connection per domain pair
SVN Revision: 928
2007-09-14 14:15:44 +00:00
Mickaël Rémond 799ff1d883 * src/ejabberd_s2s_in.erl: Add s2s whitelist / blacklist support on incoming s2s connections (EJAB-283)
* src/ejabberd_s2s.erl: Likewise

SVN Revision: 820
2007-07-19 21:17:13 +00:00