Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

[check_ajp] Fix "or die" expressions. #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChristopherSchultz
Copy link

Using || ends up binding too tightly to the operand on the left, so the || xdie expressions never do anything because all of those trailing-parameters to system calls are not undefined.

Changing them to or xdie causes them to actually do what you wanted them to do, which was actually terminate if a system call failed.

I discovered this by using check_ajp across an stunnel setup where the remote server wouldn't properly handshake. The "pong" result ends up being the literal string null for some reason, but the real problem is that sysread is throwing a "Connection reset" error. check_ajp wasn't dying when sysread was throwing an error, so ... it continued and returned an UNKNOWN response.

Using || ends up binding too tightly to the operand on the left, so the `|| xdie` expressions never do anything because all of those trailing-parameters to system calls are not undefined.

Changing them to `or xdie` causes them to actually do what you wanted them to do, which was actually terminate if a system call failed.

I discovered this by using `check_ajp` across an stunnel setup where the remote server wouldn't properly handshake. The "pong" result ends up being the literal string `null` for some reason, but the real problem is that `sysread` is throwing a "Connection reset" error. `check_ajp` wasn't dying when `sysread` was throwing an error, so ... it continued and returned an UNKNOWN response.
@ChristopherSchultz ChristopherSchultz changed the title Fix "or die" expressions. [check_ajp] Fix "or die" expressions. Apr 14, 2021
@waja
Copy link
Collaborator

waja commented Dec 16, 2021

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants