anchor.diff:              ready_to_send(NewTimerState#state{client=Pid,
                                                 connect_time=ConnectEnd,
                                                 reconnect_attempt=0});
  +        ignore ->
  +            http_fail(State);
           Why ->
               ConnectEnd = os:timestamp(),
               ?WARN("drain_id=~p channel_id=~p dest=~s at=try_connect "
  
positive.code:                                                 notify, Size),
      State#state{buf = Buf}.
  
  maybe_resize(Status, Buf) ->
      case Status of
          normal ->
              ok;
          degraded ->
              logplex_drain_buffer:resize_msg_buffer(Buf, default_buf_size())
      end.
  
  maybe_shrink(State = #state{last_good_time=never}) ->
      ?INFO("drain_id=~p channel_id=~p dest=~s at=maybe_shrink"
            " service=~p last_good_time=~p",
            log_info(State, [degraded, never])),
      State#state{service=degraded};
  maybe_shrink(State = #state{buf=Buf, service=Status, last_good_time=LastGood}) ->
      case {(now_to_msec(LastGood) < now_to_msec(os:timestamp())-?SHRINK_TIMEOUT),
                     Status} of
          {true, normal} ->
              ?INFO("drain_id=~p channel_id=~p dest=~s at=maybe_shrink"
                    " service=~p last_good_time=~s",
                    log_info(State, [degraded, logplex_utils:format_utc_timestamp(LastGood)])),
              logplex_drain_buffer:resize_msg_buffer(Buf, ?SHRINK_BUF_SIZE),
              State#state{service=degraded};
          {_, _} ->
              ?INFO("drain_id=~p channel_id=~p dest=~s at=maybe_shrink"
                    " service=~p last_good_time=~s",
                    log_info(State, [normal, logplex_utils:format_utc_timestamp(LastGood)])),
              State#state{service=normal}
      end.
  
  now_to_msec({Mega,Sec,_}) -> (Mega*1000000 + Sec)*1000.
  
  default_buf_size() -> logplex_app:config(http_drain_buffer_size, 1024).
  
negative.code: 
  -export([user_agent/0
           ,drain_buf_framing/1
           ,backoff_slot/1
          ]).
  
  %% ------------------------------------------------------------------
  