chiark / gitweb /
max_batch_up: Make it a limit on the server
[hippotat.git] / src / config.rs
index b439e4af1c56f32151dfffa40024f124b93f385a..41ae047fc3b5250d114f4cda7e11700508caf310 100644 (file)
@@ -17,6 +17,7 @@ pub struct InstanceConfig {
   #[limited]    pub max_queue_time:               Duration,
   #[limited]    pub http_timeout:                 Duration,
   #[limited]    pub target_requests_outstanding:  u32,
+  #[special(special_max_up, SKL::PerClient)]  pub max_batch_up: u32,
 
   // Ordinary settings, used by both, not client-specifi:
   #[global]  pub addrs:                        Vec<IpAddr>,
@@ -33,7 +34,6 @@ pub struct InstanceConfig {
   // Ordinary settings, used by client only:
   #[client]  pub http_timeout_grace:           Duration,
   #[client]  pub max_requests_outstanding:     u32,
-  #[client]  pub max_batch_up:                 u32,
   #[client]  pub http_retry:                   Duration,
   #[client]  pub success_report_interval:      Duration,
   #[client]  pub url:                          Uri,
@@ -68,6 +68,7 @@ mtu = 1500
 vnetwork = 172.24.230.192
 
 [LIMIT]
+max_batch_up = 262144
 max_batch_down = 262144
 max_queue_time = 121
 http_timeout = 121
@@ -684,6 +685,15 @@ impl<'c> ResolveContext<'c> {
     assert_eq!(skl, SKL::None);
     self.link.clone()
   }
+
+  #[throws(AE)]
+  pub fn special_max_up(&self, key: &'static str, skl: SKL) -> u32 {
+    assert_eq!(skl, SKL::None);
+    match self.end {
+      LinkEnd::Client => self.ordinary(key, SKL::PerClient)?,
+      LinkEnd::Server => self.ordinary(key, SKL::Limits)?,
+    }
+  }
 }
 
 impl InstanceConfig {