--- a/src/Tools/VSCode/src/channel.scala Wed Mar 08 10:50:59 2017 +0100
+++ b/src/Tools/VSCode/src/channel.scala Wed Mar 08 11:30:13 2017 +0100
@@ -59,7 +59,7 @@
s match {
case Value.Int(n) if n >= 0 =>
val msg = read_content(n)
- log("IN:\n" + msg)
+ log("IN: " + n + "\n" + msg)
Some(JSON.parse(msg))
case _ => error("Bad Content-Length: " + s)
}
@@ -73,10 +73,11 @@
def write(json: JSON.T)
{
val msg = JSON.Format(json)
- log("OUT:\n" + msg)
+ val content = UTF8.bytes(msg)
+ val n = content.length
+ val header = UTF8.bytes("Content-Length: " + n + "\r\n\r\n")
- val content = UTF8.bytes(msg)
- val header = UTF8.bytes("Content-Length: " + content.length + "\r\n\r\n")
+ log("OUT: " + n + "\n" + msg)
out.synchronized {
out.write(header)
out.write(content)