From: David Carlier Date: Wed, 16 Mar 2016 10:09:55 +0000 (+0000) Subject: MINOR: da: Using ARG12 macro for the sample fetch and the convertor. X-Git-Tag: v1.7-dev3~98 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=840b0240bc4006b0d70176d7dbbce57a70eedf68;p=thirdparty%2Fhaproxy.git MINOR: da: Using ARG12 macro for the sample fetch and the convertor. Regarding the minor update introduced in the cd6c3c7cb4fdc9cf694b62241840e3fea30e03dd commit, the DeviceAtlas module is now able to use up to 12 device properties via the new ARG12 macro. --- diff --git a/README b/README index 13aa3b2bf0..3e600e3b68 100644 --- a/README +++ b/README @@ -259,11 +259,11 @@ cases. All HTTP headers via the sample / fetch - http-request set-header X-DeviceAtlas-Data %[da-csv-fetch(primaryHardwareType,osName,osVersion,browserName,browserVersion)] + http-request set-header X-DeviceAtlas-Data %[da-csv-fetch(primaryHardwareType,osName,osVersion,browserName,browserVersion,browserRenderingEngine)] Single HTTP header (e.g. User-Agent) via the convertor - http-request set-header X-DeviceAtlas-Data %[req.fhdr(User-Agent),da-csv-conv(primaryHardwareType,osName,osVersion,browserName,browserVersion)] + http-request set-header X-DeviceAtlas-Data %[req.fhdr(User-Agent),da-csv-conv(primaryHardwareType,osName,osVersion,browserName,browserVersion,browserRenderingEngine)] # Mobile content switching with ACL diff --git a/doc/configuration.txt b/doc/configuration.txt index 6b29df4389..dc1a3fce9b 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -11678,14 +11678,14 @@ da-csv-conv([,*]) input, and to emit a string made of the concatenation of the properties enumerated in argument, delimited by the separator defined by the global keyword "deviceatlas-property-separator", or by default the pipe character - ('|'). There's a limit of 5 different properties imposed by the haproxy + ('|'). There's a limit of 12 different properties imposed by the haproxy configuration language. Example: frontend www bind *:8881 default_backend servers - http-request set-header X-DeviceAtlas-Data %[req.fhdr(User-Agent),da-csv(primaryHardwareType,osName,osVersion,browserName,browserVersion)] + http-request set-header X-DeviceAtlas-Data %[req.fhdr(User-Agent),da-csv(primaryHardwareType,osName,osVersion,browserName,browserVersion,browserRenderingEngine)] debug This converter is used as debug tool. It dumps on screen the content and the diff --git a/src/da.c b/src/da.c index a214b319cf..d15e5735a1 100644 --- a/src/da.c +++ b/src/da.c @@ -347,13 +347,13 @@ static struct cfg_kw_list dacfg_kws = {{ }, { /* Note: must not be declared as its list will be overwritten */ static struct sample_fetch_kw_list fetch_kws = {ILH, { - { "da-csv-fetch", da_haproxy_fetch, ARG5(1,STR,STR,STR,STR,STR), NULL, SMP_T_STR, SMP_USE_HRQHV }, + { "da-csv-fetch", da_haproxy_fetch, ARG12(1,STR,STR,STR,STR,STR,STR,STR,STR,STR,STR,STR,STR), NULL, SMP_T_STR, SMP_USE_HRQHV }, { NULL, NULL, 0, 0, 0 }, }}; /* Note: must not be declared as its list will be overwritten */ static struct sample_conv_kw_list conv_kws = {ILH, { - { "da-csv-conv", da_haproxy_conv, ARG5(1,STR,STR,STR,STR,STR), NULL, SMP_T_STR, SMP_T_STR }, + { "da-csv-conv", da_haproxy_conv, ARG12(1,STR,STR,STR,STR,STR,STR,STR,STR,STR,STR,STR,STR), NULL, SMP_T_STR, SMP_T_STR }, { NULL, NULL, 0, 0, 0 }, }};