[PATCH] D47643: Rewrite JSON dispatcher loop using C IO (FILE*) instead of std::istream.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 1 09:01:50 PDT 2018


sammccall created this revision.
sammccall added reviewers: malaperle, ilya-biryukov.
Herald added subscribers: cfe-commits, jkorous, ioeric, klimek.

The EINTR loop around getline was added to fix an issue with mac gdb, but seems
to loop infinitely in rare cases on linux where the parent editor exits (most
reports with VSCode).
I can't work out how to fix this in a portable way with std::istream, but the
C APIs have clearer contracts and LLVM has a RetryAfterSignal function for use
with them which seems battle-tested.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D47643

Files:
  clangd/ClangdLSPServer.cpp
  clangd/ClangdLSPServer.h
  clangd/JSONRPCDispatcher.cpp
  clangd/JSONRPCDispatcher.h
  clangd/tool/ClangdMain.cpp
  test/clangd/too_large.test

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47643.149495.patch
Type: text/x-patch
Size: 10824 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180601/ff1a2153/attachment.bin>


More information about the cfe-commits mailing list