My program uses libcurl to talk to a server (always the same one) over HTTPS. The easiest way is to always create a new curl handle for a request. But by doing so I'm not taking advantage of curl connection pooling/reuse, if I understand it right.
Could it make sense to create a pool of curl handles, so that any given thread could borrow a handle from, perform a request, and then put it back into the pool?
If the answer is yes, then a related question: given a curl handle, how to find out if for a new request it will reuse the connection, or will have to create a new one (hence it doesn't make sense to put it back into the pool in the scenario described above)?