[QFJ-544] Header with BeginString=FIXT.1.1 incorrectly parsed by FIXMessageDecoder (manifests as missing messages) Created: 20/Jul/10 Updated: 04/Sep/12 Resolved: 02/Aug/12 |
|
Status: | Resolved |
Project: | QuickFIX/J |
Component/s: | Engine |
Affects Version/s: | 1.4.0 |
Fix Version/s: | 1.5.3 |
Type: | Bug | Priority: | Default |
Reporter: | Stelios Papadopoulos | Assignee: | Christoph John |
Resolution: | Fixed | Votes: | 3 |
Labels: | None |
Attachments: | quickfixj-1.4.patch quickfixj-1.5.patch | ||||||||||||||||
Issue Links: |
|
Description |
When BeginString=FIXT.1.1 messages can be skipped if the buffer ends before the last '=' of "8=FIXT.1.1\0019=". That will happen if the buffer contains a correct message before that. Example: in messages: 8=FIXT.1.1\0019=12\00135=X\001108=30\00110=036\0018=FIXT.1.1\0019=12\00135=X\001108=30\00110=036\001 the second message will fail to be decoded if the buffer contents presented to the FixMessageDecoder in two subsequent decode() invocations are: "8=FIXT.1.1\0019=12\00135=X\001108=30\00110=036\0018=FIXT.1.1\0019" and "=12\00135=X\001108=30\00110=036\001" I have created tests to replicate this issue (and also issue Index: core/src/test/java/quickfix/mina/message/FIXMessageDecoderTest.java @Test + + ProtocolDecoder decoder = codecFactory.getDecoder(); for (int i = 1; i < data.length(); i++) { @@ -379,9 +394,8 @@ output.reset(); buffer.clear(); }-
private static BufPos indexOf(ByteBuffer buffer, int position, byte[] data) {
|
Comments |
Comment by Stelios Papadopoulos [ 20/Jul/10 ] |
the svn references are unrelated to the QuickFixJ svn repository. |
Comment by Stelios Papadopoulos [ 20/Jul/10 ] |
Found the same issue in 1.5.0 here's my diffs for the tests and the fix: Index: C:/dev/projects/QUICKFIXJ-IG/core/src/test/java/quickfix/mina/message/FIXMessageDecoderTest.java @Test + + ProtocolDecoder decoder = codecFactory.getDecoder(); for (int i = 1; i < data.length(); i++) { @@ -358,9 +373,8 @@ output.reset(); buffer.clear(); }+ }
Index: C:/dev/projects/QUICKFIXJ-IG/core/src/main/java/quickfix/mina/message/FIXMessageDecoder.java
|
Comment by Stelios Papadopoulos [ 01/Aug/12 ] |
revision numbers are unrelated to the official repository. fix for the 1.4.x branch |
Comment by Stelios Papadopoulos [ 01/Aug/12 ] |
revision numbers are unrelated to the official repository. fix for the 1.5.x branch |
Comment by Christoph John [ 02/Aug/12 ] |
Stelios, thanks for the patch! Committed as r1075 on trunk. |