gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet-scheme] 02/06: dht/client: Use /dht:path-element.


From: gnunet
Subject: [gnunet-scheme] 02/06: dht/client: Use /dht:path-element.
Date: Sat, 29 Jan 2022 20:59:34 +0100

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 44ccd8ccb82a689cc23006303d113470224c6da7
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Wed Jan 26 09:08:19 2022 +0000

    dht/client: Use /dht:path-element.
    
    * gnu/gnunet/dht/client.scm (well-formed?/path-length): Use
      /dht:path-element instead of /peer-identity.
      (reconnect)[process-client-result]: Likewise.
---
 gnu/gnunet/dht/client.scm | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/gnu/gnunet/dht/client.scm b/gnu/gnunet/dht/client.scm
index 928029f..d3d6f57 100644
--- a/gnu/gnunet/dht/client.scm
+++ b/gnu/gnunet/dht/client.scm
@@ -83,8 +83,6 @@
          (only (gnu gnunet mq error-reporting)
                report-error)
          (gnu gnunet dht struct)
-         (only (gnu gnunet crypto struct)
-               /peer-identity)
          (only (gnu gnunet message protocols)
                message-type)
          (only (gnu gnunet netstruct syntactic)
@@ -516,12 +514,12 @@ TODO actually call @var{confirmed}"
     (define-syntax-rule (well-formed?/path-length slice type (field ...) 
compare)
       "Verify the TYPE message in @var{slice}, which has @var{field ...} ...
 (e.g. one or more of get-path-length or put-path-length) and corresponding
-/peer-identities at the end of the message is well-formed -- i.e., check if 
the length
+/dht:path-element at the end of the message is well-formed -- i.e., check if 
the length
 of @var{slice} corresponds to the size of @var{type} and the get-path-length 
and
 put-path-length.
 
 @var{compare} must be @code{=} if no additional payload follows, or @code{>=}
-if an addiional payload may follow.  The message type and the size in the
+if an additional payload may follow.  The message type and the size in the
 message header is assumed to be correct."
       ;; Warning: slice is evaluated multiple times!
       (and (>= (slice-length slice) (sizeof type '()))
@@ -529,8 +527,7 @@ message header is assumed to be correct."
                  (extra-size (- (slice-length slice) (sizeof type '())))
                  (field (read% type '(field) header))
                  ...)
-            ;; TODO: C GNUnet uses /dht:path-element now ...
-            (compare extra-size (* (+ field ...) (sizeof /peer-identity 
'()))))))
+            (compare extra-size (* (+ field ...) (sizeof /dht:path-element 
'()))))))
 
     ;; TODO reduce duplication with (gnu gnunet nse client) --- maybe introduce
     ;; (gnu gnunet client) as in the C implementation?
@@ -579,12 +576,13 @@ structure) to the get request @var{handle}."
        (define get-path-length
          (read% /:msg:dht:client:result '(get-path-length) header))
        (define put-path
-         (slice-slice rest 0 (* (sizeof /peer-identity '()) put-path-length)))
+         (slice-slice rest 0 (* (sizeof /dht:path-element '())
+                                put-path-length)))
        (define get-path
-         (slice-slice rest (* (sizeof /peer-identity '()) put-path-length)
-                      (* (sizeof /peer-identity '()) get-path-length)))
+         (slice-slice rest (* (sizeof /dht:path-element '()) put-path-length)
+                      (* (sizeof /dht:path-element '()) get-path-length)))
        (define data
-         (slice-slice rest (* (sizeof /peer-identity '())
+         (slice-slice rest (* (sizeof /dht:path-element '())
                               (+ put-path-length get-path-length))))
        ;; TODO: maybe validate 'key' and 'type'
        ((get:iterator handle)

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