gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet-scheme] 190/324: Correct XXX and TODO on input:regular-end-of-fi


From: gnunet
Subject: [gnunet-scheme] 190/324: Correct XXX and TODO on input:regular-end-of-file.
Date: Tue, 21 Sep 2021 13:23:50 +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 1556d4548951574f364eb48bbc5a0855a412c144
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Fri Aug 20 16:39:55 2021 +0200

    Correct XXX and TODO on input:regular-end-of-file.
    
    At least for sockets and pipes (TTYs might be different),
    end of files only happen at the end of file, and at most once.
    
    * tests/mq-stream.scm
      (connect/test)[error-handler]: Don't handle
      input:regular-end-of-file.
    * gnu/gnunet/nse/client.scm
      (connect)[error-handler]: Remove TODO on connection:lost,
      add some TODO to input:regular-end-of-file.
    * gnu/gnunet/mq-impl/stream.scm
      (write-envelope!): Add TODO about closed output ports.
      (connect/fibers): Add documentation on closed ports, add TODO
      about closed ports.
    * README.org (List of errors): Remove TODO about connection:lost.
      Add documentation about input:regular-end-of-file.
---
 README.org                    | 4 ++--
 gnu/gnunet/mq-impl/stream.scm | 8 +++++++-
 gnu/gnunet/nse/client.scm     | 6 ++----
 tests/mq-stream.scm           | 3 ---
 4 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/README.org b/README.org
index 3abde4c..a5b4c98 100644
--- a/README.org
+++ b/README.org
@@ -114,7 +114,8 @@
    + input:regular-end-of-file
 
      The end-of-file was encountered and not unexpected
-     (compare with input:premature-eof).
+     (compare with input:premature-eof).  This means the server
+     has closed the connection on the server side.
    + input:premature-end-of-file
 
      The end-of-file was encountered, but unexpected.
@@ -130,7 +131,6 @@
      The message queue has been connected,
      so sent messages shouldn't simply be buffered.
      Injected by (gnu gnunet mq-impl stream).
-   + TODO connection:lost
 
    Input errors (decoding)
    + TODO verification failed, unknown message type
diff --git a/gnu/gnunet/mq-impl/stream.scm b/gnu/gnunet/mq-impl/stream.scm
index 0686df7..48ad549 100644
--- a/gnu/gnunet/mq-impl/stream.scm
+++ b/gnu/gnunet/mq-impl/stream.scm
@@ -85,6 +85,8 @@ parameterise the current write waiter and install exception 
handlers."
        envelope
        ((go message priority)
        (assert (slice-readable? message))
+       ;; TODO: how does the port API react to OUTPUT being closed
+       ;; by the remote peer?
        (put-bytevector output (slice-bv message)
                        (slice-offset message) (slice-length message))
        (values))
@@ -253,7 +255,11 @@ until they can be sent.  Some fibers may be created with 
@var{spawn}
 (@code{spawn-fiber} by default).
 
 When the connection has been established, the error @code{connection:connected}
-(a symbol) is injected into the message queue."
+(a symbol) is injected into the message queue.  When the connection has been
+closed by the server (e.g. because the server was stopped or is restarting)
+the error @code{input:regular-end-of-file} is injected into the message queue."
+      ;; TODO ^^^^ stop the fibers when the server closed the connection.
+
       ;; TODO closing message queues
       (define socket/box (make-atomic-box #f))
       (define rcvar (make-repeated-condition))
diff --git a/gnu/gnunet/nse/client.scm b/gnu/gnunet/nse/client.scm
index 94965f4..44d9c43 100644
--- a/gnu/gnunet/nse/client.scm
+++ b/gnu/gnunet/nse/client.scm
@@ -158,10 +158,8 @@ and @var{connected} are optional."
          ((connection:connected)
           (send-start!)
           (when connected (connected)))
-         ;; TODO not yet available ...
-         ;; (connection:lost
-         ;; (when disconnected (disconnected))
-         ;; ;; TODO reconnect!)
+         ;; TODO this means the server has closed the connection ...
+         ;; ---> reconnect?
          ((input:regular-end-of-file)
           (values))))
       (define mq (connect/fibers config "nse" handlers error-handler
diff --git a/tests/mq-stream.scm b/tests/mq-stream.scm
index ec3db00..9d8e56e 100644
--- a/tests/mq-stream.scm
+++ b/tests/mq-stream.scm
@@ -265,9 +265,6 @@
 (define (connect/test config connected?)
   (define (error-handler . error)
     (match error
-      ;; XXX correct documentation: multiple end-of-files
-      ;; are perfectly possible.
-      (('input:regular-end-of-file) (values))
       (('connection:connected) (signal-condition! connected?))))
   (connect/fibers config "service" no-handlers error-handler
                  #:spawn call-with-new-thread))

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