]> git.ipfire.org Git - thirdparty/curl.git/commit
multi: event based rework
authorStefan Eissing <stefan@eissing.org>
Sat, 22 Feb 2025 11:46:42 +0000 (12:46 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 22 Feb 2025 13:47:40 +0000 (14:47 +0100)
commitcfc657a48dbafb4194676d4c9d841388b3a22210
treeb8a4a2cab9a9a55e95f75f2b818127f9a364d013
parent886f5dea80135d6e70af5f68939f7ed194ef3671
multi: event based rework

Rework the event based handling of transfers and connections to
be "localized" into a single source file with clearer dependencies.

- add multi_ev.c and multi_ev.h
- add docs/internal/MULTI-EV.md to explain the overall workings
- only do event handling book keeping when the socket callback
  is set
- add handling for "connection only" event tracking, when internal
  easy handles are used that are not really tied to a connection.
  Used in connection pool.
- remove transfer member "last_poll" and connections "shutdown_poll"
  and keep all that internal to multi_ev.c
- add CURL_TRC_M() for tracing of "multi" related things, including
  event handling and connection pool operations. Add new trace
  feature "multi" for trace config.
  multi traces will show exactly what is going on in regard to
  event handling.
- multi: trace transfers "mstate" in every CURL_TRC_M() call
- make internal trace buffer 2048 bytes and end the silliness
  with +n here -m there. Adjust test 1652 expectations of resulting
  length and input edge cases.
- add trace feature "lib-ids" to perfix libcurl traces with transfer
  and connection ids. Useful for debugging libcurl applications.

Closes #16308
24 files changed:
docs/Makefile.am
docs/internals/MULTI-EV.md [new file with mode: 0644]
docs/libcurl/curl_global_trace.md
lib/Makefile.inc
lib/asyn-ares.c
lib/asyn-thread.c
lib/asyn.h
lib/cf-socket.c
lib/cfilters.c
lib/cfilters.h
lib/conncache.c
lib/conncache.h
lib/curl_trc.c
lib/curl_trc.h
lib/easy.c
lib/multi.c
lib/multi_ev.c [new file with mode: 0644]
lib/multi_ev.h [new file with mode: 0644]
lib/multihandle.h
lib/multiif.h
lib/urldata.h
tests/http/test_15_tracing.py
tests/http/test_19_shutdown.py
tests/unit/unit1652.c