OSSP CVS Repository

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

ossp-pkg/lmtp2nntp/lmtp2nntp_main.c 1.45 -> 1.46

--- lmtp2nntp_main.c     2002/02/28 15:57:09     1.45
+++ lmtp2nntp_main.c     2002/03/04 15:54:28     1.46
@@ -368,8 +368,6 @@
     ctx->option_operationmodefakedsn    = NULL;
     ctx->option_maxmessagesize = 0;
     ctx->option_firstheaderrule = NULL;
-    ctx->azHeaderValuePairs = NULL; //FIXME obsolete
-    ctx->asHeaderValuePairs = 0;    //FIXME obsolete
     ctx->option_timeout_lmtp_accept  = 0;
     ctx->option_timeout_lmtp_read    = 0;
     ctx->option_timeout_lmtp_write   = 0;
@@ -437,7 +435,6 @@
     (void)option_create(&o, ctx->val); /* FIXME */
     (void)option_parse(o, argc, argv);
     (void)config_context(ctx);
-    CU(0); //FIXME
 
     if (getuid() != ctx->option_uid) {
         if (setuid(ctx->option_uid) == -1) {
@@ -676,8 +673,7 @@
         sa_addr_destroy(ctx->saaServerbind);
     if (ctx->option_restrictheader != NULL)
         free(ctx->option_restrictheader);
-    if (ctx->azHeaderValuePairs != NULL)
-        free(ctx->azHeaderValuePairs);
+    //FIXME if (ctx->azHeaderValuePairs != NULL) free(ctx->azHeaderValuePairs); what about headerrules
     if (ctx->option_pidfile != NULL)
         free(ctx->option_pidfile);
     if (ctx->progname != NULL)
@@ -1476,22 +1472,11 @@
         }
     }
 
-    /* Optionally add command line specified Header/Value Pairs
-     */
-    log0(ctx, TRACE, "adding header/value pairs");
-
-    cp = NULL;
-    while ((cp = argz_next(ctx->azHeaderValuePairs, ctx->asHeaderValuePairs, cp)) != NULL) {
-        var_rc_t var_rc;
-        char *res_ptr;
-        if ((var_rc = var_expand(ctx->config_varctx, cp, strlen(cp), &res_ptr, NULL, TRUE)) != VAR_OK) {
-            log3(ctx, ERROR, "expansion of '%s' failed: %s (%d)", cp, var_strerror(ctx->config_varctx, rc, &cp) == VAR_OK ? cp : "Unknown Error", rc);
-            continue;
-        }
-        log1(ctx, DEBUG, "adding expanded header: \"%s\"", res_ptr);
-        argz_add(&ctx->msg->azHeaders, &ctx->msg->asHeaders, res_ptr);
-        free(res_ptr);
-    }
+    /* rewrite headers */
+    log0(ctx, TRACE, "appying header rewrite rules");
+    msg_headermatrixbuildup(ctx->msg);
+    headerrewrite(ctx);
+    msg_headermatrixteardwn(ctx->msg);
 
     /*  RFC0821 4.2.1. REPLY CODES BY FUNCTION GROUPS   554 Transaction failed
      *  RFC1893 2. Status Codes                         5.X.X   Permanent Failure
@@ -1616,11 +1601,10 @@
         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->pns[i].rc), 
-                nntp_lastresp(ctx->pns[i].nntp));
+                "${option.destination}[%d] returned %s\n" /*FIXME*/
+                "${option.destination}[%d] lastresp \"%s\"",  /*FIXME*/
+                i, nntp_error(ctx->pns[i].rc), 
+                i, nntp_lastresp(ctx->pns[i].nntp));
                 argz_add(&azErr, &asErr, errorstring);
             }
         }

CVSTrac 2.0.1