anchor.diff:  			websocket_data(State2, HandlerState,
   				<< SoFar/binary, Data/binary >>);
   		{Closed, Socket} ->
  -			handler_terminate(State, HandlerState, {error, closed});
  +			terminate(State, HandlerState, {error, closed});
   		{Error, Socket, Reason} ->
  -			handler_terminate(State, HandlerState, {error, Reason});
  +			terminate(State, HandlerState, {error, Reason});
   		{timeout, TRef, ?MODULE} ->
   			websocket_close(State, HandlerState, timeout);
   		{timeout, OlderTRef, ?MODULE} when is_reference(OlderTRef) ->
  
positive.code: 			websocket_payload(State2, HandlerState,
  				Type, Len, MaskKey, Rsv, CloseCode, Unmasked, UnmaskedLen, Data);
  		{Closed, Socket} ->
  			handler_terminate(State, HandlerState, {error, closed});
  		{Error, Socket, Reason} ->
  			handler_terminate(State, HandlerState, {error, Reason});
  		{timeout, TRef, ?MODULE} ->
  			websocket_close(State, HandlerState, timeout);
  		{timeout, OlderTRef, ?MODULE} when is_reference(OlderTRef) ->
  
negative.code: 		{remote, Code, _} ->
  			Transport:send(Socket, cow_ws:frame({close, Code, <<>>}, Extensions))
  	end,
  	ok.
  
  -spec terminate(#state{}, any(), terminate_reason()) -> no_return().
  terminate(State, HandlerState, Reason) ->
  	handler_terminate(State, HandlerState, Reason),
  	exit(normal).
  
  handler_terminate(#state{handler=Handler}, HandlerState, Reason) ->
  	cowboy_handler:terminate(Reason, undefined, HandlerState, Handler).
  