Commit ab6d2327 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

Curl_expire_latest: ignore already expired timers

If the existing timer is still in there but has expired, the new timer
should be added.

Reported-by: Rainer Canavan
Bug: https://curl.haxx.se/mail/lib-2017-04/0030.html
Closes #1407
parent f7991305
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -3003,10 +3003,13 @@ void Curl_expire_latest(struct Curl_easy *data, time_t milli)
       Compare if the new time is earlier, and only remove-old/add-new if it
       is. */
    time_t diff = curlx_tvdiff(set, *expire);
    if(diff > 0)
      /* the new expire time was later than the top time, so just skip this */
    if((diff > 0) && (diff < milli)) {
      /* if the new expire time is later than the top time, skip it, but not
         if the diff is larger than the new offset since then the previous
         time is already expired! */
      return;
    }
  }

  /* Just add the timeout like normal */
  Curl_expire(data, milli);
+1 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ TFTP RRQ
# Server-side
<reply>
<servercmd>
writedelay: 1
writedelay: 2
</servercmd>
# ~1200 bytes (so that they don't fit in two 512 byte chunks)
<data nocheck="yes">