LINK_DIRECTORIES(${GLIB2_LIBRARY_DIRS})
+FIND_LIBRARY(LIBZ_LIBRARY NAMES z PATH_SUFFIXES lib64 lib
+ PATHS
+ ~/Library/Frameworks
+ /Library/Frameworks
+ /usr/local
+ /usr
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ DOC "Path where the libz library can be found")
+IF(NOT LIBZ_LIBRARY)
+ MESSAGE(FATAL_ERROR "libz is required for libgmime")
+ENDIF(NOT LIBZ_LIBRARY)
# Check for libevent
FIND_LIBRARY(LIBEVENT_LIBRARY NAMES event PATH_SUFFIXES lib64 lib
################################ SUBDIRS SECTION ###########################
+ADD_SUBDIRECTORY(contrib/lgpl)
IF(GLIB_COMPAT)
- ADD_SUBDIRECTORY(contrib/lgpl)
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}/contrib/lgpl")
ENDIF(GLIB_COMPAT)
{
ctx->b = memory_pool_alloc (ctx->pool, len + 1);
rspamd_strlcpy (ctx->b, param, len + 1);
+#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 20))
+ gchar *tmp;
+ gsize tmp_len = len;
+ tmp = g_base64_decode (ctx->b, &tmp_len);
+ rspamd_strlcpy (ctx->b, tmp, len + 1);
+ g_free (tmp);
+#else
g_base64_decode_inplace (ctx->b, &len);
+#endif
ctx->blen = len;
return TRUE;
}
{
ctx->bh = memory_pool_alloc (ctx->pool, len + 1);
rspamd_strlcpy (ctx->bh, param, len + 1);
+#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 20))
+ gchar *tmp;
+ gsize tmp_len = len;
+ tmp = g_base64_decode (ctx->bh, &tmp_len);
+ rspamd_strlcpy (ctx->bh, tmp, len + 1);
+ g_free (tmp);
+#else
g_base64_decode_inplace (ctx->bh, &len);
+#endif
ctx->bhlen = len;
return TRUE;
}
rspamd_strlcpy (key->keydata, keydata, keylen + 1);
key->keylen = keylen + 1;
key->decoded_len = keylen + 1;
+#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION < 20))
+ gchar *tmp;
+ gsize tmp_len = keylen;
+ tmp = g_base64_decode (key->keydata, &tmp_len);
+ rspamd_strlcpy (key->keydata, tmp, keylen + 1);
+ g_free (tmp);
+ key->decoded_len = tmp_len;
+#else
g_base64_decode_inplace (key->keydata, &key->decoded_len);
+#endif
#ifdef HAVE_OPENSSL
key->key_bio = BIO_new_mem_buf (key->keydata, key->decoded_len);
if (key->key_bio == NULL) {
close_log (rspamd->logger);
open_log (rspamd->logger);
#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION <= 30))
+# if (GLIB_MINOR_VERSION > 20)
/* Ugly hack for old glib */
if (!g_thread_get_initialized ()) {
g_thread_init (NULL);
}
+# else
+ g_thread_init (NULL);
+# endif
#endif
msg_info ("starting %s process %P", cf->worker->name, getpid ());
cf->worker->worker_start_func (cur);
if (!item->lua_function && regexp_module_ctx->max_threads > 1) {
if (regexp_module_ctx->workers == NULL) {
#if ((GLIB_MAJOR_VERSION == 2) && (GLIB_MINOR_VERSION <= 30))
+# if GLIB_MINOR_VERSION > 20
if (! g_thread_get_initialized ()) {
g_thread_init (NULL);
}
+# else
+ g_thread_init (NULL);
+# endif
workers_mtx = g_mutex_new ();
#else
workers_mtx = memory_pool_alloc (regexp_module_ctx->regexp_pool, sizeof (GMutex));