anchor.diff:  	end;
   %% Other frames have a binary payload.
   websocket_payload(State, Req, HandlerState,
  -		Opcode, Len, MaskKey, Unmasked, Data, Rsv)
  +		Opcode, Len, MaskKey, Unmasked, UnmaskedLen, Data, Rsv)
   		when byte_size(Data) < Len ->
   	Unmasked2 = websocket_unmask(Data,
  -		rotate_mask_key(MaskKey, byte_size(Unmasked)), Unmasked),
  +		rotate_mask_key(MaskKey, UnmaskedLen), <<>>),
   	{Unmasked3, State2} = websocket_inflate_frame(Unmasked2, Rsv, false, State),
   	websocket_payload_loop(State2, Req, HandlerState,
  -		Opcode, Len - byte_size(Data), MaskKey, Unmasked3, Rsv);
  +		Opcode, Len - byte_size(Data), MaskKey,
  +		<< Unmasked/binary, Unmasked3/binary >>, UnmaskedLen + byte_size(Data),
  +		Rsv);
   websocket_payload(State, Req, HandlerState,
  -		Opcode, Len, MaskKey, Unmasked, Data, Rsv) ->
  +		Opcode, Len, MaskKey, Unmasked, UnmaskedLen, Data, Rsv) ->
   	<< End:Len/binary, Rest/bits >> = Data,
   	Unmasked2 = websocket_unmask(End,
  -		rotate_mask_key(MaskKey, byte_size(Unmasked)), Unmasked),
  +		rotate_mask_key(MaskKey, UnmaskedLen), <<>>),
   	{Unmasked3, State2} = websocket_inflate_frame(Unmasked2, Rsv, true, State),
  -	websocket_dispatch(State2, Req, HandlerState, Rest, Opcode, Unmasked3).
  +	websocket_dispatch(State2, Req, HandlerState, Rest, Opcode,
  +		<< Unmasked/binary, Unmasked3/binary >>).
   
   -spec websocket_inflate_frame(binary(), rsv(), boolean(), #state{}) ->
   		{binary(), #state{}}.
  
positive.code: 		Utf8State ->
  			websocket_payload_loop(State2#state{utf8_state=Utf8State},
  				Req, HandlerState, Opcode, Len - byte_size(Data), MaskKey,
  				<< Unmasked/binary, Unmasked3/binary >>, Rsv)
  	end;
  websocket_payload(State=#state{frag_state={Fin, 1, _}, utf8_state=Incomplete},
  		Req, HandlerState, Opcode=0, Len, MaskKey, Unmasked, Data, Rsv) ->
  	<< End:Len/binary, Rest/bits >> = Data,
  	Unmasked2 = websocket_unmask(End,
  		rotate_mask_key(MaskKey, byte_size(Unmasked)), <<>>),
  	{Unmasked3, State2} = websocket_inflate_frame(Unmasked2, Rsv, true, State),
  	case is_utf8(<< Incomplete/binary, Unmasked3/binary >>) of
  		<<>> ->
  
negative.code: 	false.
  
  -spec websocket_payload_loop(#state{}, Req, any(),
  		opcode(), non_neg_integer(), mask_key(), binary(),
  		non_neg_integer(), rsv())
  	-> {ok, Req, cowboy_middleware:env()}
  	| {suspend, module(), atom(), [any()]}
  	when Req::cowboy_req:req().
  websocket_payload_loop(State=#state{socket=Socket, transport=Transport,
  		messages={OK, Closed, Error}, timeout_ref=TRef},
  		Req, HandlerState, Opcode, Len, MaskKey, Unmasked, UnmaskedLen, Rsv) ->
  	Transport:setopts(Socket, [{active, once}]),
  	receive
  		{OK, Socket, Data} ->
  			State2 = handler_loop_timeout(State),
  			websocket_payload(State2, Req, HandlerState,
  				Opcode, Len, MaskKey, Unmasked, UnmaskedLen, Data, Rsv);
  		{Closed, Socket} ->
  			handler_terminate(State, Req, HandlerState, {error, closed});
  		{Error, Socket, Reason} ->
  