websocket: frame: Insert blocking put-bytevector hack.
[8sync.git] / 8sync / systems / websocket / frame.scm
index 7a71dba9ff56483b44c222edef00b58e4d439280..da55b90a314393f65f78edab62758dcf27eea293 100644 (file)
@@ -327,6 +327,14 @@ MASKING-KEY."
 ;;; Frame writer
 ;;;
 
+;; HACK: Do not suspend writes to avoid
+;; `The connection to ws://localhost:1236/ was interrupted while the page was loading.' (icecat)
+;; `could not decode a text frame as utf-8' (ungoogled chromium)
+(define put-bytevector (@ (ice-9 binary-ports) put-bytevector))
+
+;; This has no effect.
+;; (define put-u8 (@ (ice-9 binary-ports) put-u8))
+
 (define* (write-frame frame #:optional (port (current-output-port)))
   ;; Packs an unsigned integer into a bytevector in network byte
   ;; order.