From: Christopher Allan Webber Date: Thu, 9 Feb 2017 20:44:05 +0000 (-0600) Subject: websocket: Preventing some eof-object related errors. X-Git-Tag: v0.4.2~4 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=675ac28d37189484753eff789b2c7e2540c5291b;p=8sync.git websocket: Preventing some eof-object related errors. * 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. --- diff --git a/8sync/systems/websocket/server.scm b/8sync/systems/websocket/server.scm index 0865d67..6283255 100644 --- a/8sync/systems/websocket/server.scm +++ b/8sync/systems/websocket/server.scm @@ -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.