Mailing List Archive

[Bug 66374] Fixed string comparison doesn't work in <If>
https://bz.apache.org/bugzilla/show_bug.cgi?id=66374

Eric Covener <covener@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |WONTFIX
Status|NEW |RESOLVED

--- Comment #1 from Eric Covener <covener@gmail.com> ---
"Error" is for configuration problems that should interrupt parsing.

There is no short-circuiting of <if> config sections that can never evaluate to
true during the processing of a request, the if and the directives they enclose
are still part of the configuration.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 66374] Fixed string comparison doesn't work in <If> [ In reply to ]
https://bz.apache.org/bugzilla/show_bug.cgi?id=66374

Eric Covener <covener@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
Resolution|WONTFIX |---

--- Comment #2 from Eric Covener <covener@gmail.com> ---
Too hasty, maybe error can blow up when encountered in If

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 66374] Fixed string comparison doesn't work in <If> [ In reply to ]
https://bz.apache.org/bugzilla/show_bug.cgi?id=66374

--- Comment #3 from Eric Covener <covener@gmail.com> ---
After more thought, it seems to be high risk/reward tradeoff to change the
behavior here. It marginally helps configs that don't startup today, but
nesting <If>, IfDefine, and Error would be regressed.

I will leave it open for others to consider, but I suggest changing the subject
or otherwise clarifying

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 66374] Fixed string comparison doesn't work in <If> [ In reply to ]
https://bz.apache.org/bugzilla/show_bug.cgi?id=66374

--- Comment #4 from Michael Orlitzky <michael@orlitzky.com> ---
I think I'm having the same problem as bug #63146. There seems to be a lot of
magic going on in the config parsing that interacts badly with <If>.

I don't really know what a good solution could look like given that I'm not an
expert on the relevant limitations, but from a dumb user perspective (and to
put it bluntly) it's pretty annoying to have a feature depend on secret
details, and then fail silently / return bullshit / launch missiles when you
run afoul of the rules you didn't know about.

If you asked 100 random programmers or system administrators what

<If "'www' == 'x'">
Error "www and x are equal"
</If>

will do, I would be surprised if any of them guessed right. At a high level, my
complaint is basically just that the actual behavior of <If> should more
closely match the mental model of it that everyone is going to arrive with. And
if that's not possible, throw a sensible error instead of quietly proceeding
with a config that acts nothing like what is written.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 66374] Fixed string comparison doesn't work in <If> [ In reply to ]
https://bz.apache.org/bugzilla/show_bug.cgi?id=66374

--- Comment #5 from Michael Orlitzky <michael@orlitzky.com> ---
For posterity, this is a horrendous workaround for my original problem of
comparing $host to "www":

<IfDefine www>
Error "Constant 'www' is already defined"
</IfDefine>

<IfDefine !$host>
Define $host
<IfDefine www>
# Do whatever
</IfDefine>
Undefine $host
</IfDefine>

I don't really recommend it, but it works in a pinch.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org
[Bug 66374] Fixed string comparison doesn't work in <If> [ In reply to ]
https://bz.apache.org/bugzilla/show_bug.cgi?id=66374

--- Comment #6 from Joe Orton <jorton@redhat.com> ---
I agree we shouldn't change the behaviour. From a C perspective it's a bit like
expecting

if (0) {
#error fail
}


to do compile as a noop. Maybe this could be clarified in the docs for
Error/Warning.

--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org