gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet-scheme] 270/324: nse/client: Report errors and reconnect.


From: gnunet
Subject: [gnunet-scheme] 270/324: nse/client: Report errors and reconnect.
Date: Tue, 21 Sep 2021 13:25:10 +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 434073b38ae12b83d15016ffc6245a8e5e446b6a
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Sun Sep 12 15:48:42 2021 +0200

    nse/client: Report errors and reconnect.
    
    * gnu/gnunet/nse/client.scm
      (reconnect)[error-handler]{else}: New branch, reporting
      the error and closing the queue.
---
 gnu/gnunet/nse/client.scm | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/gnu/gnunet/nse/client.scm b/gnu/gnunet/nse/client.scm
index 1339b33..fa7d4e2 100644
--- a/gnu/gnunet/nse/client.scm
+++ b/gnu/gnunet/nse/client.scm
@@ -66,6 +66,8 @@
                send-message! close-queue!)
           (only (gnu gnunet mq-impl stream)
                connect/fibers)
+         (only (gnu gnunet mq error-reporting)
+               report-error)
           (gnu gnunet message protocols)
           (only (gnu gnunet nse struct)
                /:msg:nse:estimate))
@@ -152,9 +154,8 @@ even if not connected.  This is an idempotent operation."
        (send-message! mq s))
       (define mq-defined (make-condition))
       (define mq-closed (make-condition))
-      (define (error-handler error)
+      (define (error-handler error . arguments)
        (case error
-         ;; TODO report input errors?
          ((connection:connected)
           ;; Make sure the message queue is actually bound to the variable
           ;; @var{mq} before calling @code{send-start!}, as @code{send-start!}
@@ -169,7 +170,14 @@ even if not connected.  This is an idempotent operation."
           ;; be confusing.
           (signal-condition! mq-closed)
           (when disconnected (disconnected))
-          (apply reconnect estimate/box request-close-condition config rest))))
+          (apply reconnect estimate/box request-close-condition config rest))
+         ((connection:interrupted)
+          (values))
+         (else
+          ;; Weirdness.  Not much that can be done except report it and
+          ;; try to reconnect.  XXX untested code path, sleep a little?
+          (apply report-error error arguments)
+          (close-queue! mq))))
       ;; Only started after 'mq' is defined, so no need to wait for
       ;; 'mq-defined'.
       (define (request-close-handler)

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