aboutsummaryrefslogtreecommitdiff
path: root/gnu/gnunet/nse
Commit message (Collapse)AuthorAge
* Update copyright notices.Maxime Devos2021-09-21
|
* nse/client: Stop reconnecting when a disconnect is requested.Maxime Devos2021-09-21
| | | | | | | | | | | * gnu/gnunet/nse/client.scm (<server>)[request-close?/box]: New field. (disconnect!): Set new box before signalling the condition. (reconnect)[error-handler]{input:regular-end-of-file,input:premature-end-of-file}: When the new box holds #t as value, don't reconnect. (connect): Adjust callers. * tests/network-size.scm ("close, connected --> all fibers stop, two callbacks called"): New test.
* nse/client: Remove default for 'spawn'.Maxime Devos2021-09-21
| | | | | | | | 'connect' always sets it, so it doesn't need to be set here as well. This also prevents accidentally calling 'spawn-fiber' to a degree. * gnu/gnunet/nse/client.scm (reconnect): Remove default for 'spawn'.
* nse/client: Remove rest arguments.Maxime Devos2021-09-21
| | | | | | | For better error handling * gnu/gnunet/nse/client.scm (connect): Remove 'rest'. Adjust call to 'reconnect'.
* nse/client: Use 'spawn' instead of hardcoding 'spawn-fiber'.Maxime Devos2021-09-21
| | | | | * gnu/gnunet/nse/client.scm (reconnect): Spawn 'request-close-handler' with 'spawn' instead of 'spawn-fiber'.
* nse/client: Report errors and reconnect.Maxime Devos2021-09-21
| | | | | | * gnu/gnunet/nse/client.scm (reconnect)[error-handler]{else}: New branch, reporting the error and closing the queue.
* nse/client: Verify positivity of estimate.Maxime Devos2021-09-21
| | | | | | | | * gnu/gnunet/nse/client.scm (estimate:logarithmic-number-peers,estimate:standard-deviation) (estimate:number-peers): Remove resolved XXX. (reconnect)[handlers]<msg:nse:estimate>{well-formed?}: Verify 'size-estimate' and 'std-deviation' fields.
* nse/client: Remove resolved TODO.Maxime Devos2021-09-21
| | | | | * gnu/gnunet/nse/client.scm (reconnect)[error-handler]: Remove TODO about reconnecting.
* nse/client: Correct type documentation of <server>.Maxime Devos2021-09-21
| | | | | * gnu/gnunet/nse/client.scm (<server>)[estimate/box]: Correct type in comment.
* nse/client: Allow disconnecting.Maxime Devos2021-09-21
| | | | | | | | | | | | | | | * gnu/gnunet/nse/client.scm (<server>)[request-close-condition]: New field (disconnect!): New procedure. (reconnect): Add 'request-close-condition' argument. (reconnect)[request-close-handler]: New procedure. (reconnect): Spawn 'request-close-handler'. (connect)[request-close-condition]: New variable. (connect): Use new variable. * tests/utils.scm: Export 'call-with-temporary-directory'. * tests/network-size.scm ("close, not connected --> all fibers stop, no callbacks called"): New test.
* doc: Document that (gnu gnunet nse client) reconnects.Maxime Devos2021-09-21
| | | | | * doc/scheme-gnunet.tm (Estimation of the size of the network): Document that the module will retry after a disconnect.
* nse/client: Prepare for auto-reconnecting.Maxime Devos2021-09-21
| | | | | | * gnu/gnunet/nse/client.scm (reconnect): Extract from ... (connect): ... here.
* nse/client: Only call 'send-start!' after 'mq' has been defined.Maxime Devos2021-09-21
| | | | | | | | | This addresses a theoretical race condition. * gnu/gnunet/nse/client.scm (connect)[mq-defined]: New variable. (connect)[error-handler]: Wait on new variable. (connect)[mq]: Signal new condition after 'mq' is defined.
* nse/client: Remove unused fields.Maxime Devos2021-09-21
| | | | | | | * gnu/gnunet/nse/client.scm (<server>): Remove 'mq', 'config', 'connected-callback', 'disconnected-callback' and 'estimate-update-callback'. (estimate): Adjust call to constructor appropriately.
* nse/client: Add a 'disconnected' callback.Maxime Devos2021-09-21
| | | | | | | | | | | | * gnu/gnunet/nse/client.scm (connect): Add 'disconnected' optional keyword argument. Document it. (connect)[error-handler]: In case of input:regular-end-of-file and input:premature-end-of-file, call 'disconnected'. (<server>)[disconnected]: New field. * tests/network-size.scm ("notify disconnected after end-of-file, after 'connected'"): New test.
* nse/client: Use 'message-handler' macro.Maxime Devos2021-09-21
| | | | | * gnu/gnunet/nse/client.scm (connect)[handlers]: Use the 'message-handler' macro instead of the corresponding procedure.
* Correct XXX and TODO on input:regular-end-of-file.Maxime Devos2021-09-21
| | | | | | | | | | | | | | | | | | 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.
* nse/client: Document the optionality of callbacks.Maxime Devos2021-09-21
| | | | | * gnu/gnunet/nse/client.scm (connect): Document 'updated' and 'connected' are optional.
* nse: Allow 'updated' to be absent.Maxime Devos2021-09-21
| | | | | | | | | | | Fixes: https://notabug.org/maximed/scheme-gnunet/issues/4 * gnu/gnunet/nse/client.scm (connect)[handle-estimate]: Only call 'updated' if it isn't false. * tests/network-size.scm (act-as-the-server, estimate->list): Extract from "Client calls call-back (and sets estimates) in-order". ("likewise, without 'updated' or 'connected' (issue 4)"): Test it.
* nse/struct: Document 'timestamp' field of estimates.Maxime Devos2021-09-21
| | | | | * gnu/gnunet/nse/struct.scm (/:msg:nse:estimate)[timestamp]: Add a synopsis.
* nse/client: Implement connecting to the NSE service.Maxime Devos2021-09-21
| | | | | | | | | | | | | * Makefile.am (modules): Add new module. (SCM_TESTS): Add new tests. * README.org (GNUnet network structures): Move entry about 'nse/struct.scm' ... (Network size estimation): ... to here. (Network size estimation): New section. Note existence of new module. * gnu/gnunet/nse/client.scm: New module * tests/network-size.scm: Test it.
* nse/struct: Add missing imports.Maxime Devos2021-09-21
| | | | | | * gnu/gnunet/nse/struct.scm: Import '/time-absolute', '/ecc-signature-purpose' and 'ieee-double/big' from appropriate modules.
* Implement self-documenting ‘network structures’Maxime Devos2021-09-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | In contrast to scheme-bytestructures and (gnu gnunet utils netstruct), this allows associating a synopsis, a documention string (docstring) and arbitrary properties with structures and fields. Code compilation should be faster now as well and the compiled '.go' should be smaller due to less excessive use of syntax-rules. TODO: update old modules * Makefile.am (modules): compile new modules gnu/gnunet/netstruct/procedural.scm and gnu/gnunet/netstruct/syntactic.scm. * README.org (Network Structures): document new modules. * gnu/gnunet/crypto/struct.scm: use new module. * gnu/gnunet/hashcode/struct.scm: likewise. * gnu/gnunet/nse/struct.scm: likewise. * gnu/gnunet/util/struct.scm: likewise. * gnu/gnunet/netstruct/procedural.scm: new module for defining and using network structures procedurally. * gnu/gnunet/netstruct/syntactic.scm: likewise, but syntactically and with some inlining.
* nse: define network structures.Maxime Devos2021-09-21
* gnu/gnunet/nse/struct.scm: new module, defining some NSE network structures. * Makefile.am (modules): compile it.