anchor.diff:      advanced_messages(FrameInfos, State, State#state.timeout).
   
   advanced_messages([], State, Tout) ->
  -    {ok, State#state{unused_stream= <<>>}, Tout};
  -advanced_messages([{frame_incomplete, Unused}], State, Tout) ->
  -    %% Unused is a part of a potentially large (some kb) binary,
  -    %% so we copy it to detach it for gc purposes
  -    {ok, State#state{unused_stream=binary:copy(Unused,1)}, Tout};
  +    {ok, State, Tout};
   advanced_messages([FrameInfo|Rest], #state{close_timer=TRef}=State,
                     Tout) when TRef /= undefined ->
       case FrameInfo of
  
positive.code:     basic_messages(FrameInfos, State, State#state.timeout).
  
  basic_messages([], State, Tout) ->
      {ok, State#state{unused_stream = <<>>}, Tout};
  basic_messages([{frame_incomplete, Unused}], State, Tout) ->
      %% Unused is a part of a potentially large (some kb) binary,
      %% so we copy it to detach it for gc purposes
      {ok, State#state{unused_stream = binary:copy(Unused, 1)}, Tout};
  basic_messages([FrameInfo|Rest],
                 #state{cbinfo=CbInfo, cbstate={FrameState,CbState}}=State,
                 Tout) ->
  
negative.code: %% your socket receive buffer.
  %%
  %% -> { #ws_state, [#ws_frame_info,...,#ws_frame_info] }
  unframe(WSState, FirstPacket, Opts) ->
      unframe(WSState, FirstPacket, Opts, []).
  
  unframe(_WSState, <<>>, _Opts, Acc) ->
      {lists:reverse(Acc), <<>>};
  unframe(WSState, FirstPacket, Opts, Acc) ->
      case unframe_one(WSState, FirstPacket, Opts) of
          {FrameInfo = #ws_frame_info{ws_state = NewWSState}, RestBin} ->
              %% Every new recursion uses the #ws_state from the calling
              %% recursion.
              unframe(NewWSState, RestBin, Opts, [FrameInfo | Acc]);
          frame_incomplete ->
              {lists:reverse(Acc), FirstPacket};
          Fail ->
              {lists:reverse([Fail | Acc]), <<>>}
      end.
  
  %% -> {#ws_frame_info, RestBin} | {fail_connection, Reason}
  