chiark / gitweb /
server: introduce RoutedPacket
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 17 Aug 2021 00:00:29 +0000 (01:00 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 17 Aug 2021 00:00:29 +0000 (01:00 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/bin/server.rs

index 1cc0660414a101f0caa6a2a4e657e2380f4ddc9c..a8cb59012735fd445b412cc8fc9534028d0d7f75 100644 (file)
@@ -27,6 +27,8 @@ pub struct Client {
   web: tokio::sync::mpsc::Sender<WebRequest>,
 }
 
+pub type RoutedPacket = Box<[u8]>; // not MIME data
+
 /// Sent from hyper worker pool task to client task
 #[allow(dead_code)] // xxx
 #[derive(Debug)]
@@ -57,7 +59,7 @@ type WebResponseData = Vec<u8>;
 #[throws(PacketError)]
 pub fn route_packet(_global: &Global,
                     conn: &str, link: &dyn Display,
-                    packet: Box<[u8]>, daddr: IpAddr)
+                    packet: RoutedPacket, daddr: IpAddr)
 {
   // xxx
   trace!("{} {} discarding packet daddr={:?} len={}",