chiark / gitweb /
wip protocol
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 5 Jul 2020 12:09:54 +0000 (13:09 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 5 Jul 2020 12:09:54 +0000 (13:09 +0100)
src/sse.rs
templates/script.js

index f99fc6017977a1249648757eb39474e14ef47ecd..19637ce3b68a094cbb8b41dd19303b6781c4a0c7 100644 (file)
@@ -86,12 +86,13 @@ impl Read for UpdateReader {
 
       if next.client == self.client {
         write!(buf, "event: recorded\n\
-                     data: foo\n\n")?;
-        serde_json::to_writer(&mut *buf, &RecordedConfirmation {
+                     data: ")?;
+        serde_json::to_writer(&mut buf, &RecordedConfirmation {
           gen : next.gen,
           piece : next.piece,
           cseq : next.client_seq,
         })?;
+        write!(buf, "\n\n")?;
       } else {
         write!(buf, "id: {}\n\
                      data: {}\n\n",
index 5d7732126f4aabcd906966d615cbd83d9768268c..0c5a25b9a8f759b909ece4f0e60870daf5d10e2c 100644 (file)
@@ -198,10 +198,11 @@ function startup() {
     messages[k](j[k]);
   }
   es.addEventListener('commsworking', function(event) {
-    console.log('GOTDATA');
+    console.log('GOTDATA', event);
     status_node.innerHTML = event.data;
   });
   es.addEventListener('recorded', function(event) {
+//    var j = JSON.parse(event.data);
     xxx_recorded();
   });
   es.onerror = function(e) {