OSSP CVS Repository

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

ossp-pkg/lmtp2nntp/lmtp2nntp_main.c 1.34 -> 1.35

--- lmtp2nntp_main.c     2002/02/04 15:43:01     1.34
+++ lmtp2nntp_main.c     2002/02/05 10:40:51     1.35
@@ -727,7 +727,7 @@
      */
     if (ctx->option_operationmode != OPERATIONMODE_FAKE) {
         log0(ctx, TRACE, "check if at least one NNTP service was successfully configured");
-        if (ctx->nsc == 0) {
+        if (ctx->nns == 0) {
             res.statuscode = "451";
             res.dsncode    = "4.3.5";
             res.statusmsg  = "No valid NNTP services configured.";
@@ -744,24 +744,24 @@
         bOk = TRUE;
         log1(ctx, TRACE, "try ${option.destination}[${i}]", i); //FIXME
 
-        ctx->ns[i].l2 = ctx->l2;
+        ctx->pns[i].l2 = ctx->l2;
 
         if (bOk && (ctx->saaClientbind != NULL)) {
             log0(ctx, DEBUG, "bind local socket to ${option.clientbind}"); //FIXME
-            if (sa_bind(ctx->ns[i].sa, ctx->saaClientbind) != SA_OK) {
+            if (sa_bind(ctx->pns[i].sa, ctx->saaClientbind) != SA_OK) {
                 bOk = FALSE;
                 log0(ctx, ERROR, "binding NNTP client to local address ${option.clientbind} failed, %m"); //FIXME
             }
         }
 
-        sa_timeout(ctx->ns[i].sa, SA_TIMEOUT_ALL, 0, 0);
-        sa_timeout(ctx->ns[i].sa, SA_TIMEOUT_CONNECT, ctx->option_timeout_nntp_connect, 0);
-        sa_timeout(ctx->ns[i].sa, SA_TIMEOUT_READ,    ctx->option_timeout_nntp_read,    0);
-        sa_timeout(ctx->ns[i].sa, SA_TIMEOUT_WRITE,   ctx->option_timeout_nntp_read,    0);
+        sa_timeout(ctx->pns[i].sa, SA_TIMEOUT_ALL, 0, 0);
+        sa_timeout(ctx->pns[i].sa, SA_TIMEOUT_CONNECT, ctx->option_timeout_nntp_connect, 0);
+        sa_timeout(ctx->pns[i].sa, SA_TIMEOUT_READ,    ctx->option_timeout_nntp_read,    0);
+        sa_timeout(ctx->pns[i].sa, SA_TIMEOUT_WRITE,   ctx->option_timeout_nntp_read,    0);
 
         if (bOk) {
             log0(ctx, DEBUG, "connect");
-            if (sa_connect(ctx->ns[i].sa, ctx->ns[i].saa) != SA_OK) {
+            if (sa_connect(ctx->pns[i].sa, ctx->pns[i].saa) != SA_OK) {
                 bOk = FALSE;
                 log1(ctx, WARNING, "connect to ${option.destination}[${i}] failed, %m", i); //FIXME
             }
@@ -769,10 +769,10 @@
 
         if (bOk) {
             log0(ctx, DEBUG, "nntp_create");
-            nntp_io.ctx    = &ctx->ns[i];
+            nntp_io.ctx    = &ctx->pns[i];
             nntp_io.read   = hook_nntp_read;
             nntp_io.write  = hook_nntp_write;
-            if ((ctx->ns[i].nntp = nntp_create(&nntp_io)) == NULL) {
+            if ((ctx->pns[i].nntp = nntp_create(&nntp_io)) == NULL) {
                 bOk = FALSE;
                 log0(ctx, ERROR, "creation of NNTP context failed");
             }
@@ -780,7 +780,7 @@
 
         if (bOk) {
             log0(ctx, DEBUG, "nntp_init");
-            if ((rc = nntp_init(ctx->ns[i].nntp)) != NNTP_OK) {
+            if ((rc = nntp_init(ctx->pns[i].nntp)) != NNTP_OK) {
                 bOk = FALSE;
                 log2(ctx, ERROR, "initialization of NNTP context failed, (%d) %s", rc, nntp_error(rc));
             }
@@ -793,15 +793,15 @@
         else {
             log1(ctx, WARNING, "NNTP session establishment to ${option.destination}[${i}] failed", i); //FIXME
             log1(ctx, DEBUG, "removing ns[%d] from list", i);
-            lmtp_gfs_ns(&ctx->ns[i]);
-            if (i < --ctx->nsc) {
-                memcpy(&ctx->ns[i], &ctx->ns[i+1], (ctx->nsc - i ) * sizeof(struct ns));
+            lmtp_gfs_ns(&ctx->pns[i]);
+            if (i < --ctx->nns) {
+                memcpy(&ctx->pns[i], &ctx->pns[i+1], (ctx->nns - i ) * sizeof(struct ns));
             }
         }
-    } while (i < ctx->nsc);
+    } while (i < ctx->nns);
 
     if (ctx->option_operationmode == OPERATIONMODE_FAKE)
-        log1(ctx, NOTICE, "NNTP running in fake mode, network connections successfully established=%d but ignored", ctx->nsc);
+        log1(ctx, NOTICE, "NNTP running in fake mode, network connections successfully established=%d but ignored", ctx->nns);
     else
     {
         /*  RFC0821 4.2.1. REPLY CODES BY FUNCTION GROUPS   421 <domain> Service not available
@@ -809,7 +809,7 @@
          *  RFC1893 3.5 Network and Routing Status          X.4.1   No answer from host
          */
         log0(ctx, DEBUG, "check if at least one NNTP session successfully established");
-        if (ctx->nsc == 0) {
+        if (ctx->nns == 0) {
             log0(ctx, ERROR, "no NNTP session established");
             res.statuscode = "421";
             res.dsncode    = "4.4.1";
@@ -862,8 +862,8 @@
 
     log0(ctx, TRACE, "LMTP service LHLO command - graceful shutdown");
 
-    for (i = 0; i < ctx->nsc; i++)
-            lmtp_gfs_ns(&ctx->ns[i]);
+    for (i = 0; i < ctx->nns; i++)
+            lmtp_gfs_ns(&ctx->pns[i]);
 
     if (ctx->option_mailfrom != NULL)
         free(ctx->option_mailfrom);
@@ -1462,24 +1462,24 @@
 
     log0(ctx, TRACE, "deliver message");
     bSuccess = NNTP_ERR_DELIVERY; /* assume a hard error for the worst case */
-    for (i = 0; i < ctx->nsc; i++) {
+    for (i = 0; i < ctx->nns; i++) {
         switch (ctx->option_operationmode) {
             case OPERATIONMODE_FAKE:
-                ctx->ns[i].rc = NNTP_FAKE;
+                ctx->pns[i].rc = NNTP_FAKE;
                 break;
             case OPERATIONMODE_POST:
-                ctx->ns[i].rc = nntp_post(ctx->ns[i].nntp, ctx->msg);
+                ctx->pns[i].rc = nntp_post(ctx->pns[i].nntp, ctx->msg);
                 break;
             case OPERATIONMODE_FEED:
-                ctx->ns[i].rc = nntp_feed(ctx->ns[i].nntp, ctx->msg);
+                ctx->pns[i].rc = nntp_feed(ctx->pns[i].nntp, ctx->msg);
                 break;
         }
-        if (ctx->ns[i].rc == NNTP_OK)
+        if (ctx->pns[i].rc == NNTP_OK)
             bSuccess = NNTP_OK;
         if (   bSuccess != NNTP_OK
             && (
-                   (ctx->ns[i].rc == NNTP_ERR_SYSTEM)
-                || (ctx->ns[i].rc == NNTP_DEFER)
+                   (ctx->pns[i].rc == NNTP_ERR_SYSTEM)
+                || (ctx->pns[i].rc == NNTP_DEFER)
                   )
               )
             bSuccess = NNTP_DEFER;
@@ -1562,14 +1562,14 @@
         azErr = NULL;
         asErr = 0;
         argz_add(&azErr, &asErr, errorstring);
-        for (i = 0; i < ctx->nsc; i++) {
-            if (ctx->ns[i].rc != NNTP_OK) {
+        for (i = 0; i < ctx->nns; i++) {
+            if (ctx->pns[i].rc != NNTP_OK) {
                 str_format(errorstring, sizeof(errorstring), 
                 "${option.destination}[${i}] returned %s\n" /*FIXME*/
                 "${option.destination}[${i}] lastresp \"%s\"",  /*FIXME*/
                 i,
-                nntp_error(ctx->ns[i].rc), 
-                nntp_lastresp(ctx->ns[i].nntp));
+                nntp_error(ctx->pns[i].rc), 
+                nntp_lastresp(ctx->pns[i].nntp));
                 argz_add(&azErr, &asErr, errorstring);
             }
         }

CVSTrac 2.0.1