gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet-scheme] 01/06: server: Don't reuse lost-and-found operations.


From: gnunet
Subject: [gnunet-scheme] 01/06: server: Don't reuse lost-and-found operations.
Date: Wed, 26 Oct 2022 00:30:02 +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 99c10f89974f672f79ba349594e47cb8313cd2b5
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Tue Oct 25 21:54:16 2022 +0200

    server: Don't reuse lost-and-found operations.
    
    * gnu/gnunet/server.scm (run-loop): Make 'loop-operation' into a thunk
    making the loop operation.
    * NEWS: Document bugfix.
---
 NEWS                  | 6 ++++++
 gnu/gnunet/server.scm | 8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 80546a0..e8caee0 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,12 @@
      in the manual.  These tools have been used to reduce duplication between
      client code of different services, so tests targeting a single service
      automatically also test the other services a bit.
+** Bugfixes
+   - A potential (but unverified) bug with automatic collection is fixed --
+     previously, if DHT garbage was found multiple times within a single
+     reconnection, it might only be found once.  Due to the new unification
+     of service code, the same fix automatically applies to all other
+     services.
 ** Documentation
    - For 'make-disconnect!', only a single argument was mentioned in the
      manual, but there were actually two (non-optional!) arguments.  This
diff --git a/gnu/gnunet/server.scm b/gnu/gnunet/server.scm
index 85e28c5..9627e65 100644
--- a/gnu/gnunet/server.scm
+++ b/gnu/gnunet/server.scm
@@ -255,12 +255,12 @@ TODO: maybe 'lost'"
       (define message-queue
        (connect/fibers (loop:configuration state) (loop:service-name state)
                        handlers error-handler #:spawn (loop:spawner state)))
-      (define loop-operation
+      ;; As undocumented in (gnu gnunet lost-and-found), lost-and-found
+      ;; operations may not be reused (at least, not in all cases).
+      (define (make-loop-operation)
        (choice-operation
         (get-operation (loop:control-channel state))
         (wrap-operation
-         ;; TODO: wasn't it required to recreate this operation each
-         ;; time something was found?
          (collect-lost-and-found-operation (loop:lost-and-found state))
          (lambda (lost) (cons 'lost lost)))))
       (define (continue* message state . rest)
@@ -271,7 +271,7 @@ TODO: maybe 'lost'"
               message-queue state rest))
       (define (continue state . rest)
        "The main event loop."
-       (apply continue* (perform-operation loop-operation) state rest))
+       (apply continue* (perform-operation (make-loop-operation)) state rest))
       (apply continue state rest))
 
     (define* (spawn-server-loop server #:key (make-loop make-loop)

-- 
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]