Commit 094f5d94 094f5d94f39d5476e33dfb4e38e394746972ec74 by Sergey Poznyakoff

Minor fixes.

* include/mailutils/debug.h (mu_debug_log_nl): New proto.
* libmailutils/diag/debug.c (mu_debug_log_nl): New function.
* libmailutils/mailer/progmailer.c: Use mu_debug_log_nl.
* libmailutils/server/acl.c: Likewise.
Also, use MU_DEBUG_TRACE9 instead of the numeric value.

* libmailutils/filter/iconvflt.c (_iconv_filter): Register encoder
(same as decoder).
1 parent ee747948
......@@ -71,6 +71,8 @@ void mu_debug_log (const char *fmt, ...) MU_PRINTFLIKE(1,2);
void mu_debug_log_begin (const char *fmt, ...) MU_PRINTFLIKE(1,2);
void mu_debug_log_cont (const char *fmt, ...) MU_PRINTFLIKE(1,2);
void mu_debug_log_end (const char *fmt, ...) MU_PRINTFLIKE(1,2);
void mu_debug_log_nl (void);
#define MU_ASSERT(expr) \
......
......@@ -357,3 +357,9 @@ mu_debug_log_end (const char *fmt, ...)
mu_stream_write (mu_strerr, "\n", 1, NULL);
va_end (ap);
}
void
mu_debug_log_nl ()
{
mu_stream_write (mu_strerr, "\n", 1, NULL);
}
......
......@@ -246,7 +246,7 @@ alloc_state (void **pret, int mode MU_ARG_UNUSED, int argc, const char **argv)
static struct _mu_filter_record _iconv_filter = {
"ICONV",
alloc_state,
NULL,
_icvt_decoder,
_icvt_decoder
};
......
......@@ -154,7 +154,7 @@ mu_progmailer_open (struct _mu_progmailer *pm, char **argv)
mu_debug_log_begin ("exec %s argv:", pm->command);
for (i = 0; argv[i]; i++)
mu_debug_log_cont (" %s", argv[i]);
mu_debug_log_end ("");
mu_debug_log_nl ();
}
close (tunnel[0]);
......
......@@ -397,10 +397,10 @@ int
_acl_match (struct _mu_acl_entry *ent, struct sockaddr *sa, int salen)
{
#define RESMATCH(word) \
if (mu_debug_level_p (MU_DEBCAT_ACL, 10)) \
if (mu_debug_level_p (MU_DEBCAT_ACL, MU_DEBUG_TRACE9)) \
mu_debug_log_end ("%s; ", word);
if (mu_debug_level_p (MU_DEBCAT_ACL, 10))
if (mu_debug_level_p (MU_DEBCAT_ACL, MU_DEBUG_TRACE9))
{
struct in_addr a;
......@@ -653,7 +653,7 @@ _run_entry (void *item, void *data)
rp->idx++;
if (mu_debug_level_p (MU_DEBCAT_ACL, 10))
if (mu_debug_level_p (MU_DEBCAT_ACL, MU_DEBUG_TRACE9))
{
const char *s = "undefined";
mu_acl_action_to_string (ent->action, &s);
......@@ -679,13 +679,13 @@ _run_entry (void *item, void *data)
char *s;
if (ent->arg && expand_arg (ent->arg, rp, &s) == 0)
{
if (mu_debug_level_p (MU_DEBCAT_ACL, 10))
if (mu_debug_level_p (MU_DEBCAT_ACL, MU_DEBUG_TRACE9))
mu_debug_log_end ("%s", s);
free (s);
}
else
{
if (mu_debug_level_p (MU_DEBCAT_ACL, 10))
if (mu_debug_level_p (MU_DEBCAT_ACL, MU_DEBUG_TRACE9))
{
debug_sockaddr (rp->sa, rp->salen);
mu_debug_log_end ("");
......@@ -721,8 +721,8 @@ _run_entry (void *item, void *data)
}
}
if (mu_debug_level_p (MU_DEBCAT_ACL, 10))
mu_debug_log_end ("");
if (mu_debug_level_p (MU_DEBCAT_ACL, MU_DEBUG_TRACE9))
mu_debug_log_nl ();
return status;
}
......@@ -747,11 +747,11 @@ mu_acl_check_sockaddr (mu_acl_t acl, const struct sockaddr *sa, int salen,
}
r.salen = salen;
if (mu_debug_level_p (MU_DEBCAT_ACL, 10))
if (mu_debug_level_p (MU_DEBCAT_ACL, MU_DEBUG_TRACE9))
{
mu_debug_log_begin ("Checking sockaddr ");
debug_sockaddr (r.sa, r.salen);
mu_debug_log_end ("");
mu_debug_log_nl ();
}
r.idx = 0;
......