Browse code

Revert "Revert "tls: proper ifdef on libssl version for tls_init_locks()""

This reverts commit da5d71da620deb8b8740256e556011e93cdac1a3.

Daniel-Constantin Mierla authored on 18/09/2020 12:12:38
Showing 1 changed files
... ...
@@ -140,7 +140,7 @@ unsigned long sr_ssl_id_f()
140 140
 /* returns -1 on error, 0 on success */
141 141
 int tls_init_locks()
142 142
 {
143
-/* OpenSSL is thread-safe since 1.1.0 */
143
+/* OpenSSL is no longer supporting to set locking callbacks since 1.1.0 */
144 144
 #if OPENSSL_VERSION_NUMBER < 0x10100000L
145 145
 	/* init "static" tls locks */
146 146
 	n_static_locks=CRYPTO_num_locks();
... ...
@@ -185,10 +185,13 @@ int tls_init_locks()
185 185
 	 *  (only atomic_inc), fallback to the default use-locks mode
186 186
 	 * CRYPTO_set_add_lock_callback(atomic_add_f);
187 187
 	 */
188
-#endif
189 188
 
190 189
 	return 0;
191 190
 error:
192 191
 	tls_destroy_locks();
193 192
 	return -1;
193
+
194
+#else
195
+	return 0;
196
+#endif
194 197
 }