Change #252345
| Category | curl |
| Changed by | Stefan Eissing <stefan@eissing.org> |
| Changed at | Tue 16 Dec 2025 08:48:44 |
| Repository | https://github.com/curl/curl.git |
| Project | curl |
| Branch | master |
| Revision | 2de22a00c7adb81b4e5cbc90785e29b4b083c1ed |
Comments
lib: keep timestamp in easy handle Use `data->progress.now` as the timestamp of proecssing a transfer. Update it on significant events and refrain from calling `curlx_now()` in many places. The problem this addresses is a) calling curlx_now() has costs, depending on platform. Calling it every time results in 25% increase `./runtest` duration on macOS. b) we used to pass a `struct curltime *` around to save on calls, but when some method directly use `curx_now()` and some use the passed pointer, the transfer experienes non-linear time. This results in timeline checks to report events in the wrong order. By keeping a timestamp in the easy handle and updating it there, no longer invoking `curlx_now()` in the "lower" methods, the transfer can observer a steady clock progression. Add documentation in docs/internals/TIME-KEEPING.md Reported-by: Viktor Szakats Fixes #19935 Closes #19961
Changed files
- docs/Makefile.am
- docs/internals/TIME-KEEPING.md
- lib/asyn-ares.c
- lib/asyn-thrdd.c
- lib/cf-h1-proxy.c
- lib/cf-h2-proxy.c
- lib/cf-https-connect.c
- lib/cf-ip-happy.c
- lib/cf-socket.c
- lib/cfilters.c
- lib/conncache.c
- lib/conncache.h
- lib/connect.c
- lib/connect.h
- lib/cshutdn.c
- lib/curl_trc.c
- lib/doh.c
- lib/easy.c
- lib/file.c
- lib/ftp.c
- lib/gopher.c
- lib/hostip.c
- lib/http.c
- lib/http2.c
- lib/imap.c
- lib/mqtt.c
- lib/multi.c
- lib/multi_ev.c
- lib/multi_ev.h
- lib/multiif.h
- lib/pingpong.c
- lib/pingpong.h
- lib/pop3.c
- lib/progress.c
- lib/progress.h
- lib/ratelimit.c
- lib/ratelimit.h
- lib/request.c
- lib/sendf.c
- lib/setopt.c
- lib/smb.c
- lib/smtp.c
- lib/socks.c
- lib/telnet.c
- lib/tftp.c
- lib/transfer.c
- lib/transfer.h
- lib/url.c
- lib/url.h
- lib/urldata.h
- lib/vquic/curl_ngtcp2.c
- lib/vquic/curl_osslq.c
- lib/vquic/curl_quiche.c
- lib/vquic/vquic.c
- lib/vquic/vquic_int.h
- lib/vssh/libssh.c
- lib/vssh/libssh2.c
- lib/vtls/gtls.c
- lib/vtls/openssl.c
- lib/vtls/schannel.c
- lib/vtls/vtls.c
- lib/vtls/wolfssl.c
- lib/ws.c
- tests/data/test2500
- tests/unit/unit1303.c
- tests/unit/unit1399.c
- tests/unit/unit3216.c