mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-12 17:01:52 +01:00
Fix problem with c2s buffering on old style websocket connections
Old style websocket do use binaries for transferring data to C2S, so when we buffer that data we need to handle it different than list of #xml structs used by new style connections. This fixes github issue #515.
This commit is contained in:
parent
64978b3d9c
commit
81b0643036
@ -138,7 +138,9 @@ handle_event({activate, From}, StateName, StateData) ->
|
||||
StateData#state{waiting_input = From}};
|
||||
Input ->
|
||||
Receiver = From,
|
||||
Receiver ! {tcp, StateData#state.socket, Input},
|
||||
lists:foreach(fun(I) ->
|
||||
Receiver ! {tcp, StateData#state.socket, I}
|
||||
end, Input),
|
||||
{next_state, StateName,
|
||||
StateData#state{input = [], waiting_input = false,
|
||||
last_receiver = Receiver}}
|
||||
@ -209,7 +211,7 @@ handle_info({received, Packet}, StateName, StateDataI) ->
|
||||
{StateData, Parsed} = parse(StateDataI, Packet),
|
||||
SD = case StateData#state.waiting_input of
|
||||
false ->
|
||||
Input = StateData#state.input ++ Parsed,
|
||||
Input = StateData#state.input ++ if is_binary(Parsed) -> [Parsed]; true -> Parsed end,
|
||||
StateData#state{input = Input};
|
||||
Receiver ->
|
||||
Receiver ! {tcp, StateData#state.socket, Parsed},
|
||||
|
Loading…
Reference in New Issue
Block a user