From befef70e23fadc956cb32f6912e9e795db70ca21 Mon Sep 17 00:00:00 2001 From: Daniel Corbett Date: Tue, 9 Mar 2021 23:00:34 -0500 Subject: [PATCH] BUG/MINOR: sample: Rename SenderComID/TargetComID to SenderCompID/TargetCompID The recently introduced Financial Information eXchange (FIX) converters have some hard coded tags based on the specification that were misspelled. Specifically, SenderComID and TargetComID should be SenderCompID and TargetCompID according to the specification [1][2]. This patch updates all references, which includes the converters themselves, the regression test, and the documentation. [1] https://fiximate.fixtrading.org/en/FIX.5.0SP2_EP264/tag49.html [2] https://fiximate.fixtrading.org/en/FIX.5.0SP2_EP264/tag56.html --- doc/configuration.txt | 2 +- include/haproxy/fix-t.h | 4 ++-- include/haproxy/fix.h | 8 ++++---- reg-tests/converter/fix.vtc | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/configuration.txt b/doc/configuration.txt index 1f5d605bc..f0801aaba 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -15650,7 +15650,7 @@ fix_tag_value() from the tag . can be a string or an integer pointing to the desired tag. Any integer value is accepted, but only the following strings are translated into their integer equivalent: BeginString, BodyLength, - MsgType, SenderComID, TargetComID, CheckSum. More tag names can be easily + MsgType, SenderCompID, TargetCompID, CheckSum. More tag names can be easily added. Due to current HAProxy design, only the first message sent by the client and diff --git a/include/haproxy/fix-t.h b/include/haproxy/fix-t.h index bba9bd61a..4b4de5583 100644 --- a/include/haproxy/fix-t.h +++ b/include/haproxy/fix-t.h @@ -47,8 +47,8 @@ #define FIX_TAG_BodyLength 9 #define FIX_TAG_CheckSum 10 #define FIX_TAG_MsgType 35 -#define FIX_TAG_SenderComID 49 -#define FIX_TAG_TargetComID 56 +#define FIX_TAG_SenderCompID 49 +#define FIX_TAG_TargetCompID 56 #define FIX_MSG_MINSIZE 26 /* Minimal length for a FIX Message */ diff --git a/include/haproxy/fix.h b/include/haproxy/fix.h index 4b5928204..94aa81547 100644 --- a/include/haproxy/fix.h +++ b/include/haproxy/fix.h @@ -77,12 +77,12 @@ static inline unsigned int fix_tagid(const struct ist tag) return FIX_TAG_CheckSum; else if (isteqi(tag, ist("BodyLength"))) return FIX_TAG_BodyLength; - else if (isteqi(tag, ist("TargetComID"))) - return FIX_TAG_TargetComID; + else if (isteqi(tag, ist("TargetCompID"))) + return FIX_TAG_TargetCompID; else if (isteqi(tag, ist("BeginString"))) return FIX_TAG_BeginString; - else if (isteqi(tag, ist("SenderComID"))) - return FIX_TAG_SenderComID; + else if (isteqi(tag, ist("SenderCompID"))) + return FIX_TAG_SenderCompID; return 0; } diff --git a/reg-tests/converter/fix.vtc b/reg-tests/converter/fix.vtc index 8bddc4d8f..f035445ac 100644 --- a/reg-tests/converter/fix.vtc +++ b/reg-tests/converter/fix.vtc @@ -73,8 +73,8 @@ haproxy h1 -conf { tcp-request content set-var(req.fix_vsn) req.payload(0,0),fix_tag_value(BeginString) tcp-request content set-var(req.fix_len) req.payload(0,0),fix_tag_value(BodyLength) tcp-request content set-var(req.fix_type) req.payload(0,0),fix_tag_value(MsgType) - tcp-request content set-var(req.fix_sender) req.payload(0,0),fix_tag_value(SenderComID) - tcp-request content set-var(req.fix_target) req.payload(0,0),fix_tag_value(TargetComID) + tcp-request content set-var(req.fix_sender) req.payload(0,0),fix_tag_value(SenderCompID) + tcp-request content set-var(req.fix_target) req.payload(0,0),fix_tag_value(TargetCompID) tcp-request content set-var(req.fix_chksum) req.payload(0,0),fix_tag_value(CheckSum) tcp-request content reject if ! { var(req.fix_vsn) "FIX.4.4" } || ! { var(req.fix_len) "102" } tcp-request content reject if ! { var(req.fix_type) "A" } || ! { var(req.fix_sender) "CLIENT1" }