[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet-scheme] 23/42: dht/client: Re-indent.
From: |
gnunet |
Subject: |
[gnunet-scheme] 23/42: dht/client: Re-indent. |
Date: |
Sat, 10 Sep 2022 19:08:16 +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 4e6963a633af5e39d4456ee90b959219f4840646
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Fri Sep 9 17:25:33 2022 +0200
dht/client: Re-indent.
After the unification, there is less indentation, reducing the need to
split over multiple lines.
---
gnu/gnunet/dht/client.scm | 48 +++++++++++++++++++----------------------------
1 file changed, 19 insertions(+), 29 deletions(-)
diff --git a/gnu/gnunet/dht/client.scm b/gnu/gnunet/dht/client.scm
index d4c32eb..2d0bc4f 100644
--- a/gnu/gnunet/dht/client.scm
+++ b/gnu/gnunet/dht/client.scm
@@ -763,10 +763,8 @@ code automatically tries to reconnect, so @var{connected}
can be called after
unique id @var{unique-id}. If there is no such get operation, or the get
operation is cancelled, return @code{#false} instead."
;; TODO: is the 'terminal-condition' case needed?
- (maybe-ask* (loop:terminal-condition loop)
- (loop:control-channel loop)
- 'request-search-result-iterator
- unique-id))
+ (maybe-ask* (loop:terminal-condition loop) (loop:control-channel loop)
+ 'request-search-result-iterator unique-id))
(message-handlers
(message-handler
(type (symbol-value message-type msg:dht:monitor:get))
@@ -849,8 +847,7 @@ operation is cancelled, return @code{#false} instead."
;; Register the new get operation, such that we remember
;; where to send responses to.
(let ((id->operation-map
- (bbtree-set id->operation-map
- (get:unique-id get)
+ (bbtree-set id->operation-map (get:unique-id get)
((if (get:linger? get)
make-strong-reference
make-weak-reference) get))))
@@ -860,9 +857,8 @@ operation is cancelled, return @code{#false} instead."
(control loop old-id->operation-map id->operation-map)))
(('stop-search! get)
(let^ ((<-- (old-id->operation-map id->operation-map)
- (process-stop-search
- old-id->operation-map id->operation-map
- message-queue get)))
+ (process-stop-search old-id->operation-map
+ id->operation-map message-queue get)))
(control loop old-id->operation-map id->operation-map)))
(('put! put)
;; Send the put operation to the DHT service.
@@ -871,32 +867,26 @@ operation is cancelled, return @code{#false} instead."
;; Send by @code{request-search-result-iterator}.
(('request-search-result-iterator answer-box unique-id)
(answer answer-box
- (and=> (bbtree-ref id->operation-map unique-id)
- dereference))
+ (and=> (bbtree-ref id->operation-map unique-id) dereference))
(continue/no-change))
(('resend-old-operations!)
;; Restart old operations. Only get operations need to be submitted
;; again.
;;
;; TODO: restarting monitoring operations
- (let ((id->operation-map
- (bbtree-fold
- (lambda (id reference id->operation-map)
- (let^ ((! get (dereference reference))
- ;; If the (weak) reference is broken, that means
- ;; the operation is unreachable, so then there is
- ;; no point to resending the get operation.
- (? (not get)
- id->operation-map)
- (! id->operation-map
- (bbtree-set id->operation-map id reference)))
- (send-get! message-queue get)
- id->operation-map))
- id->operation-map
- old-id->operation-map))
- ;; Free some memory.
- (old-id->operation-map empty-bbtree))
- (control loop old-id->operation-map id->operation-map)))
+ (control loop empty-bbtree
+ (bbtree-fold
+ (lambda (id reference id->operation-map)
+ (let^ ((! get (dereference reference))
+ ;; If the (weak) reference is broken, that means
+ ;; the operation is unreachable, so then there is
+ ;; no point to resending the get operation.
+ (? (not get) id->operation-map)
+ (! id->operation-map
+ (bbtree-set id->operation-map id reference)))
+ (send-get! message-queue get)
+ id->operation-map))
+ id->operation-map old-id->operation-map)))
;; Some handles became unreachable and can be cancelled.
(('lost . lost)
(let next ((lost lost) (old-id->operation-map old-id->operation-map)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet-scheme] 31/42: doc/service-communication: Document spawn-server-loop., (continued)
- [gnunet-scheme] 31/42: doc/service-communication: Document spawn-server-loop., gnunet, 2022/09/10
- [gnunet-scheme] 11/42: dht: Use <loop> for state where possible., gnunet, 2022/09/10
- [gnunet-scheme] 13/42: dht/client: Rewrite in terms of (gnu gnunet server)., gnunet, 2022/09/10
- [gnunet-scheme] 12/42: Revert "server: Only accept a single 'state' argument.", gnunet, 2022/09/10
- [gnunet-scheme] 16/42: cadet/client: Avoid (mutating) hash tables., gnunet, 2022/09/10
- [gnunet-scheme] 05/42: dht/client: Bring API of reconnect mostly in line with (gnu gnunet server)., gnunet, 2022/09/10
- [gnunet-scheme] 28/42: server: Inline primitive-disconnect!., gnunet, 2022/09/10
- [gnunet-scheme] 15/42: server: New procedure for making the arguments to make-loop., gnunet, 2022/09/10
- [gnunet-scheme] 17/42: cadet/client: Use <loop> for various objects where possible., gnunet, 2022/09/10
- [gnunet-scheme] 27/42: cadet/client: Simplify more., gnunet, 2022/09/10
- [gnunet-scheme] 23/42: dht/client: Re-indent.,
gnunet <=
- [gnunet-scheme] 22/42: nse/indent: Re-indent., gnunet, 2022/09/10
- [gnunet-scheme] 26/42: server: Inline single-use server->loop-arguments., gnunet, 2022/09/10
- [gnunet-scheme] 24/42: cadet/client: Re-indent., gnunet, 2022/09/10
- [gnunet-scheme] 33/42: server: Document 'make-loop'., gnunet, 2022/09/10
- [gnunet-scheme] 30/42: doc/service-communication: Document the control loop., gnunet, 2022/09/10
- [gnunet-scheme] 18/42: cadet/client: Rewrite with run-loop., gnunet, 2022/09/10
- [gnunet-scheme] 32/42: server: Add type checking to make-loop., gnunet, 2022/09/10
- [gnunet-scheme] 36/42: doc/concurrency: Add missing label for lost-and-found., gnunet, 2022/09/10
- [gnunet-scheme] 39/42: server: Add type checking., gnunet, 2022/09/10
- [gnunet-scheme] 35/42: doc/service-communication: Document #:control-message-handler., gnunet, 2022/09/10