struct st_ERR_FNS
{
/* Works on the "error_hash" string table */
- LHASH *(*cb_err_get)(void);
+ LHASH *(*cb_err_get)(int create);
void (*cb_err_del)(void);
ERR_STRING_DATA *(*cb_err_get_item)(const ERR_STRING_DATA *);
ERR_STRING_DATA *(*cb_err_set_item)(ERR_STRING_DATA *);
ERR_STRING_DATA *(*cb_err_del_item)(ERR_STRING_DATA *);
/* Works on the "thread_hash" error-state table */
- LHASH *(*cb_thread_get)(void);
+ LHASH *(*cb_thread_get)(int create);
ERR_STATE *(*cb_thread_get_item)(const ERR_STATE *);
ERR_STATE *(*cb_thread_set_item)(ERR_STATE *);
void (*cb_thread_del_item)(const ERR_STATE *);
};
/* Predeclarations of the "err_defaults" functions */
-static LHASH *int_err_get(void);
+static LHASH *int_err_get(int create);
static void int_err_del(void);
static ERR_STRING_DATA *int_err_get_item(const ERR_STRING_DATA *);
static ERR_STRING_DATA *int_err_set_item(ERR_STRING_DATA *);
static ERR_STRING_DATA *int_err_del_item(ERR_STRING_DATA *);
-static LHASH *int_thread_get(void);
+static LHASH *int_thread_get(int create);
static ERR_STATE *int_thread_get_item(const ERR_STATE *);
static ERR_STATE *int_thread_set_item(ERR_STATE *);
static void int_thread_del_item(const ERR_STATE *);
/* The internal functions used in the "err_defaults" implementation */
-static LHASH *int_err_get(void)
+static LHASH *int_err_get(int create)
{
LHASH *ret = NULL;
CRYPTO_w_lock(CRYPTO_LOCK_ERR);
- if (!int_error_hash)
+ if (!int_error_hash && create)
+ {
+ CRYPTO_push_info("int_err_get (err.c)");
int_error_hash = lh_new(err_hash, err_cmp);
+ CRYPTO_pop_info();
+ }
if (int_error_hash)
ret = int_error_hash;
CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
LHASH *hash;
err_fns_check();
- hash = ERRFN(err_get)();
+ hash = ERRFN(err_get)(0);
if (!hash)
return NULL;
LHASH *hash;
err_fns_check();
- hash = ERRFN(err_get)();
+ hash = ERRFN(err_get)(1);
if (!hash)
return NULL;
LHASH *hash;
err_fns_check();
- hash = ERRFN(err_get)();
+ hash = ERRFN(err_get)(0);
if (!hash)
return NULL;
return p;
}
-static LHASH *int_thread_get(void)
+static LHASH *int_thread_get(int create)
{
LHASH *ret = NULL;
CRYPTO_w_lock(CRYPTO_LOCK_ERR);
- if (!int_thread_hash)
+ if (!int_thread_hash && create)
+ {
+ CRYPTO_push_info("int_thread_get (err.c)");
int_thread_hash = lh_new(pid_hash, pid_cmp);
+ CRYPTO_pop_info();
+ }
if (int_thread_hash)
ret = int_thread_hash;
CRYPTO_w_unlock(CRYPTO_LOCK_ERR);
LHASH *hash;
err_fns_check();
- hash = ERRFN(thread_get)();
+ hash = ERRFN(thread_get)(0);
if (!hash)
return NULL;
LHASH *hash;
err_fns_check();
- hash = ERRFN(thread_get)();
+ hash = ERRFN(thread_get)(1);
if (!hash)
return NULL;
LHASH *hash;
err_fns_check();
- hash = ERRFN(thread_get)();
+ hash = ERRFN(thread_get)(0);
if (!hash)
return;
LHASH *ERR_get_string_table(void)
{
err_fns_check();
- return ERRFN(err_get)();
+ return ERRFN(err_get)(0);
}
LHASH *ERR_get_err_state_table(void)
{
err_fns_check();
- return ERRFN(thread_get)();
+ return ERRFN(thread_get)(0);
}
const char *ERR_lib_error_string(unsigned long e)