chiark / gitweb /
make route_packet infallible
[hippotat.git] / server / suser.rs
index acae5dcd35ab8676b8371c96de0283a626566303..856afe855c180be6bd6350ca36bbebd3dfbe354f 100644 (file)
@@ -59,12 +59,14 @@ pub async fn run(global: Arc<Global>,
     }
 
     select!{
+      biased;
+
       req = web.recv() =>
       {
         let WebRequest {
           initial, initial_remaining, length_hint, mut body,
           boundary_finder,
-          reply_to, conn, mut warnings,
+          reply_to, conn, mut warnings, may_route,
         } = req.ok_or_else(|| anyhow!("webservers all shut down!"))?;
 
         match async {
@@ -140,8 +142,9 @@ pub async fn run(global: Arc<Global>,
               let daddr = ip_packet_addr::<true>(header)?;
               Ok(daddr)
             }, |(daddr,packet)| route_packet(
-              &global, &conn, &ic.link.client, daddr,packet
-            ),
+              &global, &conn, Some(&ic.link.client), daddr,
+              packet, may_route.clone(),
+            ).map(Ok),
               |e| Ok::<_,SlipFramesError<_>>({ warnings.add(&e)?; })
             ).await?;
           }