Expand Shadowsocks runtime compatibility

This commit is contained in:
JettChenT 2026-06-05 10:33:41 -07:00
parent d1638726ca
commit 4d1f589280
167 changed files with 57173 additions and 1640 deletions

View file

@ -0,0 +1,26 @@
use criterion::criterion_group;
use criterion::criterion_main;
/// Microbenchmarks go here. Larger benchmarks of (e.g..) protocol
/// performance go in examples/internal/bench.rs.
use criterion::Criterion;
#[path = "../tests/common/mod.rs"]
mod test_utils;
use test_utils::*;
use rustls::ServerConnection;
use std::io;
use std::sync::Arc;
fn bench_ewouldblock(c: &mut Criterion) {
let server_config = make_server_config(KeyType::Rsa);
let mut server = ServerConnection::new(Arc::new(server_config)).unwrap();
let mut read_ewouldblock = FailsReads::new(io::ErrorKind::WouldBlock);
c.bench_function("read_tls with EWOULDBLOCK", move |b| {
b.iter(|| server.read_tls(&mut read_ewouldblock))
});
}
criterion_group!(benches, bench_ewouldblock);
criterion_main!(benches);