anchor.diff:      {next_state, StateName, State}.
   
   %% @private
  +handle_sync_event({set_target_send_size, Size}, _From, StateName,
  +                  State = #state{})
  +  when is_integer(Size), Size > 0 ->
  +    put(target_send_size, Size),
  +    {reply, {ok, Size}, StateName, State};
   handle_sync_event({resize_msg_buffer, NewSize}, _From, StateName,
                     State = #state{buf = Buf})
     when is_integer(NewSize), NewSize > 0 ->
  
positive.code: resize_msg_buffer(Pid, NewSize)
    when is_integer(NewSize), NewSize > 0 ->
      gen_fsm:sync_send_all_state_event(Pid, {resize_msg_buffer, NewSize}).
  
  %% ------------------------------------------------------------------
  %% gen_fsm Function Definitions
  
negative.code:         ({msg, MData}) ->
              {frame, Frame(MData)}
      end.
  
  target_send_size() ->
      case get(target_send_size) of
          Size when is_integer(Size),
                    Size > 0 ->
              Size;
          _ ->
              logplex_app:config(tcp_drain_target_bytes,
                                 ?TARGET_SEND_SIZE)
      end.
  