]> source.dussan.org Git - rspamd.git/commitdiff
Print "0.00" instead of "0" in protocol output.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 9 Mar 2011 14:36:41 +0000 (17:36 +0300)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Wed, 9 Mar 2011 14:36:41 +0000 (17:36 +0300)
Fix misprint in cdb handling.

src/cdb/cdb_init.c
src/protocol.c

index af7b252560a06a623464120b2163797ba73efd74..b962c43fa876b06bcf3e93fd8f37f20760da2127 100644 (file)
@@ -133,7 +133,7 @@ cdb_timer_callback (int fd, short what, gpointer ud)
                                }
                                (void)close (cdbp->cdb_fd);
                                cdbp->cdb_fsize = 0;
-                               (void)cdb_init (cdbp, fd);
+                               (void)cdb_init (cdbp, nfd);
                        }
                }
        }
index 683d291a96623c19b4bc42d90d338b98163d6723..f6b0c30fc09cc95a131b4256b00b998186f7d5fd 100644 (file)
@@ -703,18 +703,18 @@ show_metric_result (gpointer metric_name, gpointer metric_value, void *user_data
                        if (task->proto_ver >= 11) {
                                if (!task->is_skipped) {
                                        r = rspamd_snprintf (outbuf, sizeof(outbuf),
-                                                       "Metric: default; False; 0 / %.2f / %.2f" CRLF, ms,
+                                                       "Metric: default; False; 0.00 / %.2f / %.2f" CRLF, ms,
                                                        rs);
                                }
                                else {
                                        r = rspamd_snprintf (outbuf, sizeof(outbuf),
-                                                       "Metric: default; Skip; 0 / %.2f / %.2f" CRLF, ms,
+                                                       "Metric: default; Skip; 0.00 / %.2f / %.2f" CRLF, ms,
                                                        rs);
                                }
                        }
                        else {
                                r = rspamd_snprintf (outbuf, sizeof(outbuf),
-                                               "Metric: default; False; 0 / %.2f" CRLF, ms);
+                                               "Metric: default; False; 0.00 / %.2f" CRLF, ms);
                        }
                        r += rspamd_snprintf (outbuf + r, sizeof(outbuf) - r,
                                        "Action: %s" CRLF, str_action_metric (
@@ -723,11 +723,11 @@ show_metric_result (gpointer metric_name, gpointer metric_value, void *user_data
                if (!task->is_skipped) {
                        cd->log_offset += rspamd_snprintf (cd->log_buf + cd->log_offset,
                                        cd->log_size - cd->log_offset,
-                                       "(%s: F (no action): [0/%.2f/%.2f] [", "default", ms, rs);
+                                       "(%s: F (no action): [0.00/%.2f/%.2f] [", "default", ms, rs);
                }
                else {
                        cd->log_offset += rspamd_snprintf (cd->log_buf + cd->log_offset,
-                                       cd->log_size - cd->log_offset, "(%s: S: [0/%.2f/%.2f] [",
+                                       cd->log_size - cd->log_offset, "(%s: S: [0.00/%.2f/%.2f] [",
                                        "default", ms, rs);
                }
        }