mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-20 17:27:00 +01:00
* src/ejabberd_socket.erl: Support for non-xml sockets
* src/ejabberd_c2s.erl: Likewise * src/ejabberd_s2s_in.erl: Likewise * src/ejabberd_service.erl: Likewise * src/web/ejabberd_http.erl: Likewise SVN Revision: 629
This commit is contained in:
parent
9ababf2a1d
commit
aa478100d8
19
ChangeLog
19
ChangeLog
@ -1,20 +1,29 @@
|
|||||||
|
2006-09-25 Alexey Shchepin <alexey@sevcom.net>
|
||||||
|
|
||||||
|
* src/ejabberd_socket.erl: Support for non-xml sockets
|
||||||
|
* src/ejabberd_c2s.erl: Likewise
|
||||||
|
* src/ejabberd_s2s_in.erl: Likewise
|
||||||
|
* src/ejabberd_service.erl: Likewise
|
||||||
|
* src/web/ejabberd_http.erl: Likewise
|
||||||
|
|
||||||
2006-09-24 Mickael Remond <mickael.remond@process-one.net>
|
2006-09-24 Mickael Remond <mickael.remond@process-one.net>
|
||||||
|
|
||||||
* src/msgs/es.msg: Updated Spanish translation (thanks to Badlop).
|
* src/msgs/es.msg: Updated Spanish translation (thanks to Badlop).
|
||||||
|
|
||||||
* src/mod_muc/mod_muc_room.erl: Strings update (thanks to Serguei
|
* src/mod_muc/mod_muc_room.erl: Strings update (thanks to Sergei
|
||||||
Golovan).
|
Golovan).
|
||||||
* src/msgs/ru.msg: Updated Russian translation (thanks to Serguei
|
* src/msgs/ru.msg: Updated Russian translation (thanks to Sergei
|
||||||
Golovan).
|
Golovan).
|
||||||
* src/msgs/uk.msg: Updated Ukrainian translation (thanks to Serguei
|
* src/msgs/uk.msg: Updated Ukrainian translation (thanks to Sergei
|
||||||
Golovan).
|
Golovan).
|
||||||
* src/msgs/fr.msg: Update French translation.
|
* src/msgs/fr.msg: Update French translation.
|
||||||
|
|
||||||
* src/doc/guide.html: Minor W3C compliance fix in an Hevea
|
* src/doc/guide.html: Minor W3C compliance fix in an Hevea
|
||||||
generated URL.
|
generated URL.
|
||||||
|
|
||||||
* src/doc/features.html: Added to be consistent (guide.html is in the
|
* src/doc/features.html: Added to be consistent (guide.html is in
|
||||||
repository to make Latex optional, but still allow access to the doc).
|
the repository to make Latex optional, but still allow access to
|
||||||
|
the doc).
|
||||||
|
|
||||||
2006-09-23 Mickael Remond <mickael.remond@process-one.net>
|
2006-09-23 Mickael Remond <mickael.remond@process-one.net>
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
start_link/2,
|
start_link/2,
|
||||||
send_text/2,
|
send_text/2,
|
||||||
send_element/2,
|
send_element/2,
|
||||||
|
socket_type/0,
|
||||||
get_presence/1]).
|
get_presence/1]).
|
||||||
|
|
||||||
%% gen_fsm callbacks
|
%% gen_fsm callbacks
|
||||||
@ -98,6 +99,9 @@ start(SockData, Opts) ->
|
|||||||
start_link(SockData, Opts) ->
|
start_link(SockData, Opts) ->
|
||||||
gen_fsm:start_link(ejabberd_c2s, [SockData, Opts], ?FSMOPTS).
|
gen_fsm:start_link(ejabberd_c2s, [SockData, Opts], ?FSMOPTS).
|
||||||
|
|
||||||
|
socket_type() ->
|
||||||
|
xml_stream.
|
||||||
|
|
||||||
%% Return Username, Resource and presence information
|
%% Return Username, Resource and presence information
|
||||||
get_presence(FsmRef) ->
|
get_presence(FsmRef) ->
|
||||||
gen_fsm:sync_send_all_state_event(FsmRef, {get_presence}, 1000).
|
gen_fsm:sync_send_all_state_event(FsmRef, {get_presence}, 1000).
|
||||||
|
@ -14,7 +14,8 @@
|
|||||||
%% External exports
|
%% External exports
|
||||||
-export([start/2,
|
-export([start/2,
|
||||||
start_link/2,
|
start_link/2,
|
||||||
match_domain/2]).
|
match_domain/2,
|
||||||
|
socket_type/0]).
|
||||||
|
|
||||||
%% gen_fsm callbacks
|
%% gen_fsm callbacks
|
||||||
-export([init/1,
|
-export([init/1,
|
||||||
@ -84,6 +85,9 @@ start(SockData, Opts) ->
|
|||||||
start_link(SockData, Opts) ->
|
start_link(SockData, Opts) ->
|
||||||
gen_fsm:start_link(ejabberd_s2s_in, [SockData, Opts], ?FSMOPTS).
|
gen_fsm:start_link(ejabberd_s2s_in, [SockData, Opts], ?FSMOPTS).
|
||||||
|
|
||||||
|
socket_type() ->
|
||||||
|
xml_stream.
|
||||||
|
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
%%% Callback functions from gen_fsm
|
%%% Callback functions from gen_fsm
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
|
@ -16,7 +16,8 @@
|
|||||||
-export([start/2,
|
-export([start/2,
|
||||||
start_link/2,
|
start_link/2,
|
||||||
send_text/2,
|
send_text/2,
|
||||||
send_element/2]).
|
send_element/2,
|
||||||
|
socket_type/0]).
|
||||||
|
|
||||||
%% gen_fsm callbacks
|
%% gen_fsm callbacks
|
||||||
-export([init/1,
|
-export([init/1,
|
||||||
@ -78,6 +79,9 @@ start(SockData, Opts) ->
|
|||||||
start_link(SockData, Opts) ->
|
start_link(SockData, Opts) ->
|
||||||
gen_fsm:start_link(ejabberd_service, [SockData, Opts], ?FSMOPTS).
|
gen_fsm:start_link(ejabberd_service, [SockData, Opts], ?FSMOPTS).
|
||||||
|
|
||||||
|
socket_type() ->
|
||||||
|
xml_stream.
|
||||||
|
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
%%% Callback functions from gen_fsm
|
%%% Callback functions from gen_fsm
|
||||||
%%%----------------------------------------------------------------------
|
%%%----------------------------------------------------------------------
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
%% Description:
|
%% Description:
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
start(Module, SockMod, Socket, Opts) ->
|
start(Module, SockMod, Socket, Opts) ->
|
||||||
|
case Module:socket_type() of
|
||||||
|
xml_stream ->
|
||||||
MaxStanzaSize =
|
MaxStanzaSize =
|
||||||
case lists:keysearch(max_stanza_size, 1, Opts) of
|
case lists:keysearch(max_stanza_size, 1, Opts) of
|
||||||
{value, {_, Size}} -> Size;
|
{value, {_, Size}} -> Size;
|
||||||
@ -48,7 +50,17 @@ start(Module, SockMod, Socket, Opts) ->
|
|||||||
{error, _Reason} ->
|
{error, _Reason} ->
|
||||||
SockMod:close(Socket)
|
SockMod:close(Socket)
|
||||||
end,
|
end,
|
||||||
ejabberd_receiver:become_controller(Receiver, Pid).
|
ejabberd_receiver:become_controller(Receiver, Pid);
|
||||||
|
raw ->
|
||||||
|
{ok, Pid} = Module:start({SockMod, Socket}, Opts),
|
||||||
|
case SockMod:controlling_process(Socket, Pid) of
|
||||||
|
ok ->
|
||||||
|
ok;
|
||||||
|
{error, _Reason} ->
|
||||||
|
SockMod:close(Socket)
|
||||||
|
end,
|
||||||
|
ejabberd_receiver:become_controller(Pid)
|
||||||
|
end.
|
||||||
|
|
||||||
connect(Addr, Port, Opts) ->
|
connect(Addr, Port, Opts) ->
|
||||||
case gen_tcp:connect(Addr, Port, Opts) of
|
case gen_tcp:connect(Addr, Port, Opts) of
|
||||||
@ -66,7 +78,7 @@ connect(Addr, Port, Opts) ->
|
|||||||
gen_tcp:close(Socket),
|
gen_tcp:close(Socket),
|
||||||
Error
|
Error
|
||||||
end;
|
end;
|
||||||
{error, Reason} = Error ->
|
{error, _Reason} = Error ->
|
||||||
Error
|
Error
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
-export([start/2,
|
-export([start/2,
|
||||||
start_link/2,
|
start_link/2,
|
||||||
become_controller/1,
|
become_controller/1,
|
||||||
|
socket_type/0,
|
||||||
receive_headers/1,
|
receive_headers/1,
|
||||||
url_encode/1]).
|
url_encode/1]).
|
||||||
|
|
||||||
@ -85,6 +86,9 @@ start_link({SockMod, Socket}, Opts) ->
|
|||||||
become_controller(_Pid) ->
|
become_controller(_Pid) ->
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
socket_type() ->
|
||||||
|
raw.
|
||||||
|
|
||||||
send_text(State, Text) ->
|
send_text(State, Text) ->
|
||||||
(State#state.sockmod):send(State#state.socket, Text).
|
(State#state.sockmod):send(State#state.socket, Text).
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user