Commit graph

549 commits

Author SHA1 Message Date
Raito Bezarius
f05124d6db feat(ircv3): add simple internal batch processing
Some checks failed
CI / rustfmt (pull_request) Failing after 23s
CI / test (pull_request) Failing after 1m0s
The BATCH feature is a form of a server-suggested message processing
delays.

To implement this, we can record all inflight batches, handle start/end
in handle_batch and collect all pending messages in the entrypoint of
the message handler as long as they have a correct batch id.

Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-10-14 11:19:43 +02:00
Aaron Weiss
8013504bbf
fix links in documentation. 2024-03-18 16:21:31 -07:00
Aaron Weiss
ab0d1dda5e
make channel-lists feature additive (fixes #257) 2024-03-18 16:16:46 -07:00
Aaron Weiss
ecf411cbc8
bring dangerously_accept_invalid_certs in line with the other config options 2024-03-18 16:09:03 -07:00
Aaron Weiss
f640e49571
fix mistake in Config::load and Config::save docs (fixes #256) 2024-03-18 16:06:39 -07:00
aaron
b5a017a58b
Merge pull request #253 from ljrk0/verbose_tls_error
Provide encapsulated Tls error information
2024-03-18 15:57:51 -07:00
Janis König
5b09238788 CertFP: The file must be a PKCS #12 archive
While this archive is indeed DER-formatted, in contrast to `cert_path`,
a regular DER file created from some certificate/key PEM file won't work:

```
openssl x509 -outform der -in foo.pem -out foo.der
```

This will result in the following OpenSSL error through tls-native error:

```
error:068000A8:asn1 encoding routines:asn1_check_tlen:wrong tag:crypto/asn1/tasn_dec.c:1188:
error:0688010A:asn1 encoding routines:asn1_d2i_ex_primitive:nested asn1
error:crypto/asn1/tasn_dec.c:752:
error:0688010A:asn1 encoding routines:asn1_template_noexp_d2i:nested asn1
error:crypto/asn1/tasn_dec.c:685:Field=version, Type=PKCS12
```

Instead, a PKCS #12 archive must be created like so:

```
openssl pkcs12 -export -out foo.p12 -inkey fookey.pem -in foocert.pem
```

If the PEM file contains both the private key and the certificate,
the same file can be passed to `openssl` twice.

Also compare the documentation for `from_pkcs12` to `from_der` in
native-tls, as used in the `new_secured_transport` function:

https://docs.rs/native-tls/0.2.11/native_tls/struct.Identity.html#method.from_pkcs12
2023-07-11 16:39:02 +02:00
Janis König
5658fe514f Provide encapsulated Tls error information
When `.to_string()` is invoked on a the crate-wide Error enum,
the error message using #[error("...")] is displayed.
Some of those wrapped internal enums also contain, possibly more
helpful, error messages.  This will include the string gathered by
`.to_string()` from the encapsulated enum in the main error message.

See also
https://github.com/squidowl/halloy/pull/143
2023-07-11 15:19:27 +02:00
Hyeon Kim
82387576a0
client/mod.rs: Fix mistake 2023-06-04 01:26:54 +09:00
Hyeon Kim
a9b1ea3946
Run cargo fmt 2023-06-04 01:26:15 +09:00
Hyeon Kim
781cbab4a4
Fix all trivial clippy warnings using cargo clippy --fix 2023-06-04 01:26:15 +09:00
Hyeon Kim
a8d6df4e31
Remove redundant uses of format!() 2023-06-04 01:26:12 +09:00
John-John Tedro
3e396f8577 Bump dependencies, set rust-version 2023-04-12 17:50:47 +02:00
sean borg
1e2a03d327
remove reference to for_each_incoming 2022-08-12 19:59:33 +01:00
Daniel Lublin
bcc6479d22
New option: dangerously_accept_invalid_certs
This patch adds an option to dangerously ignore all ceritificate
verifications. This option must be used with extreme caution and should
only be used as a last resort.

Closes #209, #230

Co-authored-by: Hyeon Kim <simnalamburt@gmail.com>
2021-11-15 05:52:15 +09:00
Frederik B
8605fcb421 Fix docstring and README example for ping timeout default 2021-04-11 21:03:07 +02:00
Johann150
b9d07ed9fb
better error for missing certificate files
made config::path pub(crate) to avoid code duplication
but not pub so it is not part of the public API
2021-01-14 18:07:28 +01:00
Johann150
1733c22b86
add ConfigError variant for missing files
This should be used when the config contains a path but that file cannot be read.
2021-01-14 18:04:03 +01:00
John-John Tedro
def1442e5e Upgrade to Tokio 1.0 2020-12-29 09:59:39 +01:00
John-John Tedro
9437f7264a Switch to tokio channels since they can now be suitably used 2020-12-02 08:02:25 +01:00
John-John Tedro
43c8b1cb63 Bump to Tokio 0.3.0 2020-12-02 08:02:25 +01:00
John-John Tedro
56e584fe76 Run rustfmt 2020-12-02 08:02:19 +01:00
Thomas Hurst
4c27a9513d Disable Pinger until after MOTD
Some servers ignore PING commands until after login, so clients would
otherwise always time out, as mentioned in #207, #214, and #218.

With this change I am able to reliably connect to ircu servers.
2020-11-17 05:04:37 +00:00
Aaron Weiss
5968edd355
migrate all the examples and tests to freenode 2020-07-23 13:41:01 -04:00
Aaron Weiss
e9d18b7f48
increased default ping timeout to 20 seconds 2020-07-23 13:41:01 -04:00
Aaron Weiss
7ac4585871
ping_time is once again used to define the ping intervals 2020-07-23 13:41:01 -04:00
Théo Gaillard
4d0acf91a1
feat: add multi lines support for CTCP 2020-05-13 07:33:21 +08:00
Théo Gaillard
67e61e0606
feature: add TLS as feature and support multiples TLS backends (currently native-tls and rustls) 2020-03-31 09:48:57 +08:00
Théo Gaillard
5bf3909d46
feature: add proxy config 2020-03-04 22:00:48 +08:00
Aaron Weiss
bbc99b1d20
Merge pull request #199 from belak/fix-suffix-handling
Handle suffix as a plain param
2020-01-31 13:21:10 -05:00
Kaleb Elwert
f785d15b4c Handle suffix as a plain param 2020-01-30 16:25:52 -08:00
Kaleb Elwert
dd09555537 Make serde optional 2020-01-29 11:06:58 -08:00
Kaleb Elwert
57e5874852 Fix client::test::no_user_tracking 2020-01-28 22:11:17 -08:00
Aaron Weiss
a086e0913c
Merge pull request #189 from udoprog/fix-sync-resolve
Avoid synchronously resolving server address
2019-12-30 19:28:34 -05:00
John-John Tedro
b08e2a89ae Avoid synchronously resolving server address 2019-12-29 19:08:31 +01:00
John-John Tedro
731f792686 Fix updating outgoing client state
This also allows us to simplify the channel_tracking_names_part test.
2019-12-28 07:34:48 +01:00
Aaron Weiss
71a703c762
Merge pull request #186 from udoprog/config
Simplify Config structure
2019-12-27 16:57:09 -05:00
Aaron Weiss
4c756654a1
Merge pull request #187 from udoprog/fix-test-todo
Fix test which requires driving the outgoing queue
2019-12-27 16:52:57 -05:00
John-John Tedro
9066824213 Fix test which requires driving the outgoing queue 2019-12-27 17:36:11 +01:00
John-John Tedro
5189b69e7e Simplify Config structure
This simplifies some of the `Config` structure, in particular this
means:

Parameters which are meaningfully equivalent longer stored in
an `Option<T>`, an example of this is `channels`. If you don't
want to join any channels you simply leave it as empty instead.
In effect, `None` is behaviorally equivalent to `vec![]`.

We don't allocate when accessing certain configuration options.
For example, when accessing `channels` we used to allocate a
vector to handle the "empty case", we simply return the slice
corresponding to the list of channels instead.

We skip serializing empty or optional configuration fields.
From a deserialization perspective this is already something
that was mostly supported through use of `Option<T>` and
`#[serde(default)]`.
2019-12-27 17:12:46 +01:00
John-John Tedro
f200a9f281 Switch to modern error handling 2019-12-27 17:01:03 +01:00
John-John Tedro
549e2e8722 Port to tokio 0.2 2019-12-18 21:06:04 +01:00
Adam Gausmann
400c982639 Fix compilation errors on 0.14 2019-06-10 20:52:36 -05:00
Aaron Weiss
0b7a7a0f02
fixup! Merge branch 'develop' into 0.14 2019-06-06 13:41:30 -04:00
Aaron Weiss
c383c6241e
Merge branch 'develop' into 0.14 2019-06-06 13:40:55 -04:00
jesopo
379a2db9fa Update source_response test 2019-05-18 23:08:08 +01:00
jesopo
9dbb04431a Don't send an empty CTCP SOURCE response 2019-05-18 22:51:55 +01:00
John-John Tedro
f02362c782 Mark Future in PackedIrcClient as Send + 'static 2019-03-17 11:52:48 +01:00
Daniel Griffen
971a386ca0
spawn handler futures on the reactor 2019-01-09 20:18:38 -08:00
David Blajda
199f591e78 Handle the case of a single SOH in PRIVMSG 2019-01-03 19:33:17 +00:00