From: Jan Nieuwenhuizen Date: Tue, 28 Jan 2020 13:08:29 +0000 (+0100) Subject: websocket: Oops, avoid looping. X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=5074289a33640bb3bd78a711d7ceb645d7ae0cfd;p=8sync.git websocket: Oops, avoid looping. * 8sync/systems/websocket/server.scm (websocket-client-loop): Oops, avoid looping. --- diff --git a/8sync/systems/websocket/server.scm b/8sync/systems/websocket/server.scm index af0fe1f..c29ce51 100644 --- a/8sync/systems/websocket/server.scm +++ b/8sync/systems/websocket/server.scm @@ -157,11 +157,12 @@ called for each complete message that is received." (loop fragments type)) ((first-fragment-frame? frame) ; begin accumulating fragments (loop (list frame) (frame-type frame))) - ((fragment-frame? frame) ; add a fragment - (loop (cons frame fragments) type)) ((final-fragment-frame? frame) ; concatenate all fragments - (handle-data-frame type (frame-concatenate (reverse fragments))) + (handle-data-frame type (frame-concatenate + (reverse (cons frame fragments)))) (loop '() #f)) + ((fragment-frame? frame) ; add a fragment + (loop (cons frame fragments) type)) ((data-frame? frame) ; unfragmented data frame (handle-data-frame (frame-type frame) (frame-data frame)) (loop '() #f)))))))