mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Fix crash when using IOlists with some Websocket frames
Backported from Cowlib's patch from Rob Ashton <robashton@codeofrob.com>.
This commit is contained in:
parent
26a648ef17
commit
04eadae381
1 changed files with 1 additions and 1 deletions
|
@ -570,7 +570,7 @@ websocket_dispatch(State, Req, HandlerState, _RemainingData, 8,
|
|||
%% Ping control frame. Send a pong back and forward the ping to the handler.
|
||||
websocket_dispatch(State=#state{socket=Socket, transport=Transport},
|
||||
Req, HandlerState, RemainingData, 9, Payload) ->
|
||||
Len = payload_length_to_binary(byte_size(Payload)),
|
||||
Len = payload_length_to_binary(iolist_size(Payload)),
|
||||
Transport:send(Socket, << 1:1, 0:3, 10:4, 0:1, Len/bits, Payload/binary >>),
|
||||
handler_call(State, Req, HandlerState, RemainingData,
|
||||
websocket_handle, {ping, Payload}, fun websocket_data/4);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue