OSSP CVS Repository

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

ossp-pkg/lmtp2nntp/lmtp2nntp.c 1.67 -> 1.68

--- lmtp2nntp.c  2001/10/08 13:40:22     1.67
+++ lmtp2nntp.c  2001/10/08 14:30:11     1.68
@@ -401,13 +401,31 @@
         switch (i) {
             case 'a': /*POD [B<-a> I<altio>] */
                 if ((rc = sa_addr_create(&ctx->saaAltio)) != SA_OK) {
-                    fprintf(stderr, "%s:Error: Creating address failed for -i option (%d)\n", 
+                    fprintf(stderr, "%s:Error: Creating address failed for -a option (%d)\n", 
                             ctx->progname, rc);
                 }
-                if ((rc = sa_addr_u2a(ctx->saaAltio, "inet://%s", optarg)) != SA_OK) {
-                    fprintf(stderr, "%s:Error: Parsing inputbind address failed for \"%s\" (%d)\n", 
-                            ctx->progname, optarg, rc);
-                    CU(ERR_EXECUTION);
+                if ((strncasecmp(optarg, "inet://", 7) == 0) ||
+                    (strncasecmp(optarg, "unix:/" , 6) == 0)   ) {
+                    if ((rc = sa_addr_u2a(ctx->saaAltio, "%s", optarg)) != SA_OK) {
+                        fprintf(stderr, "%s:Error: Parsing alternate IO URL failed for \"%s\" (%d)\n", 
+                                ctx->progname, optarg, rc);
+                        CU(ERR_EXECUTION);
+                    }
+                } else {
+                    if (optarg[0] == '/') {
+                        if ((rc = sa_addr_u2a(ctx->saaAltio, "unix:%s", optarg)) != SA_OK) {
+                            fprintf(stderr, "%s:Error: Parsing alternate IO guessing UNIX domain socket failed for \"%s\" (%d)\n", 
+                                    ctx->progname, optarg, rc);
+                            CU(ERR_EXECUTION);
+                        }
+                    }
+                    else {
+                        if ((rc = sa_addr_u2a(ctx->saaAltio, "inet://%s", optarg)) != SA_OK) {
+                            fprintf(stderr, "%s:Error: Parsing alternate IO guessing INET socket failed for \"%s\" (%d)\n", 
+                                    ctx->progname, optarg, rc);
+                            CU(ERR_EXECUTION);
+                        }
+                    }
                 }
                 if ((rc = sa_create(&ctx->saAltio)) != SA_OK) {
                     fprintf(stderr, "%s:Error: Creating TCP socket failed for \"%s\": %s\n", 

CVSTrac 2.0.1