bug of BeginEndMarkReceiveFilter in version 1.6.2.0

Apr 16, 2014 at 9:10 AM
When use "<record>","</record>" as begin end mark. In a very special condition the ProcessMatchedRequest function's argument commandData will less than the real.

When send data divide like this:
sock:send("<record><")
sleep(2000)
sock:send("var></var></record>")

the ProcessMatchedRequest function will recv "<record><var></var></record". 1 byte less than

send data.

to fix this bug, you can change BeginEndmarkReceiveFilter.cs line 118

FROM:
                int parsedLen = endPos - offset + m_EndSearchState.Mark.Length - prevEndMarkMatched;
TO:
                int parsedLen = endPos - offset + m_EndSearchState.Mark.Length;
                if (endPos == offset)
                    parsedLen = parsedLen - prevEndMarkMatched;
Coordinator
Apr 16, 2014 at 10:56 AM
Cool finding, I'll check it and make the change.

I am also welcome you to fork a branch and make the change by yourself and then pull a request.
Coordinator
Apr 22, 2014 at 10:41 AM
Hello Rosebush,

I had done a change to fix this issue, but the fixing way is not same with yours. This commit is in branch v1.6, and I think the code in master doesn't has this issue.
https://supersocket.codeplex.com/SourceControl/changeset/fe21f0cfff715c5ac6c64592bccd5bb6786d6749