summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4285add)
raw | patch | inline | side by side (parent: 4285add)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 24 Dec 2006 13:22:49 +0000 (14:22 +0100) | ||
committer | Florian Forster <octo@huhu.verplant.org> | |
Tue, 9 Jan 2007 13:54:31 +0000 (14:54 +0100) |
Some daemons (e.g. postgrey) don't provide any size information.
Signed-off-by: Sebastian Harl <sh@tokkee.org>
Signed-off-by: Sebastian Harl <sh@tokkee.org>
src/collectd.pod | patch | blob | history | |
src/email.c | patch | blob | history |
diff --git a/src/collectd.pod b/src/collectd.pod
index bf76055f0cac9e29041e3e9b1de974937b180cf6..8ee77ea26a8fec042a49d33eed80e0e99bf14f3b 100644 (file)
--- a/src/collectd.pod
+++ b/src/collectd.pod
e:<type>:<size>
+If C<size> is less than or equal to zero, C<size> is ignored.
+
Spam score:
s:<value>
diff --git a/src/email.c b/src/email.c
index 64b82e465c1af5ea9df81f0eb59fbfdf50f7478e..509eb2305532c9d1d199ed441640df470cf4316a 100644 (file)
--- a/src/email.c
+++ b/src/email.c
type_list_incr (&count, type, 1);
pthread_mutex_unlock (&count_mutex);
- pthread_mutex_lock (&size_mutex);
- type_list_incr (&size, type, bytes);
- pthread_mutex_unlock (&size_mutex);
+ if (bytes > 0) {
+ pthread_mutex_lock (&size_mutex);
+ type_list_incr (&size, type, bytes);
+ pthread_mutex_unlock (&size_mutex);
+ }
}
else if ('s' == line[0]) { /* s:<value> */
pthread_mutex_lock (&score_mutex);