Replies: 3 comments 5 replies
-
You are on to something, or at least so I recall, but you need to post a fool-proof reproduction recipe, so I (or anyone else) can help you with this. When you open an issue, don't you see an issue-reporting template? If you follow it, it should guide you to what things are generally desired. Is either |
Beta Was this translation helpful? Give feedback.
-
Ok, thanks. I have now displayed the buffer that holds the data associated with open-network-stream. The CR's are stripped there, and they are pressent when looking at Wireshark packet capture. So I am suspecting that the C code in Emacs internals is being "clever" with how the bytes make it from the underlying socket into a buffers.c buffer. What is interesting is that the pathway from running the LSP server as a subprocess, (inferior process) does not go down exactly the same path and the CR's are present. This is sort of fun for me to figure out. I haven't programmed in LISP since 1992, but it's all coming back. If you know of any options to network/process/buffer management in Emacs whose behaviors vary by parameters or ifdef-ed macros in the C code that might help me. I would be proud to submit a patch to Emacs or one of its packages. I have been an Emacs user since 1985. |
Beta Was this translation helpful? Give feedback.
-
Hi, I haven't forgotten this, but had to put this down for a few days to finish a (paying) work issue first. |
Beta Was this translation helpful? Give feedback.
-
I am running clangd as an LSP server over a socket to remote server using socat. Has anybody else been able to get this to work. Running clangd locally is working perfectly fine, so I am pretty sure eglot and jsonrpc are installed correctly.
The connection to the remote server dies in the initialization handshake. That is, the LSP client (eglot) has sent the first JSON-RPC method and there is a TCP reset before a reply can get back to eglot.
EDIT
The proxied connection is now sending the initialize method reply, but jsonrpc is not parsing it. I have added a lot of tracing. I am a lisp programmer from the 80's and 90's so this is pretty easy to trace.
As I investigate this further, the proxied stream to clang is showing the Content-Length header with lines terminated by LF, whereas the subprocess connection to clangd is showing CR LF, which matchers the regexp in jsonrpc.el. I am tracing the proxy and I see the 0x0D, 0x0A pairs flowing through the TCP buffers, so I am really confused. Do emacs buffers do strange things with CR's and LF's. I feel like I am very close, but there's some configuration I am missing.
EDIT2 finally got a localhost packet capture in Wireshark showing property formed JSON-RPC headers. Something in Emacs process or buffer is losing some data.
clang-remote.zip
Beta Was this translation helpful? Give feedback.
All reactions