summaryrefslogtreecommitdiffstats
path: root/src/libutil/map.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-05-15 10:05:30 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-05-15 10:05:30 +0100
commita83a59906eb6a63746d14c1e6a85207b5e79fd14 (patch)
tree5512a541ca14af934d335ace97af9af2c3bbace9 /src/libutil/map.c
parent8ec8c3ffcda9ad33c8d74f14307be6e588d2e62f (diff)
downloadrspamd-a83a59906eb6a63746d14c1e6a85207b5e79fd14.tar.gz
rspamd-a83a59906eb6a63746d14c1e6a85207b5e79fd14.zip
[Minor] Tell which map has caused errors
Diffstat (limited to 'src/libutil/map.c')
-rw-r--r--src/libutil/map.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/libutil/map.c b/src/libutil/map.c
index 1855ca5d5..e452bdd2c 100644
--- a/src/libutil/map.c
+++ b/src/libutil/map.c
@@ -301,7 +301,9 @@ free_http_cbdata_dtor (gpointer p)
cbd->stage = map_finished;
}
- msg_warn_map ("connection with http server is terminated: worker is stopping");
+ msg_warn_map ("%s: "
+ "connection with http server is terminated: worker is stopping",
+ map->name);
}
@@ -317,7 +319,9 @@ http_map_error (struct rspamd_http_connection *conn,
map = cbd->map;
cbd->periodic->errored = TRUE;
- msg_err_map ("connection with http server terminated incorrectly: %e", err);
+ msg_err_map ("error reading %s(%s): "
+ "connection with http server terminated incorrectly: %e",
+ map->name, cbd->bk->uri, err);
rspamd_map_periodic_callback (-1, EV_TIMEOUT, cbd->periodic);
MAP_RELEASE (cbd, "http_callback_data");
}
@@ -618,13 +622,15 @@ read_map_file (struct rspamd_map *map, struct file_map_data *data,
gsize len;
if (map->read_callback == NULL || map->fin_callback == NULL) {
- msg_err_map ("bad callback for reading map file");
+ msg_err_map ("%s: bad callback for reading map file",
+ data->filename);
return FALSE;
}
if (access (data->filename, R_OK) == -1) {
/* File does not exist, skipping */
- msg_err_map ("map file is unavailable for reading");
+ msg_err_map ("%s: map file is unavailable for reading",
+ data->filename);
return TRUE;
}
@@ -672,7 +678,8 @@ read_map_file (struct rspamd_map *map, struct file_map_data *data,
r = ZSTD_decompressStream (zstream, &zout, &zin);
if (ZSTD_isError (r)) {
- msg_err_map ("cannot decompress data: %s",
+ msg_err_map ("%s: cannot decompress data: %s",
+ data->filename,
ZSTD_getErrorName (r));
ZSTD_freeDStream (zstream);
g_free (out);
@@ -718,7 +725,7 @@ read_map_static (struct rspamd_map *map, struct static_map_data *data,
gsize len;
if (map->read_callback == NULL || map->fin_callback == NULL) {
- msg_err_map ("bad callback for reading map file");
+ msg_err_map ("%s: bad callback for reading map file", map->name);
data->processed = TRUE;
return FALSE;
}
@@ -755,7 +762,8 @@ read_map_static (struct rspamd_map *map, struct static_map_data *data,
r = ZSTD_decompressStream (zstream, &zout, &zin);
if (ZSTD_isError (r)) {
- msg_err_map ("cannot decompress data: %s",
+ msg_err_map ("%s: cannot decompress data: %s",
+ map->name,
ZSTD_getErrorName (r));
ZSTD_freeDStream (zstream);
g_free (out);
@@ -772,15 +780,15 @@ read_map_static (struct rspamd_map *map, struct static_map_data *data,
}
ZSTD_freeDStream (zstream);
- msg_info_map ("read map data from static memory (%z bytes compressed, "
- "%z uncompressed)",
+ msg_info_map ("%s: read map data from static memory (%z bytes compressed, "
+ "%z uncompressed)", map->name,
len, zout.pos);
map->read_callback (out, zout.pos, &periodic->cbdata, TRUE);
g_free (out);
}
else {
- msg_info_map ("read map data from static memory (%z bytes)",
- len);
+ msg_info_map ("%s: read map data from static memory (%z bytes)",
+ len, map->name);
map->read_callback (bytes, len, &periodic->cbdata, TRUE);
}
}