24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-16 22:05:29 +02:00

Remove workarounds that supported R11 or older (EJAB-446)(EJAB-628)(EJAB-997)

SVN Revision: 2486
This commit is contained in:
Badlop 2009-08-15 20:10:49 +00:00
parent 9c0495b563
commit 6eb5b544b4
7 changed files with 15 additions and 58 deletions

View File

@ -28,7 +28,7 @@ else
CHOWN_OUTPUT=&1
endif
EFLAGS += @ERLANG_SSL39@ -pa .
EFLAGS += -pa .
# make debug=true to compile Erlang module with debug informations.
ifdef debug

14
src/aclocal.m4 vendored
View File

@ -121,7 +121,6 @@ AC_DEFUN(AM_WITH_ERLANG,
-author('alexey@sevcom.net').
-export([[start/0]]).
-include_lib("ssl/include/ssl_pkix.hrl").
start() ->
EIDirS = code:lib_dir("erl_interface") ++ "\n",
@ -133,15 +132,9 @@ start() ->
end,
EXMPPDirS = EXMPPDir ++ "\n",
RootDirS = code:root_dir() ++ "\n",
file:write_file("conftest.out", list_to_binary(EIDirS ++ EILibS ++ ssldef() ++ EXMPPDirS ++ RootDirS)),
file:write_file("conftest.out", list_to_binary(EIDirS ++ EILibS ++ EXMPPDirS ++ RootDirS)),
halt().
-[ifdef]('id-pkix').
ssldef() -> "-DSSL39\n".
-else.
ssldef() -> "\n".
-endif.
%% return physical architecture based on OS/Processor
archname() ->
ArchStr = erlang:system_info(system_architecture),
@ -190,9 +183,7 @@ _EOF
# Second line
ERLANG_EI_LIB=`cat conftest.out | head -n 2 | tail -n 1`
# Third line
ERLANG_SSL39=`cat conftest.out | head -n 3 | tail -n 1`
# Fourth line
ERLANG_EXMPP=`cat conftest.out | head -n 4 | tail -n 1`
ERLANG_EXMPP=`cat conftest.out | head -n 3 | tail -n 1`
# End line
ERLANG_DIR=`cat conftest.out | tail -n 1`
@ -201,7 +192,6 @@ _EOF
AC_SUBST(ERLANG_CFLAGS)
AC_SUBST(ERLANG_LIBS)
AC_SUBST(ERLANG_SSL39)
AC_SUBST(ERLANG_EXMPP)
AC_SUBST(ERLC)
AC_SUBST(ERL)

15
src/configure vendored
View File

@ -627,7 +627,6 @@ EGREP
GREP
CPP
ERLANG_EXMPP
ERLANG_SSL39
ERLANG_LIBS
ERLANG_CFLAGS
ERL
@ -3105,7 +3104,6 @@ fi
-author('alexey@sevcom.net').
-export([start/0]).
-include_lib("ssl/include/ssl_pkix.hrl").
start() ->
EIDirS = code:lib_dir("erl_interface") ++ "\n",
@ -3117,15 +3115,9 @@ start() ->
end,
EXMPPDirS = EXMPPDir ++ "\n",
RootDirS = code:root_dir() ++ "\n",
file:write_file("conftest.out", list_to_binary(EIDirS ++ EILibS ++ ssldef() ++ EXMPPDirS ++ RootDirS)),
file:write_file("conftest.out", list_to_binary(EIDirS ++ EILibS ++ EXMPPDirS ++ RootDirS)),
halt().
-ifdef('id-pkix').
ssldef() -> "-DSSL39\n".
-else.
ssldef() -> "\n".
-endif.
%% return physical architecture based on OS/Processor
archname() ->
ArchStr = erlang:system_info(system_architecture),
@ -3174,9 +3166,7 @@ _EOF
# Second line
ERLANG_EI_LIB=`cat conftest.out | head -n 2 | tail -n 1`
# Third line
ERLANG_SSL39=`cat conftest.out | head -n 3 | tail -n 1`
# Fourth line
ERLANG_EXMPP=`cat conftest.out | head -n 4 | tail -n 1`
ERLANG_EXMPP=`cat conftest.out | head -n 3 | tail -n 1`
# End line
ERLANG_DIR=`cat conftest.out | tail -n 1`
@ -3190,7 +3180,6 @@ _EOF
# Checks for typedefs, structures, and compiler characteristics.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5

View File

@ -49,17 +49,10 @@
-include_lib("exmpp/include/exmpp.hrl").
-include("ejabberd.hrl").
-ifdef(SSL39).
-include("XmppAddr.hrl").
-include_lib("ssl/include/ssl_pkix.hrl").
-define(PKIXEXPLICIT, 'OTP-PKIX').
-define(PKIXIMPLICIT, 'OTP-PKIX').
-else.
-include_lib("ssl/include/PKIX1Explicit88.hrl").
-include_lib("ssl/include/PKIX1Implicit88.hrl").
-define(PKIXEXPLICIT, 'PKIX1Explicit88').
-define(PKIXIMPLICIT, 'PKIX1Implicit88').
-endif.
-include("XmppAddr.hrl").
-define(DICT, dict).

View File

@ -90,14 +90,6 @@
-define(generic, true).
-endif.
%% Almost a copy of string:join/2.
%% We use this version because string:join/2 is relatively
%% new function (introduced in R12B-0).
join([], _Sep) ->
[];
join([H|T], Sep) ->
[H, [[Sep, X] || X <- T]].
%% -----------------
%% Generic queries
-ifdef(generic).
@ -111,14 +103,14 @@ update_t(Table, Fields, Vals, Where) ->
Fields, Vals),
case ejabberd_odbc:sql_query_t(
["update ", Table, " set ",
join(UPairs, ", "),
string:join(UPairs, ", "),
" where ", Where, ";"]) of
{updated, 1} ->
ok;
_ ->
ejabberd_odbc:sql_query_t(
["insert into ", Table, "(", join(Fields, ", "),
") values ('", join(Vals, "', '"), "');"])
["insert into ", Table, "(", string:join(Fields, ", "),
") values ('", string:join(Vals, "', '"), "');"])
end.
%% F can be either a fun or a list of queries
@ -353,7 +345,7 @@ update_roster(_LServer, Username, SJID, ItemVals, ItemGroups) ->
ejabberd_odbc:sql_query_t(
["insert into rostergroups("
" username, jid, grp) "
" values ('", join(ItemGroup, "', '"), "');"])
" values ('", string:join(ItemGroup, "', '"), "');"])
end,
ItemGroups).
@ -365,13 +357,13 @@ update_roster_sql(Username, SJID, ItemVals, ItemGroups) ->
" username, jid, nick, "
" subscription, ask, askmessage, "
" server, subscribe, type) "
" values ('", join(ItemVals, "', '"), "');"],
" values ('", string:join(ItemVals, "', '"), "');"],
["delete from rostergroups "
" where username='", Username, "' "
" and jid='", SJID, "';"]] ++
[["insert into rostergroups("
" username, jid, grp) "
" values ('", join(ItemGroup, "', '"), "');"] ||
" values ('", string:join(ItemGroup, "', '"), "');"] ||
ItemGroup <- ItemGroups].
roster_subscribe(_LServer, Username, SJID, ItemVals) ->
@ -527,7 +519,7 @@ set_privacy_list(ID, RItems) ->
"match_presence_out "
") "
"values ('", ID, "', '",
join(Items, "', '"), "');"])
string:join(Items, "', '"), "');"])
end, RItems).
del_privacy_lists(LServer, Server, Username) ->

