This commit undoes commit f8709d6caf (Issue #263)
According to the OpenSSL-Documentation https://wiki.openssl.org/index.php/Library_Initialization#Cleanup:
"CRYPTO_cleanup_all_ex_data and ERR_remove_state should be called on each thread, and not just the main thread."
The CRYPTO_cleanup_all_ex_data for every thread have been added with the commit f8709d6caf.
However, since then there are some sporadic crashes in the automatic tests.
Checking the discussion page of this documentation (https://wiki.openssl.org/index.php/Talk:Library_Initialization):
You said: "CRYPTO_cleanup_all_ex_data and ERR_remove_state should be called on each thread, and not just the main thread."
However the FAQ says:
> "Brutal" (thread-unsafe) Application-global cleanup functions:
>
> ERR_free_strings(), EVP_cleanup() and CRYPTO_cleanup_all_ex_data().'
>
> And the code comments for CRYPTO_cleanup_all_ex_data() say:
>
>/* Release all "ex_data" state to prevent memory leaks. This can't be made
> * thread-safe without overhauling a lot of stuff, and shouldn't really be
> * called under potential race-conditions anyway (it's for program shutdown
> * after all). */
>
>So I don't think its right to say CRYPTO_cleanup_all_ex_data() should be called on each thread. >--Matt (talk) 14:30, 7 May 2015 (UTC)
... So, this commit removes the extra CRYPTO_cleanup_all_ex_data again.
Let's see if the crashes in the CI tests are gone ...
Experimental configuration option "_experimental_static_file_max_age" for tests.
TODO: rename this option and documetent it in UserManual.md
This also addresses the "Caching" issue of #201
Since the new CMake based build system will use other files for
unit tests (public_func.c, public_server.c, private.c, private_exe.c
and others), this file is no longer maintained, and will be removed
in the future.
See also #269
The worker_thread_run function will free the conn memory when it quits.
Freeing it in mg_close_connection frees it too early, causing a crash in
the worker_thread_run function as it reuses conn until the server quits
and asks the thread to quit.