anchor.diff:          empty ->
               {next_state, ready_to_send, State};
           not_empty ->
  -            PktSize = logplex_app:config(tcp_drain_target_bytes,
  -                                         ?TARGET_SEND_SIZE),
  +            PktSize = target_send_size(),
               {Data, N, NewBuf} =
                   buffer_to_pkts(Buf, PktSize, DrainTok),
               Ref = erlang:start_timer(?SEND_TIMEOUT, self(), ?SEND_TIMEOUT_MSG),
  
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.
  