OSSP CVS Repository

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

ossp-pkg/lmtp2nntp/lmtp2nntp_main.c 1.48 -> 1.49

--- lmtp2nntp_main.c     2002/03/06 14:25:39     1.48
+++ lmtp2nntp_main.c     2002/03/13 13:58:39     1.49
@@ -36,6 +36,7 @@
 #include <sys/wait.h>
 #include <sys/stat.h>
 #include <signal.h>
+#include <stdarg.h>
 
 /* third party (included) */
 #include "lmtp2nntp_argz.h"
@@ -126,6 +127,12 @@
     "a-zA-Z0-9.-" /* namechars     */ 
 };
 
+#if 0
+typedef struct {
+    l2_channel_t *l2;
+} logctx_t;
+#endif
+
 static var_rc_t ctx_lookup(
     var_t *var,
     void *_ctx, 
@@ -136,8 +143,19 @@
     var_rc_t rc;
     char *cp;
     optionval_t *ov;
+#if 0
+    logctx_t *logctx = NULL;
+
+    if ((logctx = (logctx_t *)malloc(sizeof(logctx_t))) != NULL) {
+        if (l2_channel_upstream(ctx->l2, &logctx->l2) != L2_OK) {
+            if (l2_channel_downstream(ctx->l2, &logctx->l2) != L2_OK) {
+                logctx->l2 = NULL;
+            }
+        }
+    }
+    if (logctx != NULL && logctx->l2 != NULL) log2(logctx, DEBUG, "ctx_lookup variable \"%s\" (%d)", var_ptr, var_len);
+#endif
 
-    log2(ctx, DEBUG, "ctx_lookup variable \"%s\" (%d)", var_ptr, var_len);
     rc = VAR_ERR_UNDEFINED_VARIABLE;
     if (strncasecmp(var_ptr, "option.", strlen("option.")) == 0) {
         cp = str_dupex(var_ptr, var_len);
@@ -194,10 +212,19 @@
         }
         free(cp);
     }
-    if (rc == VAR_OK)
-        log4(ctx, DEBUG, "ctx_lookup variable \"%s\" (%d) ok: result is \"%s\" (%d)", var_ptr, var_len, *val_ptr, *val_len);
-    else
-        log4(ctx, DEBUG, "ctx_lookup variable \"%s\" (%d) failed: %s (%d)", var_ptr, var_len, var_strerror(var, rc, &cp) == VAR_OK ? cp : "Unknown Error", rc);
+
+#if 0
+    if (rc == VAR_OK) {
+        if (logctx != NULL && logctx->l2 != NULL) log4(ctx, DEBUG, "ctx_lookup variable \"%s\" (%d) ok: result is \"%s\" (%d)", var_ptr, var_len, *val_ptr, *val_len);
+    }
+    else {
+        if (logctx != NULL && logctx->l2 != NULL) log4(ctx, DEBUG, "ctx_lookup variable \"%s\" (%d) failed: %s (%d)", var_ptr, var_len, var_strerror(var, rc, &cp) == VAR_OK ? cp : "Unknown Error", rc);
+    }
+
+    if (logctx != NULL)
+        free(logctx);
+#endif
+
     return rc;
 }
 
@@ -325,7 +352,6 @@
     exit(ERR_EXECUTION);
 }
 
-
 int main(int argc, char **argv)
 {
     int           rc;

CVSTrac 2.0.1