From: Willy Tarreau Date: Tue, 15 Sep 2026 14:37:58 +0000 (+0200) Subject: BUG/MINOR: proxy: also look for the closest option among cfg_opts3 X-Git-Tag: v3.5-dev9~158 X-Git-Url: https://git.kaiwu.me/$%7BISSUES%7D/static/gitweb.js?a=commitdiff_plain;h=5605269b1a3a6100ae3ccbfb013bbbb2553c8ee1;p=haproxy.git BUG/MINOR: proxy: also look for the closest option among cfg_opts3 proxy_find_best_option() scans cfg_opts[] and cfg_opts2[] for the option which looks closest to a mistyped one. When cfg_opts3[] was introduced in 3.2 with commit cc5a66212d ("MINOR: proxy: add proxy->options3"), it was not added there, so such newly added options are not proposed as candidates for mistakes (e.g. "assume-rfc6587-ntf" or "dont-parse-log"). Let's just fix this. This may be backported to 3.2. --- diff --git a/src/proxy.c b/src/proxy.c index 37785a1c5..ee759127a 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -597,6 +597,15 @@ const char *proxy_find_best_option(const char *word, const char **extra) } } + for (index = 0; cfg_opts3[index].name; index++) { + make_word_fingerprint(list_sig, cfg_opts3[index].name); + dist = word_fingerprint_distance(word_sig, list_sig); + if (dist < best_dist) { + best_dist = dist; + best_ptr = cfg_opts3[index].name; + } + } + while (extra && *extra) { make_word_fingerprint(list_sig, *extra); dist = word_fingerprint_distance(word_sig, list_sig);