OSSP CVS Repository

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

ossp-pkg/lmtp2nntp/lmtp2nntp_config.c 1.24 -> 1.25

--- lmtp2nntp_config.c   2002/01/31 13:54:21     1.24
+++ lmtp2nntp_config.c   2002/01/31 14:20:09     1.25
@@ -426,6 +426,49 @@
     }
     catch (ex)
         rethrow;
+
+    /* --headervalue MULTI */
+    try {
+        char *cp;
+        int i;
+        char *cpHeader;
+        char *cpValue;
+
+        if (   (val_get(ctx->val, "option.headervalue", &ov) != VAL_OK)
+            || ((ov->ndata >= 1) && (ov->data.m == NULL))
+              ) throw(0,0,0);
+        log1(ctx, DEBUG, "ov->ndata = %d", ov->ndata);
+        for (i = 0; i < ov->ndata; i++)
+            log2(ctx, TRACE, "--headervalue[%d] = \"%s\"", i, (ov->data.m)[i]);
+
+        if ((ctx->pacl = (struct acl *)malloc(ov->ndata * sizeof(struct acl))) == 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);
+            cpHeader = strdup(cp);
+            if ((cp = strchr(cpHeader, ':')) == NULL) {
+                log1(ctx, ERROR, "option --headervalue, header (%s) terminating colon missing", (ov->data.m)[i]);
+                throw(0,0,0);
+            }
+            *cp = NUL;
+            log2(ctx, DEBUG, "header[%d] = \"%s\"", i, cpHeader);
+            cp++;
+            while (*cp == ' ') cp++; //FIXME note this in NEWS
+            if (*cp == NUL) {
+                log1(ctx, ERROR, "option --headervalue, value (%s) missing", (ov->data.m)[i]);
+                throw(0,0,0);
+            }
+            cpValue = strdup(cp);
+            log2(ctx, DEBUG, " value[%d] = \"%s\"", i, cpValue);
+            argz_add(&ctx->azHeaderValuePairs, &ctx->asHeaderValuePairs, cpHeader);
+            argz_add(&ctx->azHeaderValuePairs, &ctx->asHeaderValuePairs, cpValue);
+            free(cpHeader);
+            free(cpValue);
+        }
+    }
+    catch (ex)
+        rethrow;
+
 CUS:
     return;
 }

CVSTrac 2.0.1