cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] getinfo.c: reset timecond when clearing session-info variables

From: Alessandro Ghedini <alessandro_at_ghedini.me>
Date: Sat, 20 Apr 2013 13:09:26 +0200

Hi,

as reported at [0], the timecond session variable doesn't get reset before
performing a request, so CURLINFO_CONDITION_UNMET may report wrong values (ie
"1" when it should be "0") if eg the CURLOPT_TIMEVALUE option changes between
requests.

The attached test case does two requests: the first with TIMEVALUE set into the
future so CURLINFO_CONDITION_UNMET reports "1" after, the second with TIMEVALUE
in the past, but CURLINFO_CONDITION_UNMET still reports "1". If the first
request is commented out the CURLINFO_CONDITION_UNMET of the remaining request
reports correctly "0".

Also attached is the patch that should fix this.

Cheers

[0] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=705783

-- 
perl -E '$_=q;$/= @{[@_]};and s;\S+;<inidehG ordnasselA>;eg;say~~reverse'


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2013-04-20