RateLimit header fields for HTTP

This commit is contained in:
Maurus Decimus
2026-05-23 11:41:43 +02:00
parent 7aa4865a10
commit 777cf1252b
71 changed files with 825 additions and 274 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "store"
version = "0.16.6"
version = "0.16.7"
edition = "2024"
[dependencies]

View File

@@ -78,11 +78,7 @@ impl EphemeralStore {
.and_then(|m| m.get(&key_bytes))
{
Some(bytes) => Ok(i64::from_le_bytes(bytes[..].try_into().map_err(|_| {
trc::Error::corrupted_key(
&key_bytes,
Some(bytes.as_slice()),
trc::location!(),
)
trc::Error::corrupted_key(&key_bytes, Some(bytes.as_slice()), trc::location!())
})?)),
None => Ok(0),
}

View File

@@ -163,7 +163,10 @@ impl EphemeralStore {
let to_key = to.serialize(0);
let mut state = self.state.write();
if let Some(map) = state.subspaces.get_mut(&subspace) {
let keys: Vec<Vec<u8>> = map.range(from_key..to_key).map(|(k, _)| k.clone()).collect();
let keys: Vec<Vec<u8>> = map
.range(from_key..to_key)
.map(|(k, _)| k.clone())
.collect();
for k in keys {
map.remove(&k);
}

View File

@@ -15,8 +15,8 @@ use std::{
task::{Context, Poll},
};
use futures::future::{FutureExt, TryFutureExt};
use aws_lc_rs::digest;
use futures::future::{FutureExt, TryFutureExt};
use rustls::ClientConfig;
use rustls_pki_types::ServerName;
use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};