--- lmtp2nntp_main.c 2002/02/28 14:07:43 1.44
+++ lmtp2nntp_main.c 2002/02/28 15:57:09 1.45
@@ -126,64 +126,6 @@
"a-zA-Z0-9.-" /* namechars */
};
-#if 0
-static var_rc_t ctx_lookup(
- void *_ctx,
- const char *var_ptr, size_t var_len, int var_idx,
- const char **val_ptr, size_t *val_len, size_t *val_size)
-{
- lmtp2nntp_t *ctx = (lmtp2nntp_t *)_ctx;
- const char *name;
- size_t len;
- char *cp;
- var_rc_t rc;
-
- log2(ctx, DEBUG, "lookup variable \"%s\" (%d)",
- var_ptr /* FIXME: NUL-termination? */, var_len);
- rc = VAR_ERR_UNDEFINED_VARIABLE;
- if (strncasecmp(var_ptr, "lmtp2nntp.version", var_len) == 0) {
- }
- else if (strncasecmp(var_ptr, "os.name", var_len) == 0) {
- }
- else if (strncasecmp(var_ptr, "os.version", var_len) == 0) {
- }
- else if (var_len > 8 && strncasecmp(var_ptr, "msg.hdr.", 8) == 0) {
- name = var_ptr + 8;
- len = strlen(name);
- if (ctx == NULL)
- return VAR_ERR_UNDEFINED_VARIABLE;
- if (ctx->msg == NULL)
- return VAR_ERR_UNDEFINED_VARIABLE;
- if (ctx->msg->azHeaders == NULL)
- return VAR_ERR_UNDEFINED_VARIABLE;
- cp = NULL;
- while ((cp = argz_next(ctx->msg->azHeaders, ctx->msg->asHeaders, cp)) != NULL) {
- char *cpVar, *cpVal;
- int nVar, nVal;
- cpVar = cp;
- nVar = strlen(cpVar);
- if ((cp = argz_next(ctx->msg->azHeaders, ctx->msg->asHeaders, cp)) == NULL)
- break;
- cpVal = cp;
- nVal = strlen(cpVal);
- if (len == (nVar-1) && strncasecmp(cpVar, name, len) == 0 && cpVar[len] == ':') {
- *val_ptr = cpVal;
- *val_len = nVal;
- *val_size = 0;
- rc = VAR_OK;
- }
- }
- }
- if (rc == VAR_OK)
- log4(ctx, DEBUG, "lookup variable \"%s\" (%d) ok: result is \"%s\" (%d)",
- var_ptr /* FIXME: NUL-termination? */, var_len, *val_ptr, *val_len);
- else
- log3(ctx, DEBUG, "lookup variable \"%s\" (%d) failed: %s",
- var_ptr /* FIXME: NUL-termination? */, var_len, var_strerror(rc));
- return rc;
-}
-#endif
-
static var_rc_t ctx_lookup(
var_t *var,
void *_ctx,
@@ -200,7 +142,6 @@
if (strncasecmp(var_ptr, "option.", strlen("option.")) == 0) {
cp = str_dupex(var_ptr, var_len);
if (val_get(ctx->val, cp, &ov) == VAL_OK) {
- //log3(ctx, DEBUG, "FIXME var_idx=%d, ov->type=%d, ov->ndata=%d", var_idx, ov->type, ov->ndata);
if ((var_idx == 0) && (ov->ndata == 1) && (ov->type == OPT_SINGLE)) { /* request first/only single value */
*val_ptr = ov->data.s;
*val_len = strlen(ov->data.s);
@@ -231,16 +172,13 @@
n = strlen(cp);
cp[n]= ':';
cp[n + 1] = NUL;
- log2(ctx, DEBUG, "FIXME var_idx=%d, cp=%s", var_idx, cp);
for (hdI = ctx->msg->hdFirst; hdI != NULL; hdI = hdI->next) { /* for each header */
- log1(ctx, DEBUG, "FIXME hdI->name=%s", hdI->name);
if (hdI->name == NULL || strlen(hdI->name) == 0)
- continue; //FIXME header w/o name cannot happen normally
+ continue;
if (strcasecmp(cp, hdI->name) == 0)
break;
}
if (hdI != NULL) {
- log1(ctx, DEBUG, "FIXME hdI->ndata=%d", hdI->ndata);
if ((var_idx == 0) && (hdI->ndata == 1)) { /* request first/only single value */
*val_ptr = hdI->data.s;
*val_len = strlen(hdI->data.s);
@@ -263,8 +201,6 @@
return rc;
}
-
-
static void lmtp_gfs_ns(struct ns *);
static void lmtp_gfs_lhlo(lmtp2nntp_t *);
static void lmtp_gfs_rset(lmtp2nntp_t *);
@@ -501,18 +437,6 @@
(void)option_create(&o, ctx->val); /* FIXME */
(void)option_parse(o, argc, argv);
(void)config_context(ctx);
-
-{
-headerrule_t *hrI;
-fprintf(stderr, "DEBUG: los geht's\n");
-for (hrI = ctx->option_firstheaderrule; hrI != NULL; hrI = hrI->next) {
- fprintf(stderr, "DEBUG: cpPri = %d\n", hrI->pri);
- fprintf(stderr, "DEBUG: cpRegex = \"%s\"\n", hrI->regex == NULL ? "(NULL)" : hrI->regex);
- fprintf(stderr, "DEBUG: cpHeader = \"%s\"\n", hrI->header == NULL ? "(NULL)" : hrI->header);
- fprintf(stderr, "DEBUG: cpValue = \"%s\"\n", hrI->val == NULL ? "(NULL)" : hrI->val);
-}
-fprintf(stderr, "DEBUG: das war's\n");
-}
CU(0); //FIXME
if (getuid() != ctx->option_uid) {
|