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: is_close_frame(_) -> false.
  
  -spec websocket_close(#state{}, any(), terminate_reason()) -> no_return().
  websocket_close(State, HandlerState, Reason) ->
  	websocket_send_close(State, Reason),
  	terminate(State, HandlerState, Reason).
  
  websocket_send_close(#state{socket=Socket, transport=Transport,
  		extensions=Extensions}, Reason) ->
  	_ = case Reason of
  		Normal when Normal =:= stop; Normal =:= timeout ->
  			Transport:send(Socket, cow_ws:frame({close, 1000, <<>>}, Extensions));
  		{error, badframe} ->
  