gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 12/42: Revert "server: Only accept a single 'state' argu


From: gnunet
Subject: [gnunet-scheme] 12/42: Revert "server: Only accept a single 'state' argument."
Date: Sat, 10 Sep 2022 19:08:05 +0200

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

commit e9d8193b7b7a939db6d0edba22fbbc2352f27da1
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Thu Sep 8 22:07:57 2022 +0200

    Revert "server: Only accept a single 'state' argument."
    
    This reverts commit 3d0891210d892ea9471df4eb3f5ea225c0d01384.
    IS apparently useful after all.
---
 gnu/gnunet/server.scm | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/gnu/gnunet/server.scm b/gnu/gnunet/server.scm
index 61bc322..b0c0925 100644
--- a/gnu/gnunet/server.scm
+++ b/gnu/gnunet/server.scm
@@ -55,7 +55,7 @@
          (only (ice-9 match)
                match)
          (only (guile)
-               lambda*))
+               lambda* define*))
   (begin
     ;; Define them here to avoid creating these objects multiple times.
     (define thunk-false (lambda () #false))
@@ -227,9 +227,9 @@ TODO: maybe 'lost'"
 
     ;; TODO: document, check types
     ;; state: <loop>
-    (define (run-loop state)
-      (define handlers ((loop:message-handlers-maker state) state))
-      (define error-handler ((loop:error-handler*-maker state) state))
+    (define (run-loop state . rest)
+      (define handlers (apply (loop:message-handlers-maker state) state rest))
+      (define error-handler (apply (loop:error-handler*-maker state) state 
rest))
       (define message-queue
        (connect/fibers (loop:configuration state) (loop:service-name state)
                        handlers error-handler
@@ -242,13 +242,13 @@ TODO: maybe 'lost'"
          ;; time something was found?
          (collect-lost-and-found-operation (loop:lost-and-found state))
          (lambda (lost) (cons 'lost lost)))))
-      (define (control* message state)
+      (define (control* message state . rest)
        ;; Let @var{control-message-handler} handle the message.
        ;; It can decide to continue with @var{control} or @var{control*},
        ;; in continuation-passing style.
-       ((loop:control-message-handler state) message control control*
-        message-queue state))
-      (define (control state)
+       (apply (loop:control-message-handler state) message
+              control control* message-queue state rest))
+      (define (control state . rest)
        "The main event loop."
-       (control* (perform-operation loop-operation) state))
-      (control state))))
+       (apply control* (perform-operation loop-operation) state rest))
+      (apply control state rest))))

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]