anchor.diff:  handle_frame(Bin, Len, ?SETTINGS, Flag, 0, State)
     when Len rem ?SETTINGS_ENTRY_SIZE =:= 0 ->
       <<Payload:Len/binary, NextBin/binary>> = Bin,
  -    case Flag band ?FLAG_ACK > 0 of
  -        true when Len =:= 0 ->
  -            on_recv(NextBin, State);
  -        true ->
  -            connection_error(State, ?PROTOCOL_ERROR);
  -        false ->
  -            State2 = parse_settings(Payload, State),
  -            on_recv(NextBin, State2)
  -    end;
  +    handle_settings(Payload, Len, Flag band ?FLAG_ACK > 0, State, NextBin);
   handle_frame(_Bin, _, ?SETTINGS, _Flag, _, State) ->
       connection_error(State, ?FRAME_SIZE_ERROR);
   handle_frame(<<_:1, Delta:31, NextBin/binary>>, 4, ?WINDOW_UPDATE, _Flag,
  
positive.code:                 hpackenc=hpack:new_encoder(), %% hpack encoder
                  hpackdec=hpack:new_decoder(), %% hpack decoder
                  initial_window_size=?REMOTE_STREAM_WINDOW_SIZE,
                  %% remove connection window size
                  remotewin=?REMOTE_SESSION_WINDOW_SIZE,
                  localwin=?LOCAL_SESSION_WINDOW_SIZE,
  
negative.code:                                    Stream#stream{remotewin=NewWin}
                             end, Streams),
      parse_settings(Rest, State#state{initial_window_size=InitialWindowSize,
                                       streams=Streams2}, NextBin);
  parse_settings(<<16#2:16, 0:32, Rest/binary>>, State, NextBin) ->
      %% SETTINGS_ENABLE_PUSH
      parse_settings(Rest, State#state{remote_enable_push=false}, NextBin);
  parse_settings(<<16#2:16, 1:32, Rest/binary>>, State, NextBin) ->
      %% SETTINGS_ENABLE_PUSH
      parse_settings(Rest, State#state{remote_enable_push=true}, NextBin);
  parse_settings(<<16#2:16, _:32, _Rest/binary>>, State, _NextBin) ->
      %% SETTINGS_ENABLE_PUSH with value not in {0,1} is error.
      connection_error(State, ?PROTOCOL_ERROR);
  parse_settings(<<_:16, _:32, Rest/binary>>, State, NextBin) ->
      parse_settings(Rest, State, NextBin);
  parse_settings(<<>>, State, NextBin) ->
      send_settings_ack(State),
      on_recv(NextBin, State).
  
  start_request(StreamId, Headers, StreamState,
                State=#state{streams=Streams, pids=Pids}) ->
  