mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
Remove workarounds that supported R11 or older (EJAB-446)(EJAB-628)(EJAB-997)
SVN Revision: 2486
This commit is contained in:
parent
9c0495b563
commit
6eb5b544b4
@ -28,7 +28,7 @@ else
|
|||||||
CHOWN_OUTPUT=&1
|
CHOWN_OUTPUT=&1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
EFLAGS += @ERLANG_SSL39@ -pa .
|
EFLAGS += -pa .
|
||||||
|
|
||||||
# make debug=true to compile Erlang module with debug informations.
|
# make debug=true to compile Erlang module with debug informations.
|
||||||
ifdef debug
|
ifdef debug
|
||||||
|
14
src/aclocal.m4
vendored
14
src/aclocal.m4
vendored
@ -121,7 +121,6 @@ AC_DEFUN(AM_WITH_ERLANG,
|
|||||||
-author('alexey@sevcom.net').
|
-author('alexey@sevcom.net').
|
||||||
|
|
||||||
-export([[start/0]]).
|
-export([[start/0]]).
|
||||||
-include_lib("ssl/include/ssl_pkix.hrl").
|
|
||||||
|
|
||||||
start() ->
|
start() ->
|
||||||
EIDirS = code:lib_dir("erl_interface") ++ "\n",
|
EIDirS = code:lib_dir("erl_interface") ++ "\n",
|
||||||
@ -133,15 +132,9 @@ start() ->
|
|||||||
end,
|
end,
|
||||||
EXMPPDirS = EXMPPDir ++ "\n",
|
EXMPPDirS = EXMPPDir ++ "\n",
|
||||||
RootDirS = code:root_dir() ++ "\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().
|
halt().
|
||||||
|
|
||||||
-[ifdef]('id-pkix').
|
|
||||||
ssldef() -> "-DSSL39\n".
|
|
||||||
-else.
|
|
||||||
ssldef() -> "\n".
|
|
||||||
-endif.
|
|
||||||
|
|
||||||
%% return physical architecture based on OS/Processor
|
%% return physical architecture based on OS/Processor
|
||||||
archname() ->
|
archname() ->
|
||||||
ArchStr = erlang:system_info(system_architecture),
|
ArchStr = erlang:system_info(system_architecture),
|
||||||
@ -190,9 +183,7 @@ _EOF
|
|||||||
# Second line
|
# Second line
|
||||||
ERLANG_EI_LIB=`cat conftest.out | head -n 2 | tail -n 1`
|
ERLANG_EI_LIB=`cat conftest.out | head -n 2 | tail -n 1`
|
||||||
# Third line
|
# Third line
|
||||||
ERLANG_SSL39=`cat conftest.out | head -n 3 | tail -n 1`
|
ERLANG_EXMPP=`cat conftest.out | head -n 3 | tail -n 1`
|
||||||
# Fourth line
|
|
||||||
ERLANG_EXMPP=`cat conftest.out | head -n 4 | tail -n 1`
|
|
||||||
# End line
|
# End line
|
||||||
ERLANG_DIR=`cat conftest.out | tail -n 1`
|
ERLANG_DIR=`cat conftest.out | tail -n 1`
|
||||||
|
|
||||||
@ -201,7 +192,6 @@ _EOF
|
|||||||
|
|
||||||
AC_SUBST(ERLANG_CFLAGS)
|
AC_SUBST(ERLANG_CFLAGS)
|
||||||
AC_SUBST(ERLANG_LIBS)
|
AC_SUBST(ERLANG_LIBS)
|
||||||
AC_SUBST(ERLANG_SSL39)
|
|
||||||
AC_SUBST(ERLANG_EXMPP)
|
AC_SUBST(ERLANG_EXMPP)
|
||||||
AC_SUBST(ERLC)
|
AC_SUBST(ERLC)
|
||||||
AC_SUBST(ERL)
|
AC_SUBST(ERL)
|
||||||
|
15
src/configure
vendored
15
src/configure
vendored
@ -627,7 +627,6 @@ EGREP
|
|||||||
GREP
|
GREP
|
||||||
CPP
|
CPP
|
||||||
ERLANG_EXMPP
|
ERLANG_EXMPP
|
||||||
ERLANG_SSL39
|
|
||||||
ERLANG_LIBS
|
ERLANG_LIBS
|
||||||
ERLANG_CFLAGS
|
ERLANG_CFLAGS
|
||||||
ERL
|
ERL
|
||||||
@ -3105,7 +3104,6 @@ fi
|
|||||||
-author('alexey@sevcom.net').
|
-author('alexey@sevcom.net').
|
||||||
|
|
||||||
-export([start/0]).
|
-export([start/0]).
|
||||||
-include_lib("ssl/include/ssl_pkix.hrl").
|
|
||||||
|
|
||||||
start() ->
|
start() ->
|
||||||
EIDirS = code:lib_dir("erl_interface") ++ "\n",
|
EIDirS = code:lib_dir("erl_interface") ++ "\n",
|
||||||
@ -3117,15 +3115,9 @@ start() ->
|
|||||||
end,
|
end,
|
||||||
EXMPPDirS = EXMPPDir ++ "\n",
|
EXMPPDirS = EXMPPDir ++ "\n",
|
||||||
RootDirS = code:root_dir() ++ "\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().
|
halt().
|
||||||
|
|
||||||
-ifdef('id-pkix').
|
|
||||||
ssldef() -> "-DSSL39\n".
|
|
||||||
-else.
|
|
||||||
ssldef() -> "\n".
|
|
||||||
-endif.
|
|
||||||
|
|
||||||
%% return physical architecture based on OS/Processor
|
%% return physical architecture based on OS/Processor
|
||||||
archname() ->
|
archname() ->
|
||||||
ArchStr = erlang:system_info(system_architecture),
|
ArchStr = erlang:system_info(system_architecture),
|
||||||
@ -3174,9 +3166,7 @@ _EOF
|
|||||||
# Second line
|
# Second line
|
||||||
ERLANG_EI_LIB=`cat conftest.out | head -n 2 | tail -n 1`
|
ERLANG_EI_LIB=`cat conftest.out | head -n 2 | tail -n 1`
|
||||||
# Third line
|
# Third line
|
||||||
ERLANG_SSL39=`cat conftest.out | head -n 3 | tail -n 1`
|
ERLANG_EXMPP=`cat conftest.out | head -n 3 | tail -n 1`
|
||||||
# Fourth line
|
|
||||||
ERLANG_EXMPP=`cat conftest.out | head -n 4 | tail -n 1`
|
|
||||||
# End line
|
# End line
|
||||||
ERLANG_DIR=`cat conftest.out | tail -n 1`
|
ERLANG_DIR=`cat conftest.out | tail -n 1`
|
||||||
|
|
||||||
@ -3190,7 +3180,6 @@ _EOF
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Checks for typedefs, structures, and compiler characteristics.
|
# Checks for typedefs, structures, and compiler characteristics.
|
||||||
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
|
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
|
||||||
|
@ -49,17 +49,10 @@
|
|||||||
-include_lib("exmpp/include/exmpp.hrl").
|
-include_lib("exmpp/include/exmpp.hrl").
|
||||||
|
|
||||||
-include("ejabberd.hrl").
|
-include("ejabberd.hrl").
|
||||||
-ifdef(SSL39).
|
-include("XmppAddr.hrl").
|
||||||
-include_lib("ssl/include/ssl_pkix.hrl").
|
-include_lib("ssl/include/ssl_pkix.hrl").
|
||||||
-define(PKIXEXPLICIT, 'OTP-PKIX').
|
-define(PKIXEXPLICIT, 'OTP-PKIX').
|
||||||
-define(PKIXIMPLICIT, '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).
|
-define(DICT, dict).
|
||||||
|
|
||||||
|
@ -90,14 +90,6 @@
|
|||||||
-define(generic, true).
|
-define(generic, true).
|
||||||
-endif.
|
-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
|
%% Generic queries
|
||||||
-ifdef(generic).
|
-ifdef(generic).
|
||||||
@ -111,14 +103,14 @@ update_t(Table, Fields, Vals, Where) ->
|
|||||||
Fields, Vals),
|
Fields, Vals),
|
||||||
case ejabberd_odbc:sql_query_t(
|
case ejabberd_odbc:sql_query_t(
|
||||||
["update ", Table, " set ",
|
["update ", Table, " set ",
|
||||||
join(UPairs, ", "),
|
string:join(UPairs, ", "),
|
||||||
" where ", Where, ";"]) of
|
" where ", Where, ";"]) of
|
||||||
{updated, 1} ->
|
{updated, 1} ->
|
||||||
ok;
|
ok;
|
||||||
_ ->
|
_ ->
|
||||||
ejabberd_odbc:sql_query_t(
|
ejabberd_odbc:sql_query_t(
|
||||||
["insert into ", Table, "(", join(Fields, ", "),
|
["insert into ", Table, "(", string:join(Fields, ", "),
|
||||||
") values ('", join(Vals, "', '"), "');"])
|
") values ('", string:join(Vals, "', '"), "');"])
|
||||||
end.
|
end.
|
||||||
|
|
||||||
%% F can be either a fun or a list of queries
|
%% 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(
|
ejabberd_odbc:sql_query_t(
|
||||||
["insert into rostergroups("
|
["insert into rostergroups("
|
||||||
" username, jid, grp) "
|
" username, jid, grp) "
|
||||||
" values ('", join(ItemGroup, "', '"), "');"])
|
" values ('", string:join(ItemGroup, "', '"), "');"])
|
||||||
end,
|
end,
|
||||||
ItemGroups).
|
ItemGroups).
|
||||||
|
|
||||||
@ -365,13 +357,13 @@ update_roster_sql(Username, SJID, ItemVals, ItemGroups) ->
|
|||||||
" username, jid, nick, "
|
" username, jid, nick, "
|
||||||
" subscription, ask, askmessage, "
|
" subscription, ask, askmessage, "
|
||||||
" server, subscribe, type) "
|
" server, subscribe, type) "
|
||||||
" values ('", join(ItemVals, "', '"), "');"],
|
" values ('", string:join(ItemVals, "', '"), "');"],
|
||||||
["delete from rostergroups "
|
["delete from rostergroups "
|
||||||
" where username='", Username, "' "
|
" where username='", Username, "' "
|
||||||
" and jid='", SJID, "';"]] ++
|
" and jid='", SJID, "';"]] ++
|
||||||
[["insert into rostergroups("
|
[["insert into rostergroups("
|
||||||
" username, jid, grp) "
|
" username, jid, grp) "
|
||||||
" values ('", join(ItemGroup, "', '"), "');"] ||
|
" values ('", string:join(ItemGroup, "', '"), "');"] ||
|
||||||
ItemGroup <- ItemGroups].
|
ItemGroup <- ItemGroups].
|
||||||
|
|
||||||
roster_subscribe(_LServer, Username, SJID, ItemVals) ->
|
roster_subscribe(_LServer, Username, SJID, ItemVals) ->
|
||||||
@ -527,7 +519,7 @@ set_privacy_list(ID, RItems) ->
|
|||||||
"match_presence_out "
|
"match_presence_out "
|
||||||
") "
|
") "
|
||||||
"values ('", ID, "', '",
|
"values ('", ID, "', '",
|
||||||
join(Items, "', '"), "');"])
|
string:join(Items, "', '"), "');"])
|
||||||
end, RItems).
|
end, RItems).
|
||||||
|
|
||||||
del_privacy_lists(LServer, Server, Username) ->
|
del_privacy_lists(LServer, Server, Username) ->
|
||||||
|
@ -9,7 +9,6 @@ LIBS = @LIBS@
|
|||||||
ERLANG_CFLAGS = @ERLANG_CFLAGS@
|
ERLANG_CFLAGS = @ERLANG_CFLAGS@
|
||||||
ERLANG_LIBS = @ERLANG_LIBS@
|
ERLANG_LIBS = @ERLANG_LIBS@
|
||||||
|
|
||||||
EFLAGS += @ERLANG_SSL39@
|
|
||||||
EFLAGS += -I ..
|
EFLAGS += -I ..
|
||||||
EFLAGS += -pz ..
|
EFLAGS += -pz ..
|
||||||
|
|
||||||
|
@ -66,12 +66,6 @@
|
|||||||
headers
|
headers
|
||||||
}).
|
}).
|
||||||
|
|
||||||
-ifdef(SSL39).
|
|
||||||
-define(STRING2LOWER, string).
|
|
||||||
-else.
|
|
||||||
-define(STRING2LOWER, httpd_util).
|
|
||||||
-endif.
|
|
||||||
|
|
||||||
-record(state, {host, docroot, accesslog, accesslogfd, directory_indices,
|
-record(state, {host, docroot, accesslog, accesslogfd, directory_indices,
|
||||||
default_content_type, content_types = []}).
|
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).
|
lists:foldl(fun(E, Acc) -> lists:concat([Acc, Separator, E]) end, H, T).
|
||||||
|
|
||||||
content_type(Filename, DefaultContentType, ContentTypes) ->
|
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
|
case lists:keysearch(Extension, 1, ContentTypes) of
|
||||||
{value, {_, ContentType}} -> ContentType;
|
{value, {_, ContentType}} -> ContentType;
|
||||||
false -> DefaultContentType
|
false -> DefaultContentType
|
||||||
@ -427,4 +421,4 @@ ip_to_string(Address) when size(Address) == 4 ->
|
|||||||
join(tuple_to_list(Address), ".");
|
join(tuple_to_list(Address), ".");
|
||||||
ip_to_string(Address) when size(Address) == 8 ->
|
ip_to_string(Address) when size(Address) == 8 ->
|
||||||
Parts = lists:map(fun (Int) -> io_lib:format("~.16B", [Int]) end, tuple_to_list(Address)),
|
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, ":"))).
|
||||||
|
Loading…
Reference in New Issue
Block a user