summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/mproc.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2015-10-14 21:18:20 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2015-10-14 21:18:20 +0000
commit58893d5a6300a4835a0d58da2a28a1a575745fb6 (patch)
tree950b6431ec0de0ee8606b10147cf14ff9b023cbe /usr.sbin/smtpd/mproc.c
parent00e3758f473fc923d93413ec914db390d5dd7709 (diff)
whitespace + only log TRACE_MPROC if not IMSG_STAT_{IN,DE}CREMENT
Diffstat (limited to 'usr.sbin/smtpd/mproc.c')
-rw-r--r--usr.sbin/smtpd/mproc.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/usr.sbin/smtpd/mproc.c b/usr.sbin/smtpd/mproc.c
index c2620b8f8a0..119c7c8f33a 100644
--- a/usr.sbin/smtpd/mproc.c
+++ b/usr.sbin/smtpd/mproc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mproc.c,v 1.13 2015/10/02 00:32:05 gilles Exp $ */
+/* $OpenBSD: mproc.c,v 1.14 2015/10/14 21:18:19 gilles Exp $ */
/*
* Copyright (c) 2012 Eric Faurot <eric@faurot.net>
@@ -319,7 +319,9 @@ m_forward(struct mproc *p, struct imsg *imsg)
imsg->hdr.pid, imsg->fd, imsg->data,
imsg->hdr.len - sizeof(imsg->hdr));
- log_trace(TRACE_MPROC, "mproc: %s -> %s : %zu %s (forward)",
+ if (imsg->hdr.type != IMSG_STAT_DECREMENT &&
+ imsg->hdr.type != IMSG_STAT_INCREMENT)
+ log_trace(TRACE_MPROC, "mproc: %s -> %s : %zu %s (forward)",
proc_name(smtpd_process),
proc_name(p->proc),
imsg->hdr.len - sizeof(imsg->hdr),
@@ -339,7 +341,9 @@ m_compose(struct mproc *p, uint32_t type, uint32_t peerid, pid_t pid, int fd,
{
imsg_compose(&p->imsgbuf, type, peerid, pid, fd, data, len);
- log_trace(TRACE_MPROC, "mproc: %s -> %s : %zu %s",
+ if (type != IMSG_STAT_DECREMENT &&
+ type != IMSG_STAT_INCREMENT)
+ log_trace(TRACE_MPROC, "mproc: %s -> %s : %zu %s",
proc_name(smtpd_process),
proc_name(p->proc),
len,
@@ -371,7 +375,9 @@ m_composev(struct mproc *p, uint32_t type, uint32_t peerid, pid_t pid,
if (p->bytes_queued > p->bytes_queued_max)
p->bytes_queued_max = p->bytes_queued;
- log_trace(TRACE_MPROC, "mproc: %s -> %s : %zu %s",
+ if (type != IMSG_STAT_DECREMENT &&
+ type != IMSG_STAT_INCREMENT)
+ log_trace(TRACE_MPROC, "mproc: %s -> %s : %zu %s",
proc_name(smtpd_process),
proc_name(p->proc),
len,
@@ -385,7 +391,7 @@ m_create(struct mproc *p, uint32_t type, uint32_t peerid, pid_t pid, int fd)
{
if (p->m_buf == NULL) {
p->m_alloc = 128;
- log_trace(TRACE_MPROC, "mproc: %s -> %s: allocating %zu",
+ log_trace(TRACE_MPROC, "mproc: %s -> %s: allocating %zu",
proc_name(smtpd_process),
proc_name(p->proc),
p->m_alloc);
@@ -711,7 +717,7 @@ m_get_string(struct msg *m, const char **s)
end = memchr(m->pos + 1, 0, m->end - (m->pos + 1));
if (end == NULL)
m_error("unterminated string");
-
+
*s = m->pos + 1;
m->pos = end + 1;
}