Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read message type from fix string without regex #909

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add comment for two-character message type
jkulubya committed Dec 10, 2024
commit fbb3c97ad59444310cee33502680118b46110d18
15 changes: 4 additions & 11 deletions QuickFIXn/Message/Message.cs
Original file line number Diff line number Diff line change
@@ -256,17 +256,10 @@ public static SessionID GetReverseSessionId(string msg)
/// <exception cref="MessageParseError">if 35 tag is missing or malformed</exception>
public static string GetMsgType(string fixstring)
{
// ------------------- haystack
// | |
// v v
// 2=3|3=E|35=0|55=ab|545=xx|
// ^
// |
// ---------needle
//
// 2=3|3=E|35=0|55=ab|545=xx| -> good message
// 35=5| -> these two are garbled messages but the old regex behavior read them just fine, so the new one does as well
// |35=A|
// 2=3|3=E|35=0|55=ab|545=xx| -> good message, msg type = 0
// 2=3|3=E|35=AX|55=ab|545=xx| -> good message, msg type = AX
// 35=5| -> these two are garbled messages but the old regex behavior
// |35=A| -> read them just fine, so this one does as well
var chars = fixstring.AsSpan();
var l = 0;
var r = 1;