25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-30 16:36:29 +01:00

Replace jlib:nodeprep/1 by exmpp_stringprep:nodeprep/1 and change the

error handling.

PR:		EJABP-1

SVN Revision: 1619
This commit is contained in:
Jean-Sébastien Pédron 2008-10-10 14:35:17 +00:00
parent c0e4af9ac0
commit 129b0e99cf
2 changed files with 9 additions and 5 deletions

View File

@ -12,6 +12,9 @@
jlib:nameprep/1 by exmpp_stringprep:nameprep/1 and change the error
handling.
* src/ejabberd_config.erl (normalize_hosts/2): Replace jlib:nodeprep/1
by exmpp_stringprep:nodeprep/1 and change the error handling.
2008-10-09 Jean-Sébastien Pédron <js.pedron@meetic-corp.com>
* src/ejabberd_c2s.erl: Fix handling of unauthenticated stanzas which

View File

@ -154,13 +154,14 @@ normalize_hosts(Hosts) ->
normalize_hosts([], PrepHosts) ->
lists:reverse(PrepHosts);
normalize_hosts([Host|Hosts], PrepHosts) ->
case jlib:nodeprep(Host) of
error ->
try
PrepHost = exmpp_stringprep:nodeprep(Host),
normalize_hosts(Hosts, [PrepHost|PrepHosts])
catch
_ ->
?ERROR_MSG("Can't load config file: "
"invalid host name [~p]", [Host]),
exit("invalid hostname");
PrepHost ->
normalize_hosts(Hosts, [PrepHost|PrepHosts])
exit("invalid hostname")
end.