From: Rutger van Beusekom Date: Fri, 22 Nov 2019 21:36:08 +0000 (+0100) Subject: Do not read a frame past EOF. X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=c3d4972e4596abbf307e91b260096d3782987624;p=8sync.git Do not read a frame past EOF. * 8sync/systems/websocket/frame.scm (read-frame): Handle EOF. --- diff --git a/8sync/systems/websocket/frame.scm b/8sync/systems/websocket/frame.scm index 7a71dba..831456a 100644 --- a/8sync/systems/websocket/frame.scm +++ b/8sync/systems/websocket/frame.scm @@ -1,5 +1,6 @@ ;;; guile-websocket --- WebSocket client/server ;;; Copyright © 2015 David Thompson +;;; Copyright © 2019 Rutger van Beusekom ;;; ;;; This file is part of guile-websocket. ;;; @@ -309,7 +310,8 @@ MASKING-KEY." (let ((bv (get-bytevector-n port length))) (when masking-key - (mask-bytevector! bv masking-key)) + (unless (eof-object? bv) + (mask-bytevector! bv masking-key))) bv)) (let* ((type-byte (get-u8 port))