Skip to content

Conversation

@walcht
Copy link

@walcht walcht commented Aug 7, 2025

No description provided.

@akoeplinger
Copy link
Member

This doesn't sound correct to me, the protocol says the headers/content should be separated by carriage return, line feed and not the literal string backslash-r, backslash-n.

@walcht
Copy link
Author

walcht commented Oct 4, 2025

Yes, you are correct... Please ignore that commit.

Just to give some further context into why I opened this pull request, I described the issue at #104.
I tried to use NeoVim with nvim-dap client (not relevant since I am pretty confident the issue is not in NeoVim client side). I simply get a timeout to the initial initialize request.

After looking at this particular line (at: https://github.com/walcht/vscode-mono-debug/blob/main/src/csharp/Protocol.cs?plain=1#L197):

var idx = s.IndexOf(TWO_CRLF);

I realized that the issue was because of a change to IndexOf implementation for newer dotnet versions that completely breaks the TWO_CRLF detection. The exact issue is described in detail here: dotnet/runtime#43736

I managed to 'solve' this in a similar project by not using IndexOf() and instead finding the literal "\r\n\r\n" in the string.

CONTENT_LENGTH_MATCHER = new Regex(@"Content-Length: (\d+)\r\n\r\n");

Although this solved my issue, searching for a literal "\r\n\r\n" character sequence is not correct (as per the protocol).

Which brings me to this question:
I think I am missing something here - why when I use verbatim string interpretation, all issues are solved and everything works fine?

(Thank you for responding and putting time into this - I really appreciate this project.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants