websocket: Preventing some eof-object related errors.
[8sync.git] / 8sync / systems / websocket / server.scm
index 0865d675d41b6421ab92fe56b31b09ec4411cf83..6283255ede52bcc5bfc48277e134878a538665fc 100644 (file)
@@ -134,7 +134,9 @@ called for each complete message that is received."
       (let ((frame (read-frame-maybe)))
         (cond
          ;; EOF - port is closed.
-         ((not frame)
+         ;; @@: Sometimes the eof object appears here as opposed to
+         ;;   at lookahead, but I'm not sure why
+         ((or (not frame) (eof-object? frame))
           (close-down))
          ;; Per section 5.4, control frames may appear interspersed
          ;; along with a fragmented message.