websocket: Preventing some eof-object related errors.
authorChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 9 Feb 2017 20:44:05 +0000 (14:44 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Thu, 9 Feb 2017 20:44:05 +0000 (14:44 -0600)
* 8sync/systems/websocket/server.scm (websocket-client-loop):
Prevent some errors where eof-objects appear as the frame by
the time we hit the cond.

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.