Index: ossp-pkg/lmtp2nntp/fixme.h RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/fixme.h,v rcsdiff -q -kk '-r1.10' '-r1.11' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/Attic/fixme.h,v' 2>/dev/null --- fixme.h 2002/02/04 15:43:01 1.10 +++ fixme.h 2002/02/05 10:40:51 1.11 @@ -91,9 +91,10 @@ int fdIOi; int fdIOo; + /* int nsc; struct ns ns[MAXNEWSSERVICES]; - /*FIXME replaced by following */ + FIXME replaced by following */ int nns; /* number of ns structures found at pns */ struct ns *pns; /* pointer to an array of ns structures */ Index: ossp-pkg/lmtp2nntp/lmtp2nntp_config.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp_config.c,v rcsdiff -q -kk '-r1.39' '-r1.40' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp_config.c,v' 2>/dev/null --- lmtp2nntp_config.c 2002/02/04 15:43:01 1.39 +++ lmtp2nntp_config.c 2002/02/05 10:40:51 1.40 @@ -449,7 +449,7 @@ log2(ctx, TRACE, "--destination[%d] = \"%s\"", i, (ov->data.m)[i]); if (ov->ndata >= 1) { - if ((ctx->pacl = (struct acl *)malloc(ov->ndata * sizeof(struct acl))) == NULL) throw(0,0,0); + if ((ctx->pns = (struct ns *)malloc(ov->ndata * sizeof(struct ns))) == NULL) throw(0,0,0); for (i = 0; i < ov->ndata; i++) { cp = (ov->data.m)[i]; log2(ctx, DEBUG, "cp = (data.m)[%d] = \"%s\"", i, cp); @@ -457,15 +457,15 @@ cp = str_concat(cp, ":nntp", NULL); //FIXME is this a config var/val? else cp = str_concat(cp, NULL); /* prepare for free() */ - if ((rc = sa_addr_create(&ctx->ns[i].saa)) != SA_OK) { + if ((rc = sa_addr_create(&ctx->pns[i].saa)) != SA_OK) { log1(ctx, ERROR, "option --destination, create address (internal) failed with \"%s\"", sa_error(rc)); throw(0,0,0); } - if ((rc = sa_addr_u2a(ctx->ns[i].saa, "inet://%s", cp)) != SA_OK) { + if ((rc = sa_addr_u2a(ctx->pns[i].saa, "inet://%s", cp)) != SA_OK) { log2(ctx, ERROR, "option --destination, parsing host address (%s) failed with \"%s\"", cp /*FIXME again, option vs. config */, sa_error(rc)); throw(0,0,0); } - if ((rc = sa_create(&ctx->ns[i].sa)) != SA_OK) { + if ((rc = sa_create(&ctx->pns[i].sa)) != SA_OK) { log2(ctx, ERROR, "option --destination, creating TCP socket (%s) failed with \"%s\"", cp /*FIXME again, option vs. config */, sa_error(rc)); throw(0,0,0); } Index: ossp-pkg/lmtp2nntp/lmtp2nntp_main.c RCS File: /v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp_main.c,v rcsdiff -q -kk '-r1.34' '-r1.35' -u '/v/ossp/cvs/ossp-pkg/lmtp2nntp/lmtp2nntp_main.c,v' 2>/dev/null --- 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 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); } }