BUG/MINOR: http-fetch: Use integer value when possible in "method" sample fetch

Because of the previous fix, if the HTTP parsing is performed when the
"method" sample fetch is called, we always rely on the string representation
of the request method.

Indeed, if no parsing was performed when the "method" sample fetch is
called, the transaction method is HTTP_METH_OTHER because it was just
initialized. However, without this patch, in this case, we always retrieve
the method by reading the request start-line.

Now, when the method is HTTP_METH_OTHER, we systematically try to parse the
request but the method is tested once again after the parsing to be able to
use the integer representation when possible.

This patch must be backported as far as 2.0.

(cherry picked from commit dbbdb25f1c0a96094c4e357105264053644d9255)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit ac082b4194544c67db11d9843d2f7342d48a62b8)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit ebbe1ada2fbb7decb154712a2298ff5701725f4a)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed