Skip to content

Commit 10e89cc

Browse files
committed
Send all received WebSocket frames to app
Prior to this commit, if the WebSocket client received multiple WebSocket frames in a single Erlang message by gen_tcp, the WebSocket client sent only the first received WebSocket frame to the application. This commit fixes this bug by having the WebSocket client send all WebSocket frames to the application. (cherry picked from commit 3d7a027)
1 parent 2ada857 commit 10e89cc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

deps/rabbitmq_ct_client_helpers/src/rfc6455_client.erl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ do_recv(State = #state{phase = opening, ppid = PPid, data = Data}) ->
160160
State#state{phase = open,
161161
data = Data1}
162162
end;
163-
do_recv(State = #state{phase = Phase, data = Data, socket = Socket, transport = Transport, ppid = PPid})
163+
do_recv(State0 = #state{phase = Phase, data = Data, socket = Socket, transport = Transport, ppid = PPid})
164164
when Phase =:= open orelse Phase =:= closing ->
165165
R = case Data of
166166
<<F:1, _:3, O:4, 0:1, L:7, Payload:L/binary, Rest/binary>>
@@ -181,8 +181,10 @@ do_recv(State = #state{phase = Phase, data = Data, socket = Socket, transport =
181181
end,
182182
case R of
183183
moredata ->
184-
State;
185-
_ -> do_recv2(State, R)
184+
State0;
185+
_ ->
186+
State = do_recv2(State0, R),
187+
do_recv(State)
186188
end.
187189

188190
do_recv2(State = #state{phase = Phase, socket = Socket, ppid = PPid, transport = Transport}, R) ->

0 commit comments

Comments
 (0)