Added utils library initialization function and improved replace_quoted

Currently the initialization function only prepares PCRE2 patterns for use.
Added the call to the new utils_init() function to MaxScale and all relevant
tests.

The replace_quoted now uses a shared PCRE2 pattern which should remove some
of the overhead of the function.
This commit is contained in:
Markus Makela
2016-01-06 13:21:07 +02:00
parent f57df4b967
commit b01e8b2eec
3 changed files with 65 additions and 35 deletions

View File

@ -1574,6 +1574,14 @@ int main(int argc, char **argv)
goto return_main;
}
if (!utils_init())
{
char* logerr = "Failed to initialise utility library.";
print_log_n_stderr(true, true, logerr, logerr, eno);
rc = MAXSCALE_INTERNALERROR;
goto return_main;
}
/** OpenSSL initialization */
if (!HAVE_OPENSSL_THREADS)
{
@ -1939,6 +1947,7 @@ int main(int argc, char **argv)
/** Release mysql thread context*/
mysql_thread_end();
utils_end();
datadir_cleanup();
MXS_NOTICE("MaxScale shutdown completed.");