/* The start time is stored in progress.t_acceptdata - as set with Curl_pgrsTime(..., TIMER_STARTACCEPT);  */
static timediff_t ftp_timeleft_accept(struct Curl_easy *data)
/* The start time is stored in progress.t_acceptdata - as set with Curl_pgrsTime(..., TIMER_STARTACCEPT);  */
static timediff_t ftp_timeleft_accept(struct Curl_easy *data)
{
  timediff_t timeout_ms = DEFAULT_ACCEPT_TIMEOUT;
  timediff_t other;
  struct curltime now;
  if(data->set.accepttimeout > 0)
    timeout_ms = data->set.accepttimeout;
  now = Curl_now();
  other =  Curl_timeleft(data, &now, FALSE);
  if(other && (other < timeout_ms))
    timeout_ms = other;
  else {
    timeout_ms -= Curl_timediff(now, data->progress.t_acceptdata);
    if(!timeout_ms)
      return -1;
  }
  return timeout_ms;
}