2
0
mirror of https://github.com/curl/curl.git synced 2025-04-18 16:30:45 +08:00
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 
2025-04-17 17:28:38 +02:00
..
2025-04-06 11:31:22 +02:00
2025-04-04 13:23:15 -07:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2025-01-10 08:20:03 +01:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2025-01-10 08:20:03 +01:00
2025-04-04 13:23:15 -07:00
2024-12-21 11:33:05 +01:00
2022-05-22 23:26:24 +02:00
2022-05-22 23:26:24 +02:00
2022-05-22 23:26:24 +02:00
2022-05-22 23:26:24 +02:00
2022-05-22 23:26:24 +02:00
2022-05-22 23:26:24 +02:00
2024-07-16 00:44:55 +02:00
2024-09-26 08:44:59 +02:00
2024-12-21 11:33:05 +01:00
2024-06-11 09:07:43 +02:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2025-04-04 13:23:15 -07:00
2025-03-25 16:47:48 +01:00
2025-03-25 16:47:48 +01:00
2025-03-25 16:47:48 +01:00
2025-03-25 16:47:48 +01:00
2025-03-25 16:47:48 +01:00
2025-03-25 16:47:48 +01:00
2025-03-25 16:47:48 +01:00
2025-04-04 13:23:15 -07:00
2024-07-16 00:44:55 +02:00
2024-07-16 00:44:55 +02:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2025-03-25 16:47:48 +01:00
2024-07-16 00:44:55 +02:00
2024-08-04 19:17:45 +02:00
2024-12-21 11:33:05 +01:00
2024-01-08 22:38:22 +01:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-03-25 16:47:48 +01:00
2025-03-25 16:47:48 +01:00
2025-03-25 16:47:48 +01:00
2025-04-03 23:18:55 +02:00
2024-12-21 11:33:05 +01:00
2025-04-04 13:23:15 -07:00
2024-07-16 00:44:55 +02:00
2025-04-04 13:23:15 -07:00
2024-07-16 00:44:55 +02:00
2024-07-16 00:44:55 +02:00
2024-07-16 00:44:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2022-03-17 14:24:14 +01:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2024-09-26 23:36:09 +02:00
2024-09-26 23:36:09 +02:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2025-03-25 16:47:48 +01:00
2025-03-25 16:47:48 +01:00
2024-12-21 11:33:05 +01:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2024-07-16 00:44:55 +02:00
2024-07-16 00:44:55 +02:00
2025-04-03 23:18:55 +02:00
2024-12-21 11:33:05 +01:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2024-08-15 14:01:24 +02:00
2025-04-04 13:23:15 -07:00
2023-07-31 11:51:34 +02:00
2024-07-16 00:44:55 +02:00
2024-07-16 00:44:55 +02:00
2025-04-03 23:18:55 +02:00
2024-07-16 00:44:55 +02:00
2024-07-16 00:44:55 +02:00
2023-07-31 11:51:34 +02:00
2023-07-31 11:51:34 +02:00
2023-07-31 11:51:34 +02:00
2023-07-31 11:51:34 +02:00
2023-07-31 11:51:34 +02:00
2023-07-31 11:51:34 +02:00
2023-11-28 14:23:06 +01:00
2024-03-19 07:45:05 +01:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2025-01-24 10:59:02 +01:00
2024-07-16 00:44:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-04 13:23:15 -07:00
2025-01-10 08:20:03 +01:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2025-02-28 12:47:31 +01:00
2025-03-11 14:52:40 +01:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2024-02-01 22:37:26 +01:00
2025-04-04 13:23:15 -07:00
2025-01-10 08:20:03 +01:00
2024-07-04 18:12:40 +02:00
2024-12-21 11:33:05 +01:00
2024-09-26 17:02:09 +02:00
2025-04-04 13:23:15 -07:00
2021-10-27 22:57:26 +02:00
2024-12-21 11:33:05 +01:00
2024-08-09 09:39:17 +02:00
2024-08-14 11:49:05 +02:00
2024-12-21 11:33:05 +01:00
2025-04-04 13:23:15 -07:00
2024-08-14 11:50:02 +02:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2022-05-31 16:09:53 +02:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2024-07-16 00:44:55 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 19:55:01 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-04 13:23:15 -07:00
2024-07-16 00:44:55 +02:00
2024-07-16 00:44:55 +02:00
2024-07-16 00:44:55 +02:00
2024-07-16 00:44:55 +02:00
2024-07-16 00:44:55 +02:00
2024-07-16 00:44:55 +02:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2024-07-16 00:44:55 +02:00
2024-07-16 00:44:55 +02:00
2024-07-16 00:44:55 +02:00
2024-08-04 19:17:45 +02:00
2025-04-04 13:23:15 -07:00
2024-09-26 08:44:59 +02:00
2024-09-26 08:44:59 +02:00
2024-09-26 08:44:59 +02:00
2024-09-26 08:44:59 +02:00
2024-09-26 08:44:59 +02:00
2024-09-26 08:44:59 +02:00
2024-09-26 08:44:59 +02:00
2024-09-26 08:44:59 +02:00
2024-09-26 08:44:59 +02:00
2024-09-26 08:44:59 +02:00
2024-09-26 08:44:59 +02:00
2024-09-26 08:44:59 +02:00
2024-09-26 08:44:59 +02:00
2024-09-26 08:44:59 +02:00
2024-07-16 00:44:55 +02:00
2025-04-03 08:26:33 +02:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-04 13:23:15 -07:00
2024-07-29 14:55:06 +02:00
2024-08-04 23:28:09 +02:00
2024-08-04 23:28:09 +02:00
2024-08-04 23:28:09 +02:00
2024-08-30 15:38:25 +02:00
2024-10-13 23:18:42 +02:00
2024-10-13 23:18:42 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:44:59 +02:00
2024-09-26 08:44:55 +02:00
2024-09-26 08:44:55 +02:00
2024-09-26 08:44:55 +02:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2025-04-04 13:23:15 -07:00
2025-04-03 23:18:55 +02:00
2024-12-21 11:33:05 +01:00
2025-03-25 16:47:48 +01:00
2025-03-25 16:47:48 +01:00
2025-03-25 16:47:48 +01:00
2025-03-25 16:47:48 +01:00
2023-10-05 13:10:51 -07:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2023-12-18 10:34:22 +01:00
2025-03-25 16:47:48 +01:00
2025-03-25 16:47:48 +01:00
2025-03-25 16:47:48 +01:00
2024-09-26 08:43:24 +02:00
2025-04-04 13:23:15 -07:00
2022-10-27 10:01:30 +02:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2024-12-21 11:33:05 +01:00
2025-03-25 16:47:48 +01:00
2024-09-05 17:05:40 +02:00
2024-12-21 11:33:05 +01:00
2025-04-04 13:23:15 -07:00
2024-12-21 11:33:05 +01:00
2024-06-27 13:33:30 +02:00
2025-04-04 13:23:15 -07:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-26 08:43:24 +02:00
2024-09-19 11:07:51 -07:00
2025-01-10 08:20:03 +01:00
2025-03-25 16:47:48 +01:00
2025-03-25 16:47:48 +01:00
2024-09-26 08:44:59 +02:00
2024-08-04 19:17:45 +02:00
2024-08-04 19:17:45 +02:00
2025-04-03 23:18:55 +02:00
2024-12-21 11:33:05 +01:00
2023-11-23 19:56:12 +01:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2024-05-25 23:42:53 +02:00
2025-04-03 08:26:33 +02:00
2023-10-09 14:07:59 +02:00
2024-06-26 08:33:17 +02:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-04 09:17:08 -07:00
2025-04-04 09:17:08 -07:00
2025-04-04 09:17:08 -07:00
2025-04-04 09:17:08 -07:00
2025-04-04 09:17:08 -07:00
2025-04-04 09:17:08 -07:00
2025-04-04 09:17:08 -07:00
2025-04-04 09:17:08 -07:00
2025-04-04 09:17:08 -07:00
2025-04-04 09:17:08 -07:00
2025-04-04 09:17:08 -07:00
2024-12-21 11:33:05 +01:00
2024-02-20 11:36:03 +01:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2025-04-04 13:23:15 -07:00
2025-02-03 20:10:09 +01:00
2024-10-09 13:48:08 +02:00
2024-07-05 11:05:50 +02:00
2025-04-04 13:23:15 -07:00
2024-10-08 09:35:56 +02:00
2025-04-04 13:23:15 -07:00
2024-12-18 08:16:30 +01:00
2024-09-26 08:44:59 +02:00
2024-09-26 08:44:59 +02:00
2024-08-04 19:17:45 +02:00
2024-02-20 11:36:12 +01:00
2024-02-20 11:36:12 +01:00
2024-12-21 11:33:05 +01:00
2024-12-21 11:33:05 +01:00
2024-11-07 09:47:53 +01:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2025-04-03 23:18:55 +02:00
2024-08-04 19:17:45 +02:00
2024-08-04 19:17:45 +02:00
2024-12-21 11:33:05 +01:00
2022-11-10 12:25:17 +01:00
2024-06-27 13:33:30 +02:00
2024-06-27 13:33:30 +02:00
2022-11-09 09:40:07 +01:00
2025-02-25 07:59:39 +01:00
2025-04-04 13:23:15 -07:00