| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
We should have been doing this, but it initializes itself upon first
use, which works as long as nobody's doing concurrent network
operations. Initialize it on our init to make sure it's not getting
initialized concurrently.
|
| | |
|
| | |
|
| |
|
|
|
| |
Move the common initialization and cleanup methods to reduce
unnecessary duplication.
|
| | |
|
| |
|
|
|
|
|
| |
Instead of allocating a brand new buffer for each error string we want
to store, we can use a per-thread buffer to store the error string and
re-use the underlying storage. We already use the buffer to format the
string, so this mostly makes that more direct.
|
| |\ |
|
| | | |
|
| |/
|
|
| |
Fixes #3318.
|
| | |
|
| |
|
|
|
| |
This is what it's meant all along, but now we actually have multiple
implementations, it's clearer to use the name of the library.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Free TLS data on thread exit (win32)
|
| |
|
|
|
|
| |
Clear the error message on git_libgit2_shutdown for all versions of
the library (no threads and Win32 threads). Drop the giterr_clear
in clar, as that shouldn't be necessary.
|
| | |
|
| |
|
|
|
|
| |
The openssl setup function needs to be GIT_EXPORT'ed, be sure
to include the `sys/openssl.h` header so that it is appropriately
decorated as an export function.
|
| |
|
|
|
| |
Our git_openssl_set_locking() would ideally not exist. Make it clearer
that we provide it as a last resort and you should prefer anything else.
|
| |\
| |
| | |
init: return the number of initializations
|
| | | |
|
| |/
|
|
|
| |
Add missing else directive to fix compiler warning: control reaches
end of non-void function
|
| | |
|
| |
|
|
|
|
| |
This describes their purpose better, as we now initialize ssl and some
other global stuff in there. Calling the init function is not something
which has been optional for a while now.
|
| |\
| |
| | |
Threading and crypto libraries
|
| | |
| |
| |
| |
| | |
Extract the lock-setting functions into their own, as we cannot assume
that it's ok for us to set this unconditionally.
|
| | |
| |
| |
| |
| | |
We're freeing the memory which holds the locks so we must make sure that
the locking function doesn't try to use it.
|
| |/ |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
All versions of SSL are considered deprecated now, so let's ask OpenSSl
to only use TLSv1. We still ask it to load those ciphers for
compatibility with servers which want to use an older hello but will use
TLS for encryption.
For good measure we also disable compression, which can be exploitable,
if the OpenSSL version supports it.
|
| |
|
|
|
| |
When we free the global state at thread termination, we must also free
the error message in order not to leak the string once per thread.
|
| | |
|
| |
|
|
|
|
|
|
| |
The OpenSSL library-loading functions do not expect to be called
multiple times. Add a flag in the non-threaded libgit2 init so we only
call once.
This fixes #2446.
|
| |\
| |
| | |
netops: init OpenSSL once under lock
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Bring together all of the OpenSSL initialization to
git_threads_init() so it's together and doesn't need locks.
Moving it here also gives us libssh2 thread safety (when built against
openssl).
|
| | | |
|
| | |
| |
| |
| | |
OpenSSL's tests init everything in the main thread, so let's do that.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
The OpenSSL init functions are not reentrant, which means that running
multiple fetches in parallel can cause us to crash.
Use a mutex to init OpenSSL, and since we're adding this extra checks,
init it only once.
|
| |/ |
|
| |\
| |
| | |
WIP: Windows fixes
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
1) Call to git_shutdown results in setting git__n_shutdown_callbacks
to -1. Next call to git__on_shutdown results in ABW (Array Bound Write)
for array git__shutdown_callbacks. In the current Implementation,
git_atomic_dec is called git__n_shutdown_callbacks + 1 times. I have
modified it to a for loop so that it is more readable. It would not
set git__n_shutdown_callbacks to a negative number and reset the
elements of git__shutdown_callbacks to NULL.
2) In function git_sysdir_get, shutdown function is registered only if
git_sysdir__dirs_shutdown_set is set to 0. However, after this variable
is set to 1, it is never reset to 0. If git_sysdir_global_init is
called again from synchronized_threads_init it does not register
shutdown function for this subsystem.
|
| |/ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|