Index: ossp-pkg/lmtp2nntp/lmtp2nntp.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/lmtp2nntp.c,v rcsdiff -q -kk '-r1.88' '-r1.89' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/lmtp2nntp.c,v' 2>/dev/null --- lmtp2nntp.c 2001/10/12 12:26:26 1.88 +++ lmtp2nntp.c 2001/10/12 13:23:52 1.89 @@ -157,6 +157,7 @@ int option_daemon; int option_aclc; struct acl option_acl[MAXACLS]; + int option_veryverbose; int option_childsmax; int active_childs; l2_stream_t *l2; @@ -211,6 +212,7 @@ "[-D] " "[-K] " "[-P pidfile] " + "[-V] " "[-a addr/mask[,addr/mask[,...]] " "[-b addr[:port]|-|path[:perms]] " "[-c addr[:port]] " @@ -356,7 +358,7 @@ log2(ctx, NOTICE, "caught signal %d - child [%ld] terminated", sig, (long)pid); return; case SIGUSR1: - log1(ctx, NOTICE, "caught signal %d - flush logging buffer", sig); + log1(ctx, NOTICE, "caught signal %d - flush logging stream", sig); l2_stream_flush(ctx->l2); return; case SIGHUP: @@ -439,6 +441,7 @@ ctx->option_killflag = FALSE; ctx->option_uid = getuid(); ctx->option_daemon = FALSE; + ctx->option_veryverbose = FALSE; ctx->option_childsmax = 10; ctx->active_childs = 0; ctx->l2 = NULL; @@ -482,7 +485,7 @@ */ /* read in the arguments */ - while ((i = getopt(argc, argv, "C:DKP:a:b:c:d:g:l:m:n:o:s:t:u:v")) != -1) { + while ((i = getopt(argc, argv, "C:DKP:Va:b:c:d:g:l:m:n:o:s:t:u:v")) != -1) { switch (i) { case 'C': /*POD [B<-C> I] */ ctx->option_childsmax = atoi(optarg); @@ -500,6 +503,9 @@ case 'P': /*POD [B<-P> I] */ ctx->option_pidfile = strdup(optarg); break; + case 'V': /*POD [B<-V>] */ + ctx->option_veryverbose = TRUE; + break; case 'a': /*POD [B<-a> I/I[,I/I[,...]] */ if (argz_create_sep(optarg, ',', &azACL, &asACL) != 0) CU(ERR_EXECUTION); @@ -945,14 +951,18 @@ CU(ERR_EXECUTION); } - if ((chBuf = l2_channel_create(&l2_handler_buffer)) == NULL) { - fprintf(stderr, "%s:Error: logging failed to create buffer channel\n", ctx->progname); - CU(ERR_EXECUTION); - } - if (l2_channel_configure(chBuf, "size", 65536) != L2_OK) { - fprintf(stderr, "%s:Error: logging failed to configure buffer channel\n", ctx->progname); - CU(ERR_EXECUTION); + if (!ctx->option_veryverbose) { + if ((chBuf = l2_channel_create(&l2_handler_buffer)) == NULL) { + fprintf(stderr, "%s:Error: logging failed to create buffer channel\n", ctx->progname); + CU(ERR_EXECUTION); + } + if (l2_channel_configure(chBuf, "size", 65536) != L2_OK) { + fprintf(stderr, "%s:Error: logging failed to configure buffer channel\n", ctx->progname); + CU(ERR_EXECUTION); + } } + else + chBuf = NULL; if ((chFile = l2_channel_create(&l2_handler_file)) == NULL) { fprintf(stderr, "%s:Error: logging failed to create file channel\n", ctx->progname); @@ -963,13 +973,21 @@ CU(ERR_EXECUTION); } - if (l2_channel_stack(chFile, chBuf) != L2_OK) { - fprintf(stderr, "%s:Error: logging failed to stack buffer channel on top of file channel\n", ctx->progname); - CU(ERR_EXECUTION); + if (!ctx->option_veryverbose) { + if (l2_channel_stack(chFile, chBuf) != L2_OK) { + fprintf(stderr, "%s:Error: logging failed to stack buffer channel on top of file channel\n", ctx->progname); + CU(ERR_EXECUTION); + } + if (l2_channel_stack(chBuf, chPrefix) != L2_OK) { + fprintf(stderr, "%s:Error: logging failed to stack prefix channel on top of buffer channel\n", ctx->progname); + CU(ERR_EXECUTION); + } } - if (l2_channel_stack(chBuf, chPrefix) != L2_OK) { - fprintf(stderr, "%s:Error: logging failed to stack prefix channel on top of buffer channel\n", ctx->progname); - CU(ERR_EXECUTION); + else { + if (l2_channel_stack(chFile, chPrefix) != L2_OK) { + fprintf(stderr, "%s:Error: logging failed to stack prefix channel on top of buffer channel\n", ctx->progname); + CU(ERR_EXECUTION); + } } if (l2_channel_open(chPrefix) != L2_OK) { @@ -991,6 +1009,9 @@ * should not be used in the remainder of the code */ + if (ctx->option_veryverbose) + log0(ctx, NOTICE, "logging very verbose (unbuffered)"); + if ((ctx->option_pidfile != NULL) && ctx->option_killflag) { if ((fd = fopen(ctx->option_pidfile, "r")) == NULL) log1(ctx, ERROR, "cannot open pidfile \"%s\" for reading %m", ctx->option_pidfile); @@ -1167,7 +1188,7 @@ log1(ctx, NOTICE, "startup new child process, parent pid[%d]", getppid()); /* child must close listening socket */ - sa_destroy(ctx->saAltio); + sa_destroy(ctx->saAltio); /* initialize LMTP context */ lmtp_io.ctx = ctx; Index: ossp-pkg/lmtp2nntp/lmtp2nntp.pod RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp.pod,v rcsdiff -q -kk '-r1.30' '-r1.31' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp.pod,v' 2>/dev/null --- lmtp2nntp.pod 2001/10/12 12:26:26 1.30 +++ lmtp2nntp.pod 2001/10/12 13:23:52 1.31 @@ -37,6 +37,7 @@ [B<-D>] [B<-K>] [B<-P> I] +[B<-V>] [B<-a> I/I[,I/I[,...]] [B<-b> I[I<:port>]|C<->|I[:perms]] [B<-c> I[I<:port>]] @@ -89,6 +90,10 @@ must be taken when using relative path names as daemonizing changes the current working directory to '/'. +=item B<-V> + +Very verbose logging. This means logging is unbuffered. + =item B<-a> I/I[,I/I[,...]] (LMTP daemon ACL) Access control list specifying TCP INET addresses and masks where incoming @@ -223,7 +228,7 @@ =head1 SIGNALS -Sending a USR1 signal to the program will flush the logging buffer. +Sending a USR1 signal to the program will flush the logging stream. =head1 DIAGNOSTICS