aboutsummaryrefslogtreecommitdiff
path: root/src/context/error.rs
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-04-06 07:38:27 +0000
committerFuwn <[email protected]>2023-04-06 07:38:27 +0000
commit50601e3248865f4c4735ea44ae0ebd253be96397 (patch)
treeb3ce54c417a8996e51e6e92c7bbf2c85e4ca7c3d /src/context/error.rs
parentrefactor(router): simplify context creation (diff)
downloadwindmark-50601e3248865f4c4735ea44ae0ebd253be96397.tar.xz
windmark-50601e3248865f4c4735ea44ae0ebd253be96397.zip
feat(context): bring back peer address
Diffstat (limited to 'src/context/error.rs')
-rw-r--r--src/context/error.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/context/error.rs b/src/context/error.rs
index 7e02b1a..3540a45 100644
--- a/src/context/error.rs
+++ b/src/context/error.rs
@@ -22,14 +22,20 @@ use url::Url;
#[allow(clippy::module_name_repetitions)]
#[derive(Clone)]
pub struct ErrorContext {
- pub url: Url,
- pub certificate: Option<X509>,
+ pub peer_address: Option<std::net::SocketAddr>,
+ pub url: Url,
+ pub certificate: Option<X509>,
}
impl ErrorContext {
#[must_use]
- pub const fn new(url: Url, certificate: Option<X509>) -> Self {
+ pub fn new(
+ peer_address: std::io::Result<std::net::SocketAddr>,
+ url: Url,
+ certificate: Option<X509>,
+ ) -> Self {
Self {
+ peer_address: peer_address.ok(),
url,
certificate,
}