fix: bound map TLS handshake latency

This commit is contained in:
torlando-agent[bot]
2026-08-07 01:37:13 +00:00
parent a758f148db
commit c46b23e860
2 changed files with 5 additions and 0 deletions
@@ -32,6 +32,10 @@ TileTransportResult MapTileHttpArduino::start(const char* url, const char* user_
client_.setCACert(ca_certificate);
client_.setTimeout(read_timeout_ms);
unsigned long handshake_seconds = static_cast<unsigned long>(connect_timeout_ms / 1000U);
if ((connect_timeout_ms % 1000U) != 0U) ++handshake_seconds;
if (handshake_seconds == 0UL) handshake_seconds = 1UL;
client_.setHandshakeTimeout(handshake_seconds);
http_.setConnectTimeout(boundedConnectTimeout(connect_timeout_ms));
http_.setTimeout(boundedReadTimeout(read_timeout_ms));
// Keep the single visible-tile TLS session alive across sequential requests.
@@ -35,6 +35,7 @@ def test_https_adapter_verifies_peer_with_explicit_ca_and_has_no_credentials():
assert "setInsecure" not in source
assert "setConnectTimeout" in source
assert "setTimeout" in source
assert "setHandshakeTimeout" in source
assert "setReuse(true)" in source
assert "useHTTP10(true)" not in source
assert "disconnectIdle" in source