From: Ian Jackson Date: Sun, 8 Aug 2021 13:36:40 +0000 (+0100) Subject: max_batch_up: Make it a limit on the server X-Git-Tag: hippotat/1.0.0~222 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=4707d7c195705a1b3bb98fd644875a501ea54003;p=hippotat.git max_batch_up: Make it a limit on the server Signed-off-by: Ian Jackson --- diff --git a/PROTOCOL b/PROTOCOL index b39253b..cb31035 100644 --- a/PROTOCOL +++ b/PROTOCOL @@ -23,6 +23,7 @@ Client form parameters (multipart/form-data): target_requests_outstanding http_timeout max_batch_down + max_batch_up d data (SLIP format, with SLIP_ESC and `-' swapped) diff --git a/docs/settings.rst b/docs/settings.rst index 8a07983..6bf1712 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -67,11 +67,20 @@ value is obtained, it is (silently) reduced to the limit value. On client, incoming response bodies are limited to this plus a fixed constant metadata overhead of 10000 bytes. - Server uses minimum of client and server value (old servers - just uses server's value). + Server uses minimum of client's and server's configured values + (old servers just use server's value). [``65536`` (bytes); ``LIMIT``: ``262144``] +``max_batch_up`` + Size limit for request upbound payloads. On client, used directly, + with ``LIMIT`` applied. + + On server, only ``LIMIT`` is relevant, and must be at least the + client's configured value (checked). xxx put in metadata + + [``4000`` (bytes); ``LIMIT``: ``262144``] + ``max_queue_time`` Discard packets after they have been queued this long waiting for http. @@ -170,9 +179,6 @@ Ordinary settings, used by client only Client will hold off sending more requests than this to server even if it has data to send. [``6``] -``max_batch_up`` - Size limit for request upbound payloads. [``4000`` (bytes)] - ``success_report_interval`` If nonzero, report success periodically. Otherwise just report it when we first have success. [``3600`` (s)] diff --git a/src/bin/client.rs b/src/bin/client.rs index b57d772..d5fce6f 100644 --- a/src/bin/client.rs +++ b/src/bin/client.rs @@ -68,12 +68,14 @@ fn submit_request<'r, 'c:'r, C:HCC>( {} {} {} + {} {}"#), &c.ic.link.client, token, c.ic.target_requests_outstanding, show_timeout, c.ic.max_batch_down, + c.ic.max_batch_up, ); let prefix2 = format!(into_crlfs!( diff --git a/src/config.rs b/src/config.rs index b439e4a..41ae047 100644 --- a/src/config.rs +++ b/src/config.rs @@ -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, @@ -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 {