OSSP CVS Repository

ossp - Difference in ossp-pkg/lmtp2nntp/lmtp2nntp_config.c versions 1.40 and 1.41
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/lmtp2nntp/lmtp2nntp_config.c 1.40 -> 1.41

--- lmtp2nntp_config.c   2002/02/05 10:40:51     1.40
+++ lmtp2nntp_config.c   2002/02/05 14:14:54     1.41
@@ -135,6 +135,7 @@
         CU(ERR_EXECUTION);
     }
     if (ov->data.s != NULL) {
+        //FIXME this is cut off on command line!? fprintf(stderr, "DEBUG: ov->data.s = \"%s\"\n", ov->data.s);
         if ((rc = l2_spec(&ctx->l2, ctx->l2_env, ov->data.s)) != L2_OK) {
             fprintf(stderr, "%s:Error: logging failed to create stream\n", ctx->progname);
             CU(ERR_EXECUTION);
@@ -153,6 +154,24 @@
      */
     log1(ctx, NOTICE, "startup, version %s", lmtp2nntp_version.v_gnu);
 
+    /* --version FLAG */
+    try {
+        if (   (val_get(ctx->val, "option.version", &ov) != VAL_OK)
+            || (ov->ndata <  0)
+            || (ov->ndata == 1 && ov->data.f < 0)
+            || (ov->ndata == 1 && ov->data.f > 1)
+            || (ov->ndata >  1)
+              ) throw(0,0,0);
+        log1(ctx, TRACE, "--version = %d", ov->data.f);
+
+        if (ov->data.f == 1) {
+            fprintf(stdout, "%s\n", lmtp2nntp_version.v_gnu);
+            exit(0); //FIXME
+        }
+    }
+    catch (ex)
+        rethrow;
+
     /* --childsmax SINGLE */
     try {
         if (   (val_get(ctx->val, "option.childsmax", &ov) != VAL_OK)
@@ -426,7 +445,9 @@
                 log1(ctx, ERROR, "option --client, create address (internal) failed with \"%s\"", sa_error(rc));
                 throw(0,0,0);
             }
-            if ((rc = sa_addr_u2a(ctx->saaClientbind, "inet://%s", ov->data.s)) != SA_OK) {
+            if ((rc = sa_addr_u2a(ctx->saaClientbind, 
+                                  (strchr(ov->data.s, ':') == NULL) ?  "inet://%s:0" : "inet://%s", 
+                                  ov->data.s)) != SA_OK) {
                 log2(ctx, ERROR, "option --client, parsing alternate IO guessing INET socket (%s) failed with \"%s\"", ov->data.s, sa_error(rc));
                 throw(0,0,0);
             }
@@ -885,24 +906,6 @@
         }
     }
     catch (ex)
-        rethrow;
-
-    /* --version FLAG */
-    try {
-        if (   (val_get(ctx->val, "option.version", &ov) != VAL_OK)
-            || (ov->ndata <  0)
-            || (ov->ndata == 1 && ov->data.f < 0)
-            || (ov->ndata == 1 && ov->data.f > 1)
-            || (ov->ndata >  1)
-              ) throw(0,0,0);
-        log1(ctx, TRACE, "--version = %d", ov->data.f);
-
-        if (ov->data.f == 1) {
-            log1(ctx, INFO, "program version %s", lmtp2nntp_version.v_gnu);
-            fprintf(stdout, "%s\n", lmtp2nntp_version.v_gnu); //FIXME is fprintf really the way to go?
-        }
-    }
-    catch (ex)
         rethrow;
 
     /* --newsgroup MULTI */

CVSTrac 2.0.1