OSSP CVS Repository

ossp - Check-in [1171]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1171
Date: 2001-Oct-12 14:26:26 (local)
2001-Oct-12 12:26:26 (UTC)
User:thl
Branch:
Comment: documented -C childsmax option and -b path[:perms]
Tickets:
Inspections:
Files:
ossp-pkg/lmtp2nntp/lmtp2nntp.c      1.87 -> 1.88     11 inserted, 10 deleted
ossp-pkg/lmtp2nntp/lmtp2nntp.pod      1.29 -> 1.30     11 inserted, 5 deleted

ossp-pkg/lmtp2nntp/lmtp2nntp.c 1.87 -> 1.88

--- lmtp2nntp.c  2001/10/12 12:03:19     1.87
+++ lmtp2nntp.c  2001/10/12 12:26:26     1.88
@@ -157,7 +157,7 @@
     int             option_daemon;
     int             option_aclc;
     struct acl      option_acl[MAXACLS];
-    int             option_maxchilds;
+    int             option_childsmax;
     int             active_childs;
     l2_stream_t    *l2;
     sa_addr_t      *saaAltio;
@@ -207,11 +207,12 @@
      */
     fprintf(stderr, 
             "USAGE: %s "
+            "[-C childsmax] "
             "[-D] "
             "[-K] "
             "[-P pidfile] "
             "[-a addr/mask[,addr/mask[,...]] "
-            "[-b addr[:port]|-|path] "
+            "[-b addr[:port]|-|path[:perms]] "
             "[-c addr[:port]] "
             "[-d addr[:port][,addr[:port], ...]] "
             "[-g groupmode] "
@@ -438,7 +439,7 @@
     ctx->option_killflag = FALSE;
     ctx->option_uid = getuid();
     ctx->option_daemon = FALSE;
-    ctx->option_maxchilds = 10;
+    ctx->option_childsmax = 10;
     ctx->active_childs = 0;
     ctx->l2 = NULL;
     ctx->saaAltio = NULL;
@@ -483,10 +484,10 @@
     /* 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) {
         switch (i) {
-            case 'C': /*POD [B<-C> I<numchilds>] */
-                ctx->option_maxchilds = atoi(optarg);
-                if (ctx->option_maxchilds <= 0) {
-                    fprintf(stderr, "%s:Error: Invalid number of maximum children (%d) to option -C\n", ctx->progname, ctx->option_maxchilds);
+            case 'C': /*POD [B<-C> I<childsmax>] */
+                ctx->option_childsmax = atoi(optarg);
+                if (ctx->option_childsmax <= 0) {
+                    fprintf(stderr, "%s:Error: Invalid number (%d) to option -C\n", ctx->progname, ctx->option_childsmax);
                     CU(ERR_EXECUTION);
                 }
                 break;
@@ -535,7 +536,7 @@
                 }
                 free(azACL);
                 break;
-            case 'b': /*POD [B<-b> I<addr>[I<:port>]|C<->|I<path>] */
+            case 'b': /*POD [B<-b> I<addr>[I<:port>]|C<->|I<path>[:perms]] */
                 if (strcmp(optarg, "-") != 0) {
                     if ((rc = sa_create(&ctx->saAltio)) != SA_OK) {
                         fprintf(stderr, "%s:Error: Creating TCP socket failed for \"%s\": %s\n", 
@@ -1081,8 +1082,8 @@
         sa_timeout(ctx->saAltio, SA_TIMEOUT_READ,   ctx->option_timeout_lmtp_read,   0);
         sa_timeout(ctx->saAltio, SA_TIMEOUT_WRITE,  ctx->option_timeout_lmtp_write,  0);
         while (1) {
-            while (ctx->active_childs >= ctx->option_maxchilds) {
-                log1(ctx, ERROR, "maximum number of childs (%d) reached - waiting (1s)", ctx->option_maxchilds);
+            while (ctx->active_childs >= ctx->option_childsmax) {
+                log1(ctx, ERROR, "maximum number of childs (%d) reached - waiting (1s)", ctx->option_childsmax);
                 sleep(1);
             }
 


ossp-pkg/lmtp2nntp/lmtp2nntp.pod 1.29 -> 1.30

--- lmtp2nntp.pod        2001/10/12 08:57:51     1.29
+++ lmtp2nntp.pod        2001/10/12 12:26:26     1.30
@@ -33,11 +33,12 @@
 =head1 SYNOPSIS
 
 B<lmtp2nntp>
+[B<-C> I<childsmax>]
 [B<-D>]
 [B<-K>]
 [B<-P> I<pidfile>]
 [B<-a> I<addr>/I<mask>[,I<addr>/I<mask>[,...]]
-[B<-b> I<addr>[I<:port>]|C<->|I<path>]
+[B<-b> I<addr>[I<:port>]|C<->|I<path>[:perms]]
 [B<-c> I<addr>[I<:port>]]
 [B<-d> I<addr>[I<:port>][,I<addr>[I<:port>], ...]]
 [B<-g> I<groupmode>]
@@ -68,6 +69,10 @@
 
 =over 4
 
+=item B<-C> I<childsmax>
+
+Childs the daemon spawns at maximum. Default is 10.
+
 =item B<-D>
 
 Daemonize program and detach from current terminal.
@@ -98,12 +103,13 @@
 specify any inclusions a fake inclusion of 0.0.0.0/0 is appended internally.
 Any addr can be a name to be resolved first.
 
-=item B<-b> I<addr>[I<:port>]|C<->|I<path> (LMTP daemon bind)
+=item B<-b> I<addr>[I<:port>]|C<->|I<path[:perms]> (LMTP daemon bind)
 
 Bind address accepting incoming LMTP connections. Supported are "C<->" for
-stdio, I<path> for Unix Domain socket and I<addr>[I<:port>] for TCP INET
-socket. Omitting this option defaults to stdio. The path for a UNIX domain
-socket must start with a slash. The addr can be a name to be resolved first.
+stdio, I<path>[:perms] for Unix Domain socket with optional chmod-like
+permissions and I<addr>[I<:port>] for TCP INET socket. Omitting this option
+defaults to stdio. The path for a UNIX domain socket must start with a slash.
+The addr can be a name to be resolved first.
 
 =item B<-c> I<addr>[I<:port>] (NNTP client bind)
 

CVSTrac 2.0.1