]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: sample: support cast from bool to string
authorWilly Tarreau <w@1wt.eu>
Fri, 21 Dec 2012 16:38:05 +0000 (17:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 21 Dec 2012 16:57:05 +0000 (17:57 +0100)
Samples could be converted from bool to int and from int to string but
not from bool to string. Let's add this.

src/sample.c

index a7d02e57ab738cefc3a8ae6241e7b242e49afa3b..f5828fa90f72a9a77d9ffb1b2a35b325a25ade5f 100644 (file)
@@ -263,7 +263,7 @@ static int c_str2int(struct sample *smp)
 typedef int (*sample_cast_fct)(struct sample *smp);
 static sample_cast_fct sample_casts[SMP_TYPES][SMP_TYPES] = {
 /*            to:  BOOL       UINT       SINT       IPV4      IPV6        STR         BIN        CSTR        CBIN   */
-/* from: BOOL */ { c_none,    c_none,    c_none,    NULL,     NULL,       NULL,       NULL,      NULL,       NULL   },
+/* from: BOOL */ { c_none,    c_none,    c_none,    NULL,     NULL,       c_int2str,  NULL,      c_int2str,  NULL   },
 /*       UINT */ { c_none,    c_none,    c_none,    c_int2ip, NULL,       c_int2str,  NULL,      c_int2str,  NULL   },
 /*       SINT */ { c_none,    c_none,    c_none,    c_int2ip, NULL,       c_int2str,  NULL,      c_int2str,  NULL   },
 /*       IPV4 */ { NULL,      c_ip2int,  c_ip2int,  c_none,   c_ip2ipv6,  c_ip2str,   NULL,      c_ip2str,   NULL   },