24
1
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:
Paweł Chmielowski 2013-01-31 20:11:02 +01:00
parent ceeef24faa
commit acee58f6bb

View File

@ -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>>