--- lmtp2nntp_main.c 2002/01/31 10:14:54 1.14
+++ lmtp2nntp_main.c 2002/01/31 10:40:07 1.15
@@ -433,10 +433,8 @@
ctx->l2 = NULL;
ctx->saaServerbind = NULL;
ctx->saServerbind = NULL;
- ctx->cpBindh = NULL;
- ctx->cpBindp = NULL;
- ctx->saaBind = NULL;
- ctx->saBind = NULL;
+ ctx->saaClientbind = NULL;
+ ctx->saClientbind = NULL;
ctx->nsc = 0;
for (i=0; i < MAXNEWSSERVICES; i++) {
ctx->ns[i].h = NULL;
@@ -482,24 +480,6 @@
/* read in the arguments */
while ((i = getopt(argc, argv, "C:DKP:Va:b:c:d:g:h:l:m:n:o:r:s:t:u:v")) != -1) {
switch (i) {
- case 'c': /*POD [B<-c> I<addr>[I<:port>]] */
- ctx->cpBindh = strdup(optarg);
- if ((ctx->cpBindp = strrchr(ctx->cpBindh, ':')) != NULL) {
- *ctx->cpBindp++ = NUL;
- ctx->cpBindp = strdup(ctx->cpBindp);
- }
- else
- ctx->cpBindp = strdup("0");
- if ((rc = sa_addr_create(&ctx->saaBind)) != SA_OK) {
- fprintf(stderr, "%s:Error: Creating address failed for -c option (%d)\n",
- ctx->progname, rc);
- }
- if ((rc = sa_addr_u2a(ctx->saaBind, "inet://%s:%s", ctx->cpBindh, ctx->cpBindp)) != SA_OK) {
- fprintf(stderr, "%s:Error: Parsing bind address failed for \"%s:%s\" (%d)\n",
- ctx->progname, ctx->cpBindh, ctx->cpBindp, rc);
- CU(ERR_EXECUTION);
- }
- break;
case 'd': /*POD [B<-d> I<addr>[I<:port>][,I<addr>[I<:port>], ...]] */
if (argz_create_sep(optarg, ',', &azHosts, &asHosts) != 0)
CU(ERR_EXECUTION);
@@ -1133,11 +1113,11 @@
ctx->ns[i].l2 = ctx->l2;
- if (bOk && (ctx->saaBind != NULL)) {
- log2(ctx, DEBUG, "bind local socket to %s:%s", ctx->cpBindh, ctx->cpBindp);
- if (sa_bind(ctx->ns[i].sa, ctx->saaBind) != SA_OK) {
+ 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) {
bOk = FALSE;
- log2(ctx, ERROR, "binding NNTP client to local address %s:%s failed, %m", ctx->cpBindh, ctx->cpBindp);
+ log0(ctx, ERROR, "binding NNTP client to local address ${option.clientbind} failed, %m"); //FIXME
}
}
@@ -1263,14 +1243,10 @@
if (ctx->option_mailfrom != NULL)
free(ctx->option_mailfrom);
- if (ctx->cpBindh != NULL)
- free(ctx->cpBindh);
- if (ctx->cpBindp != NULL)
- free(ctx->cpBindp);
- if (ctx->saBind != NULL)
- sa_destroy(ctx->saBind);
- if (ctx->saaBind != NULL)
- sa_addr_destroy(ctx->saaBind);
+ if (ctx->saClientbind != NULL)
+ sa_destroy(ctx->saClientbind);
+ if (ctx->saaClientbind != NULL)
+ sa_addr_destroy(ctx->saaClientbind);
}
static int helo_rfc0821domain(char *msg, char **domain)
|