diff options
author | Alex Auvolat <alex@adnab.me> | 2022-06-29 12:50:44 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-06-29 12:50:44 +0200 |
commit | 90b143e1c57c6561998176878b2cc586b2d89c80 (patch) | |
tree | a9f07995d9d29e9f884756cad5732bfb2cbeb3fc /src/lmtp.rs | |
parent | 9979671b001ccb25917da7091d13ad3fc1096330 (diff) | |
download | aerogramme-90b143e1c57c6561998176878b2cc586b2d89c80.tar.gz aerogramme-90b143e1c57c6561998176878b2cc586b2d89c80.zip |
Refactor to allow mutability
Diffstat (limited to 'src/lmtp.rs')
-rw-r--r-- | src/lmtp.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/lmtp.rs b/src/lmtp.rs index a0dafa5..29d61af 100644 --- a/src/lmtp.rs +++ b/src/lmtp.rs @@ -42,6 +42,8 @@ impl LmtpServer { pub async fn run(self: &Arc<Self>, mut must_exit: watch::Receiver<bool>) -> Result<()> { let tcp = TcpListener::bind(self.bind_addr).await?; + info!("LMTP server listening on {:#}", self.bind_addr); + let mut connections = FuturesUnordered::new(); while !*must_exit.borrow() { @@ -155,17 +157,14 @@ impl Config for LmtpServer { } } - async fn handle_mail<'a, 'slife0, 'slife1, 'stream, R>( - &'slife0 self, - reader: &mut EscapedDataReader<'a, R>, + async fn handle_mail<'resp, R>( + &'resp self, + reader: &mut EscapedDataReader<'_, R>, meta: MailMetadata<Message>, - conn_meta: &'slife1 mut ConnectionMetadata<Conn>, - ) -> Pin<Box<dyn futures::Stream<Item = Decision<()>> + Send + 'stream>> + conn_meta: &'resp mut ConnectionMetadata<Conn>, + ) -> Pin<Box<dyn futures::Stream<Item = Decision<()>> + Send + 'resp>> where R: Send + Unpin + AsyncRead, - 'slife0: 'stream, - 'slife1: 'stream, - Self: 'stream, { let err_response_stream = |meta: MailMetadata<Message>, msg: String| { Box::pin( |