BUG/MINOR: tools: fix url2sa return value with IPv4
Fix 8a91374 ("BUG/MINOR: tools: url2sa reads ipv4 too far") introduced a
regression in the value returned when parsing an ipv4 host.
Tthe consumed length is supposed to be as far as the first character of
the path, only its not computed correctly anymore and return the length
minus the size of the scheme.
Fixed the issue by reverting 'curr' and 'url' as they were before the
patch.
Must be backported in every stable branch where the 8a91374 patch was
backported.
(cherry picked from commit b938b77ade7b75bff94f810eec78e7e065f04f81)
Signed-off-by: William Lallemand <wlallemand@haproxy.org>
(cherry picked from commit a83367a2c2de5c267f1c199f3295c27c8dc794c6)
Signed-off-by: William Lallemand <wlallemand@haproxy.org>
diff --git a/src/tools.c b/src/tools.c
index bdf78ff..5e83230 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -1694,9 +1694,7 @@
out->host_len = ret;
}
- /* we need to assign again curr and end from the trash */
- url = trash.area;
- curr = trash.area + ret;
+ curr += ret;
/* Decode port. */
if (*curr == ':') {