gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet-scheme] branch master updated (446af15 -> 6a51f3a)


From: gnunet
Subject: [gnunet-scheme] branch master updated (446af15 -> 6a51f3a)
Date: Wed, 26 Oct 2022 00:30:01 +0200

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

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

    from 446af15  fs: Clarify the requesting / responding of a LOC signature.
     new 99c10f8  server: Don't reuse lost-and-found operations.
     new 91648c8  Unskip DHT test.
     new 4b7adae  fs/struct: Define new message type /:msg:fs:response-loc-sign.
     new ba1d72b  fs/struct: Adjust message type names.
     new 4eba71d  fs/struct: Define new message type /:msg:fs:index-start!.
     new 6a51f3a  fs/struct: Define new message type /:msg:fs:index-list:entry.

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 NEWS                             |  6 +++
 gnu/gnunet/fs/struct.scm         | 86 ++++++++++++++++++++++++++++++++++++++--
 gnu/gnunet/server.scm            |  8 ++--
 tests/distributed-hash-table.scm |  4 +-
 4 files changed, 93 insertions(+), 11 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/fs/struct.scm b/gnu/gnunet/fs/struct.scm
index 788383f..ae03a79 100644
--- a/gnu/gnunet/fs/struct.scm
+++ b/gnu/gnunet/fs/struct.scm
@@ -1,5 +1,5 @@
 ;; This file is part of Scheme-GNUnet.
-;; Copyright © 2003--2012 GNUnet e.V.
+;; Copyright © 2003--2012, 2022 GNUnet e.V.
 ;;
 ;; Scheme-GNUnet is free software: you can redistribute it and/or modify it
 ;; under the terms of the GNU Affero General Public License as published
@@ -21,8 +21,13 @@
 ;; Author: Igor Wronsky, Christian Grothoff
 ;; Ported to Scheme-GNUnet by: Maxime Devos
 (define-library (gnu gnunet fs struct)
-  (export /:msg:fs:loc-sign)
+  (export /:msg:fs:request-loc-signature
+         /:msg:fs:response-loc-signature
+         /:msg:fs:index-start!
+         /:msg:fs:index-list:entry)
   (import (only (rnrs base) define begin * quote)
+         (only (gnu gnunet crypto struct)
+               /peer-identity)
          (only (gnu gnunet hashcode struct)
                /hashcode:512)
          (only (gnu gnunet util struct)
@@ -42,7 +47,7 @@
        (field (query /hashcode:512)
              (synopsis "Hash of the encrypted content, used for querying"))))
 
-    (define-type /:msg:fs:request-loc-sign
+    (define-type /:msg:fs:request-loc-signature
       (structure/packed
        (synopsis "Message sent by a FS client to request a LOC signature.")
        (properties '((message-symbol msg:fs:request-loc-signature)
@@ -56,4 +61,77 @@
        (field (content-hash-key /content-hash-key)
              (synopsis "Information about the shared file (to be signed"))
        (field (file-length u64/big)
-             (synopsis "Size of the shared file (to be signed)"))))))
+             (synopsis "Size of the shared file (to be signed)"))))
+
+    (define-type /:msg:fs:response-loc-signature
+      (structure/packed
+       (synopsis "Message sent by the service to the client with a LOC 
signature.")
+       (properties '((message-symbol msg:fs:response-loc-signature)
+                    (c-type . ResponseLocSignatureMessage)))
+       (field (header /:message-header))
+       (field (purpose u32/big)
+             (synopsis "Requested signature purpose")
+             (documentation "For now, always 
GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT"))
+       (field (expiration-time /time-absolute)
+             (synopsis "Expiration time of this signature.")
+             (documentation "Expiration time that was actually used (rounded!).
+IIUC, not necessarily the time that was requested."))
+       (field (peer /peer-identity)
+             (synopsis "Identity of the peer sharing the file.")
+             (documentation "On a typical setup, this is the identity of the
+local peer on a typical setup, IIUC."))))
+
+    (define-type /:msg:fs:index-start!
+      (structure/packed
+       (synopsis "Message to request indexing of a file.")
+       (documentation "Message sent by a client to the service to request that
+a file (on the file system) is indexed.  The service is supposed to check that
+the specified file is available and has the same cryptographic hash as 
mentioned
+in the message.  It should then respond with either a confirmation or a denial.
+
+On operating systems where this works, it is considered acceptable if the
+service only checks that the path, device and inode match (it can then be
+assumed that the hash will also match without actually computing it; this
+is an optimisation that should be safe given that the client is not our
+advisary).
+
+This message is followed by the file name of a file with the hash \"file-id\"
+as seen by the client, then followed by an octet 0 (i.e., the file name is
+zero-terminated).")
+       (field (header /:message-header))
+       (field (reserved u32/big)
+             (synopsis "For alignment."))
+       (field (device u64/big)
+             (synopsis "ID of device containing the file")
+             ;; TODO: why write 64-bit and not 32-bit?
+             ;; Also, verify endianness against the implementations.
+             (documentation "ID of device containing the file, as seen by the
+client.  This device ID is obtained using a call like \"statvfs\" (and
+converting the \"f_fsid\" field to a 32-bit big-endian number).  Use 0 if
+the operating system does not support this, in which case the service must
+do a full hash recomputation."))
+       (field (inode u64/big) ; TODO: check endianness
+             (synopsis "Inode of the file, on the device.")
+             (documentation "Inode of the file on the given device, as seen
+by the client (\"st_ino\" field from \"struct stat\").  Use 0 if the operating
+system does not support this, in which case the service must do a full hash
+recomputation."))
+       (field (file-id /hashcode:512)
+             (synopsis "Hash of the file that we would like to index."))))
+
+    (define-type /:msg:fs:index-list:entry
+      (structure/packed
+       (synopsis "Entry in the list of all indexed files")
+       (properties '((message-symbol msg:fs:index-list:entry)
+                    (c-type . IndexInfoMessage)))
+       (documentation "Message sent by FS service in response to a request
+for all indexed files (i.e., a msg:fs:index-list:get).  Later, more of the
+same type of messages are sent or a msg:fs:index-list:end.
+
+This is folowed by a 0-terminated file name of a file with the hash
+@var{file-id} as seen by the client.")
+       (field (header /:message-header))
+       (field (reserved u32/big)
+             (synopsis "Always zero."))
+       (field (file-id /hashcode:512)
+             (synopsis "Hash of the indexed file."))))))
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)
diff --git a/tests/distributed-hash-table.scm b/tests/distributed-hash-table.scm
index 4c712fc..96d05ec 100644
--- a/tests/distributed-hash-table.scm
+++ b/tests/distributed-hash-table.scm
@@ -800,9 +800,7 @@ supported.  When @var{explode} is signalled, the connection 
is closed."
         (loop (+ n 1))))
      #true)))
 
-;; XXX hangs, maybe a bug in the DHT simulation?  Maybe best replace with a
-;; full DHT simulation.
-(test-skip 1)
+;; This test has hanged in the past, but that hang cannot be reproduced 
anymore.
 (test-assert "searches restarted after disconnect"
   (let ((stop-first-server (make-condition))
        (first-accepted (make-condition)))

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