summaryrefslogtreecommitdiff
path: root/src/global.c
Commit message (Collapse)AuthorAgeFilesLines
* ssh: initialize libssh2cmn/init-libssh2Carlos Martín Nieto2016-03-031-1/+3
| | | | | | | 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.
* global: remove an unused variableCarlos Martín Nieto2016-02-191-8/+0
|
* global: make openssl registration like the restEdward Thomson2016-02-081-115/+6
|
* global: refactor setup and cleanupEdward Thomson2016-02-081-59/+70
| | | | | Move the common initialization and cleanup methods to reduce unnecessary duplication.
* settings: add a setter for a custom user-agentCarlos Martín Nieto2015-11-121-0/+5
|
* error: store the error messages in a reusable buffercmn/error-bufferCarlos Martín Nieto2015-07-281-6/+8
| | | | | | | 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.
* Merge branch 'master' into fix-init-orderingfix-init-orderingjoshaber2015-07-221-2/+16
|\
| * Include stacktrace summary in memory leak output.Jeff Hostetler2015-06-291-2/+16
| |
* | Increment `git__n_inits` before doing `init_once`.joshaber2015-07-221-1/+1
|/ | | | Fixes #3318.
* global: Ensure we free our SSL context.Tim Hentenaar2015-06-081-0/+16
|
* Rename GIT_SSL to GIT_OPENSSLCarlos Martín Nieto2015-04-231-4/+4
| | | | | 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.
* Rename routine to free TLS dataJeff Hostetler2015-04-181-2/+7
|
* Remove DllMain now that TLS data freed by threadsJeff Hostetler2015-04-171-8/+0
|
* Also fix leak of TLS data on main thread.Jeff Hostetler2015-04-171-4/+1
|
* Attempt to fix Windows TLS memory leak.Jeff Hostetler2015-04-171-5/+13
|
* libgit2_shutdown: free TLS data (win32)Edward Thomson2015-03-041-0/+11
| | | | Free TLS data on thread exit (win32)
* libgit2_shutdown: clear err message on shutdownEdward Thomson2015-03-041-9/+27
| | | | | | 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.
* Fix leak of TLS error message in shutdown (ptherad version)Leo Yang2015-03-041-3/+3
|
* global: include sys/openssl.h for GIT_EXPORT of fnEdward Thomson2014-12-231-0/+1
| | | | | | 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.
* Make the OpenSSL locking function warnings more severeCarlos Martín Nieto2014-12-121-1/+0
| | | | | 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.
* Merge pull request #2743 from ethomson/init_valCarlos Martín Nieto2014-12-051-14/+30
|\ | | | | init: return the number of initializations
| * init: return the number of initializationsEdward Thomson2014-12-041-14/+30
| |
* | Add missing else directiveStefan Widgren2014-12-031-0/+1
|/ | | | | Add missing else directive to fix compiler warning: control reaches end of non-void function
* Plug possible leak in the openssl locksUngureanu Marius2014-11-171-0/+6
|
* Rename git_threads_ to git_libgit2_Carlos Martín Nieto2014-11-081-10/+11
| | | | | | 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.
* Merge pull request #2676 from libgit2/cmn/threadingEdward Thomson2014-11-061-18/+24
|\ | | | | Threading and crypto libraries
| * ssl: separate locking init from general initCarlos Martín Nieto2014-11-011-18/+23
| | | | | | | | | | Extract the lock-setting functions into their own, as we cannot assume that it's ok for us to set this unconditionally.
| * ssl: clear the OpenSSL locking functionCarlos Martín Nieto2014-11-011-0/+1
| | | | | | | | | | We're freeing the memory which holds the locks so we must make sure that the locking function doesn't try to use it.
* | Make the Visual Studio compiler happyJacques Germishuys2014-11-031-7/+8
|/
* global: clean up openssl_locks on shutdownEdward Thomson2014-10-261-1/+7
|
* ssl: dump the SSL ciphers in favour of TLScmn/ssl-tlsCarlos Martín Nieto2014-10-231-0/+13
| | | | | | | | | | 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.
* global: free the error message when exiting a threadcmn/free-tls-errorCarlos Martín Nieto2014-09-141-0/+3
| | | | | 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.
* Only create openssl_locks if thread support is enabledJacques Germishuys2014-07-131-0/+2
|
* ssl: init only once without threadsCarlos Martín Nieto2014-06-301-1/+7
| | | | | | | | 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.
* Merge pull request #2421 from libgit2/cmn/init-ssl-onceVicent Marti2014-06-141-0/+67
|\ | | | | netops: init OpenSSL once under lock
| * ssl: init everything all the timecmn/init-ssl-onceCarlos Martín Nieto2014-06-121-5/+48
| | | | | | | | | | | | | | | | 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).
| * ssl: init also without threadsCarlos Martín Nieto2014-06-121-9/+10
| |
| * ssl: cargo-cult thread safetyCarlos Martín Nieto2014-06-121-0/+20
| | | | | | | | OpenSSL's tests init everything in the main thread, so let's do that.
| * netops: init OpenSSL once under lockCarlos Martín Nieto2014-06-111-0/+3
| | | | | | | | | | | | | | | | 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.
* | Win32: Fix object::cache::threadmania test on x64Philip Kelley2014-06-071-2/+2
|/
* Merge pull request #2303 from jacquesg/mingw-lseekVicent Marti2014-05-191-1/+1
|\ | | | | WIP: Windows fixes
| * _InterlockedExchange expects a volatile LONGJacques Germishuys2014-05-011-1/+1
| |
* | Fix the issues in git_shutdownAnurag Gupta2014-05-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Fix the issues in git__on_shutdownAnurag Gupta2014-05-061-5/+7
|/
* Fix threading tests when threads disabledRussell Belfer2014-04-171-10/+10
|
* Correct C90 warningsJacques Germishuys2014-04-111-1/+2
|
* Move system directory cache out of utilsEdward Thomson2014-02-241-3/+3
|
* Don't use git_atomic as an integerBen Straub2013-10-041-4/+5
|
* Use InterlockedCompareExchange for the lockPhilip Kelley2013-10-041-49/+18
|
* Posix synchronized init, prototype win32 versionBen Straub2013-10-041-34/+89
|