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); ...@@ -71,6 +71,8 @@ void mu_debug_log (const char *fmt, ...) MU_PRINTFLIKE(1,2);
71 void mu_debug_log_begin (const char *fmt, ...) MU_PRINTFLIKE(1,2); 71 void mu_debug_log_begin (const char *fmt, ...) MU_PRINTFLIKE(1,2);
72 void mu_debug_log_cont (const char *fmt, ...) MU_PRINTFLIKE(1,2); 72 void mu_debug_log_cont (const char *fmt, ...) MU_PRINTFLIKE(1,2);
73 void mu_debug_log_end (const char *fmt, ...) MU_PRINTFLIKE(1,2); 73 void mu_debug_log_end (const char *fmt, ...) MU_PRINTFLIKE(1,2);
74 void mu_debug_log_nl (void);
75
74 76
75 77
76 #define MU_ASSERT(expr) \ 78 #define MU_ASSERT(expr) \
......
...@@ -357,3 +357,9 @@ mu_debug_log_end (const char *fmt, ...) ...@@ -357,3 +357,9 @@ mu_debug_log_end (const char *fmt, ...)
357 mu_stream_write (mu_strerr, "\n", 1, NULL); 357 mu_stream_write (mu_strerr, "\n", 1, NULL);
358 va_end (ap); 358 va_end (ap);
359 } 359 }
360
361 void
362 mu_debug_log_nl ()
363 {
364 mu_stream_write (mu_strerr, "\n", 1, NULL);
365 }
......
...@@ -246,7 +246,7 @@ alloc_state (void **pret, int mode MU_ARG_UNUSED, int argc, const char **argv) ...@@ -246,7 +246,7 @@ alloc_state (void **pret, int mode MU_ARG_UNUSED, int argc, const char **argv)
246 static struct _mu_filter_record _iconv_filter = { 246 static struct _mu_filter_record _iconv_filter = {
247 "ICONV", 247 "ICONV",
248 alloc_state, 248 alloc_state,
249 NULL, 249 _icvt_decoder,
250 _icvt_decoder 250 _icvt_decoder
251 }; 251 };
252 252
......
...@@ -154,7 +154,7 @@ mu_progmailer_open (struct _mu_progmailer *pm, char **argv) ...@@ -154,7 +154,7 @@ mu_progmailer_open (struct _mu_progmailer *pm, char **argv)
154 mu_debug_log_begin ("exec %s argv:", pm->command); 154 mu_debug_log_begin ("exec %s argv:", pm->command);
155 for (i = 0; argv[i]; i++) 155 for (i = 0; argv[i]; i++)
156 mu_debug_log_cont (" %s", argv[i]); 156 mu_debug_log_cont (" %s", argv[i]);
157 mu_debug_log_end (""); 157 mu_debug_log_nl ();
158 } 158 }
159 close (tunnel[0]); 159 close (tunnel[0]);
160 160
......
...@@ -397,10 +397,10 @@ int ...@@ -397,10 +397,10 @@ int
397 _acl_match (struct _mu_acl_entry *ent, struct sockaddr *sa, int salen) 397 _acl_match (struct _mu_acl_entry *ent, struct sockaddr *sa, int salen)
398 { 398 {
399 #define RESMATCH(word) \ 399 #define RESMATCH(word) \
400 if (mu_debug_level_p (MU_DEBCAT_ACL, 10)) \ 400 if (mu_debug_level_p (MU_DEBCAT_ACL, MU_DEBUG_TRACE9)) \
401 mu_debug_log_end ("%s; ", word); 401 mu_debug_log_end ("%s; ", word);
402 402
403 if (mu_debug_level_p (MU_DEBCAT_ACL, 10)) 403 if (mu_debug_level_p (MU_DEBCAT_ACL, MU_DEBUG_TRACE9))
404 { 404 {
405 struct in_addr a; 405 struct in_addr a;
406 406
...@@ -653,7 +653,7 @@ _run_entry (void *item, void *data) ...@@ -653,7 +653,7 @@ _run_entry (void *item, void *data)
653 653
654 rp->idx++; 654 rp->idx++;
655 655
656 if (mu_debug_level_p (MU_DEBCAT_ACL, 10)) 656 if (mu_debug_level_p (MU_DEBCAT_ACL, MU_DEBUG_TRACE9))
657 { 657 {
658 const char *s = "undefined"; 658 const char *s = "undefined";
659 mu_acl_action_to_string (ent->action, &s); 659 mu_acl_action_to_string (ent->action, &s);
...@@ -679,13 +679,13 @@ _run_entry (void *item, void *data) ...@@ -679,13 +679,13 @@ _run_entry (void *item, void *data)
679 char *s; 679 char *s;
680 if (ent->arg && expand_arg (ent->arg, rp, &s) == 0) 680 if (ent->arg && expand_arg (ent->arg, rp, &s) == 0)
681 { 681 {
682 if (mu_debug_level_p (MU_DEBCAT_ACL, 10)) 682 if (mu_debug_level_p (MU_DEBCAT_ACL, MU_DEBUG_TRACE9))
683 mu_debug_log_end ("%s", s); 683 mu_debug_log_end ("%s", s);
684 free (s); 684 free (s);
685 } 685 }
686 else 686 else
687 { 687 {
688 if (mu_debug_level_p (MU_DEBCAT_ACL, 10)) 688 if (mu_debug_level_p (MU_DEBCAT_ACL, MU_DEBUG_TRACE9))
689 { 689 {
690 debug_sockaddr (rp->sa, rp->salen); 690 debug_sockaddr (rp->sa, rp->salen);
691 mu_debug_log_end (""); 691 mu_debug_log_end ("");
...@@ -721,8 +721,8 @@ _run_entry (void *item, void *data) ...@@ -721,8 +721,8 @@ _run_entry (void *item, void *data)
721 } 721 }
722 } 722 }
723 723
724 if (mu_debug_level_p (MU_DEBCAT_ACL, 10)) 724 if (mu_debug_level_p (MU_DEBCAT_ACL, MU_DEBUG_TRACE9))
725 mu_debug_log_end (""); 725 mu_debug_log_nl ();
726 726
727 return status; 727 return status;
728 } 728 }
...@@ -747,11 +747,11 @@ mu_acl_check_sockaddr (mu_acl_t acl, const struct sockaddr *sa, int salen, ...@@ -747,11 +747,11 @@ mu_acl_check_sockaddr (mu_acl_t acl, const struct sockaddr *sa, int salen,
747 } 747 }
748 r.salen = salen; 748 r.salen = salen;
749 749
750 if (mu_debug_level_p (MU_DEBCAT_ACL, 10)) 750 if (mu_debug_level_p (MU_DEBCAT_ACL, MU_DEBUG_TRACE9))
751 { 751 {
752 mu_debug_log_begin ("Checking sockaddr "); 752 mu_debug_log_begin ("Checking sockaddr ");
753 debug_sockaddr (r.sa, r.salen); 753 debug_sockaddr (r.sa, r.salen);
754 mu_debug_log_end (""); 754 mu_debug_log_nl ();
755 } 755 }
756 756
757 r.idx = 0; 757 r.idx = 0;
......