Ruediger Klaehn
659d2d2225
ref: use our own bao crate
...
Requires just a tiny code change since bao takes a reference of a hash
instead of the value.
2023-02-15 10:44:31 +02:00
Floris Bruynooghe
f3086a9576
ref: Allow older rust version ( #142 )
...
This matches the rust-version from deltachat and everything still
seems to work. Not sure why we have the more recent version.
2023-02-14 15:48:43 +01:00
Floris Bruynooghe
d09a78636b
feat: Add generic progress emitter utility ( #141 )
...
This adds a generic utility which can be used to track progress of
data transfers by emitting progress via a tokio broadcast channel.
This is extracted from the deltachat PR:
https://github.com/deltachat/deltachat-core-rust/pull/4007
2023-02-14 13:17:21 +01:00
Kasey
c266ab5d9d
fix: fail if an on_blob function does not read all the content ( #139 )
...
closes #127
2023-02-13 13:32:36 -05:00
Asmir Avdicevic
fc8fbeb65c
fix(ci): run clippy directly ( #140 )
2023-02-13 19:30:36 +01:00
Floris Bruynooghe
5bd545d8eb
feat: Do not error when the provider closes the connection ( #124 )
...
This makes it so that the provider is allowed to close the connection
after a transfer is completed, without the getter resulting in an
error.
It modifies the provider to only emit the transfer completed once the
data has actually reached the client.
2023-02-13 16:34:49 +01:00
Floris Bruynooghe
8e42874a23
deps: Remove duplicate tokio dependency ( #137 )
...
The tokio feature of tracing-futures seems crazy outdated and not
needed. Enabling it pulls in an ancient version of tokio for no
reason whatsoever. Get rid of it.
2023-02-13 14:12:42 +01:00
Floris Bruynooghe
eac7b65a67
ref: on_collection doesn't need to be FnMut ( #136 )
...
It is only called once, adding FnMut is a needless restriction.
Closes #133
2023-02-13 14:11:55 +01:00
Kasey
b3ee39f92f
fix: display CIDs in the CLI for the Collection ( #131 )
...
closes #130
2023-02-10 02:30:40 -05:00
Kasey
82e2f5649b
fix: catch ctrl-c to allow a normal shutdown & clean up any tempfiles that are created ( #122 )
...
closes #102
2023-02-08 12:12:02 -05:00
Rüdiger Klaehn
145ec43eb1
Merge pull request #126 from n0-computer/collection-by-ref
...
refactor: make on_collection take a reference
2023-02-08 16:53:10 +02:00
Ruediger Klaehn
34aa8e1514
refactor: make on_collection take a reference
...
This way we avoid a clone
2023-02-08 16:31:25 +02:00
Rüdiger Klaehn
1a127fac65
Merge pull request #123 from n0-computer/cid
...
Add newtype wrapper for Hash that is compatible with Cid
2023-02-07 16:40:38 +02:00
Ruediger Klaehn
2e3d5777ea
Merge branch 'main' into cid
2023-02-07 16:00:42 +02:00
Ruediger Klaehn
f780d253c8
pr review: some renaming
2023-02-07 15:44:58 +02:00
Ruediger Klaehn
838fa5cb7e
docs: add docs for the 4 prefix bytes
2023-02-07 15:17:01 +02:00
Ruediger Klaehn
7158bc047c
refactor: move Blake3Cid to main for now
2023-02-07 14:58:40 +02:00
Floris Bruynooghe
13f703f0ef
feat: Allow shutdown of Provider ( #121 )
...
This adds Provider::shutdown allowing to stop the Provider without
having to abort it. On the wire however it still does not do anything
graceful: all the connections are stopped and any in-transit data is
lost.
Additionally this adds tracing spans to the connection handling.
Finally it fixes a bug where read_lp would not return None if the
connection was closed normally.
Part of #77 but this is not very graceful on the wire yet.
2023-02-07 12:56:35 +01:00
Ruediger Klaehn
9db0937cb6
feat: add newtype wrapper for Hash that is compatible with Cid
2023-02-07 13:08:28 +02:00
Friedel Ziegelmayer
3eff210755
feat: switch from s2n-quic to quinn ( #112 )
...
Tests are failing because of port reuse issues and shutdown, should be
fixed with the other PRs merged
Needed to allow work on hole punching in the short term.
Ref #111
See
- https://github.com/aws/s2n-quic/issues/1607
- https://github.com/aws/s2n-quic/issues/1608
2023-02-06 17:36:50 +01:00
Floris Bruynooghe
9a22de7e1f
Make Provider a Future, remove Provider::join ( #120 )
...
This removes the consuming Provider::join method and makes Provider impl
a
Future directly. This mirrors how a JoinHandle for a tokio task
behaves, which is what this also kind off is.
Primarily this allowes for the await-completion operation to be
cancelable and re-entrant. This is needed to be able to await
completion of the task in a loop, repeatedly calling tokio::select!
with it.
2023-02-06 17:29:07 +01:00
Rüdiger Klaehn
321ed44b21
Merge pull request #116 from n0-computer/reduce-surface-area
...
Reduce surface area
2023-02-06 17:07:01 +02:00
Ruediger Klaehn
c08fe11c4e
pr review: add better module docs etc.
2023-02-06 15:47:40 +02:00
Ruediger Klaehn
8255467c9a
docs: add lots of doc comments and enable deny(missing_docs)
2023-02-06 13:50:36 +02:00
Ruediger Klaehn
5994474c4d
refactor: more privatization
2023-02-06 13:32:37 +02:00
Ruediger Klaehn
d63fea1279
refactor: make a few obvious things private
2023-02-06 13:26:00 +02:00
Floris Bruynooghe
eb48132c9c
ref: pub api tweaks ( #114 )
...
A number of tweaks to the public API that I'm using in the deltachat
PR.
2023-02-06 11:00:56 +01:00
Friedel Ziegelmayer
c1eaf28fcc
feat: introduce custom Hash type ( #115 )
...
- avoids relying on blake3::Hash as a type in the public api
- ensures consistent encoding and decoding
- fixes bug where hex decoding was expected in the UI
2023-02-03 22:34:25 +01:00
Rüdiger Klaehn
694d117315
Merge pull request #113 from n0-computer/async-slice-decoder-newtype
...
refactor: make AsyncSliceDecoder pub(crate)
2023-02-03 19:58:31 +02:00
Ruediger Klaehn
be482945c3
pr review: rename BaoDecoder to DataStream and add doc comment
2023-02-03 19:47:33 +02:00
Kasey
8c254f3ea5
use default-features = false when importing sendme as a library ( #110 )
...
closes #74
Isolate `cli` specific crates behind the `cli` feature.
2023-02-03 11:03:17 -05:00
Ruediger Klaehn
6bc00b3558
refactor: make AsyncSliceDecoder pub(crate)
...
The public interface is now BaoDecoder. A benefit of this is that we
- hide the exact way we decode bao (bao crate or our own thing)
- hide the s2n_quic::stream::ReceiveStream
2023-02-03 15:11:29 +02:00
Friedel Ziegelmayer
909571810d
Merge pull request #106 from n0-computer/feat-base64
...
feat: switch printing from hex to base64
2023-02-03 12:28:02 +01:00
Friedel Ziegelmayer
1abd7ecbff
test: use random free port to avoid collisions ( #104 )
...
Closes #49
2023-02-03 12:01:38 +01:00
dignifiedquire
e2cd922fd8
chore: update MSRV to 1.64
...
latest clap requires this
2023-02-03 10:11:08 +01:00
dignifiedquire
1cf338d41a
chore: remove unused dependency
2023-02-03 10:01:39 +01:00
dignifiedquire
891004d805
feat: switch printing from hex to base64
...
Closes #91
2023-02-03 10:01:39 +01:00
Friedel Ziegelmayer
01c711a0f4
Merge pull request #109 from n0-computer/ramfox/update_deps
...
update deps to fix console bug
2023-02-03 09:52:54 +01:00
Rüdiger Klaehn
475e4578a4
Merge pull request #108 from n0-computer/enforce-overall-size
...
feature: ensure we are not being lied to about total_blobs_size
2023-02-03 08:42:20 +02:00
Kasey
48df01c933
comply w/ MSRV
2023-02-03 01:27:56 -05:00
Kasey
2bd329d805
comply with minimally supported rust version
2023-02-03 01:18:06 -05:00
Kasey
84d3a77323
update deps to fix console bug
2023-02-03 00:40:57 -05:00
Ruediger Klaehn
6d66fc5865
feature: ensure we are not being lied to about total_blobs_size
...
If e.g. somebody sets total_blobs_size to 1000 but then sends us a huge
collection, before it would download it all. Now it will fail as soon as
total_blobs_size is exceeded.
2023-02-02 20:02:10 +02:00
Rüdiger Klaehn
6658d8836a
Merge pull request #99 from n0-computer/provide-sizes
...
Enforce size limit when transferring blobs
2023-02-02 19:56:27 +02:00
Friedel Ziegelmayer
3a15ebaf52
Merge pull request #103 from n0-computer/happy-arqu
...
fix(main): remove stderr tty check
2023-02-02 18:35:15 +01:00
Kasey
9b2ad046e9
feat: pass in custom names for blobs using DataSource::NamedFile ( #97 )
2023-02-02 12:25:47 -05:00
dignifiedquire
588dbe778b
fix(main): remove stderr tty check
2023-02-02 14:54:15 +01:00
Rüdiger Klaehn
6dace45e52
Merge pull request #101 from n0-computer/enforce-debug-instances
...
Enforce debug instances
2023-02-02 12:17:59 +02:00
Asmir Avdicevic
43a6ed505f
fix: ensure CI runs on main ( #100 )
2023-02-02 11:09:41 +01:00
Ruediger Klaehn
b0cdec109d
refactor: add debug instances for public types
...
also change build to produce warnings if there are no debug instances on
public types.
2023-02-02 12:06:40 +02:00