curl/tests/server
Aki a2bcec0ee0
openssl: fix the data race when sharing an SSL session between threads
The SSL_Session object is mutated during connection inside openssl,
and it might not be thread-safe. Besides, according to documentation
of openssl:

```
SSL_SESSION objects keep internal link information about the session
cache list, when being inserted into one SSL_CTX object's session
cache. One SSL_SESSION object, regardless of its reference count,
must therefore only be used with one SSL_CTX object (and the SSL
objects created from this SSL_CTX object).
```
If I understand correctly, it is not safe to share it even in a
single thread.

Instead, serialize the SSL_SESSION before adding it to the cache,
and deserialize it after retrieving it from the cache, so that no
concurrent write to the same object is infeasible.

Also
 - add a ci test for thread sanitizer
 - add a test for sharing ssl sessions concurrently
 - avoid redefining memory functions when not building libcurl, but
   including the soruce in libtest
 - increase the concurrent connections limit in sws

Notice that there are fix for a global data race for openssl which
is not yet release. The fix is cherry pick for the ci test with
thread sanitizer.
d8def79838

Closes #14751
2024-09-02 23:35:44 +02:00
..
.gitignore tidy-up: mostly whitespace nits 2023-08-31 23:02:10 +00:00
base64.pl copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
CMakeLists.txt cmake: minor tidy-ups 2024-08-26 11:00:08 +02:00
disabled.c tests: add SHA-512/256 unit test 2024-02-20 11:36:03 +01:00
fake_ntlm.c src: fix potential macro confusion in cmake unity builds 2024-08-22 10:45:04 +02:00
getpart.c src: fix potential macro confusion in cmake unity builds 2024-08-22 10:45:04 +02:00
getpart.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
Makefile.am tidy-up: delete Makefile.inc from EXTRA_DIST 2024-08-12 14:54:47 +02:00
Makefile.inc copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
mqttd.c src: fix potential macro confusion in cmake unity builds 2024-08-22 10:45:04 +02:00
resolve.c src: fix potential macro confusion in cmake unity builds 2024-08-22 10:45:04 +02:00
rtspd.c src: fix potential macro confusion in cmake unity builds 2024-08-22 10:45:04 +02:00
server_setup.h copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
server_sockaddr.h build: prefer USE_IPV6 macro internally (was: ENABLE_IPV6) 2024-04-13 08:33:26 +00:00
sockfilt.c src: fix potential macro confusion in cmake unity builds 2024-08-22 10:45:04 +02:00
socksd.c src: fix potential macro confusion in cmake unity builds 2024-08-22 10:45:04 +02:00
sws.c openssl: fix the data race when sharing an SSL session between threads 2024-09-02 23:35:44 +02:00
testpart.c copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
tftp.h tests: tidy up types in server code 2024-05-13 11:16:26 +02:00
tftpd.c src: fix potential macro confusion in cmake unity builds 2024-08-22 10:45:04 +02:00
util.c CI: add test timeouts, more cmake build tests, fix VS2010 C warning 2024-08-27 23:40:48 +02:00
util.h build: enable missing OpenSSF-recommended warnings, with fixes 2023-12-16 13:12:37 +00:00