curl/docs/internals
Stefan Eissing 909af1a43b
multi: do transfer book keeping using mid
Change multi's book keeping of transfers to no longer use lists, but a
special table and bitsets for unsigned int values.

`multi-xfers` is the `uint_tbl` where `multi_add_handle()` inserts a new
transfer which assigns it a unique identifier `mid`. Use bitsets to keep
track of transfers that are in state "process" or "pending" or
"msgsent".

Use sparse bitsets to replace `conn->easyq` and event handlings tracking
of transfers per socket. Instead of pointers, keep the mids involved.

Provide base data structures and document them in docs/internal:
* `uint_tbl`: a table of transfers with `mid` as lookup key,
   handing out a mid for adds between 0 - capacity.
* `uint_bset`: a bitset keeping unsigned ints from 0 - capacity.
* `uint_spbset`: a sparse bitset for keeping a small number of
  unsigned int values
* `uint_hash`: for associating `mid`s with a pointer.

This makes the `mid` the recommended way to refer to transfers inside
the same multi without risk of running into a UAF.

Modifying table and bitsets is safe while iterating over them. Overall
memory requirements are lower as with the double linked list apprach.

Closes #16761
2025-04-17 17:28:38 +02:00
..
BUFQ.md docs: use lowercase curl and libcurl 2025-01-02 17:15:54 +01:00
BUFREF.md docs/internals: new subdirectory 2024-08-16 08:59:25 +02:00
CHECKSRC.md docs/internals: new subdirectory 2024-08-16 08:59:25 +02:00
CLIENT-READERS.md docs/internals: new subdirectory 2024-08-16 08:59:25 +02:00
CLIENT-WRITERS.md docs/internals: new subdirectory 2024-08-16 08:59:25 +02:00
CODE_STYLE.md CODE_STYLE: readability and banned functions 2025-02-16 16:11:13 +01:00
CONNECTION-FILTERS.md docs/internals: new subdirectory 2024-08-16 08:59:25 +02:00
DYNBUF.md lib: TLS session ticket caching reworked 2024-12-20 14:59:23 +01:00
HASH.md docs/internals: new subdirectory 2024-08-16 08:59:25 +02:00
LLIST.md docs: use lowercase curl and libcurl 2025-01-02 17:15:54 +01:00
MID.md multi: do transfer book keeping using mid 2025-04-17 17:28:38 +02:00
MQTT.md mqtt: send ping at upkeep interval 2025-04-16 09:36:19 +02:00
MULTI-EV.md multi: event based rework 2025-02-22 14:47:40 +01:00
NEW-PROTOCOL.md GHA: silence proselint warnings and an error 2024-10-15 16:44:17 +02:00
PORTING.md docs/internals/PORTING.md: new document 2025-03-29 14:10:10 +01:00
README.md docs/internals: new subdirectory 2024-08-16 08:59:25 +02:00
SPLAY.md internals/SPLAY.md: internal API documentation 2024-08-16 17:13:37 +02:00
STRPARSE.md STRPARSE: amend with recently added functions 2025-03-10 12:18:48 +01:00
TLS-SESSIONS.md docs/TLS-SESSIONS: fix typo, the->they 2025-01-21 09:23:26 +01:00
UINT_SETS.md multi: do transfer book keeping using mid 2025-04-17 17:28:38 +02:00
WEBSOCKET.md hyper: drop support 2024-12-21 11:33:05 +01:00

Internals

This directory contains documentation covering libcurl internals; APIs and concepts that are useful for contributors and maintainers.

Public APIs are documented in the public documentation, not here.