View File

@ -9,7 +9,6 @@ LIBS = @LIBS@
ERLANG_CFLAGS = @ERLANG_CFLAGS@
ERLANG_LIBS = @ERLANG_LIBS@
EFLAGS += @ERLANG_SSL39@
EFLAGS += -I ..
EFLAGS += -pz ..

View File

@ -66,12 +66,6 @@
headers
}).
-ifdef(SSL39).
-define(STRING2LOWER, string).
-else.
-define(STRING2LOWER, httpd_util).
-endif.
-record(state, {host, docroot, accesslog, accesslogfd, directory_indices,
default_content_type, content_types = []}).
@ -411,7 +405,7 @@ join([H | T], Separator) ->
lists:foldl(fun(E, Acc) -> lists:concat([Acc, Separator, E]) end, H, T).
content_type(Filename, DefaultContentType, ContentTypes) ->
Extension = ?STRING2LOWER:to_lower(filename:extension(Filename)),
Extension = string:to_lower(filename:extension(Filename)),
case lists:keysearch(Extension, 1, ContentTypes) of
{value, {_, ContentType}} -> ContentType;
false -> DefaultContentType
@ -427,4 +421,4 @@ ip_to_string(Address) when size(Address) == 4 ->
join(tuple_to_list(Address), ".");
ip_to_string(Address) when size(Address) == 8 ->
Parts = lists:map(fun (Int) -> io_lib:format("~.16B", [Int]) end, tuple_to_list(Address)),
?STRING2LOWER:to_lower(lists:flatten(join(Parts, ":"))).
string:to_lower(lists:flatten(join(Parts, ":"))).