{"author":"Stefan Eissing","author_email":"stefan@eissing.org","author_time":1740667650,"commit_time":1740910414,"committer":"Daniel Stenberg","committer_email":"daniel@haxx.se","hash":"df672695e5992ad9b99819e9950de682e243cb48","message":"shutdowns: split shutdown handling from connection pool\n\nFurther testing with timeouts in event based processing revealed that\nour current shutdown handling in the connection pool was not clear\nenough. Graceful shutdowns can only happen inside a multi handle and it\nwas confusing to track in the code which situation actually applies. It\nseems better to split the shutdown handling off and have that code\nalways be part of a multi handle.\n\nAdd `cshutdn.[ch]` with its own struct to maintain connections being\nshut down. A `cshutdn` always belongs to a multi handle and uses that\nfor socket/timeout monitoring.\n\nThe `cpool`, which can be part of a multi or share, either passes\nconnections to a `cshutdn` or terminates them with a one-time, best\neffort.\n\nAdd an `admin` easy handle to each multi and share. This is used to\nperform all maintenance operations where no \"real\" easy handle is\navailable. This solves the problem that the multi admin handle requires\nsome additional initialisation (e.g. timeout list).\n\nThe share needs its admin handle as it is often cleaned up when no other\ntransfer or multi handle exists any more. But we need a `data` in almost\nevery call.\n\nFix file:// handling of errors when adding a new connection to the pool.\n\nChanges in `curl` itself:\n\n- for parallel transfers, do not set a connection pool in the share,\n  rely on the multi's connection pool instead. While not a requirement\n  for the new `cshutdn` to work, this is\n\n  a) helpful in testing to trigger graceful shutdowns\n  b) a broader code coverage of libcurl via the curl tool\n\n- on test_event with uv, cleanup the multi handle before returning from\n  parallel_event(). The uv struct is on the stack, cleanup of the multi\n  later will crash when it tries to register sockets. This is a \"eat\n  your own dogfood\" related fix.\n\nCloses #16508\n","parents":["3afa47b627ce6a160b5711cc581c5f3ab4f8079f"],"tree_hash":"39fc4d830da17c3f7ac8d639e69f9b20976a8314"}