mirror of
https://github.com/processone/ejabberd.git
synced 2024-09-29 14:37:44 +02:00
Fix problem from conversion to binaries in old websocket protocol handler
This commit is contained in:
parent
ceeef24faa
commit
acee58f6bb
@ -283,7 +283,7 @@ check_headers(Headers, RequiredHeaders) ->
|
||||
end.
|
||||
|
||||
recv_data(#ws{buf = Buf} = Ws, Length, _Timeout) when size(Buf) >= Length->
|
||||
<<Data:Length, Tail/binary>> = Buf,
|
||||
<<Data:Length/binary, Tail/binary>> = Buf,
|
||||
{Ws#ws{buf = Tail}, Data};
|
||||
recv_data(#ws{buf = Buf, socket = Sock, sockmod = SockMod} = Ws, Length, Timeout) ->
|
||||
case SockMod of
|
||||
@ -318,7 +318,7 @@ handshake(#ws{vsn = {'draft-hixie', 0}, headers = Headers, path = Path,
|
||||
{NewState, Body} = recv_data(State, 8, 30*1000),
|
||||
|
||||
QParams = lists:map(
|
||||
fun({nokey,[]})->
|
||||
fun({nokey,<<>>})->
|
||||
none;
|
||||
({K, V})->
|
||||
<<K/binary, "=", V/binary>>
|
||||
|
Loading…
Reference in New Issue
Block a user