[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.
- [gnunet-scheme] 218/324: mq-impl/stream: Name the reader and writer thunks., (continued)
- [gnunet-scheme] 218/324: mq-impl/stream: Name the reader and writer thunks., gnunet, 2021/09/21
- [gnunet-scheme] 208/324: tests/mq-stream: Don't assume setvbuf returns anything., gnunet, 2021/09/21
- [gnunet-scheme] 212/324: mq/handler: Define a macro for constructing handlers., gnunet, 2021/09/21
- [gnunet-scheme] 220/324: mq-impl/stream: Extract code to be shared with connect/fibers., gnunet, 2021/09/21
- [gnunet-scheme] 226/324: doc: Generate PDF and HTML documentation, gnunet, 2021/09/21
- [gnunet-scheme] 227/324: mq: Remove TODOs about hypothetical &malformed-message., gnunet, 2021/09/21
- [gnunet-scheme] 229/324: guix: Import missing module., gnunet, 2021/09/21
- [gnunet-scheme] 194/324: mq-impl/stream: Eliminate atomic box., gnunet, 2021/09/21
- [gnunet-scheme] 191/324: doc: Document message queue error handling., gnunet, 2021/09/21
- [gnunet-scheme] 216/324: mq: Inject errors if no appropriate message handler exists., gnunet, 2021/09/21
- [gnunet-scheme] 190/324: Correct XXX and TODO on input:regular-end-of-file.,
gnunet <=
- [gnunet-scheme] 196/324: mq-impl/stream: Stop all fibers when EOF is reached (part 1)., gnunet, 2021/09/21
- [gnunet-scheme] 201/324: tests/mq-stream: Make test more strict., gnunet, 2021/09/21
- [gnunet-scheme] 204/324: mq-impl/stream: Document implementation pitfall., gnunet, 2021/09/21
- [gnunet-scheme] 214/324: tests/mq: Use 'message-handler' macro., gnunet, 2021/09/21
- [gnunet-scheme] 217/324: tests/mq: Spam the log less., gnunet, 2021/09/21
- [gnunet-scheme] 233/324: doc: Document the message type database a little., gnunet, 2021/09/21
- [gnunet-scheme] 232/324: doc: Partially document handler procedures and interposers., gnunet, 2021/09/21
- [gnunet-scheme] 239/324: tests/network-size: Don't let the GC close port., gnunet, 2021/09/21
- [gnunet-scheme] 241/324: nse/client: Add a 'disconnected' callback., gnunet, 2021/09/21
- [gnunet-scheme] 195/324: mq-impl/stream: Reduce nesting., gnunet, 2021/09/21