jkorous added a comment.

Hi Greg, this looks interesting! I got curious about your patch since I am 
dealing with another protocol from the same "family" - LSP.



================
Comment at: tools/lldb-vscode/lldb-vscode.cpp:1424
+//----------------------------------------------------------------------
+std::string read_json_packet(FILE *in) {
+  static std::string header("Content-Length: ");
----------------
It looks to me that since you are just logging protocol level error here they 
will manifest as JSON parsing errors down the road (L 4113). Is that ok?

BTW there's another implementation of HTTP-like header parsing in clangd:
https://github.com/llvm-mirror/clang-tools-extra/blob/master/clangd/JSONRPCDispatcher.cpp#L238


================
Comment at: tools/lldb-vscode/lldb-vscode.cpp:4107
+  uint32_t packet_idx = 0;
+  while (true) {//!feof(g_state.in) && !ferror(g_state.in)) {
+    std::string json = read_json_packet(g_state.in);
----------------
This looks like some possible forgotten debugging artefact.


https://reviews.llvm.org/D50365



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to