-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Share connection between curl requests #170
base: master
Are you sure you want to change the base?
Conversation
I have some concerns about sharing the connection (CURL_LOCK_DATA_CONNECT) between the mainloop (poller) and the download thread. The documentation states: "It is not supported to share connections between multiple concurrent threads." I did place locking on the shared data including CURL_LOCK_DATA_CONNECT though. |
I think inter-thread connection sharing as it's implemented here should be okay. Maybe we should add
|
Added. |
e84e3ec
to
0f76f69
Compare
TSAN works by inserting instrumentation into compiled code to detect race conditions. We use glib from Debian in CI, meaning those libraries are not built with TSAN instrumentation, so memory accesses cannot be tracked. This leads to false positives. So suggesting to enable the sanitizer was not a good idea after all. I'll drop the commit. |
0f76f69
to
7a8e42e
Compare
7a8e42e
to
33bd37a
Compare
I've changed the PR slightly:
|
Using a curl_share between curl requests allows sharing an open connection and re-use cached DNS, PSL and TLS session id. This change allows performing multiple requests without having to do re-perform the (full) TLS handshake. For reference, on a stm32mp151c with OPTEE + pkcs11 TA a full TLS handshake takes ~8 seconds. Mostly due to small pager pool (internal sram) available for OPTEE. With this change a mTLS curl request take around 60ms after the initial connection has been established. Signed-off-by: Robin van der Gracht <[email protected]> Signed-off-by: Bastian Krause <[email protected]>
33bd37a
to
56feb22
Compare
Using a curl_share between curl requests allows sharing an open connection and re-use cached DNS, PSL and TLS session id.
This change allows performing multiple requests without having to do re-perform the (full) TLS handshake.
For reference, on a stm32mp151c with OPTEE + pkcs11 TA a full TLS handshake takes ~8 seconds. Mostly due to small pager pool (internal sram) available for OPTEE.
With this change a mTLS curl request take around 60ms after the initial connection has been established.