BUG/MINOR: tcp-check: report the correct failed step in the status
authorWilly Tarreau <w@1wt.eu>
Thu, 2 Oct 2014 12:51:02 +0000 (14:51 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 2 Oct 2014 12:51:02 +0000 (14:51 +0200)
commit213c6785614d0228d7e96e982e5189e1d0777059
tree6ef28dbb13ef6ab1a594fe4ca92926cabcccdd0b
parentef953953e7f33c6a72c432fce8d47c2d84c69512
BUG/MINOR: tcp-check: report the correct failed step in the status

The step number was reported by checking only last_started_step, which
was not set in case of error during the initial connection phase, and
caused "step 1" to be returned with an invalid check type (typically
SEND). So now we first verify that a test was started before returning
this.

In addition to this, the indication of the test type was taken from
current_step instead of last_started_step, so the error description
was matching the next action instead of the one reported in the step
ID. Thus we could get the confusing "step 1 (send)" report below :

      tcp-check connect
      tcp-check send foo

In order to ease debugging, when the port number is known for a connect,
it is indicated in the error report.

Note that this only affects asynchronous error messages, synchronous ones
are correct.

This fix must be backported to 1.5.
src/checks.c