Merge remote-tracking branch 'opensource/RELEASE_6' into PRO_RELEASE_6
Former-commit-id: 4505b3caa94ea0366014fabcbdb36850f7b60be7
This commit is contained in:
commit
08d68dd329
43
src/tls.cpp
43
src/tls.cpp
@ -140,47 +140,6 @@ static void initCryptoLocks(void) {
|
|||||||
}
|
}
|
||||||
#endif /* USE_CRYPTO_LOCKS */
|
#endif /* USE_CRYPTO_LOCKS */
|
||||||
|
|
||||||
/**
|
|
||||||
* OpenSSL global initialization and locking handling callbacks.
|
|
||||||
* Note that this is only required for OpenSSL < 1.1.0.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
|
||||||
#define USE_CRYPTO_LOCKS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_CRYPTO_LOCKS
|
|
||||||
|
|
||||||
static pthread_mutex_t *openssl_locks;
|
|
||||||
|
|
||||||
static void sslLockingCallback(int mode, int lock_id, const char *f, int line) {
|
|
||||||
pthread_mutex_t *mt = openssl_locks + lock_id;
|
|
||||||
|
|
||||||
if (mode & CRYPTO_LOCK) {
|
|
||||||
pthread_mutex_lock(mt);
|
|
||||||
} else {
|
|
||||||
pthread_mutex_unlock(mt);
|
|
||||||
}
|
|
||||||
|
|
||||||
(void)f;
|
|
||||||
(void)line;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void initCryptoLocks(void) {
|
|
||||||
unsigned i, nlocks;
|
|
||||||
if (CRYPTO_get_locking_callback() != NULL) {
|
|
||||||
/* Someone already set the callback before us. Don't destroy it! */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
nlocks = CRYPTO_num_locks();
|
|
||||||
openssl_locks = zmalloc(sizeof(*openssl_locks) * nlocks);
|
|
||||||
for (i = 0; i < nlocks; i++) {
|
|
||||||
pthread_mutex_init(openssl_locks + i, NULL);
|
|
||||||
}
|
|
||||||
CRYPTO_set_locking_callback(sslLockingCallback);
|
|
||||||
}
|
|
||||||
#endif /* USE_CRYPTO_LOCKS */
|
|
||||||
|
|
||||||
void tlsInit(void) {
|
void tlsInit(void) {
|
||||||
/* Enable configuring OpenSSL using the standard openssl.cnf
|
/* Enable configuring OpenSSL using the standard openssl.cnf
|
||||||
* OPENSSL_config()/OPENSSL_init_crypto() should be the first
|
* OPENSSL_config()/OPENSSL_init_crypto() should be the first
|
||||||
@ -190,6 +149,8 @@ void tlsInit(void) {
|
|||||||
*/
|
*/
|
||||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||||
OPENSSL_config(NULL);
|
OPENSSL_config(NULL);
|
||||||
|
#elif OPENSSL_VERSION_NUMBER < 0x10101000L
|
||||||
|
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
|
||||||
#else
|
#else
|
||||||
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG|OPENSSL_INIT_ATFORK, NULL);
|
OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG|OPENSSL_INIT_ATFORK, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
@ -500,21 +500,6 @@ start_server {tags {"scripting"}} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
test {EVAL with pipelined command (No crash)} {
|
|
||||||
r flushall
|
|
||||||
r config set lua-time-limit 1
|
|
||||||
set rd [redis_deferring_client]
|
|
||||||
$rd eval {for i=1,1000000 do redis.call('set', i, 'sdfdsfd') end} 0
|
|
||||||
$rd set testkey foo
|
|
||||||
$rd get testkey
|
|
||||||
after 1200
|
|
||||||
catch {r echo "foo"} err
|
|
||||||
assert_match {BUSY*} $err
|
|
||||||
$rd read
|
|
||||||
$rd close
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
test {EVAL timeout from AOF} {
|
test {EVAL timeout from AOF} {
|
||||||
# generate a long running script that is propagated to the AOF as script
|
# generate a long running script that is propagated to the AOF as script
|
||||||
# make sure that the script times out during loading
|
# make sure that the script times out during loading
|
||||||
|
Loading…
x
Reference in New Issue
Block a user