aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-25 19:34:09 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2010-07-25 19:34:09 +0400
commit054e575684fe7cc8e4d753b2c460193a21bae6a4 (patch)
tree93c779335d8d20b8b9d98781b7d77105efaabcb4 /src
parent34ae83f0151a3fd31f4c045968defa39a2c40985 (diff)
downloadrspamd-054e575684fe7cc8e4d753b2c460193a21bae6a4.tar.gz
rspamd-054e575684fe7cc8e4d753b2c460193a21bae6a4.zip
* More debug
Diffstat (limited to 'src')
-rw-r--r--src/cfg_utils.c4
-rw-r--r--src/cfg_xml.c2
-rw-r--r--src/controller.c2
-rw-r--r--src/expressions.c1
-rw-r--r--src/logger.c2
-rw-r--r--src/logger.h2
-rw-r--r--src/message.c5
-rw-r--r--src/plugins/fuzzy_check.c6
8 files changed, 14 insertions, 10 deletions
diff --git a/src/cfg_utils.c b/src/cfg_utils.c
index 210bbb5f7..1f78b5ca3 100644
--- a/src/cfg_utils.c
+++ b/src/cfg_utils.c
@@ -48,7 +48,7 @@ parse_host_port (const gchar *str, struct in_addr *ina, uint16_t *port)
struct hostent *hent;
unsigned int port_parsed, saved_errno = errno;
- tokens = g_strsplit (str, ":", 0);
+ tokens = g_strsplit_set (str, ":", 0);
if (!tokens || !tokens[0]) {
return FALSE;
}
@@ -437,7 +437,7 @@ parse_filters_str (struct config_file *cfg, const gchar *str)
return;
}
- strvec = g_strsplit (str, ",", 0);
+ strvec = g_strsplit_set (str, ",", 0);
if (strvec == NULL) {
return;
}
diff --git a/src/cfg_xml.c b/src/cfg_xml.c
index 0f9bff97e..43c4091d1 100644
--- a/src/cfg_xml.c
+++ b/src/cfg_xml.c
@@ -1171,7 +1171,7 @@ xml_handle_string_list (struct config_file *cfg, struct rspamd_xml_userdata *ctx
dest = (GList **)G_STRUCT_MEMBER_P (dest_struct, offset);
*dest = NULL;
- tokens = g_strsplit (data, ";,", 0);
+ tokens = g_strsplit_set (data, ";,", 0);
if (!tokens || !tokens[0]) {
return FALSE;
}
diff --git a/src/controller.c b/src/controller.c
index 0adc77173..dd6f55fff 100644
--- a/src/controller.c
+++ b/src/controller.c
@@ -710,7 +710,7 @@ controller_read_socket (f_str_t * in, void *arg)
switch (session->state) {
case STATE_COMMAND:
s = fstrcstr (in, session->session_pool);
- params = g_strsplit (s, " ", -1);
+ params = g_strsplit_set (s, " ", -1);
memory_pool_add_destructor (session->session_pool, (pool_destruct_func) g_strfreev, params);
diff --git a/src/expressions.c b/src/expressions.c
index c3ece6808..9b8abc429 100644
--- a/src/expressions.c
+++ b/src/expressions.c
@@ -908,6 +908,7 @@ rspamd_header_exists (struct worker_task * task, GList * args, void *unused)
return FALSE;
}
+ debug_task ("try to get header %s", (char *)arg->data);
headerlist = message_get_header (task->task_pool, task->message, (char *)arg->data);
if (headerlist) {
g_list_free (headerlist);
diff --git a/src/logger.c b/src/logger.c
index 9bd3ce3f0..55a7f0fe5 100644
--- a/src/logger.c
+++ b/src/logger.c
@@ -249,7 +249,7 @@ rspamd_set_logger (enum rspamd_log_type type, enum process_type ptype, struct co
rspamd_log->debug_ip = radix_tree_create ();
if (!add_map (cfg->debug_ip_map, read_radix_list, fin_radix_list, (void **)&rspamd_log->debug_ip)) {
/* Try to parse it as list */
- strvec = g_strsplit (cfg->debug_ip_map, ",; ", 0);
+ strvec = g_strsplit_set (cfg->debug_ip_map, ",; ", 0);
num = g_strv_length (strvec);
for (i = 0; i < num; i++) {
diff --git a/src/logger.h b/src/logger.h
index 9b419c8a6..f25da8645 100644
--- a/src/logger.h
+++ b/src/logger.h
@@ -79,7 +79,7 @@ void rspamd_log_nodebug ();
#define msg_err(args...) rspamd_common_log_function(G_LOG_LEVEL_CRITICAL, __FUNCTION__, ##args)
#define msg_warn(args...) rspamd_common_log_function(G_LOG_LEVEL_WARNING, __FUNCTION__, ##args)
#define msg_info(args...) rspamd_common_log_function(G_LOG_LEVEL_INFO, __FUNCTION__, ##args)
-#define msg_debug(args...) rspamd_common_log_function(G_LOG_LEVEL_DEBUG, __FUNCTION__, ##args)
+#define msg_debug(args...) rspamd_conditional_debug(-1, __FUNCTION__, ##args)
#define debug_task(args...) rspamd_conditional_debug(task->from_addr.s_addr, __FUNCTION__, ##args)
#define debug_ip(ip, args...) rspamd_conditional_debug((ip), __FUNCTION__, ##args)
#else
diff --git a/src/message.c b/src/message.c
index 2c53deca1..be39bbb84 100644
--- a/src/message.c
+++ b/src/message.c
@@ -504,7 +504,7 @@ convert_text_to_utf (struct worker_task *task, GByteArray * part_content, GMimeC
}
if (g_ascii_strcasecmp (charset, "utf-8") == 0 || g_ascii_strcasecmp (charset, "utf8") == 0) {
- text_part->is_raw = TRUE;
+ text_part->is_raw = FALSE;
return part_content;
}
@@ -1040,16 +1040,19 @@ local_message_get_header (memory_pool_t * pool, GMimeMessage * message, const ch
return NULL;
}
+ msg_debug ("iterate over headers to find header %s", field);
h = GMIME_OBJECT (message)->headers->headers;
header_iterate (pool, h, &gret, field);
if (gret == NULL) {
/* Try to iterate with mime part headers */
+ msg_debug ("iterate over headers of mime part to find header %s", field);
part = g_mime_message_get_mime_part (message);
if (part) {
h = part->headers->headers;
header_iterate (pool, h, &gret, field);
if (gret == NULL && GMIME_IS_MULTIPART (part)) {
+ msg_debug ("iterate over headers of each multipart's subparts %s", field);
g_mime_multipart_foreach (GMIME_MULTIPART (part), multipart_iterate, &cb);
if (cb.ret != NULL) {
gret = cb.ret;
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c
index da301ddca..16ee13077 100644
--- a/src/plugins/fuzzy_check.c
+++ b/src/plugins/fuzzy_check.c
@@ -122,12 +122,12 @@ parse_flags_string (char *str)
int num, i, t;
struct fuzzy_mapping *map;
- strvec = g_strsplit (str, ", ;", 0);
+ strvec = g_strsplit_set (str, ", ;", 0);
num = g_strv_length (strvec);
for (i = 0; i < num; i ++) {
item = strvec[i];
- map_str = g_strsplit (item, ":", 3);
+ map_str = g_strsplit_set (item, ":", 3);
t = g_strv_length (map_str);
if (t != 3 && t != 2) {
msg_err ("invalid fuzzy mapping: %s", item);
@@ -165,7 +165,7 @@ parse_servers_string (char *str)
struct hostent *hent;
struct in_addr addr;
- strvec = g_strsplit (str, ",", 0);
+ strvec = g_strsplit_set (str, ",", 0);
num = g_strv_length (strvec);
fuzzy_module_ctx->servers = memory_pool_alloc0 (fuzzy_module_ctx->fuzzy_pool, sizeof (struct storage_server) * num);