25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-24 17:29:28 +01:00

* src/ejabberd_c2s.erl: Workaround to make SSL work properly

SVN Revision: 102
This commit is contained in:
Alexey Shchepin 2003-04-29 19:05:31 +00:00
parent 7f9929e1f0
commit 5b1379fe59
2 changed files with 22 additions and 4 deletions

View File

@ -1,7 +1,15 @@
2003-04-29 Alexey Shchepin <alexey@sevcom.net>
* src/ejabberd_c2s.erl: Workaround to make SSL work properly
2003-04-28 Alexey Shchepin <alexey@sevcom.net>
* src/mod_irc/mod_irc_connection.erl: Fixed URL to ejabberd
2003-04-17 Alexey Shchepin <alexey@sevcom.net>
* src/mod_muc/mod_muc.erl: Support for nick registration
2003-04-15 Alexey Shchepin <alexey@sevcom.net>
* src/ejabberd_c2s.erl: Some fixes in work with socket

View File

@ -641,10 +641,16 @@ terminate(Reason, StateName, StateData) ->
receiver(Socket, SockMod, Shaper, C2SPid) ->
XMLStreamPid = xml_stream:start(C2SPid),
ShaperState = shaper:new(Shaper),
receiver(Socket, SockMod, ShaperState, C2SPid, XMLStreamPid).
Timeout = case SockMod of
ssl ->
20;
_ ->
infinity
end,
receiver(Socket, SockMod, ShaperState, C2SPid, XMLStreamPid, Timeout).
receiver(Socket, SockMod, ShaperState, C2SPid, XMLStreamPid) ->
case SockMod:recv(Socket, 0) of
receiver(Socket, SockMod, ShaperState, C2SPid, XMLStreamPid, Timeout) ->
case SockMod:recv(Socket, 0, Timeout) of
{ok, Text} ->
ShaperSt1 = receive
{change_shaper, Shaper} ->
@ -654,7 +660,11 @@ receiver(Socket, SockMod, ShaperState, C2SPid, XMLStreamPid) ->
end,
NewShaperState = shaper:update(ShaperSt1, size(Text)),
xml_stream:send_text(XMLStreamPid, Text),
receiver(Socket, SockMod, NewShaperState, C2SPid, XMLStreamPid);
receiver(Socket, SockMod, NewShaperState, C2SPid, XMLStreamPid,
Timeout);
{error, timeout} ->
receiver(Socket, SockMod, ShaperState, C2SPid, XMLStreamPid,
Timeout);
{error, Reason} ->
exit(XMLStreamPid, closed),
gen_fsm:send_event(C2SPid, closed),