From 5074289a33640bb3bd78a711d7ceb645d7ae0cfd Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 28 Jan 2020 14:08:29 +0100 Subject: [PATCH 1/4] websocket: Oops, avoid looping. * 8sync/systems/websocket/server.scm (websocket-client-loop): Oops, avoid looping. --- 8sync/systems/websocket/server.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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))))))) -- 2.31.1 From ee371103855e5bfe8aae3debe442a24c6353e172 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Thu, 18 Mar 2021 09:47:24 +0100 Subject: [PATCH 2/4] Support for guile-3.0.5: Move test-exit inside srfi-64 test. * tests/test-actors.scm, tests/test-agenda.scm, tests/test-rmeta-slot.scm (test-exit): Move inside test, where 'test-runner-current' is still set. --- tests/test-actors.scm | 3 ++- tests/test-agenda.scm | 5 ++--- tests/test-rmeta-slot.scm | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/test-actors.scm b/tests/test-actors.scm index 30f13d0..eb3a2de 100644 --- a/tests/test-actors.scm +++ b/tests/test-actors.scm @@ -1,5 +1,6 @@ ;;; 8sync --- Asynchronous programming for Guile ;;; Copyright (C) 2016 Christopher Allan Webber +;;; Copyright (C) 2021 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of 8sync. ;;; @@ -203,5 +204,5 @@ customer> Whaaaaat? I can't believe I got voice mail!\n" (test-equal (get-spoken) '("Hi! jack inits now.\n" "Hi! jill inits now.\n"))) -(test-end "test-actors") (test-exit) +(test-end "test-actors") diff --git a/tests/test-agenda.scm b/tests/test-agenda.scm index a26c6b7..d96b601 100644 --- a/tests/test-agenda.scm +++ b/tests/test-agenda.scm @@ -1,5 +1,6 @@ ;;; 8sync --- Asynchronous programming for Guile ;;; Copyright (C) 2015 Christopher Allan Webber +;;; Copyright (C) 2021 Jan (janneke) Nieuwenhuizen ;;; ;;; This library is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU Lesser General Public @@ -283,8 +284,6 @@ ;; End tests -(test-end "test-agenda") - ;; @@: A better way to handle this at the repl? (test-exit) - +(test-end "test-agenda") diff --git a/tests/test-rmeta-slot.scm b/tests/test-rmeta-slot.scm index 37dac50..7aaa248 100644 --- a/tests/test-rmeta-slot.scm +++ b/tests/test-rmeta-slot.scm @@ -1,5 +1,6 @@ ;;; 8sync --- Asynchronous programming for Guile ;;; Copyright (C) 2017 Christopher Allan Webber +;;; Copyright (C) 2021 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of 8sync. ;;; @@ -62,5 +63,5 @@ (class-rmeta-ref 'entries 'not-defined #:dflt "no-way")) -(test-end "test-rmeta-slot") (test-exit) +(test-end "test-rmeta-slot") -- 2.31.1 From 2bfbcbfed8b14e226f6c5ed6ec23e8f0fb21a440 Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Thu, 18 Mar 2021 14:20:02 +0100 Subject: [PATCH 3/4] websocket: server: Remove .upgrade-paths accessor. * 8sync/systems/websocket/server.scm (): Remove .upgrade-paths accessor. There's a method for doing this. --- 8sync/systems/websocket/server.scm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/8sync/systems/websocket/server.scm b/8sync/systems/websocket/server.scm index c29ce51..11704d4 100644 --- a/8sync/systems/websocket/server.scm +++ b/8sync/systems/websocket/server.scm @@ -1,7 +1,7 @@ ;;; guile-websocket --- WebSocket client/server ;;; Copyright © 2015 David Thompson ;;; Copyright © 2017 Christopher Allan Webber -;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020,2021 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of guile-websocket. ;;; @@ -71,8 +71,7 @@ string." ((ws-send websocket-server-send)) (upgrade-paths #:init-value `(("websocket" . ,(wrap-apply websocket-client-loop))) - #:allocation #:each-subclass - #:accessor .upgrade-paths) + #:allocation #:each-subclass) (gen-client-id #:init-thunk make-simple-counter) -- 2.31.1 From 183b4f02e68279d4984e79b79e06bfcf1861fcbf Mon Sep 17 00:00:00 2001 From: "Jan (janneke) Nieuwenhuizen" Date: Thu, 18 Mar 2021 14:21:28 +0100 Subject: [PATCH 4/4] guix: Use guile-3.0. * guix.scm (name)[native-inputs]: Remove guile. [inputs]: New field, add guile-3.0. --- guix.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix.scm b/guix.scm index ac790de..d139e64 100644 --- a/guix.scm +++ b/guix.scm @@ -64,9 +64,9 @@ (build-system gnu-build-system) (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake) - ("guile" ,guile-2.2) ("pkg-config" ,pkg-config) ("texinfo" ,texinfo))) + (inputs `(("guile" ,guile-3.0))) (arguments `(#:phases (modify-phases %standard-phases (add-before 'configure 'bootstrap -- 2.31.1